RFR: 8262291: Refactor reserve_memory_special_huge_tlbfs [v4]

Stefan Johansson sjohanss at openjdk.java.net
Fri Mar 26 11:22:27 UTC 2021


On Thu, 25 Mar 2021 09:04:06 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Stefan Johansson has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Self review.
>>   
>>   Update helper name to better match commit_memory_special().
>
> src/hotspot/os/linux/os_linux.cpp line 3965:
> 
>> 3963:                                                    size_t alignment,
>> 3964:                                                    char* req_addr,
>> 3965:                                                    bool exec) {
> 
> So the contract is that this function will allocate huge paged memory with whatever page size is the default (controlled with UseLargePages and LargePageSizeInBytes).
> 
> And with Markus future changes we will mix-and-match page sizes best as we can. So, control of page size is out of the hands of the caller. Are there callers misusing alignment for page size?
> 
> Otherwise this seems fine to me.

Yes, right now we will only use a single large page size at a time. But using more than one (after Marcus change) need to take the alignment into account. As you know I have plans to do more changes in this area so that we can pass down what page size we want for a given reservation. But if we want to apply that change before everything else is in place I will suggest to use the alignment as an upper limit for the page size. 

A mixed mapping would still only use one large page size and then fill up with small pages. This is not optimal, but trying to mix and match even more will lead to a lot more error handling and if doing that it should be a separate change.

For cases where we only expect to use large pages (the old only case) the alignment is always set to `large_page_size` or larger.

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

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


More information about the hotspot-dev mailing list