From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC][PATCH 9/9] block: Use bdrv_co_* instead of synchronous versions in coroutines
Date: Fri, 22 Jul 2011 08:48:42 +0200 [thread overview]
Message-ID: <4E291D4A.1090506@redhat.com> (raw)
In-Reply-To: <20110721152354.GD3833@stefanha-thinkpad.localdomain>
Am 21.07.2011 17:23, schrieb Stefan Hajnoczi:
> On Fri, Jul 15, 2011 at 06:47:39PM +0200, Kevin Wolf wrote:
>> If we're already in a coroutine, there is no reason to use the synchronous
>> version of block layer functions when a coroutine one exists. This makes
>> bdrv_read/write/flush use bdrv_co_* when used inside a coroutine.
>>
>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>> ---
>> block.c | 43 +++++++++++++++++++++++++++++++++++++++++++
>> 1 files changed, 43 insertions(+), 0 deletions(-)
>
> I made similar changes to prototype qcow2 coroutines. They allowed
> synchronous code to run unmodified inside a coroutine.
>
> But do we want to keep the synchronous APIs? They tend to be misused
> because they allow synchronous implementation of devices (extboot,
> onenand, and others).
>
> The only reason to keep these around is for qemu-img and perhaps some
> startup code before the VM is running. But I think we could tackle
> those cases too simply by running in a coroutine and using a common
> event loop (which makes timers and bottom halves work too).
One change at a time. :-)
This series is manageable, can be reviewed in finite time and gives us
the immediate benefit of not blocking the VCPU any more. I know that
some tend to rewrite half of qemu for every idea they have, but I'd
prefer a more incremental approach.
Removing all synchronous bdrv_read/write calls from the devices is a
task that I wouldn't underestimate, and at the same time a completely
unrelated task (you could have suggested the same with AIO callbacks). I
agree that we should do this change some time, but for now devices get
exactly what they got before.
Kevin
next prev parent reply other threads:[~2011-07-22 6:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 16:47 [Qemu-devel] [RFC][PATCH 0/9] Use coroutines in the block layer Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 1/9] block: Add bdrv_co_readv/writev Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 2/9] block: Emulate AIO functions with bdrv_co_readv/writev Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 3/9] block: Add bdrv_co_readv/writev emulation Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 4/9] coroutines: Locks Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 5/9] qcow2: Use coroutines Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 6/9] qcow: " Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 7/9] async: Remove AsyncContext Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 8/9] coroutines: Use one global bottom half for CoQueue Kevin Wolf
2011-07-15 16:47 ` [Qemu-devel] [RFC][PATCH 9/9] block: Use bdrv_co_* instead of synchronous versions in coroutines Kevin Wolf
2011-07-21 15:23 ` Stefan Hajnoczi
2011-07-22 6:48 ` Kevin Wolf [this message]
2011-07-22 9:17 ` Stefan Hajnoczi
2011-07-22 10:00 ` Kevin Wolf
2011-08-01 9:44 ` [Qemu-devel] [RFC][PATCH 0/9] Use coroutines in the block layer 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=4E291D4A.1090506@redhat.com \
--to=kwolf@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 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.