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

Thomas Schatzl tschatzl at openjdk.org
Wed Apr 26 14:43:23 UTC 2023


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

>> Select num workers for safepoint ParallelCleanupTask to be at most the number of parallel cleanup tasks `SAFEPOINT_CLEANUP_NUM_TASKS`
>> 
>> Unsure if `WorkerThreads::max_workers()` is more correct than `WorkerThreads::created_workers()` or `WorkerThreads::active_workers()`. 
>> 
>> Tested tier1-3 Oracle platforms.
>
> Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use active_workers

> I still believe we can do it significantly better! The key here is not only minimizing the parallelism beyond the number of tasks, but also recognize that most tasks are so light-weight, they do not need a separate worker thread. In fact, if we estimate we execute _only_ the light-weight tasks, we might as well do things serially without any thread handoff.
> 
> For example, my crude experiment (patch below) cuts down the safepoint cleanup time from ~40 us to ~1 us on my M1 Mac [...]
> 
> Pretty sure we can polish it even further.
> 
[...]
> 
> This could be done in a separate PR, of course, but I don't see why not test some approaches here :)

+1

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

PR Comment: https://git.openjdk.org/jdk/pull/13616#issuecomment-1523524926


More information about the hotspot-runtime-dev mailing list