Question: 8324776: How to safely tell if MADV_POPULATE_WRITE is supported
Patrick Zhang OS
patrick at os.amperecomputing.com
Wed Feb 21 15:25:22 UTC 2024
Hi,
I have a question regarding the regression reported by [1] which was caused by the commit [2].
The root cause can be briefly described as: MADV_POPULATE_WRITE has been supported since Linux 5.14. It is suggested to call madvise(0, 0, advice) to tell if this madvise mode is valid, which "will return zero iff advice is supported by the kernel and can be relied on to probe for support" [3]. However Oracle UEKR6 5.4.17 has a duplicate definition of the number 23: MADV_DONTEXEC [4]. As a result, the test passes on Linux 5.4 mainline, while fails on UEK 5.4.17, because madvise(0, 0, 23) gives different return values. See details at [5].
It is a dilemma that how to fix so inside JVM. Thanks for any advice.
[1] https://bugs.openjdk.org/browse/JDK-8324776 runtime/os/TestTransparentHugePageUsage.java fails with The usage of THP is not enough
[2] https://bugs.openjdk.org/browse/JDK-8315923 pretouch_memory by atomic-add-0 fragments huge pages unexpectedly
[3] https://www.man7.org/linux/man-pages/man2/madvise.2.html
[4] https://yum.oracle.com/repo/OracleLinux/OL8/developer/UEKR6/aarch64/getPackageSource/kernel-uek-5.4.17-2136.327.2.el8uek.src.rpm, linux-5.4.17/include/uapi/asm-generic/mman-common.h#L75
[5] https://bugs.openjdk.org/browse/JDK-8324776?focusedId=14651275&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14651275.
Regards
Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20240221/221ee6a5/attachment.htm>
More information about the hotspot-gc-dev
mailing list