Received: from eggs.gnu.org ([208.118.235.92]:59377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBSuH-0007M7-NQ for qemu-devel@nongnu.org; Sat, 24 Mar 2012 11:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBSuG-0006Nd-2Q for qemu-devel@nongnu.org; Sat, 24 Mar 2012 11:29:29 -0400 Received: from verein.lst.de ([213.95.11.211]:52355 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBSuF-0006NO-SC for qemu-devel@nongnu.org; Sat, 24 Mar 2012 11:29:27 -0400 Date: Sat, 24 Mar 2012 16:29:26 +0100 From: Christoph Hellwig Message-ID: <20120324152926.GB13014@lst.de> References: <1331226917-6658-1-git-send-email-pbonzini@redhat.com> <1331226917-6658-7-git-send-email-pbonzini@redhat.com> <4F5A31B2.3050701@redhat.com> <4F5A46A1.4000508@redhat.com> <1331402560.8577.46.camel@watermelon.coderich.net> <4F5DEBCE.3040409@redhat.com> <1331665990.24052.42.camel@watermelon.coderich.net> <4F604B98.9090606@redhat.com> <4F60889F.6030401@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F60889F.6030401@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paolo Bonzini , Richard Laager , qemu-devel@nongnu.org On Wed, Mar 14, 2012 at 01:01:35PM +0100, Kevin Wolf wrote: > Paolo mentioned a use case as a fast way for guests to write zeros, but > is it really faster than a normal write when we have to emulate it by a > bdrv_write with a temporary buffer of zeros? On the other hand we have > the cases where discard really means "I don't care about the data any > more" and emulating it by writing zeros is just a waste of resources there. On raw a real discard also will destroy the preallocation, which might absolutely kill your performance on filesystems. XFS provides a XFS_IOC_ZERO_RANGE ioctl (same calloing convention as XFS_IOC_RESVSP), which would provide a good backend for WRITE SAME emulation in this context.