RFR: Reimplement TsanOopMap support using WeakHandle and ResizeableResourceHashtable [v2]
Jiangli Zhou
jiangli at openjdk.org
Tue Jul 23 18:57:41 UTC 2024
On Mon, 22 Jul 2024 23:47:48 GMT, Man Cao <manc at openjdk.org> wrote:
> The WeakProcessor::Task::work() function is called by a subset of GC worker thread. This function will be called multiple times in parallel, but each thread runs the same code and processes the same data, so it is redundant work. It should probably be called only once, by the VM thread.
Yes, that's correct. I've noticed it have been thinking updating this part already.
> We can invoke notify_tsan_for_freed_and_moved_objects() from the > VM thread by adding it to the two versions of WeakProcessor::weak_oops_do below:
>
> After line 142 task.report_num_dead(), in this file (weakProcessor.inline.hpp).
> In weakProcessor.cpp, between inside WeakProcessor::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive).
I think we only need to add `notify_tsan_for_freed_and_moved_objects()` call in `void WeakProcessor::weak_oops_do(WorkerThreads* workers, IsAlive* is_alive, KeepAlive* keep_alive,WeakProcessorTimes* times)` in weakProcessor.inline.hpp. I think that should be able to cover all cases.
`WeakProcessor::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive)` in weakProcessor.cpp is only used by serial GC. We can add the call in there, but it would not be fully tested.
-------------
PR Review Comment: https://git.openjdk.org/tsan/pull/19#discussion_r1688552281
More information about the tsan-dev
mailing list