RFR: JDK-8322943: runtime/CompressedOops/CompressedClassPointers.java fails on AIX [v2]
Joachim Kern
jkern at openjdk.org
Thu Feb 15 13:38:04 UTC 2024
On Wed, 14 Feb 2024 16:45:05 GMT, Joachim Kern <jkern at openjdk.org> wrote:
>> Even after recent fixes like
>> https://bugs.openjdk.org/browse/JDK-8305765
>> the test runtime/CompressedOops/CompressedClassPointers.java fails on AIX.
>>
>> This error results from the fact, that on AIX the shmat() allocation granularity is 256MB instead of the standard Pagesize (4KB or 64KB).
>>
>> As a solution we introduce a new method `os::vm_shm_allocation_granularity()`, which on all platforms except AIX returns the same value as `os::vm_allocation_granularity()`, but on AIX it returns (in the apropriate cases) 256MB.
>>
>> This new getter is used at all needed places instead of `os::vm_allocation_granularity()`.
>
> Joachim Kern has updated the pull request incrementally with one additional commit since the last revision:
>
> following Goetz objections
While almost all platforms allow to mount shared memory (via `mmap()` or `shmat()`) at least at __SC_PAGE_SIZE_
boundaries (4k or 64k), AIX does only allow the allocation of `shmat()` memory at 256MiB boundaries. If `shmat()` on AIX is called with a wish address not at an 256MiB boundary, it fails.
`vm_allocation_granularity()` is initialized on all platforms with page_size (alias `os::vm_page_size()`). This has a value of 4K or 64K.
`vm_allocation_granularity()` is used at some places to generate the rules to compute the wish address for the allocation. Of course, on AIX we get in trouble, because this often misses the 256 MiB boundary.
So, I identified (hopefully) all places, where the `vm_allocation_granularity()` is used to finally generate the which address for a shared memory mount.
The goal is to replace all those occurrences of `vm_allocation_granularity()` by a new function `vm_shm_allocation_granularity()` with the following properties.
For all platforms except AIX `vm_shm_allocation_granularity()` returns the same value as `vm_allocation_granularity()`. So, the change is a NOP for all those platforms.
On AIX `vm_shm_allocation_granularity()` returns 256 MiB, when `shmat()` will be called and `os::vm_page_size()`, when `mmap()` will be called.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17708#issuecomment-1946108574
More information about the hotspot-runtime-dev
mailing list