[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240228094703.0aeb5ae5@gandalf.local.home>
Date: Wed, 28 Feb 2024 09:47:03 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Richard Chang <richardycc@...gle.com>
Cc: mhiramat@...nel.org, mathieu.desnoyers@...icios.com,
akpm@...ux-foundation.org, liumartin@...gle.com, surenb@...gle.com,
minchan@...nel.org, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v2] mm: add alloc_contig_migrate_range allocation
statistics
On Wed, 28 Feb 2024 05:11:17 +0000
Richard Chang <richardycc@...gle.com> wrote:
> alloc_contig_migrate_range has every information to be able to
> understand big contiguous allocation latency. For example, how many
> pages are migrated, how many times they were needed to unmap from
> page tables.
>
> This patch adds the trace event to collect the allocation statistics.
> In the field, it was quite useful to understand CMA allocation
> latency.
>
> Signed-off-by: Richard Chang <richardycc@...gle.com>
> ---
> * from v1 - https://lore.kernel.org/linux-mm/20240226100045.2083962-1-richardycc@google.com/
> * Move the trace event int field to the end of the longs - rostedt
> * Do the calculation only when tracing is enabled - rostedt
>
> include/trace/events/kmem.h | 38 +++++++++++++++++++++++++++++++++++++
> mm/internal.h | 3 ++-
> mm/page_alloc.c | 32 ++++++++++++++++++++++++++-----
> mm/page_isolation.c | 2 +-
> 4 files changed, 68 insertions(+), 7 deletions(-)
>
> diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
> index 58688768ef0f..6e62cc64cd92 100644
> --- a/include/trace/events/kmem.h
> +++ b/include/trace/events/kmem.h
> @@ -304,6 +304,44 @@ TRACE_EVENT(mm_page_alloc_extfrag,
> __entry->change_ownership)
> );
>
> +TRACE_EVENT(mm_alloc_contig_migrate_range_info,
> +
> + TP_PROTO(unsigned long start,
> + unsigned long end,
> + unsigned long nr_migrated,
> + unsigned long nr_reclaimed,
> + unsigned long nr_mapped,
> + int migratetype),
Well, you didn't need to change the order of the parameters.
Anyway, from a tracing point of view:
Reviewed-by: Steven Rostedt (Google) <rostedt@...dmis.org.
-- Steve
> +
> + TP_ARGS(start, end, nr_migrated, nr_reclaimed, nr_mapped, migratetype),
> +
> + TP_STRUCT__entry(
> + __field(unsigned long, start)
> + __field(unsigned long, end)
> + __field(unsigned long, nr_migrated)
> + __field(unsigned long, nr_reclaimed)
> + __field(unsigned long, nr_mapped)
> + __field(int, migratetype)
> + ),
> +
Powered by blists - more mailing lists