[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65bb272d-b2d4-4d2a-9c7f-d3d5d2eba23d@lucifer.local>
Date: Thu, 12 Jun 2025 18:24:30 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Linux trace kernel <linux-trace-kernel@...r.kernel.org>,
linux-mm@...ck.org, x86@...nel.org,
Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>, Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH] mm, x86/mm: Move creating the tlb_flush event back to
x86 code
On Thu, Jun 12, 2025 at 10:03:13AM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@...dmis.org>
>
> Commit e73ad5ff2f76 ("mm, x86/mm: Make the batched unmap TLB flush API
> more generic") moved the trace_tlb_flush out of mm/rmap.c and back into
> x86 specific architecture, but it kept the include to the events/tlb.h
> file, even though it didn't use that event.
>
> Then another commit came in and added more events to the mm/rmap.c file
> and moved the #define CREATE_TRACE_POINTS define from the x86 specific
> architecture to the generic mm/rmap.h file to create both the tlb_flush
> tracepoint and the new tracepoints.
>
> But since the tlb_flush tracepoint is only x86 specific, it now creates
> that tracepoint for all other architectures and this wastes approximately
> 5K of text and meta data that will not be used.
>
> Remove the events/tlb.h from mm/rmap.c and add the define
> CREATE_TRACE_POINTS back in the x86 code.
>
> Fixes: 4cc79b3303f22 ("mm/migration: add trace events for base page and HugeTLB migrations")
> Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>
LGTM so:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
> ---
> Note, I will be adding code soon that will make unused events cause a warning.
>
> arch/x86/mm/init.c | 1 +
> mm/rmap.c | 1 -
> 2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
> index 7456df985d96..f85313a8b5a9 100644
> --- a/arch/x86/mm/init.c
> +++ b/arch/x86/mm/init.c
> @@ -34,6 +34,7 @@
> * We need to define the tracepoints somewhere, and tlb.c
> * is only compiled when SMP=y.
> */
> +#define CREATE_TRACE_POINTS
> #include <trace/events/tlb.h>
>
> #include "mm_internal.h"
> diff --git a/mm/rmap.c b/mm/rmap.c
> index fb63d9256f09..0bc00668970f 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -79,7 +79,6 @@
> #include <asm/tlbflush.h>
>
> #define CREATE_TRACE_POINTS
> -#include <trace/events/tlb.h>
> #include <trace/events/migrate.h>
>
> #include "internal.h"
> --
> 2.47.2
>
Powered by blists - more mailing lists