On Sun Jun 2 15:34:51 2024 +0000, Vibhav Pant wrote:
Does it not? IMO, Windows seems to provide no control over the large page size, going so far as to restrict the size provided to `CreateFileMapping` and `VirtualAlloc` to be a multiple of `GetLargePageMiniumum()`, the minimum large page size supported by the processor. Contrast it with mmap (and memfd_create), which allow setting a configurable huge page size with MAP_HUGE_<SIZE>/`MAP_HUGE_SHIFT << log2(SIZE)`. As we ultimately use `mmap` to implement `VirtualAlloc`, the `MAP_HUGETLB` flag can be used to require that the pages be allocated on `hugetlbfs`, failing with `ENOMEM` if such an allocation is not possible.
From what I understand, THP support is ultimately immaterial here, as we're **requiring** a huge page allocation, rather than depending on `khugepaged`to compact `madvise`-ed ranges.