RFR: 8306738: Select num workers for safepoint ParallelCleanupTask [v2]

Thomas Schatzl tschatzl at openjdk.org
Tue Apr 25 16:18:08 UTC 2023


On Tue, 25 Apr 2023 14:28:16 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>It seems correct to respect this flag for heap inspection and heap dump, but seemed strange and unnecessary to spin up all workers when we know that there is a limit to the amount of parallel work. (Just looking at the code, the heap inspect always uses one worker, and heap dumper uses the active number of workers)

Not sure. Imho both should determine the number of threads based on some rough estimate of work too.

>[....]
>Active: Is a bit of a strange API, because it depends on some external set state, it is the current behaviour, so maybe it should be kept and changed in a different PR.

This has been long time ago added purely for convenience to not have pass it along in a sequence of parallel tasks.
I.e. in a lot of cases the "active" number is determined at start of gc (based on e.g. heap size/overall expected work), and then reduced based on the particular task like suggested in this CR.

It is true that this value should probably not be stored in `WorkerThreads`, but then the GCs would need to pass it along elsewhere.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13616#discussion_r1176748878


More information about the hotspot-runtime-dev mailing list