RFR: 8289822: Make concurrent mark code owner of TAMSes [v2]
Thomas Schatzl
tschatzl at openjdk.org
Thu Mar 14 09:56:02 UTC 2024
> 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
Thomas Schatzl has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:
- Merge branch 'master' into 8289822-concurrent-mark-tams-owner
- Do the mark information reset more fine grained (like before this change) to not potentially make HeapRegion::hr_clear() too slow
- Fixes
- some attempts to not have TAMSes always be updated for all regions
- Remove _top_at_mark_start HeapRegion member
- 8326781
initial version
initial draft
some improvmeents
Make things work
forgotten fix
-------------
Changes: https://git.openjdk.org/jdk/pull/18150/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18150&range=01
Stats: 194 lines in 16 files changed: 73 ins; 68 del; 53 mod
Patch: https://git.openjdk.org/jdk/pull/18150.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18150/head:pull/18150
PR: https://git.openjdk.org/jdk/pull/18150
More information about the hotspot-gc-dev
mailing list