On Tue, Jun 17, 2025 at 10:30:54PM -0700, Vivek Kasireddy wrote: > When we try to allocate a folio via alloc_hugetlb_folio_reserve(), > we need to ensure that there is an active reservation associated > with the allocation. Otherwise, our allocation request would fail > if there are no active reservations made at that moment against any > other allocations. This is because alloc_hugetlb_folio_reserve() > checks h->resv_huge_pages before proceeding with the allocation. > > Therefore, to address this issue, we just need to make a reservation > (by calling hugetlb_reserve_pages()) before we try to allocate the > folio. This will also ensure that proper region/subpool accounting is > done associated with our allocation.
I'm not really familiar with memfd code, but can't you make such reservation when you create the file in alloc_file? I see that you explicitly pass VM_NORESERVE. What's the reason for that? -- Oscar Salvador SUSE Labs
