public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: Aaron Tomlin <atomlin@atomlin.com>
Cc: oleg@redhat.com, akpm@linux-foundation.org,
	gregkh@linuxfoundation.org, brauner@kernel.org, mingo@kernel.org,
	sean@ashe.io, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [v2 PATCH 1/1] fs/proc: Expose mm_cpumask in /proc/[pid]/status
Date: Tue, 6 Jan 2026 19:54:54 +0100	[thread overview]
Message-ID: <175da76e-3f04-460b-8629-05062edd2d62@kernel.org> (raw)
In-Reply-To: <suoe7pyfr2qcbxyov456lglf4hcxkrzhoyqbiaba4kw32u5m2h@hg2crnjgdfoy>

On 1/1/26 02:19, Aaron Tomlin wrote:
> On Tue, Dec 30, 2025 at 10:16:30PM +0100, David Hildenbrand (Red Hat) wrote:
>> Just a note: I have the faint recollection that there are some arch-specific
>> oddities around mm_cpumask().
>>
>> In particular, that some architectures never clear CPUs from the mask, while
>> others (e.g., x86) clear them one the TLB for them is clean.
>>
>> I'd assume that all architectures at least set the CPUs once they ever ran
>> an MM. But are we sure about that?
>>
>> $ git grep mm_cpumask | grep m68k
>>
>> gives me no results and I don't see common code to ever set a cpu in
>> the mm_cpumask.
>>
>> -- 
>> Cheers
>>
> Hi David,
> 
> You are correct; mm_cpumask semantics vary across architectures (e.g., arc)
> and are even unused on some (e.g., m68k).
> 
> Rather than attempting to standardise this across all architectures, I
> propose we restrict this information to those that follow the "Lazy" TLB
> model-specifically x86. In this model, the mask represents CPUs that might
> hold stale TLB entries for a given MM and thus require IPI-based TLB
> shootdowns to maintain coherency. Since this is the primary context where
> mm_cpumask provides actionable debug data for performance bottlenecks,
> showing it only for x86 (where it is reliably maintained) seems the most
> pragmatic path.

Yes, starting with a very restrictive set, and carefully documenting it 
sounds good to me.

One question is what would happen if these semantics one day change on 
x86. I guess best we can do is to ... document it very carefully.

> 
> I can document this arch-specific limitation in
> Documentation/filesystems/proc.rst and wrapped the implementation in
> CONFIG_X86 to avoid exposing "Best Effort" or zeroed-out data on
> architectures where the mask is not meaningful.
> 
> Please let me know your thoughts.

Something along these lines. Maybe we want an CONFIG_ARCH_* define to 
unlock this from arch code.

-- 
Cheers

David

  reply	other threads:[~2026-01-06 18:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-26 21:14 [v2 PATCH 0/1] fs/proc: Expose mm_cpumask in /proc/[pid]/status Aaron Tomlin
2025-12-26 21:14 ` [v2 PATCH 1/1] " Aaron Tomlin
2025-12-30 21:16   ` David Hildenbrand (Red Hat)
2026-01-01  1:19     ` Aaron Tomlin
2026-01-06 18:54       ` David Hildenbrand (Red Hat) [this message]
2026-01-15 18:40         ` Aaron Tomlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=175da76e-3f04-460b-8629-05062edd2d62@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=atomlin@atomlin.com \
    --cc=brauner@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=sean@ashe.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox