From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: Zhi Yong Wu <zwu.kernel@gmail.com>
Cc: kwolf@redhat.com, Stefan Hajnoczi <stefanha@gmail.com>,
wuzhy@linux.vnet.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 2/2] block: disable I/O throttling on sync api
Date: Mon, 2 Apr 2012 08:31:10 +0100 [thread overview]
Message-ID: <20120402073110.GC19057@stefanha-thinkpad.localdomain> (raw)
In-Reply-To: <CAEH94Lj07VHnuFzgLCbT+=AiTki63js38iQcKJsh6rd7WQZ+6Q@mail.gmail.com>
On Sat, Mar 31, 2012 at 08:07:25PM +0800, Zhi Yong Wu wrote:
> On Fri, Mar 30, 2012 at 6:29 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > On Fri, Mar 30, 2012 at 9:50 AM, <zwu.kernel@gmail.com> wrote:
> >> + * When all sync I/O drivers are converted to async I/O, it will be restored
> >> + * to the original state.
> >
> > The problem here is that guess_disk_lchs() uses bdrv_read(), not
> > whether device emulation uses sync or async I/O. Converting devices
> > to async I/O will not fix this.
> Yeah, but when all sync emulated devices drivers are converted to
> async mode, the code change need to be rolled back. This is what i
> mean.
There are places outside device emulation that call bdrv_read(), like
guest_disk_lchs() and bdrv_commit(). We would need to convert them
before it's safe to remove the code to disable I/O throttling in
bdrv_read()/bdrv_write().
It's not okay to drop the code before all bdrv_read()/bdrv_write()
callers that are in a code path where I/O limits can be enabled have
been fixed (including guest_disk_lchs()) because a request that exceeds
I/O limits would cause QEMU to hang.
Once all devices have been converted it might be possible to temporarily
disable throttling in bdrv_read()/bdrv_write() and never disable it
permanently. This is because the bdrv_read()/bdrv_write() calls would
only come from QEMU code that is not directly driven by the guest - here
we probably don't need to apply I/O limits anyway. In other words,
devices use bdrv_aio_*() and I/O limits apply, QEMU internal code might
still use bdrv_read()/bdrv_write() and limits will not apply.
Anyway, I think it's best to drop this part of the comment because it's
more related to the disable code in bdrv_read()/bdrv_write() than to
this patch.
Stefan
next prev parent reply other threads:[~2012-04-02 8:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 8:50 [Qemu-devel] [PATCH v3 2/2] block: disable I/O throttling on sync api zwu.kernel
2012-03-30 10:29 ` Stefan Hajnoczi
2012-03-31 12:07 ` Zhi Yong Wu
2012-04-02 7:31 ` Stefan Hajnoczi [this message]
2012-03-31 12:09 ` Zhi Yong Wu
2012-04-02 7:42 ` Stefan Hajnoczi
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=20120402073110.GC19057@stefanha-thinkpad.localdomain \
--to=stefanha@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).