From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBU9x-0003Lx-9n for qemu-devel@nongnu.org; Wed, 05 Oct 2011 12:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBU9v-0002Nz-NK for qemu-devel@nongnu.org; Wed, 05 Oct 2011 12:17:29 -0400 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:45513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBU9v-0002Lb-Eh for qemu-devel@nongnu.org; Wed, 05 Oct 2011 12:17:27 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p95GHIVQ000416 for ; Wed, 5 Oct 2011 16:17:18 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p95GHIKh2560228 for ; Wed, 5 Oct 2011 17:17:18 +0100 Received: from d06av07.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p95GHHrJ026231 for ; Wed, 5 Oct 2011 10:17:18 -0600 From: Stefan Hajnoczi Date: Wed, 5 Oct 2011 17:17:01 +0100 Message-Id: <1317831427-477-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 0/6] block: do request processing in a coroutine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , Marcelo Tosatti , Zhi Yong Wu , Avi Kivity , Christoph Hellwig Block layer features like dirty block tracing, I/O throttling, and live block copy are forced to duplicate code due to the three different interfaces: synchronous, asynchronous, and coroutines. Since there are bdrv_read(), bdrv_aio_readv(), and bdrv_co_readv() interfaces for read (and similar for write), per-request processing needs to be duplicated for each of these execution contexts. For example, dirty block tracking code is duplicated across these three interfaces. This patch series unifies request processing so that there is only one code path. I see this as a prerequisite to the live block copy (image streaming) code I am working on, so I'm pushing it now. The short-term win from this series is that it becomes easy to add live block copy and other features. We now have a single code path where the perf-request processing is done. The longer-term win will be dropping the BlockDriver .bdrv_read(), .bdrv_write(), .bdrv_aio_readv(), and .bdrv_aio_writev() interfaces. By doing that we can bring all BlockDrivers onto a common interface, namely .bdrv_co_readv() and .bdrv_co_writev(). It will also allow us to drop most of the sync and aio emulation code. A consequence of this patch series is that every I/O request goes through at least one coroutine. There is no longer a direct .bdrv_read(), .bdrv_write(), .bdrv_aio_readv(), or .bdrv_aio_writev() call - we're trying to phase out those interfaces. I have not noticed performance degradation in correctness tests but we need to confirm that there has not been a performance regression. Stefan Hajnoczi (6): block: directly invoke .bdrv_aio_*() in bdrv_co_io_em() block: split out bdrv_co_do_readv() and bdrv_co_do_writev() block: switch bdrv_read()/bdrv_write() to coroutines block: switch bdrv_aio_readv() to coroutines block: mark blocks dirty on coroutine write completion block: switch bdrv_aio_writev() to coroutines block.c | 273 +++++++++++++++++++++++++++++++-------------------------------- 1 files changed, 134 insertions(+), 139 deletions(-) -- 1.7.6.3