Re: [PATCH v6 4/6] coroutine-lock: Reimplement CoRwlock to fix downgrade bug

2021-03-30 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 12:29:39PM +0100, Paolo Bonzini wrote: > An invariant of the current rwlock is that if multiple coroutines hold a > reader lock, all must be runnable. The unlock implementation relies on > this, choosing to wake a single coroutine when the final read lock > holder exits the

[PATCH v6 4/6] coroutine-lock: Reimplement CoRwlock to fix downgrade bug

2021-03-25 Thread Paolo Bonzini
An invariant of the current rwlock is that if multiple coroutines hold a reader lock, all must be runnable. The unlock implementation relies on this, choosing to wake a single coroutine when the final read lock holder exits the critical section, assuming that it will wake a coroutine attempting to