[compiler-rt] r229117 - tsan: reduce history size in Go mode

Dmitry Vyukov dvyukov at google.com
Fri Feb 13 07:59:23 PST 2015


Author: dvyukov
Date: Fri Feb 13 09:59:23 2015
New Revision: 229117

URL: http://llvm.org/viewvc/llvm-project?rev=229117&view=rev
Log:
tsan: reduce history size in Go mode

The ContainsSameAccess optimization substantially reduces pressure
on trace by eliminating duplicate accesses. So now we can reduce
default trace size to reduce per-goroutine memory consumption.
Current default size is 64K events, new -- 32K events.
In either case user can change it with GORACE env var.

Reduces per-goroutine memory consumption from 356K to 226K.


Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_flags.inc
    compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_flags.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_flags.inc?rev=229117&r1=229116&r2=229117&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_flags.inc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_flags.inc Fri Feb 13 09:59:23 2015
@@ -63,7 +63,7 @@ TSAN_FLAG(bool, stop_on_start, false,
 TSAN_FLAG(bool, running_on_valgrind, false,
           "Controls whether RunningOnValgrind() returns true or false.")
 TSAN_FLAG(
-    int, history_size, kGoMode ? 1 : 2, // There are a lot of goroutines in Go.
+    int, history_size, kGoMode ? 1 : 3, // There are a lot of goroutines in Go.
     "Per-thread history size, controls how many previous memory accesses "
     "are remembered per thread.  Possible values are [0..7]. "
     "history_size=0 amounts to 32K memory accesses.  Each next value doubles "

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h?rev=229117&r1=229116&r2=229117&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h Fri Feb 13 09:59:23 2015
@@ -20,9 +20,9 @@
 
 namespace __tsan {
 
-const int kTracePartSizeBits = 14;
+const int kTracePartSizeBits = 13;
 const int kTracePartSize = 1 << kTracePartSizeBits;
-const int kTraceParts = 4 * 1024 * 1024 / kTracePartSize;
+const int kTraceParts = 2 * 1024 * 1024 / kTracePartSize;
 const int kTraceSize = kTracePartSize * kTraceParts;
 
 // Must fit into 3 bits.





More information about the llvm-commits mailing list