llvm-project/compiler-rt/lib/lsan
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
..
CMakeLists.txt [CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime into a single function 2015-08-25 19:53:09 +00:00
Makefile.mk Remove support for building sanitizers from Makefile/autoconf build on Linux. 2015-02-18 22:26:49 +00:00
lsan.cc [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across all sanitizers. 2015-08-21 20:49:37 +00:00
lsan.h [Sanitizer] Make StackTrace a lightweight reference to array of PCs, and 2014-10-26 03:35:14 +00:00
lsan_allocator.cc [LSan] [MIPS] adding support of LSan for mips64/mips64el arch 2015-02-19 07:30:39 +00:00
lsan_allocator.h [lsan] Implement the public allocator interface in standalone LSan. 2014-08-26 14:28:28 +00:00
lsan_common.cc tsan: speed up race deduplication 2015-09-03 11:20:46 +00:00
lsan_common.h LSan: fix a deadlock caused by dl_iterate_phdr(). 2015-02-26 14:01:08 +00:00
lsan_common_linux.cc [lsan] Add an interface function for on-demand leak checking. 2015-04-24 16:53:15 +00:00
lsan_flags.inc [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across all sanitizers. 2015-08-21 20:49:37 +00:00
lsan_interceptors.cc -Wdeprecated: Use noexcept rather than throw() where supported 2015-08-10 15:24:22 +00:00
lsan_preinit.cc [Sanitizer] Introduce SANITIZER_CAN_USE_PREINIT_ARRAY definition and use it across sanitizers. 2014-07-25 22:05:02 +00:00
lsan_thread.cc [lsan] Support ASan's stack-use-after-return mode in LSan. 2013-10-14 14:04:50 +00:00
lsan_thread.h Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:44:24 +00:00