From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WILPv-0004yg-37 for qemu-devel@nongnu.org; Tue, 25 Feb 2014 12:03:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WILPl-0005jU-Jz for qemu-devel@nongnu.org; Tue, 25 Feb 2014 12:03:39 -0500 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:46148 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WILPl-0005ic-98 for qemu-devel@nongnu.org; Tue, 25 Feb 2014 12:03:29 -0500 Message-ID: <530CCCD4.5080104@kamp.de> Date: Tue, 25 Feb 2014 18:03:16 +0100 From: Peter Lieven MIME-Version: 1.0 References: <1393074022-32388-1-git-send-email-pl@kamp.de> <20140224101152.GE3775@dhcp-200-207.str.redhat.com> <530B1E3D.8050204@kamp.de> <530B2143.1030808@redhat.com> <530B42B2.1040909@kamp.de> <20140225134157.GE3339@dhcp-200-207.str.redhat.com> In-Reply-To: <20140225134157.GE3339@dhcp-200-207.str.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 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: Kevin Wolf Cc: Paolo Bonzini , qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com Am 25.02.2014 14:41, schrieb Kevin Wolf: > Am 24.02.2014 um 14:01 hat Peter Lieven geschrieben: >> On 24.02.2014 11:38, Paolo Bonzini wrote: >>> Il 24/02/2014 11:26, Peter Lieven ha scritto: >>>> I personally do not need this for QCOW2 but for iSCSI. Here the optimization >>>> is basically saved bandwidth since a zero write becomes a WRITESAME. >>> It saves bandwidth, but at the potential cost of extra host CPU >>> utilization. I would be fine with having this automatically, but >>> drv->bdrv_co_write_zeroes is not the right check because it is >>> true for qcow2 and raw formats. Something using bdrv_get_info is >>> probably better, because it would have fewer or no false >>> positives. >>> >>>> In all cases if unmap=on it would additionally save disk space. >>> It would also cause worse performance though. I think the automatic addition BDRV_REQ_MAY_UNMAP is what should be a separate option. Perhaps you can have a three-state option, detect-zeros=no/yes/unmap. >> What would be the desired way to store this flag in the BlockDriverState? > Some new enum field? Is there an already implemented example where I can copy from? Its quite diffucult to search through all the involved functions when doing it for the first time. Peter