Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8340547: Starting many threads can delay safepoints #3263

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

snazarkin
Copy link
Contributor

@snazarkin snazarkin commented Feb 3, 2025

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 openjdk/jdk#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)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8340547 needs maintainer approval

Issue

  • JDK-8340547: Starting many threads can delay safepoints (Enhancement - P4)

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

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 3, 2025

👋 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.

@openjdk
Copy link

openjdk bot commented Feb 3, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title Backport e704c055a4cf2aab77cc2b3d034f5a8b8d9e3331 8340547: Starting many threads can delay safepoints Feb 3, 2025
@openjdk
Copy link

openjdk bot commented Feb 3, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Feb 3, 2025
@mlbridge
Copy link

mlbridge bot commented Feb 3, 2025

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 3, 2025

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant