Integrated: 8289822: G1: Make concurrent mark code owner of TAMSes

Thomas Schatzl tschatzl at openjdk.org
Tue Mar 19 10:34:28 UTC 2024


On Thu, 7 Mar 2024 10:31:27 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this change that moves TAMS ownership and handling out of `HeapRegion` into `G1ConcurrentMark`.
> 
> The rationale is that it's intrinsically a data structure only used by the marking, and only interesting during marking, so attaching it to the always present `HeapRegion` isn't fitting.
> 
> This also moves some code that is about marking decisions out of `HeapRegion`.
> 
> In this change the TAMSes are still maintained and kept up to date as long as the `HeapRegion` exists (basically always) as the snapshotting of the marking does not really snapshot ("copy over the `HeapRegion`s that existed at the time of the snapshot, only ever touching them), but assumes that they exist even for uncommitted (or free) regions due to the way it advances the global `finger` pointer.
> I did not want to change this here.
> 
> This is also why `HeapRegion` still tells `G1ConcurrentMark` to update the TAMS in two places (when clearing a region and when resetting during full gc).
> 
> Another option I considered when implementing this is clearing all marking statistics (`G1ConcurrentMark::clear_statistics`) at these places in `HeapRegion` because it decreases the amount of places where this needs to be done (maybe one or the other place isn't really necessary already). I rejected it because this would add some work that is dependent on the number of worker threads (particularly) into `HeapRegion::hr_clear()`. This change can be looked at by viewing at all but the last commit.
> 
> Testing: tier1-4, gha
> 
> Thanks,
>   Thomas

This pull request has now been integrated.

Changeset: f1c69cca
Author:    Thomas Schatzl <tschatzl at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/f1c69ccadb83306d1bb4860ff460a253af99643c
Stats:     201 lines in 14 files changed: 84 ins; 68 del; 49 mod

8289822: G1: Make concurrent mark code owner of TAMSes

Reviewed-by: ayang, iwalulya

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

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


More information about the hotspot-gc-dev mailing list