RFR: 8312180: (bf) MappedMemoryUtils passes incorrect arguments to msync (aix)

Brian Burkhalter bpb at openjdk.org
Tue Jul 18 15:42:13 UTC 2023


On Tue, 18 Jul 2023 15:33:59 GMT, Tyler Steele <tsteele at openjdk.org> wrote:

>> src/java.base/share/classes/java/nio/MappedMemoryUtils.java line 172:
>> 
>>> 170:     private static int pageSize() {
>>> 171:         int ps = pageSize0();
>>> 172:         if (ps > 0) {
>> 
>> If `sysconf(_SC_PAGESIZE)` returns a value different from `Bits::pageSize` on other Unix platforms, this could cause an unexpected change in behavior.
>
> Agreed. However, my thinking was that on systems with only one pagesize the size returned by sysconf is still the correct size to return. There is no need to pop back to the VM and trigger another call (to Bits.pageSize).

The risk is still non-zero. Calling `Bits::pageSize` does not pop back to the VM, it just returns the already injected constant.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14904#discussion_r1266964200


More information about the nio-dev mailing list