On 05/04/19 18:33, Sergio Lopez wrote: >> - qemu_bh_schedule_nested should not be necessary since we have >> ctx->notify_me to also avoid the event_notifier_set call. However, it >> is possible to avoid the smp_mb at the beginning of aio_notify, since >> atomic_xchg already implies it. Maybe add a "static void >> aio_notify__after_smp_mb"? > try_poll_mode() is called with ctx->notify_me != 0, so we get at least > one event_notifier_set() call while working in polling mode.
Right, though then there is the idea of making ctx->notify_me and ctx->notified bitmasks, where bit 0 is "BH ready" and bit 1 is "poll() parameters changed". try_poll_mode() cares about the latter, but does not need event_notifier_set() for BH ready. Paolo