From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adZYk-0003cC-PB for qemu-devel@nongnu.org; Wed, 09 Mar 2016 03:33:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adZYf-0006jG-LB for qemu-devel@nongnu.org; Wed, 09 Mar 2016 03:33:34 -0500 Date: Wed, 9 Mar 2016 16:33:18 +0800 From: Fam Zheng Message-ID: <20160309083318.GJ17947@ad.usersys.redhat.com> References: <1455645388-32401-1-git-send-email-pbonzini@redhat.com> <1455645388-32401-7-git-send-email-pbonzini@redhat.com> <20160309033504.GE17947@ad.usersys.redhat.com> <56DFD40D.4040109@redhat.com> <20160309080030.GA30583@ad.usersys.redhat.com> <56DFDD5D.7010401@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56DFDD5D.7010401@redhat.com> Subject: Re: [Qemu-devel] [PATCH 06/16] block: add BDS field to count in-flight requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: stefanha@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org On Wed, 03/09 09:22, Paolo Bonzini wrote: > > > On 09/03/2016 09:00, Fam Zheng wrote: > >> > On 09/03/2016 04:35, Fam Zheng wrote: > >>>>> > >> > enum BdrvTrackedRequestType { > >>>>> > >> > BDRV_TRACKED_READ, > >>>>> > >> > BDRV_TRACKED_WRITE, > >>>>> > >> > - BDRV_TRACKED_FLUSH, > >>>>> > >> > - BDRV_TRACKED_IOCTL, > >>>>> > >> > BDRV_TRACKED_DISCARD, > >>> > > Okay, so flush and ioctl are not needed, but why is discard different? > >> > > >> > Discard can modify the contents of the device, so I think it's safer to > >> > serialize it against RMW and copy-on-read operations. > > Okay, that makes sense, but ioctl like SG_IO can also modify content, no? > > If you use SG_IO you shouldn't use RMW (because scsi_read_complete traps > READ CAPACITY and sets the host block size as the guest block size) or > copy-on-read (because raw has no backing file). > > Besides, BDRV_TRACKED_IOCTL didn't include sector_num/nr_sectors > operations so it didn't provide serialization. > Yes, that's right. Thanks. Fam