RFR: 8330626: ZGC: Windows address space placeholders not managed correctly

Stefan Johansson sjohanss at openjdk.org
Tue Apr 23 11:42:56 UTC 2024


Please review this fix to correctly manage address space placeholders on Windows.

**Summary**
On Windows, when using small pages, we use address space placeholders to ensure consistency of the address space.

When a portion of the address space is mapped these placeholders are replaced by the actual backing and when doing this the size of the placeholder(s) needs to exactly match the size to be backed. For this reason, whenever address space is in use, we split the covering placeholder into multiple `ZGranuleSize` sized placeholders. 

During recent investigations into fragmentation of the ZGC address space, I found that there was a code code path (**currently not in use**) that did not properly manage these placeholders and we could end up in situations where no placeholder was split off when a new chunk of `ZGranuleSize` size was request. The problem is basically an off by one problem in the splitting code and the fix is to avoid this by changing it to first split the covering placeholder into two parts before splitting the part to be used into granules. 

**Testing**
* Manual testing using the included GTest as well as sample applications previously triggering the error case.
* Tier 1-5 Generational ZGC testing (ongoing)

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

Commit messages:
 - Testing improvements
 - StefanK review
 - Testing refactored
 - Test ZMapper_windows
 - 8330626: ZGC: Windows address space placeholders not managed correctly

Changes: https://git.openjdk.org/jdk/pull/18912/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18912&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8330626
  Stats: 236 lines in 3 files changed: 227 ins; 0 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/18912.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18912/head:pull/18912

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


More information about the hotspot-dev mailing list