From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCd2M-0005sJ-LA for qemu-devel@nongnu.org; Mon, 13 Jun 2016 21:21:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCd2L-0004sj-Il for qemu-devel@nongnu.org; Mon, 13 Jun 2016 21:21:02 -0400 Date: Tue, 14 Jun 2016 09:20:46 +0800 From: Fam Zheng Message-ID: <20160614012046.GA26269@ad.usersys.redhat.com> References: <20160612065603.21911-1-famz@redhat.com> <20160613093948.GB5968@noname.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160613093948.GB5968@noname.str.redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] macio: Use blk_drain instead of blk_drain_all List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, jsnow@redhat.com, mreitz@redhat.com, stefanha@redhat.com On Mon, 06/13 11:39, Kevin Wolf wrote: > Am 12.06.2016 um 08:56 hat Fam Zheng geschrieben: > > We only care about the associated backend, so blk_drain is more > > appropriate here. > > > > Signed-off-by: Fam Zheng > > [ Cc: John ] > > > --- > > hw/ide/macio.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/hw/ide/macio.c b/hw/ide/macio.c > > index 78c10a0..a8c7321 100644 > > --- a/hw/ide/macio.c > > +++ b/hw/ide/macio.c > > @@ -400,7 +400,7 @@ static void pmac_ide_flush(DBDMA_io *io) > > IDEState *s = idebus_active_if(&m->bus); > > > > if (s->bus->dma->aiocb) { > > - blk_drain_all(); > > + blk_drain(s->blk); > > } > > } > > Looks good to me: > > Reviewed-by: Kevin Wolf > > However, even this is still doing too much. We only need to drain the > requests that come from this device and can ignore e.g. block job > requests. > > Now the part that I'm not completely sure about is whether the problem > is here in the IDE emulation and it should track its own requests or > whether it is blk_drain() that actually shouldn't drain the BDS but just > all requests that came in through this specific BB. > > I'm leaning towards the latter, but I'm unsure whether we have cases > where we actually need to drain the whole root BDS. Any opinions? I agree with you and think the latter is better in this case. I think the one in migration/block.c need to drain the whole root BDS, and others don't. Fam