On Wed, May 14, 2025 at 11:50:16AM +0200, Vlastimil Babka wrote: > On 5/14/25 07:08, Shakeel Butt wrote: > > The function memcg_rstat_updated() is used to track the memcg stats > > updates for optimizing the flushes. At the moment, it is not re-entrant > > safe and the callers disabled irqs before calling. However to achieve > > the goal of updating memcg stats without irqs, memcg_rstat_updated() > > needs to be re-entrant safe against irqs. > > > > This patch makes memcg_rstat_updated() re-entrant safe using this_cpu_* > > ops. On archs with CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS, this patch is > > also making memcg_rstat_updated() nmi safe. > > > > Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx> > > Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx> > > Some nits: > Thanks Vlastimil. I will address your comments in v2 and Andrew asked me to rebase over mm-new instead of next which I will do as well.