Re: [PATCH v4 0/7] read proc/pid/smaps_rollup under per-vma lock
From: Paul E. McKenney
Date: Sat Sep 12 2026 - 14:58:41 EST
On Sat, Sep 12, 2026 at 12:24:36AM -0700, Andrew Morton wrote:
> On Fri, 11 Sep 2026 12:41:38 -0700 Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote:
>
> > proc/pid/smaps_rollup can be read using the combination of RCU and
> > VMA read locks, similar to proc/pid/{maps|smaps|numa_maps}. RCU is
> > required to safely traverse the VMA tree and VMA lock stabilizes the
> > VMA being processed and the pagetable walk.
> > Note that we have to keep the logic to drop mmap_lock on contention
> > because even when using per-VMA locks we might have to fall back to
> > holding the mmap_lock.
>
> Nice. Queued, thanks.
>
> The speedups described in [6/7] are significant, although I don't know
> how representative Paul's tests are. Probably not very.
>
> So I don't know how much improvement our users will be seeing from
> these changes?
>
> And I don't know how much usage smaps_rollup gets in the real world?
It is used heavily in some applications for monitoring. This should allow
us to more tightly fence our monitoring software, leaving more CPU for
the application.
So thank you all!!!
Thanx, Paul
> As I've no doubt you know, Sashiko is saying things. About these
> patches and about the current code. Its pre-existing
> clear_soft_dirty_pmd() driveby find looks significant.
>
> https://sashiko.dev/#/patchset/20260911194145.1781926-1-surenb@xxxxxxxxxx