From: Paolo Bonzini <pbonzini@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Fam Zheng <famz@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Ming Lei <ming.lei@canonical.com>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/3] block: block: introduce bdrv_io_plug() and bdrv_io_unplug()
Date: Wed, 02 Jul 2014 10:49:08 +0200 [thread overview]
Message-ID: <53B3C784.2030504@redhat.com> (raw)
In-Reply-To: <20140702083817.GA5996@noname.str.redhat.com>
Il 02/07/2014 10:38, Kevin Wolf ha scritto:
> > On top of this, there _could_ be reasons for formats to implement
> > plug/unplug themselves. They could coalesce metadata reads or
> > copy-on-write operations, for example. This however is independent
> > from the default behavior, which IMO is "plugging should propagate
> > along bs->file" (and possibly bs->backing_hd too, but not now
> > because that opens more cans of worms).
>
> Yes, enabling it for bs->backing_hd was my alternative option for the
> case that we keep bs->file. What can of worms do you see there? From the
> reasoning above, I can't see why bs->backing_hd should be any different
> from bs->file.
The only one I thought of, is someone changing the backing file chain
while the backing file is plugged. IIRC bs->file doesn't change when
you do bdrv_reopen.
Though changing the backing file chain probably would call
bdrv_drain_all too.
> Another point I was thinking about (not for this series, but in a
> follow-up) is what to do with bdrv_aio_multiwrite(). We could either
> leave the two different interfaces there, just that multiwrite should
> probably call plug/unplug before it sends its requests (this would apply
> the improvements to virtio-blk without dataplane; could be done easily
> even now), or we try to implement request merging with the plug/unplug
> interface and convert the callers. Not sure how we would do the latter,
> though, because we don't have a list of requests any more, except in the
> lowest layer that actually queues.
>
> Or should we have a default plug/unplug implementation in block.c that
> queues any reads and writes, and on unplug merges requests, then plugs
> bs->file and sends the requests to the driver?
Longer term this is a good point. Plug/unplug certainly provides many
optimization opportunities, but as long as we expose the right API to
the device model we need not care about it now.
In fact, there are plenty of other places where we can plug/unplug:
mirroring, I/O throttling, image formats could also use aio to submit
requests to a fragmented bs->file together and plug/unplug around the
loop. Benchmarking is needed of course to see if this actually improves
performance (unlikely except in the last case) or at least reduces CPU
usage.
Paolo
next prev parent reply other threads:[~2014-07-02 8:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 7:51 [Qemu-devel] [PATCH v2 0/3] linux-aio: introduce submit I/O at batch Ming Lei
2014-07-01 7:51 ` [Qemu-devel] [PATCH v2 1/3] block: block: introduce bdrv_io_plug() and bdrv_io_unplug() Ming Lei
2014-07-01 11:18 ` Kevin Wolf
2014-07-01 13:31 ` Ming Lei
2014-07-01 14:39 ` Ming Lei
2014-07-01 15:21 ` Kevin Wolf
2014-07-01 16:56 ` Paolo Bonzini
2014-07-02 0:46 ` Ming Lei
2014-07-02 2:35 ` Ming Lei
2014-07-02 8:18 ` Paolo Bonzini
2014-07-02 8:38 ` Kevin Wolf
2014-07-02 8:49 ` Paolo Bonzini [this message]
2014-07-02 8:39 ` Ming Lei
2014-07-02 8:56 ` Paolo Bonzini
2014-07-02 9:12 ` Kevin Wolf
2014-07-02 9:29 ` Ming Lei
2014-07-02 9:49 ` Kevin Wolf
2014-07-02 10:02 ` Ming Lei
2014-07-02 10:24 ` Paolo Bonzini
2014-07-02 10:28 ` Ming Lei
2014-07-02 9:26 ` Ming Lei
2014-07-01 7:51 ` [Qemu-devel] [PATCH v2 2/3] linux-aio: implement io plug and unplug Ming Lei
2014-07-01 7:51 ` [Qemu-devel] [PATCH v2 3/3] dataplane: submit I/O at batch Ming Lei
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=53B3C784.2030504@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=ming.lei@canonical.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).