RFR: 8315219: G1: Improve allocator pathological case where it keeps doing direct allocations instead of retiring a PLAB [v2]
Albert Mingkun Yang
ayang at openjdk.org
Wed Aug 30 10:15:11 UTC 2023
On Wed, 30 Aug 2023 09:37:45 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:
>> Hi all,
>>
>> Please review this change to improve on how G1 deals with ParallelGCBufferWastePct. Currently, any allocations larger than ParallelGCBufferWastePct of the current PLAB size are allocated directly without regard for the state of the current PLAB. This creates a pathological case where fully used up PLAB are not retired given that allocation sizes larger than ParallelGCBufferWastePct current PLAB.
>>
>> In this change, we directly check whether the current PLAB can be retired i.e. the remaining PLAB space is < ParallelGCBufferWastePct of current PLAB size. This should reduce the number of direct allocations.
>>
>> Testing: - mach5 Tier 1-6
>> - No regression was observed on perf benchmarks
>
> Ivan Walulya has updated the pull request incrementally with three additional commits since the last revision:
>
> - nit
> - nit
> - Thomas Review
src/hotspot/share/gc/g1/g1Allocator.cpp line 389:
> 387: may_throw_away_buffer(words_remaining, plab_word_size)) {
> 388:
> 389: guarantee(words_remaining <= required_in_plab, "must be");
What's the intend of this check? Also, if the two are equal, plab-alloc should have succeeded, so one shouldn't retire the current plab.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15482#discussion_r1310033904
More information about the hotspot-gc-dev
mailing list