RFR: 8333105: Shenandoah: Results of concurrent mark may be lost for degenerated cycle

Y. Srinivas Ramakrishna ysr at openjdk.org
Wed May 29 19:50:01 UTC 2024


On Tue, 28 May 2024 18:01:56 GMT, William Kemper <wkemper at openjdk.org> wrote:

> If Shenandoah does not detect a cancellation after completing concurrent mark, but before completing final mark it will fall through the concurrent cycle without collecting anything. This will shortly lead to a degenerated cycle which will _not_ use the results from the nearly complete concurrent mark. This will result in an unnecessarily longer degenerated cycle.

Looks good, but left some comments to think about may be for the future.

src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp line 147:

> 145:     bool cancelled = check_cancellation_and_abort(ShenandoahDegenPoint::_degenerated_mark);
> 146:     assert(cancelled, "GC must have been cancelled between concurrent and final mark");
> 147:     return false;

Not your change, but I notice that the semantics of the return value hasn't been explicitly documented anywhere in the class hierarchy. Might make sense to place a line of documentation, say in `ShenandoahGC` which first declares the virtual method, even something simple such as:


// Returns true if the collection was completed successfully, false otherwise.

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

Marked as reviewed by ysr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19434#pullrequestreview-2086231537
PR Review Comment: https://git.openjdk.org/jdk/pull/19434#discussion_r1619378762


More information about the shenandoah-dev mailing list