RFR (L): Add TSAN instrumentation for allocation and garbage collection

Man Cao manc at google.com
Tue Jun 25 00:51:09 UTC 2019


Hi,

Can I have reviews for the support for allocation and garbage collection?
https://cr.openjdk.java.net/~manc/tsanOopMap/webrev.00/

There is no major algorithmic or logic change. Most difference from our
internal JDK8 version is renaming and code movement.
Below is a map of renaming:
GoogleLockMap -> TsanOopMap
GoogleLockMapImpl -> TsanOopMapImpl
GoogleOopMap -> TsanOopSizeMap
GoogleOopBucket -> TsanOopBucket
GoogleTsanOopMap_lock -> TsanOopMap_lock
GoogleLockMap::do_weak_oops() -> TsanOopMap::weak_oops_do()
BitMap -> CHeapBitMap
TraceCPUTime -> GCTraceCPUTime
VALUE_OBJ_CLASS_SPEC was removed in JDK-8173070

A notable change is that the call to TsanOopMap::weak_oops_do() is a new
serial phase in WeakProcessor, instead of instrumenting various collectors
and ReferenceProcessor.

Added a test that allocates and writes to byte arrays that are larger than
the heap size, so garbage collection must have happened. The test fails
without this patch.
Another change to TsanRunner.java is to use
jdk.test.lib.management.InputArguments to pass all VM options.
The existing way of using "test.java.opts" system property does not work
for VM options in "@run" tag, and does not contain VM options
from VM_OPTIONS environment variable such as from "make test
JTREG="VM_OPTIONS=-XX:+Foo"".

-Man


More information about the tsan-dev mailing list