Received: from eggs.gnu.org ([2001:4830:134:3::10]:46166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAKJQ-000512-9B for qemu-devel@nongnu.org; Wed, 01 Jul 2015 11:52:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAKJP-0002fm-40 for qemu-devel@nongnu.org; Wed, 01 Jul 2015 11:52:36 -0400 From: Markus Armbruster References: <1434537440-28236-1-git-send-email-yarygin@linux.vnet.ibm.com> <1434537440-28236-3-git-send-email-yarygin@linux.vnet.ibm.com> <87mvzm2536.fsf@blackfin.pond.sub.org> <87egky4lj4.fsf@linux.vnet.ibm.com> <878ub3xcxf.fsf@blackfin.pond.sub.org> <20150630135208.GB31899@stefanha-thinkpad.redhat.com> Date: Wed, 01 Jul 2015 17:52:27 +0200 In-Reply-To: <20150630135208.GB31899@stefanha-thinkpad.redhat.com> (Stefan Hajnoczi's message of "Tue, 30 Jun 2015 14:52:08 +0100") Message-ID: <87oajvho3o.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v3 2/2] virtio-blk: Use blk_drain() to drain IO requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org, Alexander Yarygin , Ekaterina Tumanova , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Christian Borntraeger , Cornelia Huck , Paolo Bonzini Stefan Hajnoczi writes: > On Mon, Jun 29, 2015 at 08:10:20AM +0200, Markus Armbruster wrote: >> Alexander Yarygin writes: >> > Markus Armbruster writes: >> > * Ignorant answer: I was told that the bdrv_drain_all()'s comment is >> > obsolete and we can use bdrv_drain(). Here is a link to the old >> > thread: http://marc.info/?l=qemu-devel&m=143154211017926&w=2. >> >> Kevin, Stefan, if the comment has become wrong, it needs to be redone. >> Who's going to take care of it? > > I couldn't think of a scenario where this patch is unsafe. > > The danger is that the I/O code path depends on something outside the > AioContext. In that case you block in aio_poll(aio_context, true) > forever without making progress. The thing the I/O request depends on > will never finish. > > Code that accesses multiple BDSes puts them into the same AioContext, so > this should not be a problem in practice. Stefan, could you rework the bdrv_drain()'s to spell out how it can be used safely?