From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsVOX-0007GV-Uu for qemu-devel@nongnu.org; Wed, 13 May 2015 08:04:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsVOW-0003x9-UO for qemu-devel@nongnu.org; Wed, 13 May 2015 08:04:13 -0400 Sender: Paolo Bonzini Message-ID: <55533DB3.20402@redhat.com> Date: Wed, 13 May 2015 14:04:03 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1431538099-3286-1-git-send-email-famz@redhat.com> <1431538099-3286-2-git-send-email-famz@redhat.com> In-Reply-To: <1431538099-3286-2-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 01/11] block: Add op blocker type "device IO" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, jcody@redhat.com, armbru@redhat.com, mreitz@redhat.com, Stefan Hajnoczi On 13/05/2015 19:28, Fam Zheng wrote: > @@ -478,6 +478,10 @@ static int blk_check_request(BlockBackend *blk, int64_t sector_num, > return -EIO; > } > > + if (bdrv_op_is_blocked(blk->bs, BLOCK_OP_TYPE_DEVICE_IO, NULL)) { > + return -EBUSY; > + } I think this is incorrect. It's fine for backends to generate more I/O after a blocker is submitted, as long as it's bounded. For example, SCSI requests can result in many consecutive I/Os: (1) FUA requests are split in write+flush (2) adapters that do not use QEMUSGList-based I/O only read 128K at a time (3) WRITE SAME operations are also split in chunks (4) UNMAP operations process one descriptor at a time Paolo > return blk_check_byte_request(blk, sector_num * BDRV_SECTOR_SIZE, > nb_sectors * BDRV_SECTOR_SIZE); > }