Re: [PATCH v6 3/5] mm/gup: Introduce memfd_pin_user_pages() for pinning memfd pages (v6)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +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>






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux