RFR: 8345423: Shenandoah: Parallelize concurrent cleanup [v8]

Y. Srinivas Ramakrishna ysr at openjdk.org
Tue Dec 10 23:15:42 UTC 2024


On Tue, 10 Dec 2024 21:00:00 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 884:
>> 
>>> 882:   // During full gc, multiple GC worker threads may change region affiliations without a lock.  No lock is enforced
>>> 883:   // on read and write of _affiliated_region_count.  At the end of full gc, a single thread overwrites the count with
>>> 884:   // a coherent value.
>> 
>> Is the comment in its entirety still valid now? The part about "No lock is enforced" seems a bit dubious given the atomic op.
>> 
>> Similarly the comment in `decrement_...` below.
>
> Yes It is atomic, the lock/safepoint seems not needed. I'll probably keep the comment  as it is in this PR, since the are called from different places of FullGC and concurrentGC, we can cleanup these methods later I think.

ok for now. Will be worth examining the uses from full at some point but this was just a comment so ok for now. May be leave a `TODO` comment to track if you feel like.


// TODO: Check and correct comment, if obsolete.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22538#discussion_r1879050043


More information about the shenandoah-dev mailing list