Received: from eggs.gnu.org ([140.186.70.92]:34069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REK5W-0001NH-RG for qemu-devel@nongnu.org; Thu, 13 Oct 2011 08:08:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1REK5V-00034N-Jd for qemu-devel@nongnu.org; Thu, 13 Oct 2011 08:08:38 -0400 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:36756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REK5V-00033z-Ai for qemu-devel@nongnu.org; Thu, 13 Oct 2011 08:08:37 -0400 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p9DC8Yck026470 for ; Thu, 13 Oct 2011 12:08:34 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9DC8Y3M2064586 for ; Thu, 13 Oct 2011 13:08:34 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9DC8YAd021986 for ; Thu, 13 Oct 2011 06:08:34 -0600 From: Stefan Hajnoczi Date: Thu, 13 Oct 2011 13:08:20 +0100 Message-Id: <1318507705-13840-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v2 0/5] 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 , Stefan Hajnoczi Note: this version applies against Kevin's block tree 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. v2: * Fixed bdrv_read()/bdrv_write() infinite loop [Kevin] Stefan Hajnoczi (5): block: directly invoke .bdrv_* from emulation functions 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 | 245 ++++++++++++++++++++++++++++---------------------------------- 1 files changed, 111 insertions(+), 134 deletions(-) -- 1.7.6.3