[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/50] qht-bench: relax test_start/stop atomic access
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 10/50] qht-bench: relax test_start/stop atomic accesses |
Date: |
Mon, 24 Oct 2016 15:46:55 +0200 |
From: "Emilio G. Cota" <address@hidden>
test_start/stop are used only as flags to loop on. Barriers are unnecessary,
since no dependent data is transferred among threads apart from the flags
themselves.
This commit relaxes the three accesses to test_start/stop that were
not yet relaxed.
Signed-off-by: Emilio G. Cota <address@hidden>
---
tests/qht-bench.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/qht-bench.c b/tests/qht-bench.c
index 76360a0..2afa09d 100644
--- a/tests/qht-bench.c
+++ b/tests/qht-bench.c
@@ -193,7 +193,7 @@ static void *thread_func(void *p)
rcu_register_thread();
atomic_inc(&n_ready_threads);
- while (!atomic_mb_read(&test_start)) {
+ while (!atomic_read(&test_start)) {
cpu_relax();
}
@@ -393,11 +393,11 @@ static void run_test(void)
while (atomic_read(&n_ready_threads) != n_rw_threads + n_rz_threads) {
cpu_relax();
}
- atomic_mb_set(&test_start, true);
+ atomic_set(&test_start, true);
do {
remaining = sleep(duration);
} while (remaining);
- atomic_mb_set(&test_stop, true);
+ atomic_set(&test_stop, true);
for (i = 0; i < n_rw_threads; i++) {
qemu_thread_join(&rw_threads[i]);
--
1.8.3.1
- [Qemu-devel] [PULL 02/50] rbd: shift byte count as a 64-bit value, (continued)
- [Qemu-devel] [PULL 02/50] rbd: shift byte count as a 64-bit value, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 05/50] Put the copyright information on a separate line, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 07/50] qemu-thread: use acquire/release to clarify semantics of QemuEvent, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 03/50] block/iscsi: Introducing new zero-copy API, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 08/50] rcu: simplify memory barriers, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 04/50] block/iscsi: Adding new iSER transport layer option, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 06/50] atomic: introduce smp_mb_acquire and smp_mb_release, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 12/50] target-i386: fix 32-bit addresses in LEA, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 11/50] test-i386: fix bitrot for 64-bit, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 09/50] atomic: base mb_read/mb_set on load-acquire and store-release, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 10/50] qht-bench: relax test_start/stop atomic accesses,
Paolo Bonzini <=
- [Qemu-devel] [PULL 13/50] tcg: try sti when moving a constant into a dead memory temp, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 14/50] memory: eliminate global MemoryListeners, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 17/50] memory: optimize memory_region_sync_dirty_bitmap, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 15/50] memory: add a per-AddressSpace list of listeners, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 20/50] rng: remove unused included header, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 16/50] memory: optimize memory_global_dirty_log_sync, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 19/50] char.h: misc doc fix, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 21/50] char: remove use-after-free on win-stdio, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 18/50] char: serial: check divider value against baud base, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 22/50] ringbuf: fix chr_write return value, Paolo Bonzini, 2016/10/24