From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrwyG-0005RQ-Mp for qemu-devel@nongnu.org; Thu, 09 Apr 2009 12:19:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrwyC-0005Ou-2r for qemu-devel@nongnu.org; Thu, 09 Apr 2009 12:19:20 -0400 Received: from [199.232.76.173] (port=57417 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrwyB-0005Ok-LP for qemu-devel@nongnu.org; Thu, 09 Apr 2009 12:19:15 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:55045) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1LrwyA-0001JK-Ui for qemu-devel@nongnu.org; Thu, 09 Apr 2009 12:19:15 -0400 Received: from samy by const with local (Exim 4.69) (envelope-from ) id 1Lrwy5-0007VO-0J for qemu-devel@nongnu.org; Thu, 09 Apr 2009 18:19:09 +0200 Date: Thu, 9 Apr 2009 18:19:08 +0200 From: Samuel Thibault Subject: Re: [Qemu-devel] buffer alignment for block backends Message-ID: <20090409161908.GM5457@const.bordeaux.inria.fr> References: <49DCA80A.1020808@eu.citrix.com> <49DCF2C0.9070704@codemonkey.ws> <49DDC66F.2000404@eu.citrix.com> <49DDF3FF.8050706@codemonkey.ws> <20090409151944.GD5457@const.bordeaux.inria.fr> <49DE1AAB.90204@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <49DE1AAB.90204@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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