Commit 16fd6b31 authored by Baolin Wang's avatar Baolin Wang Committed by Andrew Morton

Revert "mm: migration: fix the FOLL_GET failure on following huge page"

Revert commit 83156821 ("mm: migration: fix the FOLL_GET failure on
following huge page"), since after commit 1a6baaa0 ("s390/hugetlb:
switch to generic version of follow_huge_pud()") and commit 57a196a5
("hugetlb: simplify hugetlb handling in follow_page_mask") were merged,
now all the following huge page routines can support FOLL_GET operation.

Link: https://lkml.kernel.org/r/496786039852aba90ffa68f10d0df3f4236a990b.1667983080.git.baolin.wang@linux.alibaba.comSigned-off-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: default avatarHaiyue Wang <haiyue.wang@intel.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent c66b6ead
......@@ -1899,7 +1899,6 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
for (i = 0; i < nr_pages; i++) {
unsigned long addr = (unsigned long)(*pages);
unsigned int foll_flags = FOLL_DUMP;
struct vm_area_struct *vma;
struct page *page;
int err = -EFAULT;
......@@ -1908,12 +1907,8 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
if (!vma)
goto set_status;
/* Not all huge page follow APIs support 'FOLL_GET' */
if (!is_vm_hugetlb_page(vma))
foll_flags |= FOLL_GET;
/* FOLL_DUMP to ignore special (like zero) pages */
page = follow_page(vma, addr, foll_flags);
page = follow_page(vma, addr, FOLL_GET | FOLL_DUMP);
err = PTR_ERR(page);
if (IS_ERR(page))
......@@ -1926,8 +1921,7 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
if (!is_zone_device_page(page))
err = page_to_nid(page);
if (foll_flags & FOLL_GET)
put_page(page);
put_page(page);
set_status:
*status = err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment