Re: [Qemu-devel] [PATCH 2/2] AioContext: optimize clearing the EventNotifier

2015-07-19 Thread Paolo Bonzini
On 20/07/2015 07:25, Paolo Bonzini wrote: > > /* fill pollfds */ > > +i = 0; > > QLIST_FOREACH(node, &ctx->aio_handlers, node) { > > if (!node->deleted && node->pfd.events) { > > add_pollfd(node); > > +if (node->pfd.fd == event_notifier_get_fd(&ctx-

Re: [Qemu-devel] [PATCH 2/2] AioContext: optimize clearing the EventNotifier

2015-07-19 Thread Paolo Bonzini
On 20/07/2015 04:27, Fam Zheng wrote: > For aio-posix, how about keeping the optimization local which doesn't need > atomic operation? (no idea for win32 :) > > diff --git a/aio-posix.c b/aio-posix.c > index 5c8b266..7e98123 100644 > --- a/aio-posix.c > +++ b/aio-posix.c > @@ -236,6 +236,7 @@ bo

Re: [Qemu-devel] [PATCH 2/2] AioContext: optimize clearing the EventNotifier

2015-07-19 Thread Fam Zheng
On Sat, 07/18 22:21, Paolo Bonzini wrote: > It is pretty rare for aio_notify to actually set the EventNotifier. It > can happen with worker threads such as thread-pool.c's, but otherwise it > should never be set thanks to the ctx->notify_me optimization. The > previous patch, unfortunately, added

[Qemu-devel] [PATCH 2/2] AioContext: optimize clearing the EventNotifier

2015-07-18 Thread Paolo Bonzini
It is pretty rare for aio_notify to actually set the EventNotifier. It can happen with worker threads such as thread-pool.c's, but otherwise it should never be set thanks to the ctx->notify_me optimization. The previous patch, unfortunately, added an unconditional call to event_notifier_test_and_