RFR: 8334371: [AIX] Beginning with AIX 7.3 TL1 mmap() supports 64K memory pages
Joachim Kern
jkern at openjdk.org
Tue Jun 18 15:04:12 UTC 2024
On Tue, 18 Jun 2024 14:11:21 GMT, Thomas Stuefe <stuefe 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().
>
> 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?
OK, I will use 64*K
> 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.
And what about the other guarantees in the same function after shmget() or shmat()?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19771#discussion_r1644619149
PR Review Comment: https://git.openjdk.org/jdk/pull/19771#discussion_r1644621596
More information about the hotspot-runtime-dev
mailing list