Re: [PATCH] mm/percpu, memcontrol: Per-memcg-lruvec percpu accounting

From: Yosry Ahmed

Date: Mon Mar 30 2026 - 15:02:58 EST


> > You should probably also speak to extra memory overhead to move all
> > these stats from per-memcg to per-lruvec.
>
> Hello Yosry,
>
> Thank you for your feedback!
>
> Here are the things that I cna see from my end:
> - NR_PERCPU_B adds a byte per-node, per-cpu. I think this is manageable.
> - lruvec_stats_percpu grows by 1 long in 2 arrays (state, state_prev) since
> NR_MEMCG_NODE_STAT_ITEMS grows by 1 from ~30. This is +16 bytes per
> cgroup x node x CPU. Even still, I'm not sure this is too concerning,
> on a host with 300 CPUs across 2 nodes with 100 cgroups (theoretical)
> we would see a 16 * 300 * 2 * 100 = 937 kB change, less than a mB (and
> I think this would be considered a big machine).
>
> What do you think? Do these numbers look acceptable?

Oh I wasn't trying to say whether this is acceptable or not, just that
this is a relevant context that should be included to help people see
the tradeoff clearly and make a decision.

>
> Thanks again for your insights, I hope you have a great day : -)
> Joshua
>