[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR11MB349546A36F2AE9C82E85EF71F7699@BYAPR11MB3495.namprd11.prod.outlook.com>
Date: Sun, 14 Aug 2022 06:20:13 +0000
From: "Wang, Haiyue" <haiyue.wang@...el.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"david@...hat.com" <david@...hat.com>,
"linmiaohe@...wei.com" <linmiaohe@...wei.com>,
"Huang, Ying" <ying.huang@...el.com>,
"songmuchun@...edance.com" <songmuchun@...edance.com>,
"naoya.horiguchi@...ux.dev" <naoya.horiguchi@...ux.dev>
Subject: RE: [PATCH v1] mm: migration: fix the FOLL_GET failure on following
huge page
> -----Original Message-----
> From: Andrew Morton <akpm@...ux-foundation.org>
> Sent: Sunday, August 14, 2022 07:29
> To: Wang, Haiyue <haiyue.wang@...el.com>
> Cc: linux-mm@...ck.org; linux-kernel@...r.kernel.org; david@...hat.com; linmiaohe@...wei.com; Huang,
> Ying <ying.huang@...el.com>; songmuchun@...edance.com; naoya.horiguchi@...ux.dev
> Subject: Re: [PATCH v1] mm: migration: fix the FOLL_GET failure on following huge page
>
> On Fri, 12 Aug 2022 16:49:21 +0800 Haiyue Wang <haiyue.wang@...el.com> wrote:
>
> > Not all huge page APIs support FOLL_GET option, so the __NR_move_pages
> > will fail to get the page node information for huge page.
>
> Which ones need fixing?
1. 'follow_huge_pud' arch/s390/mm/hugetlbpage.c
2. 'follow_huge_addr' arch/ia64/mm/hugetlbpage.c
3. 'follow_huge_pgd' mm/hugetlb.c
And I found that only 'pud' and 'pmd' need to check 'is_vm_hugetlb_page' like:
pud_huge(*pud) && is_vm_hugetlb_page(vma)
pmd_huge(pmdval) && is_vm_hugetlb_page(vma)
So I'm not sure whether my patch can cover 2 & 3 for other huge page use cases
except by hugetlbfs.
>
> What are the user-visible runtime effects of this bug?
>
In my test, the '__NR_move_pages' system call will return '-2' for 1GB huge page
memory map when dump the page node information. [Test on linux-5.19 stable]
> Is a -stable backport warranted?
Yes.
Since the mainline has introduced the new patch:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3218f8712d6bb
The backported needs to rebase like for 5.19:
- if (page && !is_zone_device_page(page)) {
+ if (page) {
>
> > This is an temporary solution to mitigate the racing fix.
> >
> > After supporting follow huge page by FOLL_GET is done, this fix can be
> > reverted safely.
> >
Powered by blists - more mailing lists