* [PATCH v2 0/2] x86, mm: minor tlb_flush tracepoint adjustments
@ 2025-12-12 9:08 Tal Zussman
2025-12-12 9:08 ` [PATCH v2 1/2] x86/tlb/trace: Export the TLB_REMOTE_WRONG_CPU enum Tal Zussman
2025-12-12 9:08 ` [PATCH v2 2/2] mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS Tal Zussman
0 siblings, 2 replies; 7+ messages in thread
From: Tal Zussman @ 2025-12-12 9:08 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar,
Rik van Riel, Andrew Morton, Lorenzo Stoakes, Liam R. Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
x86, Will Deacon, Aneesh Kumar K.V, Nick Piggin, Peter Zijlstra,
David Hildenbrand
Cc: linux-kernel, linux-trace-kernel, linux-mm, linux-arch,
Tal Zussman, David Hildenbrand
One minor fix and one minor cleanup related to the tlb_flush tracepoint.
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
---
Changes in v2:
- Propagated tags (thanks David, Rik, Steven!)
- Added MMU Gather maintainers to recipients
- Rebased on master
- Link to v1: https://lore.kernel.org/r/20250528-tlb-trace-fix-v1-0-2e94c58f450d@columbia.edu
---
Tal Zussman (2):
x86/tlb/trace: Export the TLB_REMOTE_WRONG_CPU enum
mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS
include/linux/mm_types.h | 1 -
include/trace/events/tlb.h | 3 ++-
2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: d358e5254674b70f34c847715ca509e46eb81e6f
change-id: 20250528-tlb-trace-fix-eb9b6fc7bb26
Best regards,
--
Tal Zussman <tz2294@columbia.edu>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/2] x86/tlb/trace: Export the TLB_REMOTE_WRONG_CPU enum
2025-12-12 9:08 [PATCH v2 0/2] x86, mm: minor tlb_flush tracepoint adjustments Tal Zussman
@ 2025-12-12 9:08 ` Tal Zussman
2025-12-15 12:39 ` Lorenzo Stoakes
2025-12-12 9:08 ` [PATCH v2 2/2] mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS Tal Zussman
1 sibling, 1 reply; 7+ messages in thread
From: Tal Zussman @ 2025-12-12 9:08 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar,
Rik van Riel, Andrew Morton, Lorenzo Stoakes, Liam R. Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
x86, Will Deacon, Aneesh Kumar K.V, Nick Piggin, Peter Zijlstra,
David Hildenbrand
Cc: linux-kernel, linux-trace-kernel, linux-mm, linux-arch,
Tal Zussman, David Hildenbrand
When the TLB_REMOTE_WRONG_CPU enum was introduced for the tlb_flush
tracepoint, the enum was not exported to userspace. Add it to the
appropriate macro definition to enable parsing by userspace tools, as
per [0].
[0] Link: https://lore.kernel.org/all/20150403013802.220157513@goodmis.org
Fixes: 2815a56e4b72 ("x86/mm/tlb: Add tracepoint for TLB flush IPI to stale CPU")
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Rik van Riel <riel@surriel.com>
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
---
include/trace/events/tlb.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h
index b4d8e7dc38f8..725a75720a23 100644
--- a/include/trace/events/tlb.h
+++ b/include/trace/events/tlb.h
@@ -13,7 +13,8 @@
EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \
EM( TLB_LOCAL_SHOOTDOWN, "local shootdown" ) \
EM( TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" ) \
- EMe( TLB_REMOTE_SEND_IPI, "remote ipi send" )
+ EM( TLB_REMOTE_SEND_IPI, "remote ipi send" ) \
+ EMe( TLB_REMOTE_WRONG_CPU, "remote wrong CPU" )
/*
* First define the enums in TLB_FLUSH_REASON to be exported to userspace
--
2.39.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS
2025-12-12 9:08 [PATCH v2 0/2] x86, mm: minor tlb_flush tracepoint adjustments Tal Zussman
2025-12-12 9:08 ` [PATCH v2 1/2] x86/tlb/trace: Export the TLB_REMOTE_WRONG_CPU enum Tal Zussman
@ 2025-12-12 9:08 ` Tal Zussman
2025-12-15 12:40 ` Lorenzo Stoakes
1 sibling, 1 reply; 7+ messages in thread
From: Tal Zussman @ 2025-12-12 9:08 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar,
Rik van Riel, Andrew Morton, Lorenzo Stoakes, Liam R. Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
x86, Will Deacon, Aneesh Kumar K.V, Nick Piggin, Peter Zijlstra,
David Hildenbrand
Cc: linux-kernel, linux-trace-kernel, linux-mm, linux-arch,
Tal Zussman, David Hildenbrand
This has been unused since it was added 11 years ago in commit
d17d8f9dedb9 ("x86/mm: Add tracepoints for TLB flushes").
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Rik van Riel <riel@surriel.com>
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
---
include/linux/mm_types.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 9f6de068295d..42af2292951d 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -1631,7 +1631,6 @@ enum tlb_flush_reason {
TLB_LOCAL_MM_SHOOTDOWN,
TLB_REMOTE_SEND_IPI,
TLB_REMOTE_WRONG_CPU,
- NR_TLB_FLUSH_REASONS,
};
/**
--
2.39.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] x86/tlb/trace: Export the TLB_REMOTE_WRONG_CPU enum
2025-12-12 9:08 ` [PATCH v2 1/2] x86/tlb/trace: Export the TLB_REMOTE_WRONG_CPU enum Tal Zussman
@ 2025-12-15 12:39 ` Lorenzo Stoakes
0 siblings, 0 replies; 7+ messages in thread
From: Lorenzo Stoakes @ 2025-12-15 12:39 UTC (permalink / raw)
To: Tal Zussman
Cc: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar,
Rik van Riel, Andrew Morton, Liam R. Howlett, Vlastimil Babka,
Mike Rapoport, Suren Baghdasaryan, Michal Hocko, x86,
Will Deacon, Aneesh Kumar K.V, Nick Piggin, Peter Zijlstra,
David Hildenbrand, linux-kernel, linux-trace-kernel, linux-mm,
linux-arch
On Fri, Dec 12, 2025 at 04:08:07AM -0500, Tal Zussman wrote:
> When the TLB_REMOTE_WRONG_CPU enum was introduced for the tlb_flush
> tracepoint, the enum was not exported to userspace. Add it to the
> appropriate macro definition to enable parsing by userspace tools, as
> per [0].
>
> [0] Link: https://lore.kernel.org/all/20150403013802.220157513@goodmis.org
>
> Fixes: 2815a56e4b72 ("x86/mm/tlb: Add tracepoint for TLB flush IPI to stale CPU")
> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> Reviewed-by: Rik van Riel <riel@surriel.com>
> Signed-off-by: Tal Zussman <tz2294@columbia.edu>
LGTM, so:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> ---
> include/trace/events/tlb.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h
> index b4d8e7dc38f8..725a75720a23 100644
> --- a/include/trace/events/tlb.h
> +++ b/include/trace/events/tlb.h
> @@ -13,7 +13,8 @@
> EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \
> EM( TLB_LOCAL_SHOOTDOWN, "local shootdown" ) \
> EM( TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" ) \
> - EMe( TLB_REMOTE_SEND_IPI, "remote ipi send" )
> + EM( TLB_REMOTE_SEND_IPI, "remote ipi send" ) \
> + EMe( TLB_REMOTE_WRONG_CPU, "remote wrong CPU" )
>
> /*
> * First define the enums in TLB_FLUSH_REASON to be exported to userspace
>
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS
2025-12-12 9:08 ` [PATCH v2 2/2] mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS Tal Zussman
@ 2025-12-15 12:40 ` Lorenzo Stoakes
2025-12-15 13:35 ` Mathieu Desnoyers
0 siblings, 1 reply; 7+ messages in thread
From: Lorenzo Stoakes @ 2025-12-15 12:40 UTC (permalink / raw)
To: Tal Zussman
Cc: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar,
Rik van Riel, Andrew Morton, Liam R. Howlett, Vlastimil Babka,
Mike Rapoport, Suren Baghdasaryan, Michal Hocko, x86,
Will Deacon, Aneesh Kumar K.V, Nick Piggin, Peter Zijlstra,
David Hildenbrand, linux-kernel, linux-trace-kernel, linux-mm,
linux-arch
On Fri, Dec 12, 2025 at 04:08:08AM -0500, Tal Zussman wrote:
> This has been unused since it was added 11 years ago in commit
> d17d8f9dedb9 ("x86/mm: Add tracepoints for TLB flushes").
>
> Acked-by: David Hildenbrand <david@redhat.com>
> Reviewed-by: Rik van Riel <riel@surriel.com>
> Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Hmm, guess just a way of counting the number of reasons, but if nobody's using
it that's silly. So:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> ---
> include/linux/mm_types.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 9f6de068295d..42af2292951d 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -1631,7 +1631,6 @@ enum tlb_flush_reason {
> TLB_LOCAL_MM_SHOOTDOWN,
> TLB_REMOTE_SEND_IPI,
> TLB_REMOTE_WRONG_CPU,
> - NR_TLB_FLUSH_REASONS,
> };
>
> /**
>
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS
2025-12-15 12:40 ` Lorenzo Stoakes
@ 2025-12-15 13:35 ` Mathieu Desnoyers
2025-12-16 10:32 ` Lorenzo Stoakes
0 siblings, 1 reply; 7+ messages in thread
From: Mathieu Desnoyers @ 2025-12-15 13:35 UTC (permalink / raw)
To: Lorenzo Stoakes, Tal Zussman, Steven Rostedt
Cc: Masami Hiramatsu, Ingo Molnar, Rik van Riel, Andrew Morton,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, x86, Will Deacon,
Aneesh Kumar K.V, Nick Piggin, Peter Zijlstra, David Hildenbrand,
linux-kernel, linux-trace-kernel, linux-mm, linux-arch
On 2025-12-15 07:40, Lorenzo Stoakes wrote:
> On Fri, Dec 12, 2025 at 04:08:08AM -0500, Tal Zussman wrote:
>> This has been unused since it was added 11 years ago in commit
>> d17d8f9dedb9 ("x86/mm: Add tracepoints for TLB flushes").
>>
>> Acked-by: David Hildenbrand <david@redhat.com>
>> Reviewed-by: Rik van Riel <riel@surriel.com>
>> Signed-off-by: Tal Zussman <tz2294@columbia.edu>
>
> Hmm, guess just a way of counting the number of reasons, but if nobody's using
> it that's silly. So:
If TRACE_DEFINE_ENUM was implemented differently [1,2], then we could use
NR_TLB_FLUSH_REASONS in a static assert to validate that the number of
exported enum labels matches the enum tlb_flush_reason.
This would catch this kind of discrepancy at compile-time.
Thanks,
Mathieu
[1] https://github.com/lttng/lttng-modules/blob/master/include/instrumentation/events/sched.h#L132
[2] https://github.com/lttng/lttng-modules/blob/master/include/lttng/tracepoint-event-impl.h#L176
>
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS
2025-12-15 13:35 ` Mathieu Desnoyers
@ 2025-12-16 10:32 ` Lorenzo Stoakes
0 siblings, 0 replies; 7+ messages in thread
From: Lorenzo Stoakes @ 2025-12-16 10:32 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Tal Zussman, Steven Rostedt, Masami Hiramatsu, Ingo Molnar,
Rik van Riel, Andrew Morton, Liam R. Howlett, Vlastimil Babka,
Mike Rapoport, Suren Baghdasaryan, Michal Hocko, x86,
Will Deacon, Aneesh Kumar K.V, Nick Piggin, Peter Zijlstra,
David Hildenbrand, linux-kernel, linux-trace-kernel, linux-mm,
linux-arch
On Mon, Dec 15, 2025 at 08:35:58AM -0500, Mathieu Desnoyers wrote:
> On 2025-12-15 07:40, Lorenzo Stoakes wrote:
> > On Fri, Dec 12, 2025 at 04:08:08AM -0500, Tal Zussman wrote:
> > > This has been unused since it was added 11 years ago in commit
> > > d17d8f9dedb9 ("x86/mm: Add tracepoints for TLB flushes").
> > >
> > > Acked-by: David Hildenbrand <david@redhat.com>
> > > Reviewed-by: Rik van Riel <riel@surriel.com>
> > > Signed-off-by: Tal Zussman <tz2294@columbia.edu>
> >
> > Hmm, guess just a way of counting the number of reasons, but if nobody's using
> > it that's silly. So:
>
> If TRACE_DEFINE_ENUM was implemented differently [1,2], then we could use
> NR_TLB_FLUSH_REASONS in a static assert to validate that the number of
> exported enum labels matches the enum tlb_flush_reason.
>
> This would catch this kind of discrepancy at compile-time.
Sure, but for the time being this isn't being used, so dead code -> yoink!
We can obviously come back to this as necessary.
>
> Thanks,
>
> Mathieu
>
> [1] https://github.com/lttng/lttng-modules/blob/master/include/instrumentation/events/sched.h#L132
> [2] https://github.com/lttng/lttng-modules/blob/master/include/lttng/tracepoint-event-impl.h#L176
>
> >
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> https://www.efficios.com
Cheers, Lorenzo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-12-16 10:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-12 9:08 [PATCH v2 0/2] x86, mm: minor tlb_flush tracepoint adjustments Tal Zussman
2025-12-12 9:08 ` [PATCH v2 1/2] x86/tlb/trace: Export the TLB_REMOTE_WRONG_CPU enum Tal Zussman
2025-12-15 12:39 ` Lorenzo Stoakes
2025-12-12 9:08 ` [PATCH v2 2/2] mm: Remove tlb_flush_reason::NR_TLB_FLUSH_REASONS Tal Zussman
2025-12-15 12:40 ` Lorenzo Stoakes
2025-12-15 13:35 ` Mathieu Desnoyers
2025-12-16 10:32 ` Lorenzo Stoakes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox