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 #1365

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

Conversation

snazarkin
Copy link

@snazarkin snazarkin commented Jan 28, 2025

I'd like to backport this fix to fix the issue with starting a lot of threads in a burst. Some users found this to be a barrier to migrating from JDK8.

The backport is not clean as required to adjust globals.hpp and replace ConditionalMutexLocker with classic MutexLocker. Original fix and discussion are here

Tested with tier1 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)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/1365/head:pull/1365
$ git checkout pull/1365

Update a local copy of the PR:
$ git checkout pull/1365
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/1365/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1365

View PR using the GUI difftool:
$ git pr show -t 1365

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/1365.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 28, 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 Jan 28, 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 Jan 28, 2025
@openjdk
Copy link

openjdk bot commented Jan 28, 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 Jan 28, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 28, 2025

Webrevs

Copy link
Contributor

@olivergillespie olivergillespie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a reviewer but took a look since it was my original patch. Looks good to me.

@@ -2955,9 +2955,10 @@ JVM_ENTRY(void, JVM_StartThread(JNIEnv* env, jobject jthread))
// We must release the Threads_lock before we can post a jvmti event
// in Thread::start.
{
MutexLocker throttle_ml(UseThreadsLockThrottleLock ? ThreadsLockThrottle_lock : NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be nullptr, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thank you!

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.

2 participants