RFR: 8334371: [AIX] Beginning with AIX 7.3 TL1 mmap() supports 64K memory pages
Thomas Stuefe
stuefe at openjdk.org
Tue Jun 18 14:21:15 UTC 2024
On Tue, 18 Jun 2024 13:48:00 GMT, Joachim Kern <jkern at openjdk.org> wrote:
> Beginning with AIX 7.3 TL1 mmap() supports 64K memory pages. As an enhancement, during the initialization of the VM the availability of this new feature is examined. If the 64K pages are supported the VM will use mmap() with 64K pages instead of shmget()/shmat() with 64K pages due to the bad 256M alignment of shmget()/shmat().
At long last. Cool.
Once 7.3 is the minimum requirement, you can shake lose a lot of code here, all that old SystemV shm coding.
Small remarks, otherwise okay
src/hotspot/os/aix/os_aix.cpp line 458:
> 456: // Can we use mmap with 64K pages? (Should be available with AIX7.3 TL1)
> 457: {
> 458: void* p = mmap(NULL, 1000000, PROT_READ | PROT_WRITE, MAP_ANON_64K | MAP_ANONYMOUS | MAP_SHARED, -1, 0);
Weird size. Why 1mio decimal? Why not 64K?
src/hotspot/os/aix/os_aix.cpp line 459:
> 457: {
> 458: void* p = mmap(NULL, 1000000, PROT_READ | PROT_WRITE, MAP_ANON_64K | MAP_ANONYMOUS | MAP_SHARED, -1, 0);
> 459: guarantee0(p != (void*) -1); // Should always work.
I probably introduced those guarantee's myself many years ago, but we actually used guarantee very rarely, only for things that absolutely have to work, or the world explodes.
Here, there are a number of reasons why an mmap could fail, and you probably don't want to crash the VM with an guarantee at a customer site. I'd use assert.
test/hotspot/gtest/runtime/test_os.cpp line 47:
> 45: # define MAP_ANON_64K 0x400
> 46: # endif
> 47: #endif
Could you move the AIX-specific files out to something like test_os_aix.cpp, please? (same directory, just use ifdef AIX in the whole file). Its nicer, and precedence is there with the Cgroup tests of linux.
-------------
PR Review: https://git.openjdk.org/jdk/pull/19771#pullrequestreview-2125644541
PR Review Comment: https://git.openjdk.org/jdk/pull/19771#discussion_r1644540031
PR Review Comment: https://git.openjdk.org/jdk/pull/19771#discussion_r1644544689
PR Review Comment: https://git.openjdk.org/jdk/pull/19771#discussion_r1644550604
More information about the hotspot-runtime-dev
mailing list