Skip to contentSkip to conversation

mm: /proc/pid/smaps_rollup: fix maple tree search

PATCH Applied Hugh Dickins 2 participants 2 messages Oct 19, 2022 – Oct 20, 2022

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

PATCH 1/1 mm: /proc/pid/smaps_rollup: fix maple tree search

/proc/pid/smaps_rollup showed 0 kB for everything: now find first vma.

Fixes c4c84f06285e ("fs/proc/task_mmu: stop using linked list and highest_vm_end")

---

 fs/proc/task_mmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/task_mmu.c +1 -1
@@ -902,7 +902,7 @@ static int show_smaps_rollup(struct seq_
 		goto out_put_mm;
 
 	hold_task_mempolicy(priv);
-	vma = mas_find(&mas, 0);
+	vma = mas_find(&mas, ULONG_MAX);
 
 	if (unlikely(!vma))
 		goto empty_set;
Reviewed-by on v1 1/1
#1 lore raw

Thanks Hugh. I guess this 'optimisation' was a little more aggressive and a little more buggy than needed.

Quoted 20 lines · Hugh Dickins

/proc/pid/smaps_rollup showed 0 kB for everything: now find first vma.

Fixes c4c84f06285e ("fs/proc/task_mmu: stop using linked list and highest_vm_end")

---

 fs/proc/task_mmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/task_mmu.c +1 -1
@@ -902,7 +902,7 @@ static int show_smaps_rollup(struct seq_
 		goto out_put_mm;
 
 	hold_task_mempolicy(priv);
-	vma = mas_find(&mas, 0);
+	vma = mas_find(&mas, ULONG_MAX);
 
 	if (unlikely(!vma))
 		goto empty_set;