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]

 



Hi,

> > +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.
Unlike alloc_hugetlb_folio_nodemask(), hugetlb_add_to_page_cache() does not
get exposed without enabling CONFIG_HUGETLB_PAGE.

> 
> Either way, this looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Thank you for the review.

Thanks,
Vivek
> 
> 





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux