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

Xiaolong Peng xpeng at openjdk.org
Mon Jan 12 21:19:51 UTC 2026


On Wed, 7 Jan 2026 22:24:23 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahAllocator.cpp line 254:
>> 
>>> 252:   // Step 1: find out the alloc regions which are ready to refresh.
>>> 253:   for (uint i = 0; i < _alloc_region_count; i++) {
>>> 254:     ShenandoahAllocRegion* alloc_region = &_alloc_regions[i];
>> 
>> We've got the heap lock here.  why does this need to be atomic?  Comments in the code should make this clear.
>
> I believe AtomicAccess::load here is not needed, I'll remove it.

I have removed the AtomicAccess::load here.

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

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


More information about the shenandoah-dev mailing list