llvm-project/compiler-rt/lib
Dmitry Vyukov 3464dac0ca tsan: speed up race deduplication
Race deduplication code proved to be a performance bottleneck in the past if suppressions/annotations are used, or just some races left unaddressed. And we still get user complaints about this:
https://groups.google.com/forum/#!topic/thread-sanitizer/hB0WyiTI4e4
ReportRace already has several layers of caching for racy pcs/addresses to make deduplication faster. However, ReportRace still takes a global mutex (ThreadRegistry and ReportMutex) during deduplication and also calls mmap/munmap (which take process-wide semaphore in kernel), this makes deduplication non-scalable.

This patch moves race deduplication outside of global mutexes and also removes all mmap/munmap calls.
As the result, race_stress.cc with 100 threads and 10000 iterations become 30x faster:

before:
real	0m21.673s
user	0m5.932s
sys	0m34.885s

after:
real	0m0.720s
user	0m23.646s
sys	0m1.254s

http://reviews.llvm.org/D12554

llvm-svn: 246758
2015-09-03 11:20:46 +00:00
..
BlocksRuntime Move tests for BlocksRuntime and builtins to corresponding directories under test/ 2014-02-14 09:47:31 +00:00
asan [asan] Fix signal interception on Android. 2015-09-02 21:32:46 +00:00
builtins [CMake] Enable building builtins for iOS and iOS simulator. 2015-08-31 22:26:02 +00:00
cfi CFI: Make the cfi target a dependency of compiler-rt. 2015-09-02 02:18:46 +00:00
dfsan [CMake] Add ARCHS option to add_sanitizer_rt_symbols. 2015-08-27 20:07:54 +00:00
interception [windows] Implement GetProcAddress internally to avoid initializing the CRT 2015-08-18 22:38:27 +00:00
lsan tsan: speed up race deduplication 2015-09-03 11:20:46 +00:00
msan [CMake] Add ARCHS option to add_sanitizer_rt_symbols. 2015-08-27 20:07:54 +00:00
profile [CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime into a single function 2015-08-25 19:53:09 +00:00
safestack [CMake] Unify build rules for sanitizer_common for Apple and non-Apple platforms. 2015-08-27 22:23:27 +00:00
sanitizer_common tsan: speed up race deduplication 2015-09-03 11:20:46 +00:00
tsan tsan: speed up race deduplication 2015-09-03 11:20:46 +00:00
ubsan [CMake] Unify build rules for sanitizer_common for Apple and non-Apple platforms. 2015-08-27 22:23:27 +00:00
CMakeLists.txt CFI: Add a default blacklist. 2015-07-15 12:16:25 +00:00
Makefile.mk Remove support for building sanitizers from Makefile/autoconf build on Linux. 2015-02-18 22:26:49 +00:00