Re: Spindle speed of Hard Disk- How to find
From: P.T. Breuer (ptb_at_oboe.it.uc3m.es)
Date: 05/01/04
- Next message: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Previous message: Kasper Dupont: "Re: Wondering about raid5"
- In reply to: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Next in thread: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Reply: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 1 May 2004 13:51:23 +0200
Kasper Dupont <kasperd@daimi.au.dk> wrote:
> "P.T. Breuer" wrote:
> > Unfortunately, that's byte-at-a-time, which is slow.
>
> Actually that is not the case. Using raw devices you must
> read a number of full sectors at a time. And it must to a
> sector aligned address.
I'm not aware of that. I have written character interfaces to block
devices and I have placed no restriction like that, but maybe it's
implicit. Let's see .... The idea is that one makes a fileops struct
which points at a typical char device interface. The "raw read and
write ops" make a kiovec out of the user request. You then walk the
pages of the iovec and make block requests out of each page (plus
offset), as a single-buffer request, and drop them onto your block
device queue.
Can't say that I've tested the result too far, however!
Umm .. since the block request counts in sectors, yes, it looks like we
can only make block requests straightforwardly if the original i/o was
sector aligned. Otherwise we are going to have to over-ask and select
what we want out of the response. It can be done, though.
> The performance can be good. I have had throughputs that
> were 50% higher than the cached reads reported by hdparm.
>
> The performance is very dependent on the number of sectors
> you read at a time. And it is not very predictable. IIRC
> I got good performance with 32KB and 128KB reads, but 64KB
> reads were a litle slower.
>
> I think raw devices combined with aio should give the best
> performance you can possible get from your hardware.
>
> But in this particular case I don't think performance
> really matters.
>
> > And you can't mount a character device!
>
> Why would you want to do that?
To get a whole file system which worked without (device) buffering.
(Yes, I know about the dentry cache ...).
> > The 2.6 way is to open the device with O_DIRECT. Unfortunately, reads
> > and writes have to be page aligned thereafter,
>
> Are you sure it is page aligned? I would expect sector
> aligned to be enough. (Not that it really makes much of
> a difference).
It varies/has varied. General consensus is that page alignment is safe
and if you get anything else to work you are essentially being lucky.
The reasoning is that you are doing without the VMS, so you must do the
work that the VMS would normally do for you. In that is included the
idea of only submitting requests to the device that are block-aligned.
But yes, even some file systems (xfs) issue sector aligned requests
when the block size is larger than a sector! And the block layer
requests can happily deal with sector sizes. So there is an indication
that sector alignment may be alright at that level ... but then there
are the horrors of pagestore backing .. shudder. I would stick to page
alignment for safety.
> I think reads done using the glibc stdio will actually
> be page aligned. But other than that you shouldn't
It has not been my experience. It is perfectly clear that read() and
write() are not page aligned, since you supply the buffer directly.
printf, maybe?
> expect programs to align their reads. I have modified a
> few of my own programs to align read buffers, but I only
> did so when I actually needed to use the program on a
> raw device (for performance reasons).
Interesting.
Peter
- Next message: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Previous message: Kasper Dupont: "Re: Wondering about raid5"
- In reply to: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Next in thread: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Reply: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|