Integrated: 8252752: Clear card table for old regions during scan in G1
Thomas Schatzl
tschatzl at openjdk.java.net
Mon Sep 28 08:32:20 UTC 2020
On Thu, 24 Sep 2020 19:12:35 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> Hi all,
>
> can I get reviews for this change that removes the need for explicit clearing of the card table for typically a large
> amount of regions in most cases?
>
> Currently g1 unconditionally marks scanned dirty cards as "scanned" to remember that they had already been scanned in
> earlier evacuation passes. Then in the "clear card table phase" g1 clears all these marks including the card table of
> evacuated regions. This change modifies g1 so that if possible, it clears dirty cards after scanning them instead of
> setting them to "scanned" if there is only one evacuation pass. This saves a lot of work later (e.g. the amount of
> regions to clear in the clear card table phase may be reduced by a magnitude or more, depending on the ration between
> evacuated and scanned regions). The main change here is which type of regions (ones in the collection set, ones that
> are only scanned) are put into which list of regions g1 already manages: there is one "all" list containing all regions
> that need clearing, and a "next" list containing the regions to be scanned in the current evacuation pass. Previously
> g1 put regions into at least one list; now regions in the current collection set are always directly put into the "all"
> list (as they independently of other reasons require card table cleaning), while to-be-scanned regions are always only
> put into the "next" list. Then, to achieve the desired effect that only regions that absolutely require clearing are
> in the "all" list, g1 does not merge the "next" list into the "all" list when it detects that there will only be one
> evacuation pass. Performance impact: Decreases clear card table time significantly if the number of regions in the
> collection set is much smaller than the number of scanned regions (as it decreases the number of regions to clear).
> Some cursory perf testing showed slight overall pause time improvements. Testing: hs-tier1-5 ("Initial import" change)
> hs-tier1-2 (latest)
This pull request has now been integrated.
Changeset: e9c17827
Author: Thomas Schatzl <tschatzl at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/e9c17827
Stats: 120 lines in 6 files changed: 80 ins; 11 del; 29 mod
8252752: Clear card table for old regions during scan in G1
Reviewed-by: kbarrett, iwalulya, ayang
-------------
PR: https://git.openjdk.java.net/jdk/pull/343
More information about the hotspot-gc-dev
mailing list