RFR: 8364114: Test TestHugePageDecisionsAtVMStartup.java#LP_enabled fails when no free hugepage [v3]

SendaoYan syan at openjdk.org
Sat Jul 26 04:33:20 UTC 2025


> Hi all,
> 
> The test runtime/os/TestHugePageDecisionsAtVMStartup.java#LP_enabled will fails when there is no free hugepases.
> The /proc/meminfo and /sys/kernel/mm/hugepages/hugepages-*/free_hugepages says there is no free hugepage, and the JVM output also say there is available large page.
> 
> 
>> cat /proc/meminfo | grep -i HugePages
> AnonHugePages:         0 kB
> ShmemHugePages:        0 kB
> FileHugePages:         0 kB
> HugePages_Total:       2
> HugePages_Free:        0
> HugePages_Rsvd:        0
> HugePages_Surp:        2
> Hugepagesize:       2048 kB
> 
>> ( set -x ; cat /sys/kernel/mm/hugepages/hugepages-*/free_hugepages )
> + cat /sys/kernel/mm/hugepages/hugepages-1048576kB/free_hugepages /sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages
> 0
> 0
> 
> JVM output snippet from java -XX:+UseLargePages -Xlog:pagesize -version
> [0.001s][info][pagesize] Large page size (2M) failed sanity check, checking if smaller large page sizes are usable
> [0.001s][warning][pagesize] UseLargePages disabled, no large pages configured and available on the system.
> 
> 
> The JVM can not use large page when there is no available large page on system, it's not a JVM bug. So I think it's not suitable to report test failure, but report SkippedException.
> 
> Change has been verified locally, test report SkippedException on the system without free hugepage, the test passes on the system with free hugepage. Test-fix only, risk is low.

SendaoYan has updated the pull request incrementally with one additional commit since the last revision:

  Make explicitAvailableHugePageNumber as a member of HugePageConfiguration

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/26480/files
  - new: https://git.openjdk.org/jdk/pull/26480/files/b2c096fa..4e0c9a7a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26480&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26480&range=01-02

  Stats: 14 lines in 2 files changed: 10 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/26480.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26480/head:pull/26480

PR: https://git.openjdk.org/jdk/pull/26480


More information about the hotspot-runtime-dev mailing list