Re: [RFC PATCH] mm: only set fault addrsss' access bit in do_anonymous_page
From: David Hildenbrand (Arm)
Date: Fri Feb 13 2026 - 04:08:11 EST
On 2/13/26 10:02, Wenchao Hao wrote:
On Thu, Feb 12, 2026 at 4:54 PM David Hildenbrand (Arm)
<david@xxxxxxxxxx> wrote:
On 2/12/26 02:57, Wenchao Hao wrote:
On Wed, Feb 11, 2026 at 5:05 PM David Hildenbrand (Arm)
<david@xxxxxxxxxx> wrote:
Thanks for your explanation. I now understand the design logic.
What I’m proposing is mainly for debugging. After enabling 64K large folio
on Android, we observed increased application memory footprint, especially
for anonymous pages.
Since Android app memory usage depends on runtime scenarios, we cannot
confirm if the growth is directly caused by large folio. We want to
analyze memory
usage via the `Referenced` field in `/proc/[pid]/smaps`.
Scanning for zero-filled pages will be much easier and more reliable.
For a debug feature good enough.
I'm wondering what the best interface for something like that could be:
we don't want to make "/proc/[pid]/smaps" slower for all users.
Maybe we could for debug kernels.
For example, adding with CONFIG_DEBUG_KERNEL a new entry
Anon_Zero:
counter that just tests whether the page content of an anonymous page is
all zeroes could be doable.
Apologies for the delayed reply – I was just writing a demo to verify the
approach you mentioned.
Using the CONFIG_DEBUG_KERNEL compile-time macro to isolate this feature
is indeed an excellent idea.
However, in engineering practice, it requires recompiling and
replacing the kernel,
which can be cumbersome. Could we instead use a dynamic switch to control
whether scan for zero-filled pages when reading /proc/[pid]/smaps?
Maybe a kernel cmdline option could do? Selectively enabling it for some PIDs only is not really possible, but also, maybe it's not really needed.
--
Cheers,
David