RFR: 8319795: Static huge pages are not used for CodeCache [v8]

Thomas Stuefe stuefe at openjdk.org
Tue Dec 19 16:24:53 UTC 2023


On Thu, 7 Dec 2023 15:36:03 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:

>> This is a fix of a regression introduced by [JDK-8261894](https://bugs.openjdk.org/browse/JDK-8261894).
>> After JDK-8261894, `os::can_execute_large_page_memory()` returns `true` only if `UseTransparentHugePages` is true. As CodeCache uses `os::can_execute_large_page_memory()` when it detects a page size, CodeCache cannot use static huge pages (`UseTransparentHugePages` is `false`) anymore after the change.
>> Before JDK-8261894, `os::can_execute_large_page_memory()` returned `true`  when either `UseTransparentHugePages` or `UseHugeTLBFS` was true.
>> 
>> After JDK-8261894, `XX:+UseLargePages XX:-UseTransparentHugePages` means to use static huge pages: aka `UseHugeTLBFS` is `true`. If `UseLargePages` is not set to `true` via the option, it will be set to `true` if `UseTransparentHugePages` is `true`.
>> 
>> `os::can_execute_large_page_memory()` is modified to return `UseLargePages`. A regression gtest  is added.
>> 
>> Tested fastdebug and release builds:
>> - [x] tier1
>> - [x] gtest
>> - [x] test/hotspot/jtreg/gtest/LargePageGtests.java
>
> Evgeny Astigeevich has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision:
> 
>  - Remove compiler/codecache/CheckLargePages.java from problem list
>  - Add new tests
>  - Merge branch 'master' into JDK-8319795
>  - Fix support of explicit huge pages
>  - Revert "Refactor CodeCache init code for better support of different memory page sizes"
>    
>    This reverts commit 5416895d565923b7689b3059af68bd9011c61705.
>  - Revert "Add missing include"
>    
>    This reverts commit c35739fccf05c12969083d5c14c3750b5920fc21.
>  - Revert "Align ReservedCodeCacheSize to max(preferred page size, os::vm_allocation_granularity())"
>    
>    This reverts commit f495310ef48791d851ef37eb3fb1d559dabf329e.
>  - Revert "Fix code heap sizes to be multiple of rs.alignment()"
>    
>    This reverts commit 41cc20b2e488647468de009d13085ea7882d5437.
>  - Revert "Fix code heap initial sizes to be multiple of rs.alignment()"
>    
>    This reverts commit 17c42cddd220a0f47f8b944271d9b96b32e51b59.
>  - Fix code heap initial sizes to be multiple of rs.alignment()
>  - ... and 7 more: https://git.openjdk.org/jdk/compare/618424ab...f6d181d8

The code itself is ok and a nice simplification. I have questions about the test, see below.

test/hotspot/jtreg/compiler/codecache/CheckLargePages.java line 72:

> 70:         OutputAnalyzer out = new OutputAnalyzer(pb.start());
> 71:         out.shouldMatch("Code cache size too small for \\S* pages\\. Reverting to smaller page size \\((\\S*)\\)\\.");
> 72:         out.shouldHaveExitValue(0);

I don't get this.

The new version (which I like, btw) now assumes min_pages=1 if InitialCCS == ReservedCCS. Should this not then work? I would have expected to get a code cache with 2x1G pages. I would not have expected a "code cache size too small" warning.

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

PR Review: https://git.openjdk.org/jdk/pull/16582#pullrequestreview-1789258269
PR Review Comment: https://git.openjdk.org/jdk/pull/16582#discussion_r1431646541


More information about the hotspot-runtime-dev mailing list