summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-04-27 08:23:02 +0000
committerDmitry Vyukov <dvyukov@google.com>2016-04-27 08:23:02 +0000
commitd87c7b321af8790cb41cc105331a08fba4975a27 (patch)
treea344470912bca00c9f536fbf5efb62632642c2fd /compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
parent4ba78a46ff760b254d4853e676e12ce35b4f65ac (diff)
downloadbcm5719-llvm-d87c7b321af8790cb41cc105331a08fba4975a27.tar.gz
bcm5719-llvm-d87c7b321af8790cb41cc105331a08fba4975a27.zip
tsan: split thread into logical and physical state
This is reincarnation of http://reviews.llvm.org/D17648 with the bug fix pointed out by Adhemerval (zatrazz). Currently ThreadState holds both logical state (required for race-detection algorithm, user-visible) and physical state (various caches, most notably malloc cache). Move physical state in a new Process entity. Besides just being the right thing from abstraction point of view, this solves several problems: Cache everything on P level in Go. Currently we cache on a mix of goroutine and OS thread levels. This unnecessary increases memory consumption. Properly handle free operations in Go. Frees are issue by GC which don't have goroutine context. As the result we could not do anything more than just clearing shadow. For example, we leaked sync objects and heap block descriptors. This will allow to get rid of libc malloc in Go (now we have Processor context for internal allocator cache). This in turn will allow to get rid of dependency on libc entirely. Potentially we can make Processor per-CPU in C++ mode instead of per-thread, which will reduce resource consumption. The distinction between Thread and Processor is currently used only by Go, C++ creates Processor per OS thread, which is equivalent to the current scheme. llvm-svn: 267678
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_interface_java.cc')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_interface_java.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
index 0aea63d1167..fd771b46a11 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
@@ -111,7 +111,7 @@ void __tsan_java_free(jptr ptr, jptr size) {
CHECK_GE(ptr, jctx->heap_begin);
CHECK_LE(ptr + size, jctx->heap_begin + jctx->heap_size);
- ctx->metamap.FreeRange(thr, pc, ptr, size);
+ ctx->metamap.FreeRange(thr->proc, ptr, size);
}
void __tsan_java_move(jptr src, jptr dst, jptr size) {
OpenPOWER on IntegriCloud