HeapRegion::oops_on_card_seq_iterate_careful() is currently used to walk through the heap corresponding to cards both during concurrent refinement and the update RS phase during GC.
For this reason it does too much particularly during gc: the filter_young and the card_ptr are only used during refinement actually used, additionally some code that is not necessary during the update RS phase is executed.
In particular:
- during update RS, filter young is always false, and card_ptr is always NULL.
- the check whether we are during gc could be removed then
- during GC it is not possible to run into an unparseable point, so all the corresponding checks are superfluous there
- I am not sure if the loop to get from the first block_start() call to the first object reaching into the given memory range is actually necessary. A single check whether the parseable point has been reached is probably sufficient (if any), given that it should be impossible to actually get a card in the queue that has not been allocated into at all. It is likely a renmant of the previous use of block_start_careful() instead of block_start.
The code should get slightly faster too, although probably not noticeable.
For this reason it does too much particularly during gc: the filter_young and the card_ptr are only used during refinement actually used, additionally some code that is not necessary during the update RS phase is executed.
In particular:
- during update RS, filter young is always false, and card_ptr is always NULL.
- the check whether we are during gc could be removed then
- during GC it is not possible to run into an unparseable point, so all the corresponding checks are superfluous there
- I am not sure if the loop to get from the first block_start() call to the first object reaching into the given memory range is actually necessary. A single check whether the parseable point has been reached is probably sufficient (if any), given that it should be impossible to actually get a card in the queue that has not been allocated into at all. It is likely a renmant of the previous use of block_start_careful() instead of block_start.
The code should get slightly faster too, although probably not noticeable.
- relates to
-
JDK-8069760 When iterating over a card, G1 often iterates over much more references than are contained in the card
-
- Resolved
-
-
JDK-8071278 Fix the closure mess in G1RemSet::refine_card()
-
- Resolved
-
-
JDK-8177707 Specialize G1RemSet::refine_card for concurrent/during safepoint refinement
-
- Resolved
-
-
JDK-8166607 G1 needs klass_or_null_acquire
-
- Resolved
-
-
JDK-8166995 Consider removing stale cards from HCC during cleanup
-
- Closed
-