mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
atomics: eliminate mb_read/mb_set
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. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
09a49afeae
commit
06831001ac
11 changed files with 20 additions and 46 deletions
|
@ -244,7 +244,7 @@ static void *rr_cpu_thread_fn(void *arg)
|
|||
|
||||
while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) {
|
||||
/* Store rr_current_cpu before evaluating cpu_can_run(). */
|
||||
qatomic_mb_set(&rr_current_cpu, cpu);
|
||||
qatomic_set_mb(&rr_current_cpu, cpu);
|
||||
|
||||
current_cpu = cpu;
|
||||
|
||||
|
@ -287,7 +287,7 @@ static void *rr_cpu_thread_fn(void *arg)
|
|||
qatomic_set(&rr_current_cpu, NULL);
|
||||
|
||||
if (cpu && cpu->exit_request) {
|
||||
qatomic_mb_set(&cpu->exit_request, 0);
|
||||
qatomic_set_mb(&cpu->exit_request, 0);
|
||||
}
|
||||
|
||||
if (icount_enabled() && all_cpu_threads_idle()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue