Re: [PATCH 5/5] memcg: make memcg_rstat_updated nmi safe
From: Vlastimil Babka
Date: Fri May 16 2025 - 05:47:01 EST
On 5/16/25 08:49, Shakeel Butt wrote:
> memcg: convert stats_updates to atomic_t
You have two subjects, I guess delete the second one?
> Currently kernel maintains memory related stats updates per-cgroup to
> optimize stats flushing. The stats_updates is defined as atomic64_t
> which is not nmi-safe on some archs. Actually we don't really need 64bit
> atomic as the max value stats_updates can get should be less than
> nr_cpus * MEMCG_CHARGE_BATCH. A normal atomic_t should suffice.
>
> Also the function cgroup_rstat_updated() is still not nmi-safe but there
> is parallel effort to make it nmi-safe, so until then let's ignore it in
> the nmi context.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
Acked-by: Vlastimil Babka <vbabka@xxxxxxx>