RFR: 8333105: Shenandoah: Results of concurrent mark may be lost for degenerated cycle
Aleksey Shipilev
shade at openjdk.org
Wed May 29 18:29:02 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.
OK, this looks reasonable. I don't think we need a verbose comment here. Something like this would suffice:
// Handle the corner case when GC cancellation was detected only during the final mark.
// Final mark leaves the in-progress flag up in this case, and does not do any evacs.
if (heap->is_concurrent_mark_in_progress()) {
bool cancelled = check_cancellation_and_abort(ShenandoahDegenPoint::_degenerated_mark);
assert(cancelled, "GC must have been cancelled between concurrent and final mark");
return false;
}
How often does this corner case fire anyway?
-------------
Marked as reviewed by shade (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/19434#pullrequestreview-2086121356
More information about the hotspot-gc-dev
mailing list