From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adZOb-000410-Jn for qemu-devel@nongnu.org; Wed, 09 Mar 2016 03:23:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adZOS-0004hz-LB for qemu-devel@nongnu.org; Wed, 09 Mar 2016 03:23:05 -0500 Sender: Paolo Bonzini 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> From: Paolo Bonzini Message-ID: <56DFDD5D.7010401@redhat.com> Date: Wed, 9 Mar 2016 09:22:53 +0100 MIME-Version: 1.0 In-Reply-To: <20160309080030.GA30583@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Fam Zheng Cc: stefanha@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org 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. Paolo