RFR: 8255765: Shenandoah: Isolate concurrent, degenerated and full GC
Roman Kennke
rkennke at openjdk.java.net
Mon Jan 18 20:32:51 UTC 2021
On Wed, 6 Jan 2021 16:45:03 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
> The purpose of this patch is to isolate concurrent, degenerated and full gc implementation, so that, makes each GC implementation more straightforward and clean, and improves readability.
>
> Current implementation emphasis code sharing, e.g. degenerated GC reuses concurrent GC's ops. It was not a problem in the beginning, when they actually behave similarly. Since concurrent GC moved root processing into concurrent phases, code started to diverge, we started to put bandages to make the shared ops work for both concurrent and degenerated GC, that made code hard to read and error prone.
>
> The patch breaks up GCs into 3 (mainly just concurrent and degenerated GC, as full GC already standalone) easy to identify and understand classes (ShenandoahConcurrentGC, ShenandoahDegeneratedGC and ShenandoahMarkCompactGC), subclasses of ShenandoahGC class.
>
> The three GCs still keep vmop/entry/op paradigm, but encapsulate GC control flow inside their own classes, as ShenandoahMarkCompact GC already does. So that, concurrent and degenerated GC no longer share ops and op implementations no longer need to consider other GC modes, which results in simplifying implementation and improving readability. Code sharing is achieved via helper methods provided by ShenandoahHeap.
>
> Test:
> - [x] hotspot_gc_shenandoah
> - [x] nightly tests
Nice! I really like how that moves some burden out from ShHeap (and ShControlThread) to more apprppriate places. Just the following two remarks.
src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.cpp line 45:
> 43: _cycle_counter(0) {
> 44:
> 45: Copy::zero_to_bytes(_degen_points, sizeof(size_t) * ShenandoahGC::_DEGENERATED_LIMIT);
I wonder if those statistics all belong into ShenandoahDegenGC now? Might be worth considering as a follow-up.
src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.hpp line 30:
> 28: #include "gc/shared/gcTrace.hpp"
> 29: #include "gc/shenandoah/shenandoahGC.hpp"
> 30: #include "gc/shenandoah/shenandoahSharedVariables.hpp"
What's that include for shenandoahSharedVariables.hpp needed for?
-------------
PR: https://git.openjdk.java.net/jdk/pull/1964
More information about the shenandoah-dev
mailing list