RFR: JDK-8264987: G1: Fill BOTs for Survivor-turned-to-Old regions in full gc [v2]

Thomas Schatzl tschatzl at openjdk.java.net
Thu Apr 15 08:11:38 UTC 2021


On Wed, 14 Apr 2021 09:09:22 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> in JDK-8262068, we have an enhancement for full gc which will skip compacting some regions with high survivor ratio. There might be some young regions among these skipped regions. These young regions are not filled with BOTs info as they're young.
>> But after full GC these young regions will become old regions, and the BOTs info is better to be filled for performance consideration.
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   refine the code.

Minor nits.

src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp line 71:

> 69:       force_pinned = true;
> 70:       if (hr->is_young()) {
> 71:         // Old regions have BOTs info for performance consideration, but young regions

I'd replace this comment with something like this:

    // G1 updates the BOT for old region contents incrementally, but young regions lack BOT 
    // information for performance reasons.
    // Recreate BOT information of high live ratio young regions here to keep expected
    // performance during scanning their card tables in the collection pauses later.

Or something like this...

src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp line 170:

> 168: 
> 169: void G1FullGCPrepareTask::G1CalculatePointersClosure::update_bot(HeapRegion* hr) {
> 170:   HeapWord* limit = hr->top();

Maybe make this `const`.

src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp line 173:

> 171:   HeapWord* next_addr = hr->bottom();
> 172:   HeapWord* threshold = hr->initialize_threshold();
> 173:   HeapWord* pre_addr;

Minor nit: typically the "friend" of `next` is `prev`, not `pre` in traversals.

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

Changes requested by tschatzl (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3459



More information about the hotspot-gc-dev mailing list