[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240403013249.1418299-3-peterx@redhat.com>
Date: Tue, 2 Apr 2024 21:32:48 -0400
From: peterx@...hat.com
To: linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: Huacai Chen <chenhuacai@...nel.org>,
peterx@...hat.com,
David Hildenbrand <david@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>,
Nathan Chancellor <nathan@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Matthew Wilcox <willy@...radead.org>,
WANG Xuerui <kernel@...0n.name>,
Ryan Roberts <ryan.roberts@....com>,
loongarch@...ts.linux.dev
Subject: [PATCH 2/3] fixup! mm/gup: handle huge pmd for follow_pmd_mask()
From: Peter Xu <peterx@...hat.com>
Allow follow_pmd_mask() to take hugetlb tail pages. The old warnings do
not help now as hugetlb now allows it to happen, so drop them.
Reported-by: Ryan Roberts <ryan.roberts@....com>
Signed-off-by: Peter Xu <peterx@...hat.com>
---
mm/gup.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/mm/gup.c b/mm/gup.c
index 91d70057aea0..d60b63fcfc82 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -775,8 +775,6 @@ static struct page *follow_huge_pmd(struct vm_area_struct *vma,
assert_spin_locked(pmd_lockptr(mm, pmd));
page = pmd_page(pmdval);
- VM_BUG_ON_PAGE(!PageHead(page) && !is_zone_device_page(page), page);
-
if ((flags & FOLL_WRITE) &&
!can_follow_write_pmd(pmdval, page, vma, flags))
return NULL;
@@ -805,7 +803,6 @@ static struct page *follow_huge_pmd(struct vm_area_struct *vma,
page += (addr & ~HPAGE_PMD_MASK) >> PAGE_SHIFT;
ctx->page_mask = HPAGE_PMD_NR - 1;
- VM_BUG_ON_PAGE(!PageCompound(page) && !is_zone_device_page(page), page);
return page;
}
--
2.44.0
Powered by blists - more mailing lists