Integrated: 8354929: ZGC: Update collection stats while holding page allocator lock

Stefan Johansson sjohanss at openjdk.org
Tue Apr 22 08:02:57 UTC 2025


On Thu, 17 Apr 2025 10:48:54 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> 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

This pull request has now been integrated.

Changeset: 50358d1c
Author:    Stefan Johansson <sjohanss at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/50358d1ca49c26d100c5c658de29c75f864fdc60
Stats:     47 lines in 3 files changed: 19 ins; 15 del; 13 mod

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

Reviewed-by: stefank, tschatzl, aboldtch

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

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


More information about the hotspot-gc-dev mailing list