Skip to contentSkip to conversation

mm: Update validate_mm() to use vma iterator CONFIG flag

PATCH In review Liam R. Howlett 1 participant 2 messages Jun 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: Update validate_mm() to use vma iterator CONFIG flag

The validate_mm() function was deemed too heavy to enable with CONFIG_DEBUG_VM [1]. Revert the config option to CONFIG_DEBUG_VM_MAPLE_TREE

---

Andrew,

Please squash this into your mm-unstable commit e9c9b8e9753d ("mm:
update validate_mm() to use vma iterator")

 mm/mmap.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
mm/mmap.c +3 -6
index 71733953ff83..7c106a164c0f 100644
@@ -299,7 +299,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
 	return origbrk;
 }
 
-#if defined(CONFIG_DEBUG_VM)
+#if defined(CONFIG_DEBUG_VM_MAPLE_TREE)
 static void validate_mm(struct mm_struct *mm)
 {
 	int bug = 0;
@@ -307,10 +307,7 @@ static void validate_mm(struct mm_struct *mm)
 	struct vm_area_struct *vma;
 	VMA_ITERATOR(vmi, mm, 0);
 
-#if defined(CONFIG_DEBUG_VM_MAPLE_TREE)
 	mt_validate(&mm->mm_mt);
-#endif
-
 	for_each_vma(vmi, vma) {
 #ifdef CONFIG_DEBUG_VM_RB
 		struct anon_vma *anon_vma = vma->anon_vma;
@@ -353,9 +350,9 @@ static void validate_mm(struct mm_struct *mm)
 	VM_BUG_ON_MM(bug, mm);
 }
 
-#else /* !CONFIG_DEBUG_VM */
+#else /* !CONFIG_DEBUG_VM_MAPLE_TREE */
 #define validate_mm(mm) do { } while (0)
-#endif /* CONFIG_DEBUG_VM */
+#endif /* CONFIG_DEBUG_VM_MAPLE_TREE */
 
 /*
  * vma has some anon_vma assigned, and is already inserted on that
Signature · 1 line
2.39.2
#1 lore raw

Sorry, I should have added some more Cc's here.

Quoted 54 lines · Liam R. Howlett

The validate_mm() function was deemed too heavy to enable with CONFIG_DEBUG_VM [1]. Revert the config option to CONFIG_DEBUG_VM_MAPLE_TREE

---

Andrew,

Please squash this into your mm-unstable commit e9c9b8e9753d ("mm:
update validate_mm() to use vma iterator")

 mm/mmap.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
mm/mmap.c +3 -6
index 71733953ff83..7c106a164c0f 100644
@@ -299,7 +299,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
 	return origbrk;
 }
 
-#if defined(CONFIG_DEBUG_VM)
+#if defined(CONFIG_DEBUG_VM_MAPLE_TREE)
 static void validate_mm(struct mm_struct *mm)
 {
 	int bug = 0;
@@ -307,10 +307,7 @@ static void validate_mm(struct mm_struct *mm)
 	struct vm_area_struct *vma;
 	VMA_ITERATOR(vmi, mm, 0);
 
-#if defined(CONFIG_DEBUG_VM_MAPLE_TREE)
 	mt_validate(&mm->mm_mt);
-#endif
-
 	for_each_vma(vmi, vma) {
 #ifdef CONFIG_DEBUG_VM_RB
 		struct anon_vma *anon_vma = vma->anon_vma;
@@ -353,9 +350,9 @@ static void validate_mm(struct mm_struct *mm)
 	VM_BUG_ON_MM(bug, mm);
 }
 
-#else /* !CONFIG_DEBUG_VM */
+#else /* !CONFIG_DEBUG_VM_MAPLE_TREE */
 #define validate_mm(mm) do { } while (0)
-#endif /* CONFIG_DEBUG_VM */
+#endif /* CONFIG_DEBUG_VM_MAPLE_TREE */
 
 /*
  * vma has some anon_vma assigned, and is already inserted on that
Signature · 1 line
2.39.2