RFR: JDK-8256155: os::Linux Populate all large_page_sizes, select smallest page size in reserve_memory_special_huge_tlbfs* [v15]

Ivan Walulya iwalulya at openjdk.java.net
Mon Jan 18 12:20:52 UTC 2021


On Mon, 18 Jan 2021 11:44:13 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Marcus G K Williams has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 23 commits:
>> 
>>  - Merge branch 'master' into update_hlp
>>  - Merge branch 'master' into update_hlp
>>  - Remove extraneous ' from warning
>>    
>>    Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
>>  - Merge branch 'master' into update_hlp
>>  - Merge branch 'master' into update_hlp
>>  - Merge branch 'master' into update_hlp
>>  - Fix os::large_page_size() in last update
>>    
>>    Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
>>  - Ivan W. Requested Changes
>>    
>>    Removed os::Linux::select_large_page_size and
>>    use os::page_size_for_region instead
>>    
>>    Removed Linux::find_large_page_size and use
>>    register_large_page_sizes. Streamlined
>>    Linux::setup_large_page_size
>>    
>>    Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
>>  - Fix space format, use Linux:: for local func.
>>    
>>    Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
>>  - Merge branch 'update_hlp' of github.com:mgkwill/jdk into update_hlp
>>  - ... and 13 more: https://git.openjdk.java.net/jdk/compare/da2415fe...d73e7a4c
>
> src/hotspot/os/linux/os_linux.cpp line 3746:
> 
>> 3744:       if (page_size * K > (size_t)Linux::page_size()) {
>> 3745:           // Add each found Large Page Size to _page_sizes
>> 3746:           _page_sizes.add(page_size * K);
> 
> Just realized one more thing, with this code we will enable all page sizes configured even if there are no pages "allocated" for the given size. 
> 
> Is that what we want or should we read the file nr_hugepages in the given director and only add it if the size is > 0?

I think a more complete solution is to check the nr_hugepages. Additionally, this will be required by the solution you propose above that would consider "largest possible page size with enough pages free".

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

PR: https://git.openjdk.java.net/jdk/pull/1153



More information about the hotspot-gc-dev mailing list