RFR: Mixed evacuation [v5]

Kelvin Nilsen kdnilsen at openjdk.java.net
Mon Apr 19 21:06:06 UTC 2021


> This code adds to generational Shenandoah the ability to perform concurrent garbage collection of young-gen and old-gen memory. Following completion of an old-gen concurrent marking effort, we select certain old-gen heap regions to serve as candidates for future collection sets. All dead objects within the old-gen heap regions that are not part of this candidate set are coalesced and filled so that remembered-set scanning of these old-gen heap regions will not be confused by "zombie objects" (objects that old-gen has decided are dead, which reside in regions that have not yet been collected). After concurrently coalescing and filling these dead objects, each subsequent young-gen evacuation pass includes a subset of the old-gen candidates until all candidates have been collected. This code passes TIER1 and hotspot-gc-shenandoah jtreg tests without regressions. A new jtreg test has been added to exercise concurrent old/young GC.

Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:

  Refactor ShenandoahOldHeuristics
  
  Code reviewers of the draft mixed-evacuation pull request raised a concern
  about entanglement between young-gen and old-gen heuristics.  In response to
  suggestions by reviewers, this patch refactors the old-gen heuristics
  implementation as follows:
  
  1. Add old_heuristics argument and pass it so we no longer depend on
     _old_heuristics field.
  
     Done, tested with run-milestone8-github, "make test TEST=tier1" and
     "make test TEST=hotspot_gc_shenandoah"
  
  2. Hoist test for should_defer_gc() into
     ShenandoahRegulatorThread::start_old_cycle().  Remove all other
     invocations of should_defer_gc().
  
     Done, tested with run-milestone8-github, "make test TEST=tier1" and
     "make test TEST=hotspot_gc_shenandoah"
  
  3. Remove _old_heuristics field and constructor and initializer
     argument from ShenandoahPassiveHeuristics,
     ShenandoahStaticHeuristics, ShenandoahAdaptiveHeuristics,
     ShenandoahAggresiveHeuristics,
     ShenandoahMode::initialize_heuristics(),
     ShenandoahPassiveMode:::initialize_heuristics(),
     ShenandoahGeneration::initialize_heuristics().
  
     Done, tested with run-milestone8-github, "make test TEST=tier1" and
     "make test TEST=hotspot_gc_shenandoah".  Note that GC behavior
     changed a little in run-milestone8-github.  Without confirmed
     review of output files, my impression is that full GC triggered
     earlier, at GC(101), and piggyback collections each processed fewer
     old-gen candidates (18 rather than 30).
  
  4. Introduce a new ShenandoahOldHeuristics subclass of
     ShenandoahHeuristics.  Move certain old-gen specific methods there,
     including: prime_collection_set() (renamed from
     prime_collection_set_with_old_candidates()),
     prepare_for_old_collection(), start_old_evacuations(),
     unprocessed_old_collection_candidates(),
     next_old_collection_candidates(),
     consume_old_collection_candidates(),
     old_coalesce_and_fill_candidates(),
     get_coalesce_and_fill_candidates(), should_defer_gc().
     Remove the _old_heuristics argument from prime_collection_set() and
     prepare_for_old_collection(); adjust the invocations.
  
  5. Make the following subclasses of ShenandoahOldHeuristics.  In the
     initial implementation, these subclasses have the same behavior
     as the young-gen heuristics from which they were copied.  Future
     refinement may result in tailored behavior of the old-gen
     versions of each heuristic: ShenandoahAdaptiveOldHeuristics,
     ShenandoahAggresiveOldHeuristics, ShenandoahCompactHeuristics,
     ShenandoahPassiveOldHeuristics, ShenandoahStaticOldHeuristics.

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

Changes:
  - all: https://git.openjdk.java.net/shenandoah/pull/29/files
  - new: https://git.openjdk.java.net/shenandoah/pull/29/files/f6f6a734..c883f237

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=shenandoah&pr=29&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=shenandoah&pr=29&range=03-04

  Stats: 1842 lines in 34 files changed: 1402 ins; 396 del; 44 mod
  Patch: https://git.openjdk.java.net/shenandoah/pull/29.diff
  Fetch: git fetch https://git.openjdk.java.net/shenandoah pull/29/head:pull/29

PR: https://git.openjdk.java.net/shenandoah/pull/29


More information about the shenandoah-dev mailing list