RFR: 8339387: ZGC: Synchronize medium page allocation [v2]

Stefan Johansson sjohanss at openjdk.org
Mon Sep 9 06:46:25 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

Stefan Johansson has updated the pull request incrementally with two additional commits since the last revision:

 - Review - use explicit null checks
 - StefanK review - change lock type

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20883/files
  - new: https://git.openjdk.org/jdk/pull/20883/files/66a9a238..fd5ad8b1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20883&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20883&range=00-01

  Stats: 19 lines in 2 files changed: 7 ins; 8 del; 4 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