jdk17u-dev
jdk17u-dev copied to clipboard
8340547: Starting many threads can delay safepoints
I'd like to backport this fix to fix the issue with starting a lot of threads in a burst.
Despite the low priority of this issue, some users have found this to be a barrier to migrating from JDK8.
The backport is not clean as it needs to adjust globals.hpp and replace ConditionalMutexLocker with classic MutexLocker. The rank nonleaf of UseThreadsLockThrottleLock has been chosen to be as close as possible to the rank of Threads_lock and to not cause a crash in debug mode:
# Internal Error (/home/ubuntu/jdk17u-dev/src/hotspot/share/runtime/mutex.cpp:398), pid=1777, tid=1782
# assert(false) failed: Attempting to acquire lock Threads_lock/22 out of order with lock ThreadsLockThrottle_lock/22 -- possible deadlock
Field _allow_vm_block is set to false to prevent
# Internal Error (/home/ubuntu/jdk17u-dev/src/hotspot/share/runtime/thread.cpp:981), pid=56846, tid=56851
# assert(false) failed: Possible safepoint reached by thread that does not allow it
Similar PR is on review at jdk21 Original fix and discussion are https://github.com/openjdk/jdk/pull/21111
Tested with tier1 (release), tier2(fastdebug), and reproducers from JDK-8340547, JDK-8307970
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
- [ ] JDK-8340547 needs maintainer approval
Issue
- JDK-8340547: Starting many threads can delay safepoints (Enhancement - P4)
Reviewers
- Oli Gillespie (@olivergillespie - Author)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3263/head:pull/3263
$ git checkout pull/3263
Update a local copy of the PR:
$ git checkout pull/3263
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3263/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3263
View PR using the GUI difftool:
$ git pr show -t 3263
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3263.diff
Using Webrev
:wave: Welcome back snazarki! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
This backport pull request has now been updated with issue from the original commit.
@snazarkin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
@snazarkin This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.
@snazarkin Can you reopen this pull request ?
/open
@snazarkin This pull request is now open
/reviewer credit @olivergillespie /reviewer credit @dimitryc
@snazarkin
Reviewer ogillespie successfully credited.
@snazarkin
Reviewer dcherepanov successfully credited.
/reviewers 1
@snazarkin The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 1 (with at least 1 Reviewer).
@olivergillespie could you please review the patch?
@snazarkin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
/touch
@snazarkin The pull request is being re-evaluated and the inactivity timeout has been reset.
@snazarkin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
/touch
@snazarkin The pull request is being re-evaluated and the inactivity timeout has been reset.