RFR: 8361099: Shenandoah: Improve heap lock contention by using CAS for memory allocation [v5]

Xiaolong Peng xpeng at openjdk.org
Thu Nov 6 23:29:10 UTC 2025


On Wed, 5 Nov 2025 22:28:06 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> Xiaolong Peng has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 135 commits:
>> 
>>  - Merge branch 'openjdk:master' into cas-alloc-1
>>  - Merge branch 'openjdk:master' into cas-alloc-1
>>  - format
>>  - Merge branch 'openjdk:master' into cas-alloc-1
>>  - Merge branch 'openjdk:master' into cas-alloc-1
>>  - Merge branch 'master' into cas-alloc-1
>>  - Move ShenandoahHeapRegionIterationClosure to shenandoahFreeSet.hpp
>>  - Merge branch 'openjdk:master' into cas-alloc-1
>>  - Fix errors caused by renaming ofAtomic to AtomicAccess
>>  - Merge branch 'openjdk:master' into cas-alloc-1
>>  - ... and 125 more: https://git.openjdk.org/jdk/compare/2f613911...e6bfef05
>
> src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp line 559:
> 
>> 557:          range(1, 128)                                                      \
>> 558:                                                                             \
>> 559:   product(uintx, ShenandoahDirectAllocationMaxProbes, 3, EXPERIMENTAL,      \
> 
> I think we found that setting DirectAllocationMaxProbes to equal ShenandoahDirectlyAlloctableRegionCount works "best".  I'm inclined to remove this parameter entirely as it somewhat simplifies the implementation.  If you think we want to keep it, can you explain the rationale?  Would we change the default value?

I just fixed all the test failures after merging your changes from tip.
Totally agreed, I do plan to remove DirectAllocationMaxProbes, we don't need to keep it based on the test result, I'll update the PR to remove it shortly.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26171#discussion_r2501197258


More information about the hotspot-gc-dev mailing list