Re: [RFC PATCH 0/5] mm/mglru: walk page tables under per-VMA locks
From: Zicheng Wang
Date: Fri Dec 04 2026 - 05:39:21 EST
Hi Suren, Chuanhua, Lorenzo,
We hit the same stalls (140-250ms mmap/munmap/mprotect waits on
SurfaceFlinger and Launcher) and have a measurement that may be
relevant to the try_lock_next_vma() direction.
In 3 dogfood user traces we picked for this problem, each with janky
frames over 500ms, a direct reclaim task doing the aging walk holds
mmap_lock for 140-250ms. Over 99% of that hold is spent runnable,
waiting to be scheduled; the aging walk itself runs for less than 1ms.
Each trace has thousands of direct reclaim events inside the jank window.
A finer lock narrows who waits, but not how long. The walker runs with
preemption enabled while holding the lock, so a round can be preempted
mid-way and the lock is then held for the whole scheduling delay.
Since the aging walk itself is already fast (<1ms), could we simply
disable preemption during the walk's lock-hold window instead of
changing the lock? We are testing a ~60-line prototype (no new lock or API)
and will send the patch and data separately—mainly wondering whether
you would prefer bounding that non-preemptible window at PUD or PMD
granularity.
Polished-by: LLM :)
Thanks,
Zicheng