Integrated: 8263427: Shenandoah: Trigger weak-LRB even when heap is stable

Roman Kennke rkennke at openjdk.java.net
Tue Mar 16 14:16:11 UTC 2021


On Thu, 11 Mar 2021 18:38:26 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> We currently guard all LRBs, including weak-LRB, by a test for heap-stable and only enter the LRB when heap is unstable (e.g. evacuation or update-refs in progress). However, the weak LRB must also be entered when heap is stable and concurrent refs is in progress, otherwise we may accidentally resurrect otherwise unreachable weak referents. This can happen when we take the shortcut cycle and skip evac&update-refs.
> 
> I believe this might be the root cause for JDK-8262852. 
> 
> The way out of it is change conc-weakroots-in-progress flag to a bit in gc-state, and test for this in weak-LRB gc-state-check, and enter weak-LRB even when heap is stable, but conc-weakroots-in-progress.
> 
> There's one gotcha here: we used to change gc-state only at safepoints so that the flag can safely be propagated to all Java threads. But conc-weakroots-in-progress is turned-off concurrently. I deal with this by propagating the flag change to Java threads via the rendevouz (that we do anyway), and change the global flag only once all threads got the thread-local flag change.
> 
> This stuff makes the verifier unhappy, because it doesn't know about the new bit. And it'd be difficult to properly verify it, because sometimes it is set (conc-cycle) and sometimes it is not (degen-cycle), so instead of additing extra verification, I figured we could keep ignoring the flag (for now?)
> 
> Testing:
>  - [x] New testcase failed without change, passes now
>  - [x] hotspot_gc_shenandoah
>  - [ ] tier1 (+Shenandoah)

This pull request has now been integrated.

Changeset: 75ef6f58
Author:    Roman Kennke <rkennke at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/75ef6f58
Stats:     292 lines in 23 files changed: 215 ins; 66 del; 11 mod

8263427: Shenandoah: Trigger weak-LRB even when heap is stable

Reviewed-by: shade, zgu

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

PR: https://git.openjdk.java.net/jdk/pull/2945


More information about the shenandoah-dev mailing list