Skip to content

Commit 2815a56

Browse files
rikvanrielingomolnar
authored andcommitted
x86/mm/tlb: Add tracepoint for TLB flush IPI to stale CPU
Add a tracepoint when we send a TLB flush IPI to a CPU that used to be in the mm_cpumask, but isn't any more. Suggested-by: Dave Hansen <dave.hansen@intel.com> Signed-off-by: Rik van Riel <riel@surriel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20241114152723.1294686-3-riel@surriel.com
1 parent 209954c commit 2815a56

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

arch/x86/mm/tlb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ static void flush_tlb_func(void *info)
760760
/* Can only happen on remote CPUs */
761761
if (f->mm && f->mm != loaded_mm) {
762762
cpumask_clear_cpu(raw_smp_processor_id(), mm_cpumask(f->mm));
763+
trace_tlb_flush(TLB_REMOTE_WRONG_CPU, 0);
763764
return;
764765
}
765766
}

include/linux/mm_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,7 @@ enum tlb_flush_reason {
13351335
TLB_LOCAL_SHOOTDOWN,
13361336
TLB_LOCAL_MM_SHOOTDOWN,
13371337
TLB_REMOTE_SEND_IPI,
1338+
TLB_REMOTE_WRONG_CPU,
13381339
NR_TLB_FLUSH_REASONS,
13391340
};
13401341

0 commit comments

Comments
 (0)