Skip to contentSkip to conversation

powerpc-8xx-document-and-enforce-that-split-pt-locks-are-not-used.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 2, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: powerpc/8xx: document and enforce that split PT locks are not used
has been removed from the -mm tree. Its filename was
powerpc-8xx-document-and-enforce-that-split-pt-locks-are-not-used.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: David Hildenbrand <[email protected]>
Subject: powerpc/8xx: document and enforce that split PT locks are not used
Date: Fri, 26 Jul 2024 17:07:28 +0200

Right now, we cannot have split PT locks because 8xx does not support SMP.

But for the sake of documentation *why* 8xx is fine regarding what we documented in huge_pte_lockptr(), let's just add code to enforce it at the same time as documenting it.

This should also make everybody who wants to copy from the 8xx approach of supporting such unusual ways of mapping hugetlb folios aware that it gets tricky once multiple page tables are involved.

Cc Alexander Viro <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Boris Ostrovsky <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Juergen Gross <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Mike Rapoport (Microsoft) <[email protected]>
Cc Muchun Song <[email protected]>
Cc "Naveen N. Rao" <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Peter Xu <[email protected]>
Cc Russell King <[email protected]>
Cc Thomas Gleixner <[email protected]>

---

 arch/powerpc/mm/pgtable.c |    6 ++++++
 1 file changed, 6 insertions(+)
arch/powerpc/mm/pgtable.c renamed from arch/powerpc/mm/pgtable.c~powerpc-8xx-document-and-enforce-that-split-pt-locks-are-not-used +6 -0
@@ -297,6 +297,12 @@ int huge_ptep_set_access_flags(struct vm
 }
 
 #if defined(CONFIG_PPC_8xx)
+
+#if defined(CONFIG_SPLIT_PTE_PTLOCKS) || defined(CONFIG_SPLIT_PMD_PTLOCKS)
+/* We need the same lock to protect the PMD table and the two PTE tables. */
+#error "8M hugetlb folios are incompatible with split page table locks"
+#endif
+
 static void __set_huge_pte_at(pmd_t *pmd, pte_t *ptep, pte_basic_t val)
 {
 	pte_basic_t *entry = (pte_basic_t *)ptep;

_

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

mm-rmap-use-folio-_mapcount-for-small-folios.patch mm-always-inline-_compound_head-with-config_hugetlb_page_optimize_vmemmap=y.patch selftests-mm-fix-charge_reserved_hugetlbsh-test.patch