RFR: 8372747: G1: Conservative heap alignment does not account for card table constraint
Martin Doerr
mdoerr at openjdk.org
Mon Dec 1 10:05:48 UTC 2025
On Mon, 1 Dec 2025 09:26:20 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:
> Hello,
>
> We removed `GCArguments::compute_heap_alignment` in [JDK-8372150](https://bugs.openjdk.org/browse/JDK-8372150) to simplify the interface a bit, with the expecation that each GC handles alignment on their own. This is true when the default "small" page size is 4K, but with 64K default "small" pages on PPC, this assumption doesn't hold. To fix this, we should make sure to account for the card table constraints in `G1Arguments::conservative_max_heap_alignment`.
>
> I've tested this locally by changing the following line to "emulate" 64K default "small" pages, which I've used to confirm this fix.
>
> uintx CardTable::ct_max_alignment_constraint() {
> // Calculate maximum alignment using GCCardSizeInBytes as card_size hasn't been set yet
> - return GCCardSizeInBytes * os::vm_page_size();
> + return GCCardSizeInBytes * 64 * K;
> }
>
>
> Also tested with Oracle's tier1-4.
Looks good and fixes the issue. Thanks!
-------------
Marked as reviewed by mdoerr (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28572#pullrequestreview-3524180620
More information about the hotspot-gc-dev
mailing list