* [PATCH] Revert "mm: migration: fix the FOLL_GET failure on following huge page"
@ 2022-11-09 8:40 Baolin Wang
2022-11-09 11:36 ` Wang, Haiyue
0 siblings, 1 reply; 2+ messages in thread
From: Baolin Wang @ 2022-11-09 8:40 UTC (permalink / raw)
To: akpm
Cc: haiyue.wang, ying.huang, mike.kravetz, songmuchun, baolin.wang,
linux-mm, linux-kernel
Revert commit 831568214883 ("mm: migration: fix the FOLL_GET failure on
following huge page"), since after commit 1a6baaa0db73 ("s390/hugetlb:
switch to generic version of follow_huge_pud()") and commit 57a196a58421
("hugetlb: simplify hugetlb handling in follow_page_mask") were merged,
now all the following huge page routines can support FOLL_GET operation.
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
mm/migrate.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index 1317e5c..53af072 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1908,7 +1908,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;
@@ -1917,12 +1916,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))
@@ -1935,8 +1930,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;
--
1.8.3.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] Revert "mm: migration: fix the FOLL_GET failure on following huge page"
2022-11-09 8:40 [PATCH] Revert "mm: migration: fix the FOLL_GET failure on following huge page" Baolin Wang
@ 2022-11-09 11:36 ` Wang, Haiyue
0 siblings, 0 replies; 2+ messages in thread
From: Wang, Haiyue @ 2022-11-09 11:36 UTC (permalink / raw)
To: Baolin Wang, akpm
Cc: Huang, Ying, mike.kravetz, songmuchun, linux-mm, linux-kernel
> -----Original Message-----
> From: Baolin Wang <baolin.wang@linux.alibaba.com>
> Sent: Wednesday, November 9, 2022 16:40
> To: akpm@linux-foundation.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; Huang, Ying <ying.huang@intel.com>; mike.kravetz@oracle.com;
> songmuchun@bytedance.com; baolin.wang@linux.alibaba.com; linux-mm@kvack.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] Revert "mm: migration: fix the FOLL_GET failure on following huge page"
>
> Revert commit 831568214883 ("mm: migration: fix the FOLL_GET failure on
> following huge page"), since after commit 1a6baaa0db73 ("s390/hugetlb:
> switch to generic version of follow_huge_pud()") and commit 57a196a58421
> ("hugetlb: simplify hugetlb handling in follow_page_mask") were merged,
> now all the following huge page routines can support FOLL_GET operation.
>
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> ---
Cool, thanks, my ugly code is gone. ;-)
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
> mm/migrate.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-09 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 8:40 [PATCH] Revert "mm: migration: fix the FOLL_GET failure on following huge page" Baolin Wang
2022-11-09 11:36 ` Wang, Haiyue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox