From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCTSR-0004oC-Pv for qemu-devel@nongnu.org; Tue, 27 Mar 2012 06:17:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCTSL-0004On-Id for qemu-devel@nongnu.org; Tue, 27 Mar 2012 06:16:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCTSL-0004OU-AX for qemu-devel@nongnu.org; Tue, 27 Mar 2012 06:16:49 -0400 Message-ID: <4F719465.3080203@redhat.com> Date: Tue, 27 Mar 2012 12:20:21 +0200 From: Kevin Wolf MIME-Version: 1.0 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> <4F608B9A.8040406@redhat.com> <20120324153040.GC13014@lst.de> <1332790848.3486.27.camel@watermelon.coderich.net> In-Reply-To: <1332790848.3486.27.camel@watermelon.coderich.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Richard Laager Cc: Christoph Hellwig , qemu-devel@nongnu.org Am 26.03.2012 21:40, schrieb Richard Laager: > On Sat, 2012-03-24 at 16:30 +0100, Christoph Hellwig wrote: >> On Wed, Mar 14, 2012 at 01:14:18PM +0100, Paolo Bonzini wrote: >>> >>> Note that the discard granularity is only a hint, so it's really more a >>> maximum suggested value than a granularity. Outside of a cluster >>> boundary the format would still have to write zeros manually. >>> >>> Also, Linux for example will only round the number of sectors down to >>> the granularity, not the start sector. >> >> Which really is more of a bug than a feature. The current discard >> implementation in Linux is still very poor. > > The disk protocols do not require the granularity to be respected. It is > *only a hint*. Therefore, QEMU has to handle non-aligned discards. It > doesn't really matter what we wish was the case; this is the reality. But we can do suboptimal things (like just ignoring the request if we didn't promise to zero data, or turn it into a non-discarding zero buffer write otherwise) if the OS knowingly uses misaligned discards. Not our bug then. Kevin