Integrated: 8343153: compiler/codecache/CheckLargePages.java fails on linux with huge pages configured but its number set to 0

Damon Fenacci dfenacci at openjdk.org
Mon Nov 4 07:36:36 UTC 2024


On Tue, 29 Oct 2024 10:54:31 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:

> # Issue
> 
> The third test of `compiler/codecache/CheckLargePages.java` checks that non-segmented 1GB code cache can be allocated with 1GB large pages.
> 
> On linux (the only supported platform) in order to allocate them, 1GB huge pages have to be enabled (checkable from `/proc/meminfo` and `/sys/kernel/mm/hugepages/hugepages-xxxx`) and their number has to be set to >0 (checkable from `/sys/kernel/mm/hugepages/hugepages-xxxx/nr_hugepages`).
> 
> If 1GB huge pages are enabled but their number is 0, the test fails because it looks for a string that matches `CodeCache: min=1[gG] max=1[gG] base=[^ ]+ size=1[gG] page_size=1[gG]` but the actual output is `CodeCache: min=1G max=1G base=0x00007f4040000000 size=1G page_size=2M`. This happens because the VM tries to allocate 1GB huge pages but it fails beause the number of allocatable ones is 0 and the VM reverts to smaller large page sizes (2MB).
> 
> # Solution
> 
> The problem might be attributed to the VM only checking for 1GB huge pages to be supported, not how many there currently are. Nevertheless, this seems to be the correct behaviour, not least because their number can be changed dynamically.
> So, the correct thing to do seems to be to "relax" the check made by the test to include both cases:
> * when 1GB huge pages are supported and can be allocated correctly
> * when 1GB huge pages are supported but cannot be allocated correctly (because there are none available) and the VM reverts to 2MB huge pages (if there are no 2MB pages available the test doesn't run at all).

This pull request has now been integrated.

Changeset: e7f0bf11
Author:    Damon Fenacci <dfenacci at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e7f0bf11ff0e89b6b156d5e88ca3771c706aa46a
Stats:     24 lines in 2 files changed: 20 ins; 1 del; 3 mod

8343153: compiler/codecache/CheckLargePages.java fails on linux with huge pages configured but its number set to 0

Reviewed-by: eastigeevich, thartmann

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

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


More information about the hotspot-compiler-dev mailing list