[Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-02-09 Thread Paolo Bonzini
This is the first step towards having fine-grained critical sections in dataplane threads, which resolves lock ordering problems between address_space_* functions (which need the BQL when doing MMIO, even after we complete RCU-based dispatch) and the AioContext. Because AioContext does not use con

[Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-02-08 Thread Paolo Bonzini
This is the first step towards having fine-grained critical sections in dataplane threads, which resolves lock ordering problems between address_space_* functions (which need the BQL when doing MMIO, even after we complete RCU-based dispatch) and the AioContext. Because AioContext does not use con

Re: [Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-02-08 Thread Paolo Bonzini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 05/02/2016 18:51, Stefan Hajnoczi wrote: >> Because this is a file descriptor source, there is really no >> difference between the code's behavior, no matter if aio_poll >> starts before or after the event_notifier_set. The test passes >> ev

Re: [Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-02-08 Thread Stefan Hajnoczi
On Wed, Feb 03, 2016 at 10:52:38AM +0100, Paolo Bonzini wrote: > > > On 03/02/2016 10:34, Stefan Hajnoczi wrote: > > +g_usleep(50); > > Sleep? > >>> > >>> What about it? :) > > Sleep in a loop is inefficient but at least correct. > > > > A sleep outside a loop is a race cond

Re: [Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-02-03 Thread Paolo Bonzini
On 03/02/2016 10:34, Stefan Hajnoczi wrote: > +g_usleep(50); > Sleep? >>> >>> What about it? :) > Sleep in a loop is inefficient but at least correct. > > A sleep outside a loop is a race condition. If the machine is > heavily loaded, whatever you are waiting for may not ha

Re: [Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-02-03 Thread Stefan Hajnoczi
On Tue, Feb 02, 2016 at 04:01:55PM +0100, Paolo Bonzini wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > > > On 02/02/2016 15:52, Stefan Hajnoczi wrote: > >>> @@ -110,6 +111,8 @@ static void *test_acquire_thread(void > >>> *opaque) qemu_mutex_lock(&data->start_lock); > >>> qemu_mu

Re: [Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-02-02 Thread Paolo Bonzini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 02/02/2016 15:52, Stefan Hajnoczi wrote: >>> @@ -110,6 +111,8 @@ static void *test_acquire_thread(void >>> *opaque) qemu_mutex_lock(&data->start_lock); >>> qemu_mutex_unlock(&data->start_lock); >>> >>> +g_usleep(50); > Sleep? What abo

Re: [Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-02-02 Thread Stefan Hajnoczi
On Fri, Jan 15, 2016 at 04:12:08PM +0100, Paolo Bonzini wrote: > @@ -120,9 +117,17 @@ Block layer code must therefore expect to run in an > IOThread and avoid using > old APIs that implicitly use the main loop. See the "How to program for > IOThreads" above for information on how to do that. >

[Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll

2016-01-15 Thread Paolo Bonzini
This is the first step towards having fine-grained critical sections in dataplane threads, which resolves lock ordering problems between address_space_* functions (which need the BQL when doing MMIO, even after we complete RCU-based dispatch) and the AioContext. Because AioContext does not use con