From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBGhX-0000TT-E3 for qemu-devel@nongnu.org; Thu, 18 May 2017 04:22:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBGhW-000620-Kg for qemu-devel@nongnu.org; Thu, 18 May 2017 04:22:27 -0400 Date: Thu, 18 May 2017 10:22:13 +0200 From: Kevin Wolf Message-ID: <20170518082213.GC4646@noname.redhat.com> References: <20170517170941.25850-1-stefanha@redhat.com> <20170517170941.25850-3-stefanha@redhat.com> <20170518075759.GA4646@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Eric Blake , Paolo Bonzini , qemu block , Fam Zheng , qemu-devel , Stefan Hajnoczi Am 18.05.2017 um 10:06 hat Stefan Hajnoczi geschrieben: > On Thu, May 18, 2017 at 8:57 AM, Kevin Wolf wrote: > > Am 17.05.2017 um 22:16 hat Eric Blake geschrieben: > >> On 05/17/2017 12:09 PM, Stefan Hajnoczi wrote: > >> > Calling aio_poll() directly may have been fine previously, but this is > >> > the future, man! > >> > >> lol > >> > >> > The difference between an aio_poll() loop and > >> > BDRV_POLL_WHILE() is that BDRV_POLL_WHILE() releases the AioContext > >> > around aio_poll(). > >> > > >> > This allows the IOThread to run fd handlers or BHs to complete the > >> > request. Failure to release the AioContext causes deadlocks. > >> > > >> > Using BDRV_POLL_WHILE() partially fixes a 'savevm' hang with -object > >> > iothread. > >> > >> I'm surprised at how many separate hangs we actually had! > > > > How hard would it be to write some test cases for this? Dataplane has > > a serious lack of automated testing. > > And this hang doesn't even require in-flight guest I/O, so it would be > easy to reproduce in qemu-iotests if we add an IOThread mode. I don't think I would make it a separate mode (because people would run only one or the other - when did you last run qcow2 v2 tests?), but just add some test cases that make use of it during the normal -qcow2 or -raw run. Kevin