Re: [PATCH] mm: proc/task_mmu: Use walk_page_range_vma() for smaps
From: Andrew Morton
Date: Tue Jul 21 2026 - 22:44:10 EST
On Tue, 21 Jul 2026 05:19:02 +0000 kaleshsingh@xxxxxxxxxx wrote:
> From: Kalesh Singh <kaleshsingh@xxxxxxxxxx>
>
> Modify smap_gather_stats() to use walk_page_range_vma() instead of
> walk_page_range() when walking page tables.
>
> walk_page_range() internally calls find_vma(), which asserts that
> mmap_lock is held. This assertion fails when reading /proc/pid/smaps
> under per-VMA locks (where mmap_lock is not held).
So the kernel is emitting a WARN trace under some situation?
I'm surprised. The offending patch is only six weeks old, but we'd
normally hear about this very promptly. Is a bug report available
somewhere?
> walk_page_range_vma() walks a range within a single VMA and does not
> use find_vma(). It relies on the VMA lock instead (when configured
> with PGWALK_VMA_RDLOCK_VERIFY), making it compatible with per-VMA
> locks.
Sashiko said a thing:
https://sashiko.dev/#/patchset/20260721051903.691848-1-kaleshsingh@xxxxxxxxxx