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

Ioi Lam iklam at openjdk.java.net
Tue Feb 23 17:12:41 UTC 2021


On Tue, 23 Feb 2021 16:02:13 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> > @tstuefe @theRealAph @iklam
> > Thanks for review! Currently linux-aarch64, macos-aarch64(I don't know AIX) can be configured with 4K/64K page size. To make one build compatible with both, this change takes the 64K (or bigger) as the default region alignment. It is hard to make it optional I think. Will check the possibility of more options.
> 
> Hi Yumin,
> 
> What I meant was to leave `_core_region_alignment` at allocation granularity for all platforms but aarch64. Since we do not move the archive across platforms, and all other platforms only have one base page size, so on those platforms you never run into build page size being different than runtime page size. Or am I overlooking something?
> 
> Wrt to AIX, I looked at it, I think you can disregard it for now.
> 
> Thanks, Thomas

How about changing the code to

  if (DumpSharedSpaces) {
    _core_region_alignment = (size_t)os::vm_allocation_granularity();
#if (defined(LINUX) && defined(AARCH64)) || defined(__APPLE__)
    // If you create a CDS archive on one machine, and use it on another, and the two
    // machines have different page sizes, make sure the archive can be used
    // on both machines.
    // 
    // (a) Linux/aarch64 can be configured to have either 4KB or 64KB page sizes.
    // (b) macOS/x64 uses 4KB, but macOS/aarch64 uses 64KB (note: you can run an x64 JDK
    //     on an M1-based MacBook using Rosetta).
    if (_core_region_alignment < 64*K) {
      log_info(cds)("Force core region alignment to 64K");
      _core_region_alignment = 64*K;
    }
#endif
  } else {

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

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


More information about the hotspot-runtime-dev mailing list