From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nwbu8-0006wx-Fo for qemu-devel@nongnu.org; Tue, 30 Mar 2010 09:54:52 -0400 Received: from [140.186.70.92] (port=55993 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwbu7-0006wQ-1s for qemu-devel@nongnu.org; Tue, 30 Mar 2010 09:54:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nwbu5-00040B-Bz for qemu-devel@nongnu.org; Tue, 30 Mar 2010 09:54:50 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:48560) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwbu5-0003zC-8c for qemu-devel@nongnu.org; Tue, 30 Mar 2010 09:54:49 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by e4.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o2UDhIA4023094 for ; Tue, 30 Mar 2010 09:43:18 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2UDsl28160668 for ; Tue, 30 Mar 2010 09:54:47 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2UDslxT010379 for ; Tue, 30 Mar 2010 09:54:47 -0400 Message-ID: <4BB202A5.8020105@linux.vnet.ibm.com> Date: Tue, 30 Mar 2010 08:54:45 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH -V3 09/32] virtio-9p: Implement P9_TWRITE/ Thread model in QEMU References: <1269535420-31206-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1269535420-31206-10-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <4BB04A59.1040204@linux.vnet.ibm.com> <4BB0C09D.7090204@linux.vnet.ibm.com> <4BB10E30.70908@redhat.com> <4BB110B3.8040300@linux.vnet.ibm.com> <4BB1136B.6050506@redhat.com> <4BB11A48.4060805@linux.vnet.ibm.com> <4BB1D143.5040308@redhat.com> <4BB1F915.6020800@linux.vnet.ibm.com> <4BB1FC83.6000202@redhat.com> In-Reply-To: <4BB1FC83.6000202@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: ericvh@gmail.com, Kevin Wolf , jvrao , "Aneesh Kumar K.V" , qemu-devel@nongnu.org On 03/30/2010 08:28 AM, Avi Kivity wrote: >> But that offers no advantage to what we have which fails the >> proof-by-example that threading makes the situation better. > > > It has an advantage, qcow2 is currently synchronous in parts: > > block/qcow2-cluster.c: ret = bdrv_write(s->hd, (cluster_offset >> > 9) + n_start, > block/qcow2-cluster.c: ret = bdrv_read(bs->backing_hd, sector_num, buf, n1); The two of these happen in copy_sectors(). copy_sectors() runs from qcow2_alloc_cluster_link_l2() which is called from qcow_aio_write_cb() and preallocate(). > block/qcow2.c: bdrv_write(s->hd, (meta.cluster_offset >> 9) + > num - 1, buf, 1); This only happens during creation (for preallocation). > block/qcow2.c: bdrv_write(bs, sector_num, buf, > s->cluster_sectors); > block/qcow2-cluster.c: ret = bdrv_read(s->hd, coffset >> 9, > s->cluster_data, nb_csectors); These two are only for compressed images. So it looks like we really only have one operation (qcow2_alloc_cluster_link_l2) that blocks. Do we really think that it's sufficiently difficult to make this function asynchronous that it justifies threading the block layer? Regards, Anthony Liguori