RFR: 8236847: CDS archive with 4K alignment unusable on machines with 64k pages [v2]

Ioi Lam ioi.lam at oracle.com
Mon Mar 1 21:13:25 UTC 2021



On 2/28/21 6:11 AM, Andrew Haley wrote:
> On Fri, 26 Feb 2021 18:28:04 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
>
>> Before this fix, the alignment is defaulting to that of the build host. We would like to provide a way to produce a JDK distribution, with a pre generated CDS archive, where the alignment has the highest known value of any target host for maximum compatibility. The currently known such values are 64K for Linux and 16K for Mac. If we aren't going to allow the user (builder of OpenJDK) the free choice of any alignment anyway, would it make sense to limit the choice between something more abstract like "host" and "compatible" instead of listing explicit numbers?
>   That's problematic because it assumes we know all of the possible alignments.  At the present time we think that 64 is the largest we'll ever encounter, but IMO that isn't a great way to think about things. It would be very nice indeed if we didn't have to edit OpenJDK for the next page size. I guess 4k, 16k, and 64k are all we'll ever see, but I wouldn't bet the farm on it.
>

Hi Andrew,

The only cases we know of a variable page size are Linux/ARM and (to 
some degree) running macOS/x64 inside Rosetta.

The page size on aarch64 seems to be configurable to 4, 64 and 1MB (and 
also 16KB on some platforms, apparently M1 is the case). Do we know if 
anyone that plans to use 1MB page sizes?

It seems Linux/aarch64 is configurable only for 4 or 64KB. There's no 
configuration option to pick any other sizes. Is this true?

In terms of the configure option, we have 2 choices

- allow specific numbers to be set. Like --with-cds-alignment=65536. 
This is more flexible and will be future proof. The down side is people 
can enter incorrect values, and it's not easy to check. E.g., you can 
specify 1M for linux/aarch64, but that's wasteful.

- as currently proposed, with a boolean switch: 
--enable-compatible-cds-alignment. The specific value is in the os-cpu 
directory. (64KB for linux/aarch64 and 16KB for macOS/x64. This switch 
is ignored on all other platforms).

The boolean option seems safer, and probably will suffice since we don't 
see such variable page sizes very often (twice in the past decade??).

I would prefer a safe option for now, and if this indeed changes in the 
future, we can modify the syntax accordingly.

Thanks
- Ioi


More information about the hotspot-runtime-dev mailing list