On 19.11.24 14:29, Dmitry Dolgov wrote:
>> I see that memfd_create() has a MFD_HUGETLB flag. It's not very clear how
>> that interacts with the MAP_HUGETLB flag for mmap(). Do you need to specify
>> both of them if you want huge pages?
> Correct, both (one flag in memfd_create and one for mmap) are needed to
> use huge pages.
I was worried because the FreeBSD man page says
MFD_HUGETLB This flag is currently unsupported.
It looks like FreeBSD doesn't have MAP_HUGETLB, so maybe this is irrelevant.
But you should make sure in your patch that the right set of flags for
huge pages is passed.