From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ald4w-0005Sp-V1 for qemu-devel@nongnu.org; Thu, 31 Mar 2016 09:56:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ald4r-0004Gs-6G for qemu-devel@nongnu.org; Thu, 31 Mar 2016 09:56:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ald4r-0004Gn-0T for qemu-devel@nongnu.org; Thu, 31 Mar 2016 09:56:01 -0400 References: <1459429325-16350-1-git-send-email-den@openvz.org> <24E4A85C-254F-4324-A2F4-9DACA6037381@alex.org.uk> From: Paolo Bonzini Message-ID: <56FD2C6A.9030208@redhat.com> Date: Thu, 31 Mar 2016 15:55:54 +0200 MIME-Version: 1.0 In-Reply-To: <24E4A85C-254F-4324-A2F4-9DACA6037381@alex.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/1] NBD proto: add WRITE_ZEROES extension List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh , "Denis V. Lunev" Cc: "nbd-general@lists.sourceforge.net" , Kevin Wolf , "qemu-devel@nongnu.org" , Pavel Borzenkov , "Stefan stefanha@redhat. com" , Wouter Verhelst On 31/03/2016 15:53, Alex Bligh wrote: >> > + If the flag `NBD_CMD_FLAG_MAY_TRIM` was set by the client in the command >> > + flags field, the server MAY use trimming to zero out the area, but it >> > + MUST ensure that the data reads back as zero. >> > + > Can you give an example of a situation where the client would not set this > and it would be undesirable for the server to create a 'hole' using > 'trim' type technology, even when the client doesn't specify it? > I suspect there are already some backends (e.g. ceph on qemu-nbd) which > will effectively do a 'trim' if you write 4k of zeroes even under > current circumstances. > > IE why not always permit trimming PROVIDED the data always reads back > as zero? This would be far simpler. Because trimming can make future operations more expensive and cause fragmentation (which may not be as bad as it used to be at the media level, but it is still somewhat bad at the filesystem level). So if you want a fully-provisioned file, the simplest way to do so is to write zeroes to it, and trimming is undesirable. Paolo