From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42135 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OxiYs-0006lK-Kj for qemu-devel@nongnu.org; Mon, 20 Sep 2010 11:45:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OxiYq-00074g-Ha for qemu-devel@nongnu.org; Mon, 20 Sep 2010 11:45:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52434) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxiYq-00074T-BI for qemu-devel@nongnu.org; Mon, 20 Sep 2010 11:45:44 -0400 Message-ID: <4C9781BA.7020303@redhat.com> Date: Mon, 20 Sep 2010 17:46:02 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes References: <1284991010-10951-1-git-send-email-kwolf@redhat.com> <4C977028.3050602@codemonkey.ws> <4C9778EC.9060704@redhat.com> <4C977ECF.4000907@redhat.com> In-Reply-To: <4C977ECF.4000907@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org Am 20.09.2010 17:33, schrieb Avi Kivity: > On 09/20/2010 05:08 PM, Kevin Wolf wrote: >>> >>> Let's expand it a bit more: >>> >>> 1. Update refcount table >>> 2. bdrv_flush >>> 3. Update L2 entry >>> 4. Write data to disk >>> 5. Report write complete >>> >>> I'm struggling to understand how a thread helps out. >> >> This sequence becomes: >> >> 1. Update refcount table >> 2. Write data to disk >> 3. Report write complete >> >> And only later: >> >> 4. Update L2 entry >> 5. bdrv_flush (possibly merged with other flushes) >> > > The L2 update needs to happen after we're sure the refcount update is > stable, so need a bdrv_flush between them. > > Still, the basic idea looks sound. You can do many refcount updates, > flush, many L2 updates, flush. Oops, my bad. Swap 4 and 5, that's what I meant. We don't need a flush after writing the L2 entry until we need to flush for other reasons. Kevin