summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini2015-02-20 17:26:51 +0100
committerKevin Wolf2015-04-28 15:36:08 +0200
commit49110174f8835ec3d5ca7fc076ee1f51c18564fe (patch)
treec05646cd2b8b3e3ba896ecea96afe5a39118bc2b /include
parentaio-posix: move pollfds to thread-local storage (diff)
downloadqemu-49110174f8835ec3d5ca7fc076ee1f51c18564fe.tar.gz
qemu-49110174f8835ec3d5ca7fc076ee1f51c18564fe.tar.xz
qemu-49110174f8835ec3d5ca7fc076ee1f51c18564fe.zip
AioContext: acquire/release AioContext during aio_poll
This is the first step in pushing down acquire/release, and will let rfifolock drop the contention callback feature. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1424449612-18215-3-git-send-email-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/aio.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/block/aio.h b/include/block/aio.h
index 0dc7a258e2..d2bb423de1 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -118,13 +118,14 @@ void aio_context_ref(AioContext *ctx);
void aio_context_unref(AioContext *ctx);
/* Take ownership of the AioContext. If the AioContext will be shared between
- * threads, a thread must have ownership when calling aio_poll().
+ * threads, and a thread does not want to be interrupted, it will have to
+ * take ownership around calls to aio_poll(). Otherwise, aio_poll()
+ * automatically takes care of calling aio_context_acquire and
+ * aio_context_release.
*
- * Note that multiple threads calling aio_poll() means timers, BHs, and
- * callbacks may be invoked from a different thread than they were registered
- * from. Therefore, code must use AioContext acquire/release or use
- * fine-grained synchronization to protect shared state if other threads will
- * be accessing it simultaneously.
+ * Access to timers and BHs from a thread that has not acquired AioContext
+ * is possible. Access to callbacks for now must be done while the AioContext
+ * is owned by the thread (FIXME).
*/
void aio_context_acquire(AioContext *ctx);