qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] buffer alignment for block backends
Date: Thu, 9 Apr 2009 18:19:08 +0200	[thread overview]
Message-ID: <20090409161908.GM5457@const.bordeaux.inria.fr> (raw)
In-Reply-To: <49DE1AAB.90204@codemonkey.ws>

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	other threads:[~2009-04-09 16:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 13:35 [Qemu-devel] buffer alignment for block backends Stefano Stabellini
2009-04-08 18:53 ` Anthony Liguori
2009-04-09  9:57   ` Stefano Stabellini
2009-04-09 13:11     ` Anthony Liguori
2009-04-09 13:30       ` Stefano Stabellini
2009-04-09 13:54         ` Gerd Hoffmann
2009-04-09 15:21           ` Samuel Thibault
2009-04-09 15:46             ` Stefano Stabellini
2009-04-09 15:50             ` Gerd Hoffmann
2009-04-09 16:11               ` Stefano Stabellini
2009-04-09 16:13               ` Samuel Thibault
2009-04-09 16:28               ` Anthony Liguori
2009-04-09 15:55             ` Jamie Lokier
2009-04-09 16:15               ` Samuel Thibault
2009-04-09 17:29               ` Lennart Sorensen
2009-04-09 13:33       ` Stefano Stabellini
2009-04-09 15:19       ` Samuel Thibault
2009-04-09 15:38         ` Paul Brook
2009-04-09 15:40           ` Samuel Thibault
2009-04-09 15:56         ` Anthony Liguori
2009-04-09 16:19           ` Samuel Thibault [this message]
2009-04-09 10:07   ` Stefano Stabellini
2009-04-09 13:14     ` Anthony Liguori
2009-04-09 13:30       ` Stefano Stabellini
2009-04-09 13:19     ` Christoph Hellwig
2009-04-09 13:30       ` Stefano Stabellini
2009-04-09 15:31         ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090409161908.GM5457@const.bordeaux.inria.fr \
    --to=samuel.thibault@ens-lyon.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).