qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] atomics: eliminate mb_read/mb_set


From: Richard Henderson
Subject: Re: [PATCH] atomics: eliminate mb_read/mb_set
Date: Fri, 26 May 2023 08:55:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 5/26/23 01:18, Paolo Bonzini wrote:
qatomic_mb_read and qatomic_mb_set were the very first atomic primitives
introduced for QEMU; their semantics are unclear and they provide a false
sense of safety.

The last use of qatomic_mb_read() has been removed, so delete it.
qatomic_mb_set() instead can survive as an optimized
qatomic_set()+smp_mb(), similar to Linux's smp_store_mb(), but
rename it to qatomic_set_mb() to match the order of the two
operations.

Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
---
  accel/tcg/cpu-exec.c              |  2 +-
  accel/tcg/tcg-accel-ops-mttcg.c   |  2 +-
  accel/tcg/tcg-accel-ops-rr.c      |  4 ++--
  docs/devel/atomics.rst            | 27 ++++-----------------------
  include/qemu/atomic.h             |  4 ++--
  monitor/qmp.c                     |  2 +-
  softmmu/cpus.c                    |  2 +-
  softmmu/physmem.c                 |  2 +-
  target/arm/hvf/hvf.c              |  2 +-
  tests/unit/test-aio-multithread.c |  2 +-
  util/qemu-coroutine-lock.c        |  4 ++--
  11 files changed, 17 insertions(+), 36 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]