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

Yannik Stradmann duke at openjdk.org
Wed Apr 16 13:33:33 UTC 2025


> 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 incrementally with one additional commit since the last revision:

  Fix build on Windows: Sleep() only accepts milliseconds

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24682/files
  - new: https://git.openjdk.org/jdk/pull/24682/files/d3051d54..d4841a00

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24682&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24682&range=00-01

  Stats: 7 lines in 4 files changed: 0 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/24682.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24682/head:pull/24682

PR: https://git.openjdk.org/jdk/pull/24682


More information about the hotspot-runtime-dev mailing list