From: David Edmondson Date: Thu, 25 Mar 2021 11:29:38 +0000 (+0100) Subject: coroutine-lock: Store the coroutine in the CoWaitRecord only once X-Git-Tag: v6.0.0-rc2~10^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f6ef0393b54383c204d4d6aa5b8eec2bcad566f;p=thirdparty%2Fqemu.git coroutine-lock: Store the coroutine in the CoWaitRecord only once When taking the slow path for mutex acquisition, set the coroutine value in the CoWaitRecord in push_waiter(), rather than both there and in the caller. Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Edmondson Signed-off-by: Paolo Bonzini Message-id: 20210325112941.365238-4-pbonzini@redhat.com Message-Id: <20210309144015.557477-4-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index 5816bf89009..eb73cf11dcc 100644 --- a/util/qemu-coroutine-lock.c +++ b/util/qemu-coroutine-lock.c @@ -204,7 +204,6 @@ static void coroutine_fn qemu_co_mutex_lock_slowpath(AioContext *ctx, unsigned old_handoff; trace_qemu_co_mutex_lock_entry(mutex, self); - w.co = self; push_waiter(mutex, &w); /* This is the "Responsibility Hand-Off" protocol; a lock() picks from