RFR: 8377048: Shenandoah: shenandoahLock related improvments [v5]

Xiaolong Peng xpeng at openjdk.org
Mon Feb 23 22:21:37 UTC 2026


> While I was working on https://bugs.openjdk.org/browse/JDK-8373371, I made these changes to the shenandoahLock, but I feel it make sense peel off these changes into a separate PR as they are not really related to JDK-8373371. 
> 
> Major thing in this PR is to use template for ShenandoahReentrantLock and ShenandoahLocker so we could get rid of duplicate code, along with some other changes where the locks are used e.g. use type alias for ShenandoahNMethodLock and ShenandoahNMethodLocker, use ShenandoahReentrantLock for ShenandoahRebuildLock.
> 
> Another improvement is to strengthen assert in SheandnoahHeapLocker to avoid potential dead lock(this was also discussed in previous PR [here](https://github.com/openjdk/jdk/pull/27612#discussion_r2479898169) and our internal channel
> 
> ### Test
> - [x] MacOS aach64, server fastdebug: hotspot_gc_shenandoah
> - [x] GHA

Xiaolong Peng has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits:

 - Merge remote-tracking branch 'origin/master' into shenandoah-heap-lock-asserts
 - Revert unintended changes
 - Locker class should assume that lock instance is never be nullptr
 - Address review comments
 - Remove unintentional spaces
 - Remove unintended lock in ShenandoahRegionPartitions::assert_bounds
 - Merge branch 'openjdk:master' into shenandoah-heap-lock-asserts
 - Def type ShenandoahRebuildLock as ShenandoahReentrantLock<ShenandoahLock>
 - Revert name change of ShenandoahRebuildLock for the PR(it will be in next pr after this)
 - Rename ShenandoahRebuildLock to ShenandoahHeapUsageAccountingLock
 - ... and 3 more: https://git.openjdk.org/jdk/compare/6b576235...bff5afab

-------------

Changes: https://git.openjdk.org/jdk/pull/29543/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29543&range=04
  Stats: 138 lines in 15 files changed: 39 ins; 37 del; 62 mod
  Patch: https://git.openjdk.org/jdk/pull/29543.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29543/head:pull/29543

PR: https://git.openjdk.org/jdk/pull/29543


More information about the shenandoah-dev mailing list