-
Bug
-
Resolution: Fixed
-
P3
-
8-shenandoah, 11.0.9, 15, 16
-
b33
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8249729 | 16 | Roman Kennke | P3 | Resolved | Fixed | b07 |
JDK-8250198 | 15.0.2 | Roman Kennke | P3 | Resolved | Fixed | b01 |
JDK-8250497 | 15.0.1 | Roman Kennke | P3 | Resolved | Fixed | b03 |
JDK-8251879 | 11.0.9 | Roman Kennke | P3 | Resolved | Fixed | b04 |
There are a number of related problems in how explicit and implicic GC requests are handled, which can lead to a thread not waiting for the requested GC cycle not finishing.
First, observe that the gc_id in the control-thread is incremented concurrently.
1. If the initial read of gc_id and the subsequent read at the beginning of the loop crosses that concurrent increment, then it will skip the whole loop and thus not wait as it should
2. Even if we incremented the ID only at safepoints, it would be problematic, because both lock-acquisition and wait can cross a safepoint.
The accesses of GC ID can be reshuffled to be safe. We migth also consider to update the ID at the initial safepoint, but it does not seem necessary.
First, observe that the gc_id in the control-thread is incremented concurrently.
1. If the initial read of gc_id and the subsequent read at the beginning of the loop crosses that concurrent increment, then it will skip the whole loop and thus not wait as it should
2. Even if we incremented the ID only at safepoints, it would be problematic, because both lock-acquisition and wait can cross a safepoint.
The accesses of GC ID can be reshuffled to be safe. We migth also consider to update the ID at the initial safepoint, but it does not seem necessary.
- backported by
-
JDK-8249729 Shenandoah: Fix racy GC request handling
-
- Resolved
-
-
JDK-8250198 Shenandoah: Fix racy GC request handling
-
- Resolved
-
-
JDK-8250497 Shenandoah: Fix racy GC request handling
-
- Resolved
-
-
JDK-8251879 Shenandoah: Fix racy GC request handling
-
- Resolved
-