[master] Integrated: Implement ZGC support

Roman Kennke rkennke at openjdk.java.net
Thu Mar 17 13:59:41 UTC 2022


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

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

Commit messages:
 - Don't iterate using object size in Z relocation
 - Reintroduce STS in ZRelocation
 - Revert unnecessary change
 - Revert all STS changes
 - Don't use STS in conc-mark
 - Cleanups
 - Refine STS usage
 - Implement ZGC support

Changes: https://git.openjdk.java.net/lilliput/pull/44/files
 Webrev: https://webrevs.openjdk.java.net/?repo=lilliput&pr=44&range=00
  Stats: 22 lines in 5 files changed: 9 ins; 5 del; 8 mod
  Patch: https://git.openjdk.java.net/lilliput/pull/44.diff
  Fetch: git fetch https://git.openjdk.java.net/lilliput pull/44/head:pull/44

PR: https://git.openjdk.java.net/lilliput/pull/44


More information about the lilliput-dev mailing list