RFR: 8276098: Do precise BOT updates in G1 evacuation phase [v3]

Stefan Johansson sjohanss at openjdk.java.net
Tue Nov 9 10:00:42 UTC 2021

On Tue, 9 Nov 2021 09:36:29 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> > Okay, it's actually not relevant to this patch. `G1ScanHRForRegionClosure::do_claimed_block` has made an unaligned request to BOT because of `_scanned_to`. That is, `_scanned_to` is not aligned on card boundary. And this causes a slow path. I think there might be an easy way to prevent slow path, e.g., make a special case for unaligned mr.start() in `HeapRegion::oops_on_memregion_seq_iterate_careful`. But that might be another topic.
> In this case `_scanned_to` points to a valid object anyway; from just reading the code, possibly the `block_start()` call in `HeapRegion::oops_on_memregion_seq_iterate_careful` shouldn't be done in this case. Maybe if the caller of `HeapRegion::oops_on_memregion_seq_iterate_careful` already finds the necessary start.
> Or `block_start` could be changed to `block_start_const` in this case.
> However this is a different issue I think.

I've created [JDK-8276229](https://bugs.openjdk.java.net/browse/JDK-8276229) and I plan to open a PR for this once this issue has been resolved. 

I also noticed that we sometimes still enter `forward_to_block_containing_addr_slow` and my solution is (as Thomas suggest) to use the "const" versions of the functions, but renamed without "const".


PR: https://git.openjdk.java.net/jdk/pull/6166

More information about the hotspot-gc-dev mailing list