RFR: 8271217: Fix race between G1PeriodicGCTask checks and GC request [v2]

Kim Barrett kbarrett at openjdk.java.net
Wed Aug 4 15:08:06 UTC 2021


> Please review this change to remove a race involving G1PeriodicGCTask.  The
> task performs various checks to determine whether a periodic GC should be
> performed.  If they pass, then it requests the GC by calling try_collect.
> The problem is that an unrelated GC could occur after the task's checks but
> before its request is processed.  In that case we don't want to do the
> periodic GC after all, but there's nothing to prevent it.
> 
> This change lets the task capture the various GC counters as part of its
> checking, and pass them to try_collect for use in detecting an intervening
> GC.
> 
> Testing:
> mach5 tier1

Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge branch 'master' into g1service_races
 - eliminate races in periodic gc requests

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4905/files
  - new: https://git.openjdk.java.net/jdk/pull/4905/files/0152fd58..c48d53b6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4905&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4905&range=00-01

  Stats: 38804 lines in 372 files changed: 34765 ins; 2096 del; 1943 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4905.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4905/head:pull/4905

PR: https://git.openjdk.java.net/jdk/pull/4905



More information about the hotspot-gc-dev mailing list