RFR: Concurrent remembered set scanning [v3]

Roman Kennke rkennke at openjdk.java.net
Thu Jul 22 14:19:26 UTC 2021


On Wed, 21 Jul 2021 17:15:32 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> This pull request includes code to perform remembered set scanning concurrently with ongoing mutator execution.  As currently implemented, the remembered set is copied to a read-only remembered set during init-mark safepoint.  After copying, all cards in the remembered set are restored to a clean value.  Following the init-mark safepoint, mutator thread write barriers update the active remembered set copy every time a reference field is overwritten by dirtying the corresponding cards.
>> 
>> Concurrent remembered set scanning for the purpose of marking works with the read-only copy of the remembered set.  When concurrent remembered set scanning encounters an interesting pointer, the corresponding card of the active remembered set is overwritten dirty.
>> 
>> The remembered set is scanned a second time concurrently during the update-refs phase of gc.  The second scan uses the same read/write active copy of the remembered set that is being overwritten by the mutator write barrier.
>> 
>> The SATB barrier and load reference barriers are sufficient to resolve any races between setting of dirty flags and scanning of the remembered set.
>> 
>> A possible future enhancement involves replacing the remembered set copy (during init-mark safepoint) with a simple pointer swap operation to exchange the roles of a read-byte-map and a write-byte-map.  Making this change is deferred because it requires far-reaching changes to the implementations of mutator write barriers.  As currently implemented, these barriers hard-code the address of the card-table byte map.
>> 
>> This patch passes tier1 and hotspot_gc_shenandoah regression tests.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove extraneous space from comment

Looks good now! Thank you!

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

Marked as reviewed by rkennke (Lead).

PR: https://git.openjdk.java.net/shenandoah/pull/37


More information about the shenandoah-dev mailing list