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

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


On Wed, 20 Mar 2024 10:21:11 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> 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 seven additional commits since the last revision:
> 
>  - Refine assertion further & modify comment block.
>  - Merge branch 'master' into active_generation
>  - jcheck cleanup.
>  - Weaken assertion so it passes for now; add comment.
>  - Clean up assertion checking for race.
>  - Read active_generetion() only once in is_is_active_generation() to work
>    around potential flicker; interlocking reads to detect flicker. Need
>    better checks.
>  - Robustify ShenandoahGCSession, and fix a missing use for
>    coalesce_and_fill of old gen.

Publishing the draft for feedback.

Still needs a few cleanups. Not too happy with the minutiae of the mechanics that need to be better abstracted.

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

PR Comment: https://git.openjdk.org/shenandoah/pull/407#issuecomment-2117925118


More information about the shenandoah-dev mailing list