qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-1.2] qed: refuse unaligned zero writes with a backing file
Date: Wed, 29 Aug 2012 08:53:53 +0100	[thread overview]
Message-ID: <20120829075353.GA26390@stefanha-thinkpad.localdomain> (raw)
In-Reply-To: <503CD463.80009@redhat.com>

On Tue, Aug 28, 2012 at 04:23:31PM +0200, Paolo Bonzini wrote:
> Il 28/08/2012 15:37, Stefan Hajnoczi ha scritto:
> >> > The "right fix" would not be much more complex though, something like this, right?
> >> > (untested).
> > Yes but it's more complicated.  To do a really good job we should
> > slice off the first/last clusters if they are unaligned, handle them
> > like regular allocating writes, and handle the middle of the request
> > as a zero write.
> > 
> > I decided to do the simplest implementation since this scenario only
> > occurs in test cases, not real guests.
> 
> Yes, I was curious because it reminded me of the patch I did to write
> zeroes when I was playing with discard to avoid the large bounce buffer
> in qed_aio_write_inplace.  That patch takes care of processing clusters
> one by one (though that means one L2 write for each and every cluster,
> not just the first and last).
> 
> It probably causes a performance hit, but anyway I attach it for
> completeness.

Thanks for sharing.  I think this patch could be used as the basis for
something that handles the first and last clusters one-at-a-time and
does the middle clusters in a single L2 update.

I'm not going to implement that right now because I prefer the simple
solution unless this code path becomes more used.

Stefan

  reply	other threads:[~2012-08-29  7:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28 13:04 [Qemu-devel] [PATCH for-1.2] qed: refuse unaligned zero writes with a backing file Stefan Hajnoczi
2012-08-28 13:25 ` Paolo Bonzini
2012-08-28 13:37   ` Stefan Hajnoczi
2012-08-28 14:23     ` Paolo Bonzini
2012-08-29  7:53       ` Stefan Hajnoczi [this message]
2012-08-29  9:09         ` Paolo Bonzini
2012-08-28 13:38   ` Kevin Wolf

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=20120829075353.GA26390@stefanha-thinkpad.localdomain \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).