Skip to contentSkip to conversation

mm-gup-cache-p4d-in-follow_p4d_mask.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 26, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/gup: cache p4d in follow_p4d_mask()
has been removed from the -mm tree. Its filename was
mm-gup-cache-p4d-in-follow_p4d_mask.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Peter Xu <[email protected]>
Subject: mm/gup: cache p4d in follow_p4d_mask()
Date: Mon, 18 Mar 2024 16:03:52 -0400

Add a variable to cache p4d in follow_p4d_mask(). It's a good practise to make sure all the following checks will have a consistent view of the entry.

Cc Alistair Popple <[email protected]>
Cc Andreas Larsson <[email protected]>
Cc "Aneesh Kumar K.V" <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Dave Hansen <[email protected]>
Cc David S. Miller <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Konrad Dybcio <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Mark Salter <[email protected]>
Cc "Matthew Wilcox (Oracle)" <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Mike Rapoport (IBM) <[email protected]>
Cc Muchun Song <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc "Naveen N. Rao" <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Russell King <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Will Deacon <[email protected]>

---

 mm/gup.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
mm/gup.c renamed from mm/gup.c~mm-gup-cache-p4d-in-follow_p4d_mask +7 -6
@@ -772,16 +772,17 @@ static struct page *follow_p4d_mask(stru
 				    unsigned int flags,
 				    struct follow_page_context *ctx)
 {
-	p4d_t *p4d;
+	p4d_t *p4dp, p4d;
 
-	p4d = p4d_offset(pgdp, address);
-	if (p4d_none(*p4d))
+	p4dp = p4d_offset(pgdp, address);
+	p4d = READ_ONCE(*p4dp);
+	if (p4d_none(p4d))
 		return no_page_table(vma, flags);
-	BUILD_BUG_ON(p4d_huge(*p4d));
-	if (unlikely(p4d_bad(*p4d)))
+	BUILD_BUG_ON(p4d_huge(p4d));
+	if (unlikely(p4d_bad(p4d)))
 		return no_page_table(vma, flags);
 
-	return follow_pud_mask(vma, address, p4d, flags, ctx);
+	return follow_pud_mask(vma, address, p4dp, flags, ctx);
 }
 
 /**

_

Patches currently in -mm which might be from [email protected] are

mm-userfaultfd-reset-ptes-when-close-for-wr-protected-ones.patch mm-hugetlb-assert-hugetlb_lock-in-__hugetlb_cgroup_commit_charge.patch mm-page_table_check-support-userfault-wr-protect-entries.patch