RFR: 8305670: Performance regression in LockSupport.unpark with lots of idle threads [v6]
Daniel D. Daugherty
dcubed at openjdk.org
Fri Apr 28 20:04:26 UTC 2023
On Fri, 28 Apr 2023 19:42:53 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> Address the performance regression in `LockSupport.unpark()` with the following changes:
>> - Add `FastThreadsListHandle` helper class to threadSMR.[ch]pp for quickly determining if a JavaThread* is protected by the ThreadsListHandle embedded in the new helper object.
>> - Update `Unsafe_Unpark()` to pass `java_lang_Thread::thread_acquire(thread_oop)` to a new instance of the `FastThreadsListHandle` object and only do the unpark work if the target JavaThread* is protected.
>
> Daniel D. Daugherty has updated the pull request incrementally with six additional commits since the last revision:
>
> - Merge JDK-8305670 with code review changes in JDK-8307068.
> - Merge branch 'JDK-8307068' into JDK-8305670
> - Forgot to checkpoint the use of java_lang_Thread::thread_acquire(thread_oop) in ThreadsListHandle::cv_internal_thread_to_JavaThread().
> - dholmes CR - follow the foo_acquire() and release_set_foo() convention;
> revert a comment change and reformat.
> - 8307068: store a JavaThread* in the java.lang.Thread object after the JavaThread* is added to the main ThreadsList
> - 8307067: remove broken EnableThreadSMRExtraValidityChecks option
The previous version of this patch has been reworked into two dependent patches:
- [JDK-8307067](https://bugs.openjdk.org/browse/JDK-8307067) remove broken EnableThreadSMRExtraValidityChecks option
- https://github.com/openjdk/jdk/pull/13704
and:
- [JDK-8307068](https://bugs.openjdk.org/browse/JDK-8307068) store a JavaThread* in the java.lang.Thread object after the JavaThread* is added to the main ThreadsList
- https://github.com/openjdk/jdk/pull/13723
with this PR now containing just the performance tweak parts of the original fix.
When I refactored the pieces of [JDK-8307068](https://bugs.openjdk.org/browse/JDK-8307068)
into that dependent PR, I also addressed @dholmes-ora code review comments on that
portion of the previous patch.
This PR has also been updated to use `java_lang_Thread::thread_acquire()` as needed.
I'm doing the usual Mach5 testing on this patch.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13519#issuecomment-1528017277
More information about the hotspot-runtime-dev
mailing list