RFR: JDK-8267562: G1: Missing BOT in Open Archive regions causes long pauses [v2]

Thomas Schatzl tschatzl at openjdk.java.net
Tue Jun 1 08:17:21 UTC 2021

On Mon, 31 May 2021 19:36:44 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:

>> Populate G1BlockOffsetTableParts and associated G1BlockOffsetTable::_offset_array entries for 'open' archive regions during VM initialization at runtime.
>> G1BlockOffsetTable divides the covered space (Java heap) into “N”-word subregions (“N” is from 2^”LogN”). It uses an _offset_array to tell how far back it must go to find the start of a block that contains the first word of a subregion. Every G1 region (is a G1ContiguousSpace) owns a G1BlockOffsetTablePart (associates to part of the _offset_array), which covers space of the current region. For a mapped open archive heap region with pre-populated Java objects, its G1BlockOffsetTablePart is never setup at runtime because there is no allocation done within the region. As a result, G1BlockOffsetTablePart::block_start() always does lookup from the start (bottom) of an open archive region when called at runtime, regardless if the given 'addr' is near the bottom, top or in the middle of the region. The lookup becomes linear, instead of O(2^LogN). Large heap region size makes the situation worse and young-gen pauses longer.
>> Removed G1FullGCPrepareTask::G1CalculatePointersClosure::update_bot (introduced by JDK-8264987 change, https://github.com/openjdk/jdk/pull/3459). It's merged as G1BlockOffsetTablePart::update, which is used for Survivor-turned-to-Old regions in full gc and open archive region. Thanks Thomas Schatzl  for pointing to JDK-8264987 change for code reuse.
>> Tested with tier1 and hotspot_gc tests on linux_x86. Appreciate any help for testing other platforms and more tiers. Thanks!
> Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision:
>   Updated comment based on the review feedback from Thomas.

One last comment change :)

src/hotspot/share/cds/filemap.cpp line 2057:

> 2055:     //
> 2056:     // This is only needed for open archive regions, but not the closed archive
> 2057:     // regions, because objects in closed archive regions are 'immutable'.


    // This is only needed for open archive regions, but not the closed archive
    // regions, because objects in closed archive regions never reference objects
    // outside the closed archive regions and they are immutable, so we never
    // need their BOT during garbage collection.


Marked as reviewed by tschatzl (Reviewer).

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

More information about the hotspot-gc-dev mailing list