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

8305670: Performance regression in LockSupport.unpark with lots of idle threads #13393

Closed
wants to merge 1 commit into from

Conversation

dcubed-ojdk
Copy link
Member

@dcubed-ojdk dcubed-ojdk commented Apr 7, 2023

A trivial fix to only check the ThreadsList in a ThreadsListHandle::cv_internal_thread_to_JavaThread()
call in fastdebug or slowdebug bits by default. The -XX:+EnableThreadSMRExtraValidityChecks option
can enable the check in release bits and the -XX:-EnableThreadSMRExtraValidityChecks option can
disable the check in fastdebug or slowdebug bits.

fastdebug or slowdebug bits will now fail an assert() if the java_thread is NOT found on the
ThreadsList (which should never happen).


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

Issue

  • JDK-8305670: Performance regression in LockSupport.unpark with lots of idle threads

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13393/head:pull/13393
$ git checkout pull/13393

Update a local copy of the PR:
$ git checkout pull/13393
$ git pull https://git.openjdk.org/jdk.git pull/13393/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13393

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13393.diff

Webrev

Link to Webrev Comment

@dcubed-ojdk
Copy link
Member Author

/label add hotspot-runtime

@dcubed-ojdk dcubed-ojdk marked this pull request as ready for review April 7, 2023 20:08
@bridgekeeper
Copy link

bridgekeeper bot commented Apr 7, 2023

👋 Welcome back dcubed! 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 openjdk bot added rfr Pull request is ready for review hotspot-runtime hotspot-runtime-dev@openjdk.org labels Apr 7, 2023
@openjdk
Copy link

openjdk bot commented Apr 7, 2023

@dcubed-ojdk
The hotspot-runtime label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Apr 7, 2023

Webrevs

@dcubed-ojdk
Copy link
Member Author

Did some manual testing with this fix by adding code that would set the
is_on_list variable to false when the -XX:+UseNewCode option was
specified. That allowed me to verify the right output for the assertion failure:

#  Internal Error (/System/Volumes/Data/work/shared/bug_hunt/XXXXXXX_for_jdk21.git/open/src/hotspot/share/runtime/threadSMR.cpp:841), pid=26005, tid=2146563
#  assert(is_on_list) failed: java_thread=0x00007fac2ac29810 is not on ThreadsList(0x00007fac2ed51240)

I verified that the target thread (0x00007fac2ac29810) is listed in the
"Threads class SMR info:" section of the hs_err_pid file and I verified that
the ThreadsList (0x00007fac2ed51240) matches the current system
ThreadsList.

Also testing with Mach5 Tier[1-3].

@dcubed-ojdk
Copy link
Member Author

It looks like a couple of tests are unhappy with the new code:

  • runtime/handshake/HandshakeWalkOneExitTest.java
  • runtime/handshake/HandshakeDirectTest.java

I'm going to switch back to draft while I sort this out...

@dcubed-ojdk dcubed-ojdk marked this pull request as draft April 7, 2023 21:08
@openjdk openjdk bot removed the rfr Pull request is ready for review label Apr 7, 2023
@dcubed-ojdk
Copy link
Member Author

To avoid confusion between the approach taken in this PR with new
approach that is being tested now, I'm closing this PR and will open
a new PR when I've done more testing of the merge of my latest
changes with @robehn's quick_mode idea.

@dcubed-ojdk dcubed-ojdk deleted the JDK-8305670 branch April 18, 2023 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org
1 participant