[all-commits] [llvm/llvm-project] 97795b: tsan: optimize test-only barrier
Dmitry Vyukov via All-commits
all-commits at lists.llvm.org
Fri Jul 30 02:39:52 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 97795be22f634667ce7a022398c59ccc9f7440eb
https://github.com/llvm/llvm-project/commit/97795be22f634667ce7a022398c59ccc9f7440eb
Author: Dmitry Vyukov <dvyukov at google.com>
Date: 2021-07-30 (Fri, 30 Jul 2021)
Changed paths:
M compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
M compiler-rt/test/tsan/test.h
Log Message:
-----------
tsan: optimize test-only barrier
The updated lots_of_threads.c test with 300 threads
started running for too long on machines with low
hardware parallelism (e.g. taskset -c 0-1).
On lots of CPUs it finishes in ~2 secs. But with
taskset -c 0-1 it runs for hundreds of seconds
effectively spinning in the barrier in the sleep loop.
We now have the handy futex API in sanitizer_common.
Use it instead of the passive spin loop.
It makes the test run only faster with taskset -c 0-1,
it runs for ~1.5 secs, while with full parallelism
it still runs for ~2 secs (but consumes less CPU time).
Depends on D107131.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D107132
More information about the All-commits
mailing list