RFR: 8339661: ZGC: Move some page resets and verification to callsites

Joel Sikström duke at openjdk.org
Fri Sep 6 12:49:01 UTC 2024


Currently, `ZPage::reset()` does different things depending on where the page is being reset and what it will be used for. This leads to checks being somewhat hard to understand and to follow the edge-cases of.

By moving some of the reset logic that is now part of `ZPage::reset()` to the callsite, some operations can be made easier to understand the reason behind when reading the code.

Main highlights:
- Clear logic behind initializing remsets at callsites, now guarded by asserts in `ZPage::remset_initialize()`.
- `ZPage::clone_limited()` retains the value of the top-pointer.
- The kind of verification for remsets are now at callsites:
  - Allocations from the page cache, and only if the page got a remset
  - Old-to-old in-place relocations, where only the inactive remset is checked

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

Commit messages:
 - 8339661: ZGC: Move some page resets and verification to callsites

Changes: https://git.openjdk.org/jdk/pull/20890/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20890&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8339661
  Stats: 127 lines in 6 files changed: 34 ins; 64 del; 29 mod
  Patch: https://git.openjdk.org/jdk/pull/20890.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20890/head:pull/20890

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


More information about the hotspot-gc-dev mailing list