Re: [Qemu-devel] [PATCH 04/11] aio: introduce aio_co_schedule

2016-05-26 Thread Stefan Hajnoczi
On Tue, May 17, 2016 at 04:57:28PM +0200, Paolo Bonzini wrote: > That said, there is at least another case where it will be used. In the > dataplane branch, where AIO callbacks take the AioContext mutex > themselves, we have: > > static void bdrv_co_io_em_complete(void *opaque, int ret) > { >

Re: [Qemu-devel] [PATCH 04/11] aio: introduce aio_co_schedule

2016-05-17 Thread Paolo Bonzini
On 19/04/2016 16:31, Stefan Hajnoczi wrote: > On Fri, Apr 15, 2016 at 01:31:59PM +0200, Paolo Bonzini wrote: >> @@ -255,6 +257,8 @@ aio_ctx_finalize(GSource *source) >> } >> #endif >> >> +qemu_bh_delete(ctx->schedule_bh); > > Please include an assertion that the scheduled corouti

Re: [Qemu-devel] [PATCH 04/11] aio: introduce aio_co_schedule

2016-05-17 Thread Paolo Bonzini
On 29/04/2016 07:11, Fam Zheng wrote: > > +int main(int argc, char **argv) > > +{ > > +init_clocks(); > > + > > +g_test_init(&argc, &argv, NULL); > > +g_test_add_func("/aio/multi/lifecycle", test_lifecycle); > > +if (g_test_quick()) { > > +g_test_add_func("/aio/multi/sched

Re: [Qemu-devel] [PATCH 04/11] aio: introduce aio_co_schedule

2016-04-28 Thread Fam Zheng
On Fri, 04/15 13:31, Paolo Bonzini wrote: > This provides the infrastructure to start a coroutine on a remote > AioContext. It will be used by CoMutex and CoQueue, so that > coroutines don't jump from one context to another when they > go to sleep on a mutex or waitqueue. > > aio_co_schedule is b

Re: [Qemu-devel] [PATCH 04/11] aio: introduce aio_co_schedule

2016-04-19 Thread Stefan Hajnoczi
On Fri, Apr 15, 2016 at 01:31:59PM +0200, Paolo Bonzini wrote: > @@ -255,6 +257,8 @@ aio_ctx_finalize(GSource *source) > } > #endif > > +qemu_bh_delete(ctx->schedule_bh); Please include an assertion that the scheduled coroutines list is empty. > + > qemu_lockcnt_lock(&ctx->li

[Qemu-devel] [PATCH 04/11] aio: introduce aio_co_schedule

2016-04-15 Thread Paolo Bonzini
This provides the infrastructure to start a coroutine on a remote AioContext. It will be used by CoMutex and CoQueue, so that coroutines don't jump from one context to another when they go to sleep on a mutex or waitqueue. aio_co_schedule is based on a lock-free multiple-producer, single-consumer