Integrated: 8271217: Fix race between G1PeriodicGCTask checks and GC request

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


On Mon, 26 Jul 2021 18:05:10 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> 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

This pull request has now been integrated.

Changeset: 452f7d76
Author:    Kim Barrett <kbarrett at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/452f7d764fc0112cabf0be944e4233173d63f933
Stats:     159 lines in 8 files changed: 126 ins; 13 del; 20 mod

8271217: Fix race between G1PeriodicGCTask checks and GC request

Reviewed-by: iwalulya, tschatzl, lkorinth

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

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



More information about the hotspot-gc-dev mailing list