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

Xiaolong Peng xpeng at openjdk.org
Fri Jan 9 19:16:02 UTC 2026


On Thu, 8 Jan 2026 19:58:25 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahAllocator.hpp line 79:
>> 
>>> 77:   int refresh_alloc_regions(ShenandoahAllocRequest* req = nullptr, bool* in_new_region = nullptr, HeapWord** obj = nullptr);
>>> 78: #ifdef ASSERT
>>> 79:   virtual void verify(ShenandoahAllocRequest& req) { }
>> 
>> Need a comment to explain what verify does.  Is this simply checking to make sure the req is "properly formatted"?  I think the intention is to enforce that req affiliation corresponds to ALLOC_PARTITION.  Would be good to clarify this in the comment.
>> 
>> Do we need this to be virtual?  It seems like a single templated implementation would suffice.
>
> Yes, it can be templated implementation, I'll update the implementation to use template.

verify method use template parameter now.

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

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


More information about the hotspot-gc-dev mailing list