From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Ping Fan Liu <pingfank@linux.vnet.ibm.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>,
alex@alex.org.uk, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 00/18] aio: drop io_flush()
Date: Fri, 09 Aug 2013 15:14:11 +0800 [thread overview]
Message-ID: <520496C3.9010500@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130806150715.GB9327@stefanha-thinkpad.redhat.com>
于 2013-8-6 23:07, Stefan Hajnoczi 写道:
> On Thu, Jul 25, 2013 at 05:18:07PM +0200, Stefan Hajnoczi wrote:
>> v6:
>> * Fix block/stream.c:close_unused_images() dangling pointer in Patch 2
>> * Rebase onto qemu.git/master
>>
>> v5:
>> * Split out bdrv_delete() drain fix [bonzini]
>> * Fix commit message [bonzini]
>>
>> v4:
>> * Ensure pending BHs are processed in bdrv_drain_all() [bonzini]
>>
>> v3:
>> * I forgot about this series, time to push it again!
>> * Rebase onto qemu.git/master
>> * Drop now-unused AioFlushHandler typedef [bonzini]
>>
>> This series gets rid of aio's .io_flush() callback. It's based on Paolo's
>> insight that bdrv_drain_all() can be implemented using the bs->tracked_requests
>> list. io_flush() is redundant since the block layer already knows if requests
>> are pending.
>>
>> The point of this effort is to simplify our event loop(s). If we can reduce
>> custom features like io_flush() it becomes possible to unify AioContext and
>> main-loop.c, maybe even to replace it with glib's main loop.
>>
>> This is also important to me for dataplane, since bdrv_drain_all() is one of
>> the synchronization points between threads. QEMU monitor commands invoke
>> bdrv_drain_all() while the block device is accessed from a dataplane thread.
>>
>> Background on io_flush() semantics:
>>
>> The io_flush() handler must return 1 if this aio fd handler is active. That
>> is, requests are pending and we'd like to make progress by monitoring the fd.
>>
>> If io_flush() returns 0, the aio event loop skips monitoring this fd. This is
>> critical for block drivers like iscsi where we have an idle TCP socket which we
>> want to block on *only* when there are pending requests.
>>
>> The series works as follows:
>>
>> Part 1 - stop relying on .io_flush()
>>
>> The first patches change aio_poll() callers to check their termination
>> condition themselves instead of relying on .io_flush():
>>
>> bcfa688 block: ensure bdrv_drain_all() works during bdrv_delete()
>> c1351f5 block: stop relying on io_flush() in bdrv_drain_all()
>> b75d9e5 dataplane/virtio-blk: check exit conditions before aio_poll()
>> 18fc4d6 tests: adjust test-aio to new aio_poll() semantics
>> 4c52a7c tests: adjust test-thread-pool to new aio_poll() semantics
>>
>> Part 2 - stop calling .io_flush() from aio_poll()
>>
>> The semantic change to aio_poll() is made here:
>>
>> bacae7a aio: stop using .io_flush()
>>
>> Part 3 - drop io_flush() handlers, just pass NULL for the io_flush argument
>>
>> Remove the now dead code from all .io_flush() users:
>>
>> 720e0ad block/curl: drop curl_aio_flush()
>> 2830cf3 block/gluster: drop qemu_gluster_aio_flush_cb()
>> c683e8e block/iscsi: drop iscsi_process_flush()
>> 5019686 block/linux-aio: drop qemu_laio_completion_cb()
>> b862bcf block/nbd: drop nbd_have_request()
>> 516e517 block/rbd: drop qemu_rbd_aio_flush_cb()
>> 177090b block/sheepdog: drop have_co_req() and aio_flush_request()
>> e2e9e85 block/ssh: drop return_true()
>> 7cc7bac dataplane/virtio-blk: drop flush_true() and flush_io()
>> db3cb18 thread-pool: drop thread_pool_active()
>> 10a783b tests: drop event_active_cb()
>>
>> Part 4 - remove io_flush arguments from aio functions
>>
>> The big, mechanical patch that drops the io_flush argument:
>>
>> 4a8c36b aio: drop io_flush argument
>>
>> Note that I split Part 3 from Part 4 so it's easy to review individual block
>> drivers.
>>
>> Stefan Hajnoczi (18):
>> block: ensure bdrv_drain_all() works during bdrv_delete()
>> block: stop relying on io_flush() in bdrv_drain_all()
>> dataplane/virtio-blk: check exit conditions before aio_poll()
>> tests: adjust test-aio to new aio_poll() semantics
>> tests: adjust test-thread-pool to new aio_poll() semantics
>> aio: stop using .io_flush()
>> block/curl: drop curl_aio_flush()
>> block/gluster: drop qemu_gluster_aio_flush_cb()
>> block/iscsi: drop iscsi_process_flush()
>> block/linux-aio: drop qemu_laio_completion_cb()
>> block/nbd: drop nbd_have_request()
>> block/rbd: drop qemu_rbd_aio_flush_cb()
>> block/sheepdog: drop have_co_req() and aio_flush_request()
>> block/ssh: drop return_true()
>> dataplane/virtio-blk: drop flush_true() and flush_io()
>> thread-pool: drop thread_pool_active()
>> tests: drop event_active_cb()
>> aio: drop io_flush argument
>>
>> aio-posix.c | 36 ++++++------------
>> aio-win32.c | 37 ++++++++-----------
>> async.c | 4 +-
>> block.c | 50 ++++++++++++++++++-------
>> block/curl.c | 25 ++-----------
>> block/gluster.c | 21 ++---------
>> block/iscsi.c | 10 +----
>> block/linux-aio.c | 18 +--------
>> block/nbd.c | 18 ++-------
>> block/rbd.c | 16 +-------
>> block/sheepdog.c | 33 ++++-------------
>> block/ssh.c | 12 +-----
>> block/stream.c | 6 ++-
>> hw/block/dataplane/virtio-blk.c | 25 +++----------
>> include/block/aio.h | 14 +------
>> main-loop.c | 9 ++---
>> tests/test-aio.c | 82 +++++++++++++++++++++--------------------
>> tests/test-thread-pool.c | 24 ++++++------
>> thread-pool.c | 11 +-----
>> 19 files changed, 163 insertions(+), 288 deletions(-)
>
> Ping?
>
I tried to apply this series to do more work above it, but seems
code conflict with upstream.
--
Best Regards
Wenchao Xia
next prev parent reply other threads:[~2013-08-09 7:16 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 15:18 [Qemu-devel] [PATCH v6 00/18] aio: drop io_flush() Stefan Hajnoczi
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 01/18] block: ensure bdrv_drain_all() works during bdrv_delete() Stefan Hajnoczi
2013-07-26 6:43 ` Wenchao Xia
2013-08-06 15:06 ` Stefan Hajnoczi
2013-08-07 2:42 ` Wenchao Xia
2013-08-07 7:31 ` Stefan Hajnoczi
2013-08-07 7:42 ` Stefan Hajnoczi
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 02/18] block: stop relying on io_flush() in bdrv_drain_all() Stefan Hajnoczi
2013-07-29 7:01 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 03/18] dataplane/virtio-blk: check exit conditions before aio_poll() Stefan Hajnoczi
2013-07-26 16:44 ` Jeff Cody
2013-07-29 7:10 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 04/18] tests: adjust test-aio to new aio_poll() semantics Stefan Hajnoczi
2013-07-29 7:39 ` Wenchao Xia
2013-07-29 8:24 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 05/18] tests: adjust test-thread-pool " Stefan Hajnoczi
2013-07-29 7:51 ` Wenchao Xia
2013-07-29 14:26 ` Stefan Hajnoczi
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 06/18] aio: stop using .io_flush() Stefan Hajnoczi
2013-07-26 16:10 ` Jeff Cody
2013-07-26 16:25 ` Paolo Bonzini
2013-07-26 16:36 ` Jeff Cody
2013-07-26 16:43 ` Jeff Cody
2013-07-29 8:08 ` Wenchao Xia
2013-07-29 14:32 ` Stefan Hajnoczi
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 07/18] block/curl: drop curl_aio_flush() Stefan Hajnoczi
2013-07-29 8:11 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 08/18] block/gluster: drop qemu_gluster_aio_flush_cb() Stefan Hajnoczi
2013-07-29 8:17 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 09/18] block/iscsi: drop iscsi_process_flush() Stefan Hajnoczi
2013-07-29 8:17 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 10/18] block/linux-aio: drop qemu_laio_completion_cb() Stefan Hajnoczi
2013-07-29 8:19 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 11/18] block/nbd: drop nbd_have_request() Stefan Hajnoczi
2013-07-29 8:19 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 12/18] block/rbd: drop qemu_rbd_aio_flush_cb() Stefan Hajnoczi
2013-07-29 8:20 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 13/18] block/sheepdog: drop have_co_req() and aio_flush_request() Stefan Hajnoczi
2013-07-26 5:50 ` MORITA Kazutaka
2013-07-29 8:24 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 14/18] block/ssh: drop return_true() Stefan Hajnoczi
2013-07-29 8:25 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 15/18] dataplane/virtio-blk: drop flush_true() and flush_io() Stefan Hajnoczi
2013-07-29 8:32 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 16/18] thread-pool: drop thread_pool_active() Stefan Hajnoczi
2013-07-29 8:33 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 17/18] tests: drop event_active_cb() Stefan Hajnoczi
2013-07-29 8:34 ` Wenchao Xia
2013-07-25 15:18 ` [Qemu-devel] [PATCH v6 18/18] aio: drop io_flush argument Stefan Hajnoczi
2013-07-29 8:37 ` Wenchao Xia
2013-08-06 15:07 ` [Qemu-devel] [PATCH v6 00/18] aio: drop io_flush() Stefan Hajnoczi
2013-08-09 7:14 ` Wenchao Xia [this message]
2013-08-09 8:31 ` 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=520496C3.9010500@linux.vnet.ibm.com \
--to=xiawenc@linux.vnet.ibm.com \
--cc=alex@alex.org.uk \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=pingfank@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--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).