Re: [PATCH 2/5] memcg: nmi safe memcg stats for specific archs

From: Vlastimil Babka
Date: Fri May 16 2025 - 05:43:20 EST


On 5/16/25 08:49, Shakeel Butt wrote:
> There are archs which have NMI but does not support this_cpu_* ops
> safely in the nmi context but they support safe atomic ops in nmi
> context. For such archs, let's add infra to use atomic ops for the memcg
> stats which can be updated in nmi.
>
> At the moment, the memcg stats which get updated in the objcg charging
> path are MEMCG_KMEM, NR_SLAB_RECLAIMABLE_B & NR_SLAB_UNRECLAIMABLE_B.
> Rather than adding support for all memcg stats to be nmi safe, let's
> just add infra to make these three stats nmi safe which this patch is
> doing.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>

Acked-by: Vlastimil Babka <vbabka@xxxxxxx>