On Mon, 3 Mar 2025 15:19:20 GMT, Albert Mingkun Yang <ay...@openjdk.org> wrote:

> Can you elaborate on what the "special handling" would be, if we don's set 
> "claimed" for non-committed regions?

the iteration code, would for every region check whether the region is actually 
committed or not.

The `heap_region_iterate()` API of `G1CollectedHeap` only iterates over 
committed regions. So only committed regions will be updated in the state 
table. Later when iterating over the state table, the code uses the array 
directly, i.e. the claim state of uncommitted regions would be read as 
uninitialized.

Further, it would be hard to exclude regions committed after the snapshot 
otherwise (we do not need to iterate over them. Their card table can't contain 
card marks) as we do not track newly committed regions in the snapshot. We 
could do, but would be a headache due to memory synchronization because regions 
can be committed any time.

Imho it is much simpler to reset all the card claims to "already processed" and 
then make the regions we want to work on claimable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23739#discussion_r1978893134

Reply via email to