aboutsummaryrefslogtreecommitdiff
path: root/tests/atomic_add-bench.c
AgeCommit message (Collapse)Author
2018-06-28tests/atomic_add-bench: add -m option to use mutexesEmilio G. Cota
This allows us to use atomic-add-bench as a microbenchmark for evaluating qemu_mutex_lock's performance. Signed-off-by: Emilio G. Cota <cota@braap.org> [cherry picked from https://github.com/cota/qemu/commit/f04f34df] Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180425025459.5258-2-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-10-26tests: add atomic_add-benchEmilio G. Cota
With this microbenchmark we can measure the overhead of emulating atomic instructions with a configurable degree of contention. The benchmark spawns $n threads, each performing $o atomic ops (additions) in a loop. Each atomic operation is performed on a different cache line (assuming lines are 64b long) that is randomly selected from a range [0, $r). [ Note: each $foo corresponds to a -foo flag ] Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Message-Id: <1467054136-10430-20-git-send-email-cota@braap.org>