[compiler-rt] r177520 - tsan: reduce size of mutexsets from 64 to 16 mutexes
Dmitry Vyukov
dvyukov at google.com
Wed Mar 20 06:50:48 PDT 2013
Author: dvyukov
Date: Wed Mar 20 08:50:47 2013
New Revision: 177520
URL: http://llvm.org/viewvc/llvm-project?rev=177520&view=rev
Log:
tsan: reduce size of mutexsets from 64 to 16 mutexes
overflow is handled anyway
saves memory because each thread holds 1024 mutexsets
Modified:
compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc
compiler-rt/trunk/lib/tsan/rtl/tsan_mutexset.h
Modified: compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc?rev=177520&r1=177519&r2=177520&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc Wed Mar 20 08:50:47 2013
@@ -1,10 +1,12 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s
#include "java.h"
+#include <unistd.h>
jptr varaddr;
jptr lockaddr;
void *Thread(void *p) {
+ sleep(1);
__tsan_java_mutex_lock(lockaddr);
*(int*)varaddr = 42;
__tsan_java_mutex_unlock(lockaddr);
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_mutexset.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_mutexset.h?rev=177520&r1=177519&r2=177520&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_mutexset.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_mutexset.h Wed Mar 20 08:50:47 2013
@@ -22,7 +22,7 @@ class MutexSet {
public:
// Holds limited number of mutexes.
// The oldest mutexes are discarded on overflow.
- static const uptr kMaxSize = 64;
+ static const uptr kMaxSize = 16;
struct Desc {
u64 id;
u64 epoch;
More information about the llvm-commits
mailing list