[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/3] block: pause block jobs for
From: |
Fam Zheng |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/3] block: pause block jobs for bdrv_drain_begin/end |
Date: |
Tue, 28 Mar 2017 20:26:13 +0800 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Fri, 03/24 15:27, Stefan Hajnoczi wrote:
> On Thu, Mar 23, 2017 at 06:57:14PM +0100, Paolo Bonzini wrote:
> >
> >
> > On 23/03/2017 18:44, Stefan Hajnoczi wrote:
> > >> It's possible to wedge QEMU if the guest tries to reset a virtio-pci
> > >> device as QEMU is also using the drive for a blockjob. This patchset
> > >> aims to allow us to safely pause/resume jobs attached to individual
> > >> nodes in a manner similar to how bdrv_drain_all_begin/end do.
> > >
> > > Weird, I thought the 0 nanosecond sleep that block jobs do in their
> > > main loop allows aio_poll() loops to finish.
> >
> > The 0 nanosecond sleep is now done in the BDS AioContext rather than in
> > the "non-aio_poll-aware" main loop:
> >
> > commit 0b9caf9b3166c8deb3c4f3a774c2384b069dc29c
> > Author: Fam Zheng <address@hidden>
> > Date: Tue Aug 26 15:15:43 2014 +0800
> >
> > coroutine: Drop co_sleep_ns
> >
> > block_job_sleep_ns is the only user. Since we are moving towards
> > AioContext aware code, it's better to use the explicit version and drop
> > the old one.
> >
> > Signed-off-by: Fam Zheng <address@hidden>
> > Reviewed-by: BenoƮt Canet <address@hidden>
> > Signed-off-by: Stefan Hajnoczi <address@hidden>
>
> But we hold the AioContext lock and are calling aio_poll(), so I would
> expect our loop to terminate. The blockjob coroutine should still be
> leaving this little gap in activity during which the aio_poll() loop
> finishes.
I am not sure, but at each gap, aio_poll() is free to fire the 0 nanosecond
sleep timer cb already, which will generate more I/O. The correct thing is, like
in this series, set the pause flag.
Fam
Re: [Qemu-block] [PATCH v2 0/3] block: pause block jobs for bdrv_drain_begin/end, Stefan Hajnoczi, 2017/03/23