[master] Integrated: Implement ZGC support
Erik Österlund
eosterlund at openjdk.java.net
Thu Mar 17 13:59:41 UTC 2022
On Tue, 8 Mar 2022 20:14:48 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> This change enables support for ZGC in Lilliput.
>
> Similar to Shenandoah, the main trouble is concurrent relocation racing with stack-locking while trying to get hold of the header to figure out the object size. See #32 for details on this. Unfortunately, unlike Shenandoah, we cannot use the header as arbiter to prevent that race, because ZGC uses a forwarding table instead. For this reason I disabled stack-locking with ZGC, for now.
>
> Other changes:
> - Plant some STS usage, this is important to avoid racing header acess in GC workers with concurrent monitor deflation. Especially the ZRelocationTask and ZMarkTask don't seem to run under STS, and ZMarkRootTask has an STSJoiner in its constructor, but that would be called by the thread that drives the workers, not by the worker thread itself. I moved it into the worker. I also planted STS::yield() calls, so that safepoints (e.g. for monitor cleanup) can be reached in a timely manner. It may be useful to not do that after every object, but only after a certain number of strides, but that seems a minor and secondary problem.
> - Removed an assert in ZBarrierSetC2 that seems wrong under Lilliput.
>
> Testing:
> - [x] gc/z
> - [x] tier1 +UseZGC
> - [ ] tier2 +UseZGC
> - [ ] tier3 +UseZGC
Looks good.
Looks good. Probably possible to get some deadlocks when in-place relocation is triggered from a load barrier in a safepoint, but we can deal with that separately.
-------------
Marked as reviewed by eosterlund (Committer).
PR: https://git.openjdk.java.net/lilliput/pull/44
More information about the lilliput-dev
mailing list