|
| From: | Richard Henderson |
| Subject: | Re: [PATCH 7/8] qemu-coroutine-lock: add smp_mb__after_rmw() |
| Date: | Sun, 5 Mar 2023 11:36:22 -0800 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 3/3/23 09:19, Paolo Bonzini wrote:
mutex->from_push and mutex->handoff in qemu-coroutine-lock implement
the familiar pattern:
write a write b
smp_mb() smp_mb()
read b read a
The memory barrier is required by the C memory model even after a
SEQ_CST read-modify-write operation such as QSLIST_INSERT_HEAD_ATOMIC.
Add it and avoid the unclear qatomic_mb_read() operation.
Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
---
util/qemu-coroutine-lock.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
| [Prev in Thread] | Current Thread | [Next in Thread] |