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

Kelvin Nilsen kdnilsen at openjdk.org
Wed Mar 13 19:12:49 UTC 2024


On Fri, 1 Mar 2024 17:59:10 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 60 commits:
>> 
>>  - Remove instrumentation and cleanup magic numbers
>>    
>>    Two places, I had used 63 when I should have used
>>    _bits_per_array_element -1.
>>  - Address 32-bit compile issues
>>  - Fix 32-bit size formatting in log messages
>>  - Fix white space
>>  - Merge remote-tracking branch 'origin/master' into restructure-free-set
>>  - Merge branch 'openjdk:master' into master
>>  - Two bug fixes for better performance
>>    
>>    1. Collector reserve size is based on memory available within regions
>>       rather than the region size (oops).
>>    
>>    2. If an attempt to allocate within a region fails and the region has
>>       already provided the percentage presumed by ShenandoahEvacWaste,
>>       retire this region.  This is motivated by observations that
>>       otherwise, we end up with large numbers of regions that have only
>>       a small amount of memory within them (e.g. 4k) and every allocation
>>       request has to wade through all of these regions before it eventually
>>       finds a region that has a sufficiently large amount of available
>>       memory.  In the original Shenandoah free-set implementation, the
>>       behavior was to retire the first time an allocation within that
>>       regions fails, regardless of whether the region has already reached
>>       the ShenandoahEvacWaste threshold.
>>  - Fix off-by-one error in is_forward_consecutive_ones()
>>  - Fix whitespace
>>  - Bug fixes and performance improvements
>>    
>>    1. Correct off-b-one-error in count of trailingones
>>    2. Speed up search for contiguous regions (for humongous allocations) by
>>       sliding window instead of initiating new search each time
>>    3. Bias regular region allocations to favor regions that are already
>>       partially consumed
>>    4. Fix bug in move_regions_from_collector_to_mutator which caused some
>>       non-empty regions to be ignored.
>>  - ... and 50 more: https://git.openjdk.org/jdk/compare/be2b92bd...1aa5a3e6
>
> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 1541:
> 
>> 1539:   shenandoah_assert_heaplocked();
>> 1540: 
>> 1541:   // Allocation request is known to satisfy all memory budgeting constraints.
> 
> What does it mean?

I'll remove this comment.  It is a future vestige belonging to generational GC.  In that realm, we enforce independent budgets on OLD allocations for the purpose of promoting vs OLD allocations for the purpose of compacting.  We may reject certain promotions "at the moment" if they run a risk of compromising our ability to finish compaction of a mixed evacuation's OLD collection set.

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

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


More information about the shenandoah-dev mailing list