RFR: 8370041: GenShen: Filter young pointers from thread local SATB buffers when only marking old [v2]
William Kemper
wkemper at openjdk.org
Fri Oct 31 00:02:49 UTC 2025
> When GenShen is only marking the old generation, we do not need the SATB mechanism to preserve young pointers. We currently filter these out of the SATB buffers during the final-update-refs and init-mark safepoints. This increases latency and introduces no small amount of complexity. It should be possible to instead filter out these pointers when the SATB buffers are 'compacted' before being 'completed'.
>
> # Background
> When GenShen is marking the old generation it leaves the SATB barrier enabled. When a young collection interrupts old marking, it creates a situation where a mutator thread could overwrite a field holding a pointer into a collection set region. The SATB barrier will dutifully place this object in the SATB queue. If this pointer makes it into a mark queue, the marking thread will crash. Prior to this change, GenShen filtered out such pointers _after_ the thread local SATB buffers were completed. After this change, such pointers are filtered out _before_ the buffers are completed. This is more inline with the natural way of things.
William Kemper 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 20 additional commits since the last revision:
- Merge remote-tracking branch 'jdk/master' into piggyback-satb-flush-on-update-roots
- Flush SATB buffers upon entering degenerated cycle when old marking is in progress
This has to happen at least once during the degenerated cycle. Doing it at the start, rather than the end, simplifies the verifier.
- Fix typo in comment
- Remove duplicate satb flush closure
- Only flush satb once during degenerated cycle
- Cleanup and comments
- Merge remote-tracking branch 'jdk/master' into piggyback-satb-flush-on-update-roots
- Fix assertion
- Oops, move inline definition out of ifdef ASSERT
- Try piggybacking satb flush on update roots
- ... and 10 more: https://git.openjdk.org/jdk/compare/3bb543d1...01f0f976
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27983/files
- new: https://git.openjdk.org/jdk/pull/27983/files/ec58b72f..01f0f976
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27983&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27983&range=00-01
Stats: 43161 lines in 471 files changed: 21775 ins; 18947 del; 2439 mod
Patch: https://git.openjdk.org/jdk/pull/27983.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27983/head:pull/27983
PR: https://git.openjdk.org/jdk/pull/27983
More information about the hotspot-gc-dev
mailing list