Re: [PATCH] mm: Add AnonZero accounting for zero-filled anonymous pages

From: David Hildenbrand (Arm)

Date: Mon Feb 16 2026 - 07:20:20 EST


On 2/16/26 12:58, Kiryl Shutsemau wrote:
On Mon, Feb 16, 2026 at 12:45:13PM +0100, David Hildenbrand (Arm) wrote:
On 2/16/26 12:34, Kiryl Shutsemau wrote:

I expect it to slowdown /proc/pid/smaps read substantially. I don't
think this line in smaps worth it.


That's why it's enabled through a command line parameter.

One users want the stat and all users on the machine pay the price?
That's a poor trade off.


It's a debug mechanism as stated in the patch description.

Similar to CONFIG_DEBUG_VM slowing your machine down.

In general, smaps scales poorly. It collects a lot of stats and most of
them are ignored by user. We need something like statx(2) where user can
declare what he is interested in, so kernel won't waste cycles.

Kernel cmdline parameter is the wrong place to declare what stats you
want to see.

If you have a good idea, please shoot. I proposed using module parameter that
can get toggled more easily by the admin that debugs something.

It's a good question of someone would want to use this mechanism not just for debugging. Then, indeed, a more selective (per-process) toggle could be warranted. But likely the scanning would in any case be too expensive for any non-debug case.

So let's not over-engineer a debug mechanism if this is intended to stay a debug mechanism.

--
Cheers,

David