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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260115212313.GF830755@noisy.programming.kicks-ass.net>
Date: Thu, 15 Jan 2026 22:23:13 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "David Hildenbrand (Red Hat)" <david@...nel.org>
Cc: Aaron Tomlin <atomlin@...mlin.com>, oleg@...hat.com,
	akpm@...ux-foundation.org, gregkh@...uxfoundation.org,
	brauner@...nel.org, mingo@...nel.org, neelx@...e.com, sean@...e.io,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	Andy Lutomirski <luto@...nel.org>,
	"x86@...nel.org" <x86@...nel.org>
Subject: Re: [v3 PATCH 1/1] fs/proc: Expose mm_cpumask in /proc/[pid]/status

On Thu, Jan 15, 2026 at 10:19:08PM +0100, David Hildenbrand (Red Hat) wrote:
> On 1/15/26 21:54, Aaron Tomlin wrote:
> > This patch introduces two new fields to /proc/[pid]/status to display the
> > set of CPUs, representing the CPU affinity of the process's active
> > memory context, in both mask and list format: "Cpus_active_mm" and
> > "Cpus_active_mm_list". The mm_cpumask is primarily used for TLB and
> > cache synchronisation.
> > 
> > Exposing this information allows userspace to easily describe the
> > relationship between CPUs where a memory descriptor is "active" and the
> > CPUs where the thread is allowed to execute. The primary intent is to
> > provide visibility into the "memory footprint" across CPUs, which is
> > invaluable for debugging performance issues related to IPI storms and
> > TLB shootdowns in large-scale NUMA systems. The CPU-affinity sets the
> > boundary; the mm_cpumask records the arrival; they complement each
> > other.
> > 
> > Frequent mm_cpumask changes may indicate instability in placement
> > policies or excessive task migration overhead.
> > 
> > These fields are exposed only on architectures that explicitly opt-in
> > via CONFIG_ARCH_WANT_PROC_CPUS_ACTIVE_MM. This is necessary because
> > mm_cpumask semantics vary significantly across architectures; some
> > (e.g., x86) actively maintain the mask for coherency, while others may
> > never clear bits, rendering the data misleading for this specific use
> > case. x86 is updated to select this feature by default.
> > 
> > The implementation reads the mask directly without introducing additional
> > locks or snapshots. While this implies that the hex mask and list format
> > could theoretically observe slightly different states on a rapidly
> > changing system, this "best-effort" approach aligns with the standard
> > design philosophy of /proc and avoids imposing locking overhead on
> > critical memory management paths.
> 
> 
> Yes, restricting to architectures that have the expected semantics is
> better.
> 
> ... but we better get the blessing from x86 folks :)
> 
> (CCing the x86 MM folks)

Yeah, seems like a very bad idea this. mm_cpumask really is an arch
detail you cannot rely on very much. Exposing this to userspace is
terrible.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ