On 3/12/26 6:40 AM, Vlastimil Babka (SUSE) wrote:
On 3/7/26 05:55, JP Kobryn (Meta) wrote:
When investigating pressure on a NUMA node, there is no straightforward way
to determine which policies are driving allocations to it.
Add per-policy page allocation counters as new node stat items. These
counters track allocations to nodes and also whether the allocations were
intentional or fallbacks.
The new stats follow the existing numa hit/miss/foreign style and have the
following meanings:
hit
- for BIND and PREFERRED_MANY, allocation succeeded on node in nodemask
- for other policies, allocation succeeded on intended node
- counted on the node of the allocation
miss
- allocation intended for other node, but happened on this one
- counted on other node
foreign
- allocation intended on this node, but happened on other node
- counted on this node
Counters are exposed per-memcg, per-node in memory.numa_stat and globally
in /proc/vmstat.
Signed-off-by: JP Kobryn (Meta) <[email protected]>
I think I've been on of the folks on previous versions arguing against the
many counters, and one of the arguments was it they can't tell the full
story anyway (compared to e.g. tracing), but I don't think adding even more
counters is the right solution. Seems like a number of other people
responding to the thread are providing similar feedback.
For example I'm still not sure how it would help me if I knew the
hits/misses were due to a preferred vs preferred_many policy, or interleave
vs weithed interleave?
How about I change from per-policy hit/miss/foreign triplets to a single
aggregated policy triplet (i.e. just 3 new counters which account for
all policies)? They would follow the same hit/miss/foreign semantics
already proposed (visible in quoted text above). This would still
provide the otherwise missing signal of whether policy-driven
allocations to a node are intentional or fallback.
Note that I am also planning on moving the stats off of the memcg so the
3 new counters will be global per-node in response to similar feedback.