All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Zhi Yong Wu <zwu.kernel@gmail.com>
Cc: kwolf@redhat.com, Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v3 1/2] block: add the support to drain throttled requests
Date: Mon, 12 Mar 2012 16:30:05 +0100	[thread overview]
Message-ID: <4F5E167D.4030209@redhat.com> (raw)
In-Reply-To: <CAEH94LhVy_CUh_DKxKRu6N+viFnH0dGJ5+HtCZWjyoFBKtrtgw@mail.gmail.com>

Il 12/03/2012 16:25, Zhi Yong Wu ha scritto:
> > > -    qemu_aio_flush();
> > > +    QTAILQ_FOREACH(bs, &bdrv_states, list) {
> > > +        do {
> > > +            qemu_co_queue_restart_all(&bs->throttled_reqs);
> > > +            qemu_aio_flush();
> > > +        } while (!qemu_co_queue_empty(&bs->throttled_reqs));
> > > +    }
> >
> > Even this is not enough.  Block device 2 could start a throttled request
> > on block device 1.
>
> I think that this should be allowed here. It does not affect the final
> result. All throttled requests for all disks are drained.

Unfortunately, that depends on the order of block devices.  It needs to
be something like this:

    do {
        qemu_aio_flush();
        busy = false;
        QTAILQ_FOREACH(bs, &bdrv_states, list) {
            if (!qemu_co_queue_empty(&bs->throttled_reqs)) {
                qemu_co_queue_restart_all(&bs->throttled_reqs);
                busy = true;
            }
        }
    } while (busy);


This means that bdrv_drain() cannot be implemented.  The device models
can "drain themselves", but for example monitor commands must still rely
on bdrv_drain_all().

Paolo

      reply	other threads:[~2012-03-12 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12 14:53 [Qemu-devel] [PATCH v3 1/2] block: add the support to drain throttled requests zwu.kernel
2012-03-12 15:05 ` Paolo Bonzini
2012-03-12 15:25   ` Zhi Yong Wu
2012-03-12 15:30     ` 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=4F5E167D.4030209@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.