> +struct page *memfd_alloc_page(struct file *memfd, pgoff_t idx) > +{ > +#ifdef CONFIG_HUGETLB_PAGE > + struct folio *folio; > + int err; > + > + if (is_file_hugepages(memfd)) { > + folio = alloc_hugetlb_folio_nodemask(hstate_file(memfd), > + NUMA_NO_NODE, > + NULL, > + GFP_USER); > + if (folio && folio_try_get(folio)) { > + err = hugetlb_add_to_page_cache(folio, If alloc_hugetlb_folio_nodemask moved out of the CONFIG_HUGETLB_PAGE ifdef, the ifdef here could go away. Either way, this looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>