qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: kwolf@redhat.com, chris@arachsys.com,
	stefanha@linux.vnet.ibm.com, qemu-devel@nongnu.org,
	zwu.kernel@gmail.com, Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] block: add the support for draining the throttled request queue
Date: Fri, 24 Feb 2012 13:54:55 +0100	[thread overview]
Message-ID: <4F47889F.7030801@redhat.com> (raw)
In-Reply-To: <20120224084903.GB872@stefanha-thinkpad.localdomain>

On 02/24/2012 09:49 AM, Stefan Hajnoczi wrote:
>> > +void bdrv_drain_request(BlockDriverState *throttled_bs)
>> >  {
>> >      BlockDriverState *bs;
>> >  
>> > +    QTAILQ_FOREACH(bs, &bdrv_states, list) {
>> > +        if (throttled_bs && throttled_bs != bs) {
>> > +            continue;
>> > +        }
>> > +        qemu_co_queue_restart_all(&bs->throttled_reqs);
>> > +    }
>> > +
>> >      qemu_aio_flush();
> Since I/O throttling is still enabled, the restarted requests could
> enqueue again if they exceed the limit.  We could still hit the assert.

Yes, and qemu_aio_flush() rightly doesn't know that there are pending
requests, because these are "not there" until the timer fires.

Perhaps the bug is simply that the assert is bogus.  If there are
throttled requests, we need to invoke qemu_aio_flush() again.  The
problem with this is that timers don't run inside qemu_aio_wait() so we
have to restart them all and we're effectively busy waiting.  Not a huge
problem since qemu_aio_flush() is rare, but not too nice either.

Paolo

      parent reply	other threads:[~2012-02-24 12:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20  4:50 [Qemu-devel] [PATCH 1/2] block: add the support for draining the throttled request queue zwu.kernel
2012-02-20  9:26 ` Kevin Wolf
2012-02-20  9:29   ` Zhi Yong Wu
2012-02-20  9:39     ` Kevin Wolf
2012-02-20  9:46       ` Zhi Yong Wu
2012-02-20  9:34   ` Zhi Yong Wu
2012-02-24  8:49 ` Stefan Hajnoczi
2012-02-24  9:20   ` Zhi Yong Wu
2012-02-24  9:25   ` Zhi Yong Wu
2012-02-24 11:18     ` Stefan Hajnoczi
2012-02-24 13:07       ` Zhi Yong Wu
2012-02-24 12:54   ` Paolo Bonzini [this message]

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=4F47889F.7030801@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=chris@arachsys.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=wuzhy@linux.vnet.ibm.com \
    --cc=zwu.kernel@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).