On Wed, 8 Sep 2021 09:56:21 GMT, Per Liden <pli...@openjdk.org> wrote:
> JDK-8237354 introduced the concept of "foreground work" in WorkGang, as a > special case for use by the HeapDumper. I propose that we remove this code, > since this special use case can be solved without the need for the concept of > "foreground work" in WorkGang. > > As far as I can tell, there's no reason why it must be the VM thread that > takes on the task of writing the header, iterating over roots, etc. So, in > VM_HeapDumper::work(), instead of checking if the current thread is the VM > thread we can just check if the worker_id is non-zero. That way, a single > worker thread will take on the task of writing the header, iterating over > roots, etc, and all other worker threads will continue to call worker_loop(). > > Testing: > - Passed Tier1-3 > - Passed multiple runs of test/hotspot/jtreg/serviceability/dcmd/gc/ > - Manually ran jcmd GC.heap_dump with various GCs enabled This pull request has now been integrated. Changeset: c1e39faa Author: Per Liden <pli...@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/c1e39faaa99ee62ff626ffec9f978ed0f8ffaca1 Stats: 25 lines in 6 files changed: 0 ins; 17 del; 8 mod 8273482: Remove "foreground work" concept from WorkGang Reviewed-by: tschatzl, kbarrett ------------- PR: https://git.openjdk.java.net/jdk/pull/5410