RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v10]

William Kemper wkemper at openjdk.org
Fri Oct 3 00:37:55 UTC 2025


On Thu, 2 Oct 2025 23:05:29 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> The existing implementation of get_live_data_bytes() and git_live_data_words() does not always behave as might be expected.  In particular, the value returned ignores any allocations that occur subsequent to the most recent mark effort that identified live data within the region.  This is typically ok for young regions, where the amount of live data determines whether a region should be added to the collection set during the final-mark safepoint.
>> 
>> However, old-gen regions that are placed into the set of candidates for mixed evacuation are more complicated.  In particular, by the time the old-gen region is added to a mixed evacuation, its live data may be much larger than at the time concurrent old marking ended.
>> 
>> This PR provides comments to clarify the shortcomings of the existing functions, and adds new functions that provide more accurate accountings of live data for mixed-evacuation candidate regions.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   reviewer feedback to reduce code duplication

I think we can delete the field `_mixed_candidate_garbage_words` now with the refactoring. Would also be good to run this through testing again.

src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp line 262:

> 260:   volatile size_t _critical_pins;
> 261: 
> 262:   size_t _mixed_candidate_garbage_words;

Can we delete this field now?

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

Changes requested by wkemper (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24319#pullrequestreview-3296942280
PR Review Comment: https://git.openjdk.org/jdk/pull/24319#discussion_r2400454938


More information about the hotspot-gc-dev mailing list