[jdk21u-dev] RFR: 8334371: [AIX] Beginning with AIX 7.3 TL1 mmap() supports 64K memory pages [v4]

Thomas Stuefe stuefe at openjdk.org
Tue Feb 4 07:32:17 UTC 2025


On Tue, 28 Jan 2025 09:28:32 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().
>> 
>> In this downport to jdk21 we want to support the new AIX 7.3 TL1 feature, but with some differences explained here:
>> - `static void query_multipage_support()` in `src/hotspot/os/aix/os_aix.cpp` 
>> The structure of the function was changed identically in head and jdk21. Because jdk21 beforehand used trcVerbose(...) and head beforehand used log_warning(pagesize)(...) this seems to be a difference, but I just kept the tracing functions as the were before.
>> 
>> - `src/hotspot/share/memory/virtualspace.cpp`
>> Adding the use of `os::Aix::supports_64K_mmap_pages()` introduces the dependency to the header `src/hotspot/os/aix/os_aix.hpp`. In head this header was included with `#include "runtime/os.inline.hpp"` beforehand by dependant code added after jdk21. Therefore I have to include `#include "runtime/os.inline.hpp" `explicitely in virtualspace.cpp.
>> 
>> - `src/hotspot/share/runtime/os.cpp`
>> Function  `char* os::attempt_reserve_memory_between()` does not exist in jdk21, so I do not have to port the adoptions of head there.
>> 
>> - `TEST_VM(os, aix_reserve_at_non_shmlba_aligned_address)` moved from `test/hotspot/gtest/runtime/test_os.cpp` to `test/hotspot/gtest/runtime/test_os_aix.cpp`
>> This test function does not exist in jdk21, so there is nothing to move.
>
> Joachim Kern has updated the pull request incrementally with one additional commit since the last revision:
> 
>   additionally headers

Patch looks good. Thanks for doing this.

After 20 years we can finally start reducing the crud around 64k page handling. If 64K page handling is ubiquitous, you will be able to throw out the System V shm allocation path, and all that vmem_xxx stuff we wrote 20 years ago.

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk21u-dev/pull/1362#pullrequestreview-2591944110


More information about the jdk-updates-dev mailing list