Re: [Aoetools-discuss] write buffering and the AoE kernel module
Brought to you by:
ecashin,
elcapitansam
From: Jon N. <jne...@ja...> - 2007-04-26 19:55:42
|
On Thu, 26 Apr 2007, Sam Hopkins wrote: > Hi Jon, > > > Thanks for the answer! However, it doesn't /quite/ answer my question. I > > should have been clearer. I know all about O_SYNC (although your > > description is probably the most concise I've ever seen!). What I want > > to know is what (if any) caveats AoE introduces. Does the aoe driver > > itself buffer anything before constructing a packet and sending it off? > > Let me rephrase: Does the AoE driver attempt any sort of write > > buffering or does the write system call translate directly into packets > > sent and received? If so, then I think I've got my answer. > > The block layer gives the aoe driver requests and the aoe driver translates > them into aoe read/write commands. There's no buffering going on in > the aoe driver. > > >> Those block devices just pass block I/O through to the lower level > >> block device driver, so they don't really affect the situation. > > > > What I'm wondering, then, is why creating a single-disk raid1 (for > > example) changes the payload sizes of the packets going over the wire, > > such as when using dd to access the device directly. > > Ah. That's an implementation detail of the linux block layer. It's > been a while since I've looked at it so my memory may have developed > barnacles, but here's my best recollection. > > When you submit I/O to a block device the block layer enforces size > constraints on the I/O request based on the underlying size of the > device. If, e.g., the underlying device has an odd number of sectors, > then the block layer is going to force the requests given to the aoe > driver to be limited to 512 bytes. If, e.g., the block device has an > odd KiB in size (5KiB), the block layer would limit each I/O request to > 1KiB. So it is entirely a function of the /number/ of blocks (you said sectors, did you mean blocks?)? If I use 'stat -f' on an aoe device and on an md device made with that aoe device, I get 4096b blocks in both cases. Or am I looking at the wrong thing? > I hope that description isn't too muddled. I haven't had much coffee > yet this morning. :) No, it's great! -- Jon Nelson <jne...@ja...> |