tsan: allocate vector clocks using slab allocator
authorDmitry Vyukov <dvyukov@google.com>
Tue, 5 Aug 2014 18:45:02 +0000 (18:45 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Tue, 5 Aug 2014 18:45:02 +0000 (18:45 +0000)
commit70db9d4d725647d682bbd4fba7fd0caf4d29b715
treee1c84a68828791cc011c7d33eedc366d29be5546
parentbcd82afad64a22b15000de350d075b10f2de273a
tsan: allocate vector clocks using slab allocator

Vector clocks is the most actively allocated object in tsan runtime.
Current internal allocator is not scalable enough to handle allocation
of clocks in scalable way (too small caches). This changes transforms
clocks to 2-level array with 512-byte blocks. Since all blocks are of
the same size, it's possible to cache them more efficiently in per-thread caches.

llvm-svn: 214912
13 files changed:
compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cc
compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h
compiler-rt/lib/tsan/rtl/tsan_clock.cc
compiler-rt/lib/tsan/rtl/tsan_clock.h
compiler-rt/lib/tsan/rtl/tsan_flags.cc
compiler-rt/lib/tsan/rtl/tsan_rtl.h
compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
compiler-rt/lib/tsan/rtl/tsan_sync.cc
compiler-rt/lib/tsan/rtl/tsan_sync.h
compiler-rt/lib/tsan/tests/unit/tsan_clock_test.cc
compiler-rt/lib/tsan/tests/unit/tsan_sync_test.cc
compiler-rt/test/tsan/thread_detach.c [new file with mode: 0644]