aboutsummaryrefslogtreecommitdiff
path: root/block/backup-top.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2020-08-06 14:18:01 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2020-08-13 13:32:59 +0100
commit601829f88e0eff8f54fa08b7a69b0774a9c259c8 (patch)
tree7de8aa930014c903d1a973a0e08aef8895a5afc1 /block/backup-top.c
parentc13be5a1bfcd6cafdf20072c75eaf3e5af35f2e6 (diff)
async: always set ctx->notified in aio_notify()
aio_notify() does not set ctx->notified when called with ctx->aio_notify_me disabled. Therefore aio_notify_me needs to be enabled during polling. This is suboptimal since expensive event_notifier_set(&ctx->notifier) and event_notifier_test_and_clear(&ctx->notifier) calls are required when ctx->aio_notify_me is enabled. Change aio_notify() so that aio->notified is always set, regardless of ctx->aio_notify_me. This will make polling cheaper since ctx->aio_notify_me can remain disabled. Move the event_notifier_test_and_clear() to the fd handler function (which is now no longer an empty function so "dummy" has been dropped from its name). The next patch takes advantage of this by optimizing polling in util/aio-posix.c. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20200806131802.569478-3-stefanha@redhat.com [Paolo Bonzini pointed out that the smp_wmb() in aio_notify_accept() should be smp_wb() but the comment should be smp_wmb() instead of smp_wb(). Fixed. --Stefan] Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/backup-top.c')
0 files changed, 0 insertions, 0 deletions