RFR: 8339387: ZGC: Synchronize medium page allocation

Stefan Johansson sjohanss at openjdk.org
Fri Sep 6 07:20:20 UTC 2024


Please review this change to synchronize medium page allocations in ZGC.

**Summary**
In ZGC objects of a certain size class are allocated in medium sized pages. For each age there is a single medium page shared by all mutators. When this page gets full all thread that try to do a medium page allocation will try to allocate and install a new medium page, but only one will succeed. This can lead to a lot of unnecessary medium page allocation which in turn can lead to the unnecessary page cache flushing.

This change introduces synchronization to only a allow a single thread to allocate the medium page in the common case.  

**Testing**
* Functional testing through mach5 tier1-7 using ZGC
* Performance testing through aurora to verify no regression occur
* Manual testing to verify performance
* Manual testing to verify we avoid page cache flushing

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

Commit messages:
 - StefanK comments and reuse of share page addr
 - 8339387: ZGC: Synchronize medium page allocation

Changes: https://git.openjdk.org/jdk/pull/20883/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20883&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8339387
  Stats: 57 lines in 2 files changed: 49 ins; 5 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/20883.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20883/head:pull/20883

PR: https://git.openjdk.org/jdk/pull/20883


More information about the hotspot-gc-dev mailing list