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

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


On Tue, 10 Dec 2024 19:46:08 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:

> There could be race condition that other caller immoderately set the flag, hence the assert may fail, 

Which other caller? We are asserting here in the constructor of the SHR object. Is this object visible to anyone other than the constructing thread at this point? I am not sure I understand the reason for a race here.

It's possible I am missing something in the lifecycle of the SHR object here.

If so, it would be good to add a brief comment on why this needs to occur here despite the constructor for the `_recycling` flag which should have been called by this point, so it should already be unset by now.

> notice similar race condition in test, that is why the double check for is_trash() was added.

Yes, I understood that race, which is between multiple threads potentially racing to recycle a trashed region, and resolves such a race in favor of the thread that manages to CAS  true into `_recycling` with interlocking checks for its `trash`ness.

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

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


More information about the hotspot-gc-dev mailing list