RFR: 8261448: Preserve GC stack watermark across safepoints in StackWalk
Erik Österlund
eosterlund at openjdk.java.net
Fri Feb 12 23:17:39 UTC 2021
On Fri, 12 Feb 2021 21:43:20 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
>> I'm converting back to draft. The Loom tests (test/jdk/java/lang/Continuation/*) are still failing and it looks like fetchFirstBatch() does indeed require treatment, and it's complicated because fetchFirstBatch() may end up calling fetchNextBatch() and the KeepStackGCProcessedMark is not reentrant.
>
> I tested the original patch in Loom with tests that use stack-walking and it failed because we'd need another KeepStackGCProcessedMark in fetchFirstBatch() too. Unfortunately, fetchFirstBatch() can wind up calling fetchNextBatch() recursively, but we *also* can call fetchNextBatch() without calling fetchFirstBatch() on outer frame, thus we need KeepStackGCProcessedMark to be reentrant. I achieved this by linking together nested linked watermark. I am not sure this is the right way to achieve it. It fixes all tests in Loom *and* mainline JDK though.
I think this solution is wrong, regarding nesting. There is only a single node but it looks like you think there are multiple. The result is seemingly that the unlink function won't unlink anything, which permanently disables incremental stack scanning on that thread.
Is there any way the mark can be placed closer to the problematic allocation so we don't need nesting?
-------------
PR: https://git.openjdk.java.net/jdk/pull/2500
More information about the hotspot-gc-dev
mailing list