RFR: 8312023: Parallel pretouch should shortcut when only 1 thread is needed [v2]
Aleksey Shipilev
shade at openjdk.org
Thu Nov 30 20:56:04 UTC 2023
On Thu, 30 Nov 2023 20:09:06 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> There may have been some concern that some task might care about the kind of thread it runs on?
Exactly, in generic case you don't know if caller thread is set up to do the task in the way the worker threads are. This pretouching code is one of the cases where we know running in caller is fine. Existing code even does it when no worker pool is available.
> So I'm not convinced this change should be made.
I believe we want to do it. Round-tripping to worker pool is asking for a latency hiccup. Even if things go well, we lose double-digit microseconds on this path. This is a common optimization we do. Last time [we did it in safepoints](https://bugs.openjdk.org/browse/JDK-8306738) with [great results](https://github.com/openjdk/jdk/pull/13616#issuecomment-1538206572).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16882#issuecomment-1834544347
More information about the hotspot-gc-dev
mailing list