Re: [PATCH 2/3] async: always set ctx->notified in aio_notify()

2020-08-04 Thread Stefan Hajnoczi
On Tue, Aug 04, 2020 at 09:12:46AM +0200, Paolo Bonzini wrote: > On 04/08/20 07:28, Stefan Hajnoczi wrote: > > @@ -425,19 +425,14 @@ void aio_notify(AioContext *ctx) > > smp_mb(); > > if (atomic_read(&ctx->notify_me)) { > > event_notifier_set(&ctx->notifier); > > -atomic_

Re: [PATCH 2/3] async: always set ctx->notified in aio_notify()

2020-08-04 Thread Paolo Bonzini
On 04/08/20 07:28, Stefan Hajnoczi wrote: > @@ -425,19 +425,14 @@ void aio_notify(AioContext *ctx) > smp_mb(); > if (atomic_read(&ctx->notify_me)) { > event_notifier_set(&ctx->notifier); > -atomic_mb_set(&ctx->notified, true); > } > + > +atomic_mb_set(&ctx->notif

[PATCH 2/3] async: always set ctx->notified in aio_notify()

2020-08-03 Thread Stefan Hajnoczi
aio_notify() does not set ctx->notified when called with ctx->aio_notify_me disabled. In order to poll ctx->notified it is therefore necessary to enable ctx->aio_notify_me. This is suboptimal since expensive event_notifier_set(&ctx->notifier) and event_notifier_test_and_clear(&ctx->notifier) calls