From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHu4Q-0000XV-4A for qemu-devel@nongnu.org; Mon, 24 Feb 2014 06:51:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHu4H-0000XT-NT for qemu-devel@nongnu.org; Mon, 24 Feb 2014 06:51:38 -0500 Received: from mail-qa0-x231.google.com ([2607:f8b0:400d:c00::231]:53050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHu4H-0000XP-Ix for qemu-devel@nongnu.org; Mon, 24 Feb 2014 06:51:29 -0500 Received: by mail-qa0-f49.google.com with SMTP id w8so6007649qac.36 for ; Mon, 24 Feb 2014 03:51:29 -0800 (PST) Sender: Paolo Bonzini Message-ID: <530B323C.5050609@redhat.com> Date: Mon, 24 Feb 2014 12:51:24 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1393074022-32388-1-git-send-email-pl@kamp.de> <20140222164512.GC16767@T430.redhat.com> <530A479E.4070900@kamp.de> <20140224010150.GA6840@T430.redhat.com> <530B216C.5050902@redhat.com> <20140224113311.GA24100@T430.redhat.com> In-Reply-To: <20140224113311.GA24100@T430.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, Peter Lieven , qemu-devel@nongnu.org, stefanha@redhat.com Il 24/02/2014 12:33, Fam Zheng ha scritto: > > This is (or should be) bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP. > > But IIUC bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP doesn't require > cluster allocation if it's allocated yet, which is a bit different. Yeah, that's why I wrote "or should be". Those are the intended semantics of bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP: always allocate a cluster that will read as zeroes (allocating even if it does not necessarily write the zeroes). For legacy reasons it may not be exactly what is implemented. I asked Kevin a couple of weeks ago and he sent a patch, but even he wasn't sure of what qcow2 was doing util he looked at the code. :) Paolo