qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] buffer alignment for block backends


From: Samuel Thibault
Subject: Re: [Qemu-devel] buffer alignment for block backends
Date: Thu, 9 Apr 2009 18:19:08 +0200
User-agent: Mutt/1.5.12-2006-07-14

Anthony Liguori, le Thu 09 Apr 2009 10:56:27 -0500, a écrit :
> Samuel Thibault wrote:
> >Anthony Liguori, le Thu 09 Apr 2009 08:11:27 -0500, a écrit :
> >>I suspect you'll find a lot of guests that, in practice, do not
> >>align requests at 4k boundaries.
> >
> >Eeeeerrr, why shoudn't they?  Guests usually work on pages, which are
> >already aligned on 4k boundaries.
> >  
> 
> Like if you do a 512-byte O_DIRECT write (in userspace) to a 512-byte, 
> but not 4096-byte aligned buffer in Linux.  This may not happen all the 
> time, but if you don't handle this in your backend, you'll get a lot of 
> lovely bug reports :-)

As I said, the requirement is sector alignment.  Yes, if the blkback
sector size is greater than 512 bytes we'll have to cope with the
userspace buffer not aligned with 512 bytes, by adding a grant to the
blkback request.  In such a case however, I'd suggest having qemu expose
4k sector virtual disks, so that the guest automaticcally chooses to
align to 4k, and thus get full optimization.

Samuel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]