RFR: 8328235: GenShen: Robustify ShenandoahGCSession and fix missing use [v3]

Y. Srinivas Ramakrishna ysr at openjdk.org
Fri May 17 16:11:37 UTC 2024


> ShenandoahGCSession is intended to create a scope where the ShenandoahHeap's _gc_cause and _gc_generation field reflect the current gc cycle. We now check that we do not overwrite existing non-default settings (respectively _no_gc and nullptr). The destructor of the scope/stack object also resets these fields to their default settings, ensuring intended uses. This uncovered a situation where the scope was not entered when it should have been, which we have now fixed. A case of flickering of active_generation() was identified, and found to be benign. An assert now checks for this situation. The code has been made robust wrt the flickering (seen only by mutators executing load barriers).
> 
> *Testing*:
> - [x] code pipeline
> - [x] specjbb
> - [x] jtreg:hotspot_gc and jtreg:hotspot:tier1 w/fastdebug
> - [x] GHA

Y. Srinivas Ramakrishna has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 32 additional commits since the last revision:

 - jcheck whitespace
 - Fixed mismerge because of code moving between files in merge from
   master; encapsulate assert & provide more useful debugging info. We
   aren't done yet... It might be the case that we do away with the
   sync/async split of the variable and instead move the relevant state
   into the closure if possible. That might have to wait for another day
   though based on whether it'll work well everywhere or not.
 - Merge branch 'master' into active_generation
 - Greater separation of gc_generation and active_generation fields of
   ShHeap. WIP.
 - Clean ups.
 - jcheck whitespace
 - Banish forcing entirely. Fix one case where full gc sets
   active_generation directly. Might be other cases as well. Will need a
   cleaner and more natural abstraction different from the unseemly
   under-the-covers groveling that we do currently.
 - Relax an assert that is too strong; still iterating execution paths,
   more cleanups planned.
 - Disallow forcing.
   Test.
 - Remove an incorrect gc status setting.
 - ... and 22 more: https://git.openjdk.org/shenandoah/compare/5cefc2d8...61848c82

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

Changes:
  - all: https://git.openjdk.org/shenandoah/pull/407/files
  - new: https://git.openjdk.org/shenandoah/pull/407/files/a86d3edd..61848c82

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=shenandoah&pr=407&range=02
 - incr: https://webrevs.openjdk.org/?repo=shenandoah&pr=407&range=01-02

  Stats: 588111 lines in 6590 files changed: 100933 ins; 144093 del; 343085 mod
  Patch: https://git.openjdk.org/shenandoah/pull/407.diff
  Fetch: git fetch https://git.openjdk.org/shenandoah.git pull/407/head:pull/407

PR: https://git.openjdk.org/shenandoah/pull/407


More information about the shenandoah-dev mailing list