# Re: \[PATCH v2 2/2\] mm: Remove tlb\_flush\_reason::NR\_TLB\_FLUSH\_REASONS

- From: Lorenzo Stoakes \<hidden\>
- Date: 2025-12-16 10:32:50 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2025/12/3335131
- Thread: https://ratatoskr.run/linux-trace-kernel/2025/12/3331665/t.md

```text
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 <redacted>
> > > Reviewed-by: Rik van Riel <riel@surriel.com>
> > > Signed-off-by: Tal Zussman <redacted>
> >
> > 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
```
