diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-01-12 19:07:53 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-01-16 13:25:17 +0000 |
commit | d7c99a1282ca2de1c344b8aa91be5364e9c6aa8f (patch) | |
tree | e7ea12e8f68e634eb89b7a4f98c739442f6745b6 /include | |
parent | 51dee5e465e1b3454a886792ca3e14b851e8e67d (diff) |
aio: make ctx->list_lock a QemuLockCnt, subsuming ctx->walking_bh
This will make it possible to walk the list of bottom halves without
holding the AioContext lock---and in turn to call bottom half
handlers without holding the lock.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 20170112180800.21085-4-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/aio.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/block/aio.h b/include/block/aio.h index 013d4002f6..be3adfec43 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -90,17 +90,15 @@ struct AioContext { */ uint32_t notify_me; - /* lock to protect between bh's adders and deleter */ - QemuMutex list_lock; + /* A lock to protect between bh's adders and deleter, and to ensure + * that no callbacks are removed while we're walking and dispatching + * them. + */ + QemuLockCnt list_lock; /* Anchor of the list of Bottom Halves belonging to the context */ struct QEMUBH *first_bh; - /* A simple lock used to protect the first_bh list, and ensure that - * no callbacks are removed while we're walking and dispatching callbacks. - */ - int walking_bh; - /* Used by aio_notify. * * "notified" is used to avoid expensive event_notifier_test_and_clear |