lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <mezzzvbplz2jtt6wjel7dwic25owtydcu3hp2mkqlhp2q3zb7x@js2bm7oheljs>
Date: Wed, 14 May 2025 18:49:47 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Peter Zijlstra <peterz@...radead.org>, 
	Andrew Morton <akpm@...ux-foundation.org>, Tejun Heo <tj@...nel.org>, Johannes Weiner <hannes@...xchg.org>, 
	Michal Hocko <mhocko@...nel.org>, Roman Gushchin <roman.gushchin@...ux.dev>, 
	Muchun Song <muchun.song@...ux.dev>, Alexei Starovoitov <ast@...nel.org>, 
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>, bpf@...r.kernel.org, linux-mm@...ck.org, cgroups@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Meta kernel team <kernel-team@...a.com>, 
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 0/4] memcg: nmi-safe kmem charging

On Tue, May 13, 2025 at 03:17:00PM -0700, Shakeel Butt wrote:
[...]
> 
> Thanks a lot Vlastimil & Peter for the suggestions. Let me summarize
> what I plan to do and please point out if I am doing something wrong:
> 
> 
> #if defined(CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS) || !defined(CONFIG_HAVE_NMI)
> 
> // Do normal this_cpu* ops
> 
> #elif defined(ARCH_HAVE_NMI_SAFE_CMPXCHG)
> 
> // Do 32 bit atomic ops with in_nmi() checks
> 
> #else
> 
> // Build error or ignore nmi stats??
> 
> #endif
> 
> 

Just wanted to circle back on the updated plan:

#if defined(CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS) || !defined(CONFIG_HAVE_NMI)

- Allow memcg charging in nmi context
- Use this_cpu_ops for memcg stats even in nmi context

#elif defined(ARCH_HAVE_NMI_SAFE_CMPXCHG)

- Allow memcg charging in nmi context
- Use atomic* ops for selected memcg stats in nmi context

#else

- Do not allow memcg charging in nmi context

#endif

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ