RFR: 8331721: Introduce CollectedHeap helper methods for any GC in progress

Aleksey Shipilev shade at openjdk.org
Tue May 7 17:20:01 UTC 2024


Continuation of [JDK-8331573](https://bugs.openjdk.org/browse/JDK-8331573). So far we only have a way to test for STW GCs. We would need these more generic sensing methods for [JDK-8331572](https://bugs.openjdk.org/browse/JDK-8331572).

This patch considers that there can be several concurrent GCs in progress. A notable example of that is Generational ZGC, where minor and major concurrent collections can run at the same time.
 
Initially, I thought to use `is_gc_active` name freed up by [JDK-8331573](https://bugs.openjdk.org/browse/JDK-8331573), but then I thought better of it. My concern would be that some backports might be confused about what `is_gc_active` name really means, depending on whether JDK-8331573 and this PR is backported or not. To avoid this confusion, I chose `is_any_gc_active` name instead.

This PR is somewhat open for bikeshedding about the names :)

Additional testing:
 - [x] Linux AArch64 server fastdebug, `hotspot_gc`
 - [ ] Linux AArch64 server fastdebug, `all`

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

Commit messages:
 - Work

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

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


More information about the hotspot-gc-dev mailing list