RFR: 8273872: ZGC: Explicitly use 2M large pages [v4]
Per Liden
pliden at openjdk.java.net
Fri Sep 17 07:50:47 UTC 2021
On Thu, 16 Sep 2021 13:48:44 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> I don't think we should be passing `MAP_*` flags to `memfd_create()` as there's no guarantee that `MAP_HUGE_2MB` and `MFD_HUGE_2MB` are the same values. It's more of a lucky/convenient implementation detail that they happen to be the same.
>
> The manpages explicitly mention that the calculation is the same:
>> MFD_HUGE_2MB, MFD_HUGE_1GB, ...
>> Used in conjunction with MFD_HUGETLB to select alternative
>> hugetlb page sizes (respectively, 2 MB, 1 GB, ...) on
>> systems that support multiple hugetlb page sizes.
>> Definitions for known huge page sizes are included in the
>> header file <linux/memfd.h>.
>>
>> For details on encoding huge page sizes not included in
>> the header file, see the discussion of the similarly named
>> constants in mmap(2).
>
> I.e. this is specified that way.
Ok. I think I'll stick with an explicit `MFD_HUGE_2MB` since that's always what we want to use.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5541
More information about the hotspot-dev
mailing list