RFR: 8354929: Update collection stats while holding page allocator lock

Stefan Johansson sjohanss at openjdk.org
Thu Apr 17 10:53:29 UTC 2025


Please review this change to restructure some code in the mark start pause to do updates while holding the lock.

**Summary**
We currently update the collection high and low used values during the mark start pause without taking the page allocator lock. This is fine since it is read atomically, but consistency verification in this code requires the lock to be held. We later in the pause take the lock to get the current statistics, this change moves the update code to also happen while holding the lock. 

I've renamed `reset_statistics()` to `update_collection_stats()` to better match what it actually does and made it private. 

**Testing**
Mach5 tier1-5

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

Commit messages:
 - Move collection stat update under lock

Changes: https://git.openjdk.org/jdk/pull/24719/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24719&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354929
  Stats: 45 lines in 3 files changed: 17 ins; 15 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/24719.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24719/head:pull/24719

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


More information about the hotspot-gc-dev mailing list