RFR: 8324649: Shenandoah: refactor implementation of free set [v6]

Y. Srinivas Ramakrishna ysr at openjdk.org
Sat Feb 3 08:55:07 UTC 2024


On Sat, 3 Feb 2024 07:51:14 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename and comments for _capacity_of and _used_by
>
> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 467:
> 
>> 465:               log_debug(gc, free)("Flipped region " SIZE_FORMAT " to gc for request: " PTR_FORMAT, idx, p2i(&req));
>> 466:               return result;
>> 467:             }
> 
> It seems like this can cause potentially many (because of the loop) Mutator regions to flip to Collector (can we call the method `flip_to_collector`?) sometimes even when the request won't be satisfied. Why not flip to Collector only _after_ the allocation is successful? I assume the attempt to allocate would run afoul of assertion checks if it happened before the flip, but I worry about flipping a bunch of stuff unnecessarily and failing to allocate in them after all. Is that futile flipping cause for concern? Can it be avoided (e.g. by repositioning the assertion checks using a proxy variable to signal intent to flip following a successful allocation, then using it to ensure the post-allocation flip, or something similar)? May be such futile flips are uncommon and not a cause for concern?

On further thought, when is it that the allocation may fail (lines 463,464)?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17561#discussion_r1477017088


More information about the hotspot-gc-dev mailing list