Skip to contentSkip to conversation

mm-add-rcu-annotation-to-pte_offset_map_lock.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Dec 19, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: add RCU annotation to pte_offset_map(_lock)
has been removed from the -mm tree. Its filename was
mm-add-rcu-annotation-to-pte_offset_map_lock.patch

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

------------------------------------------------------
From: Petr Malat <[email protected]>
Subject: mm: add RCU annotation to pte_offset_map(_lock)
Date: Tue, 10 Dec 2024 01:06:04 +0100

RCU lock is taken by ___pte_offset_map() unless it returns NULL. Add this information to its inline callers to avoid sparse warning about context imbalance in pte_unmap().

---

 include/linux/mm.h   |   13 +++++++++++--
 mm/pgtable-generic.c |    2 +-
 2 files changed, 12 insertions(+), 3 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-add-rcu-annotation-to-pte_offset_map_lock +11 -2
@@ -3010,7 +3010,15 @@ static inline void pagetable_pte_dtor(st
 	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
 }
 
-pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp);
+pte_t *___pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp);
+static inline pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr,
+			pmd_t *pmdvalp)
+{
+	pte_t *pte;
+
+	__cond_lock(RCU, pte = ___pte_offset_map(pmd, addr, pmdvalp));
+	return pte;
+}
 static inline pte_t *pte_offset_map(pmd_t *pmd, unsigned long addr)
 {
 	return __pte_offset_map(pmd, addr, NULL);
@@ -3023,7 +3031,8 @@ static inline pte_t *pte_offset_map_lock
 {
 	pte_t *pte;
 
-	__cond_lock(*ptlp, pte = __pte_offset_map_lock(mm, pmd, addr, ptlp));
+	__cond_lock(RCU, __cond_lock(*ptlp,
+			pte = __pte_offset_map_lock(mm, pmd, addr, ptlp)));
 	return pte;
 }
 
mm/pgtable-generic.c renamed from mm/pgtable-generic.c~mm-add-rcu-annotation-to-pte_offset_map_lock +1 -1
@@ -279,7 +279,7 @@ static unsigned long pmdp_get_lockless_s
 static void pmdp_get_lockless_end(unsigned long irqflags) { }
 #endif
 
-pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp)
+pte_t *___pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp)
 {
 	unsigned long irqflags;
 	pmd_t pmdval;

_

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