coroutine-lock: reschedule coroutine on the AioContext it was running on
commita9d9235567e7637d474fa9a52432c63c9feeed07
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 13 Feb 2017 13:52:25 +0000 (13 14:52 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 21 Feb 2017 11:14:08 +0000 (21 11:14 +0000)
treea222f3c26bddfb5b007f6557317b1d50b757cbc2
parentff82911cd3f69f028f2537825c9720ff78bc3f19
coroutine-lock: reschedule coroutine on the AioContext it was running on

As a small step towards the introduction of multiqueue, we want
coroutines to remain on the same AioContext that started them,
unless they are moved explicitly with e.g. aio_co_schedule.  This patch
avoids that coroutines switch AioContext when they use a CoMutex.
For now it does not make much of a difference, because the CoMutex
is not thread-safe and the AioContext itself is used to protect the
CoMutex from concurrent access.  However, this is going to change.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 20170213135235.12274-9-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
util/qemu-coroutine-lock.c
util/trace-events