RFR: 8334371: [AIX] Beginning with AIX 7.3 TL1 mmap() supports 64K memory pages [v3]
Thomas Stuefe
stuefe at openjdk.org
Wed Jun 19 15:56:12 UTC 2024
On Wed, 19 Jun 2024 12:13:42 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().
>
> Joachim Kern has updated the pull request incrementally with one additional commit since the last revision:
>
> delete not needed header files
src/hotspot/os/aix/os_aix.cpp line 102:
> 100: #ifndef MAP_ANON_64K
> 101: #define MAP_ANON_64K 0x400
> 102: #endif
Suggestion:
// sys/mman.h defines MAP_ANON_64K beginning with AIX7.3 TL1
#ifndef MAP_ANON_64K
#define MAP_ANON_64K 0x400
#else
STATIC_ASSERT(MAP_ANON_64K == 0x400);
#endif
That adds a test, for when you *do* have the MAP_ANON_64K constant, that your assumption about its value (0x400) is correct. Needs utilities/debug.hpp, but you should include that anyway.
src/hotspot/os/aix/os_aix.cpp line 231:
> 229: bool can_use_64K_pages; // True if we can alloc 64K pages dynamically with Sys V shm.
> 230: bool can_use_16M_pages; // True if we can alloc 16M pages dynamically with Sys V shm.
> 231: bool can_use_64K_mmap_pages;// True if we can alloc 64K pages dynamically with mmap.
nit: blank after semicolon
src/hotspot/os/aix/os_aix.cpp line 432:
> 430: IPC_CREAT | S_IRUSR | S_IWUSR);
> 431: assert(shmid != -1, "shmget failed");
> 432: if (shmid != -1) {
Ah, I see what you do here, you now want to handle shmid == -1 for the release build, because I wanted you to change guarantee->assert? Okay. That is very thorough.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19771#discussion_r1646432643
PR Review Comment: https://git.openjdk.org/jdk/pull/19771#discussion_r1646434936
PR Review Comment: https://git.openjdk.org/jdk/pull/19771#discussion_r1646440024
More information about the hotspot-runtime-dev
mailing list