RFR: 8354560: Exponentially delay subsequent native thread creation in case of EAGAIN [v6]

duke duke at openjdk.org
Mon May 19 11:16:56 UTC 2025


On Mon, 19 May 2025 09:01:46 GMT, Yannik Stradmann <duke at openjdk.org> wrote:

>> This change introduces an exponential backoff when hitting `EAGAIN` during native thread creation in hotspot.
>> 
>> In contrast to the current solution, where we retry to create a native thread up to three times in a tight loop, hotspot will will thereby be more kind to an already depleted resource, reduce stress on the kernel and become more robust on systems under high load.
>> 
>> The proposed modifications to `os_linux.cpp` have substantially improved system stability in a mid-sized Jenkins cluster and have been in production within our systems over the past three years. I have verbatim ported these to the other platforms, which previously also relied on identical logic.
>
> Yannik Stradmann has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:
> 
>  - Clean up initializaiton/use of trials_remaining
>  - Merge remote-tracking branch 'upstream/master' into robust_pthread
>  - Remove restrictive scopes
>  - Reduce interim thread start log level to debug
>  - Merge remote-tracking branch 'upstream/master' into robust_pthread
>  - Fix build on Windows: Sleep() only accepts milliseconds
>  - Exponentially delay native thread creation retries

@ystradmann 
Your change (at version 6d6c9f74b490065347a51b76042e2ecd40818c72) is now ready to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/jdk/pull/24682#issuecomment-2890624644


More information about the hotspot-runtime-dev mailing list