From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34033 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvYzs-0005Wz-9I for qemu-devel@nongnu.org; Tue, 14 Sep 2010 13:08:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvYzq-0001R9-V9 for qemu-devel@nongnu.org; Tue, 14 Sep 2010 13:08:44 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:64696) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvYzq-0001Qy-Lp for qemu-devel@nongnu.org; Tue, 14 Sep 2010 13:08:42 -0400 Received: by pxi12 with SMTP id 12so2560352pxi.4 for ; Tue, 14 Sep 2010 10:08:41 -0700 (PDT) Message-ID: <4C8FAC15.1020500@codemonkey.ws> Date: Tue, 14 Sep 2010 12:08:37 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] qcow2 performance plan References: <4C8F7394.8060802@redhat.com> <4C8F7BE4.5010102@codemonkey.ws> <4C8F9087.2050005@redhat.com> <4C8F92D9.2000908@codemonkey.ws> <4C8F9920.7070908@redhat.com> <4C8F9FDE.8050004@codemonkey.ws> <4C8FA297.2020807@redhat.com> In-Reply-To: <4C8FA297.2020807@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; 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: Kevin Wolf , Stefan Hajnoczi , qemu-devel On 09/14/2010 11:28 AM, Avi Kivity wrote: > On 09/14/2010 06:16 PM, Anthony Liguori wrote: >> >> Right, it should only freeze if the L2 table needs to be allocated, >> not if it only needs to be updated. IOW, >> >> diff --git a/block/qed.c b/block/qed.c >> index 4c4e7a2..0357c03 100644 >> --- a/block/qed.c >> +++ b/block/qed.c >> @@ -948,7 +948,7 @@ static void qed_aio_write_data(void *opaque, int >> ret, >> } >> >> /* Freeze this request if another allocating write is in >> progress */ >> - if (need_alloc) { >> + if (ret == QED_CLUSTER_L1) { >> if (acb != QSIMPLEQ_FIRST(&s->allocating_write_reqs)) { >> QSIMPLEQ_INSERT_TAIL(&s->allocating_write_reqs, acb, next); >> } >> >> It's being a bit more conservative than it needs to be. > > Yes, I hit this too. So without this patch, it does serialize all > allocating writes? Yes, but my patch is not enough as it turns out. When dealing with O_DIRECT, we have to handle RMW on our own which means we need to serialize access to the same sector. The way we're planning on addressing this in the short term is to break the single allocator queue into a per-L2 table queue. So writes to the same L2 would be serialized but writes to different L2s would not be serialized. Regards, Anthony Liguori > If multiple requests need to update pointers in L2, will those updates > generate one write per request, or just two writes (one write from the > first request, another from all those that serialized after it)? >