RFR: 8289822: G1: Make concurrent mark code owner of TAMSes [v5]

Thomas Schatzl tschatzl at openjdk.org
Sat Mar 16 22:20:20 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 incrementally with one additional commit since the last revision:

  ayang review2

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/18150/files
  - new: https://git.openjdk.org/jdk/pull/18150/files/652330cd..fae12ca0

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=18150&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=18150&range=03-04

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 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-dev mailing list