RFR: 8312180: (bf) MappedMemoryUtils passes incorrect arguments to msync (aix)
Tyler Steele
tsteele at openjdk.org
Tue Jul 18 15:33:13 UTC 2023
On Mon, 17 Jul 2023 17:21:01 GMT, Tyler Steele <tsteele at openjdk.org> wrote:
> Calls to `msync` on AIX require the length to be a multiple of a specific pagesize which may not be the same as the one returned by `Bits.pageSize()`, as explained in the JBS issue description.
>
>> EINVAL The addr argument is not a multiple of the page size as **returned by the sysconf subroutine using the _SC_PAGE_SIZE value for the Name parameter**, ...
> [emphasis added by me]
>
> By adding this as platform dependant code, the correct value of page size is used on AIX. Other Unix platforms should see no change by calling sysconf instead of Bits.pagesize. Windows is unchanged.
@bplb and @AlanBateman there's a bit more info in the JBS issue. I encourage you to take another look there too.
> How many page sizes are you dealing with on AIX[?]
Just two!
> what does Unsafe::pageSize return vs. sysconf(_SC_PAGESIZE)[?]
It boils down to [Dynamic Variable Page Sizes](https://www.ibm.com/docs/en/aix/7.2?topic=support-dynamic-variable-page-size), which is an AIX feature. The larger page size returned by Unsafe::pageSize is the system page size (by default 64 KiB). The page size required by msync (and returned by sysconf(_SC_PAGESIZE) is the fine-grained page size (by default 4 KiB).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14904#issuecomment-1640454917
More information about the nio-dev
mailing list