Re: [v3 PATCH 1/1] fs/proc: Expose mm_cpumask in /proc/[pid]/status

From: Rik van Riel

Date: Thu Jan 15 2026 - 21:28:42 EST


On Thu, 2026-01-15 at 20:53 -0500, Aaron Tomlin wrote:
>
> Based on my reading of arch/x86/mm/tlb.c, the lifecycle of each bit
> in
> mm_cpumask appears to follow this logic:
>
>     1. Schedule on (switch_mm): Bit set.
>     2. Schedule off: Bit remains set (CPU enters "Lazy" mode).
>     3. Remote TLB Flush (IPI):
>        - If Running: Flush TLB, bit remains set.
>        - If lazy (leave_mm): Switch to init_mm, bit clearing is
> deferred.
>        - If stale (mm != loaded_mm): bit is cleared immediately
>          (effectively the second IPI for a CPU that was previously
> lazy).
>

You're close. When a process uses INVLPGB, no remote TLB
flushing IPIs will get sent, and CPUs never get cleared
from the mm_cpumask.

--
All Rights Reversed.