Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 6d065f50 authored by Yuanyuan Zhong's avatar Yuanyuan Zhong Committed by Andrew Morton
Browse files

mm: /proc/pid/smaps_rollup: avoid skipping vma after getting mmap_lock again

After switching smaps_rollup to use VMA iterator, searching for next entry
is part of the condition expression of the do-while loop.  So the current
VMA needs to be addressed before the continue statement.

Otherwise, with some VMAs skipped, userspace observed memory
consumption from /proc/pid/smaps_rollup will be smaller than the sum of
the corresponding fields from /proc/pid/smaps.

Link: https://lkml.kernel.org/r/20240523183531.2535436-1-yzhong@purestorage.com
Fixes: c4c84f06

 ("fs/proc/task_mmu: stop using linked list and highest_vm_end")
Signed-off-by: default avatarYuanyuan Zhong <yzhong@purestorage.com>
Reviewed-by: default avatarMohamed Khalfella <mkhalfella@purestorage.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent eb85dace
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment