All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-page_alloc-add-trace-event-for-totalreserve_pages-calculation.patch added to mm-unstable branch
@ 2025-03-12 20:34 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-03-12 20:34 UTC (permalink / raw)
  To: mm-commits, rostedt, rientjes, mhiramat, mathieu.desnoyers,
	liumartin, akpm


The patch titled
     Subject: mm/page_alloc: add trace event for totalreserve_pages calculation
has been added to the -mm mm-unstable branch.  Its filename is
     mm-page_alloc-add-trace-event-for-totalreserve_pages-calculation.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_alloc-add-trace-event-for-totalreserve_pages-calculation.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Martin Liu <liumartin@google.com>
Subject: mm/page_alloc: add trace event for totalreserve_pages calculation
Date: Sat, 8 Mar 2025 03:46:02 +0000

This commit introduces a new trace event,
`mm_calculate_totalreserve_pages`, which reports the new reserve value at
the exact time when it takes effect.

The `totalreserve_pages` value represents the total amount of memory
reserved across all zones and nodes in the system.  This reserved memory
is crucial for ensuring that critical kernel operations have access to
sufficient memory, even under memory pressure.

By tracing the `totalreserve_pages` value, developers can gain insights
that how the total reserved memory changes over time.

Link: https://lkml.kernel.org/r/20250308034606.2036033-4-liumartin@google.com
Signed-off-by: Martin Liu <liumartin@google.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/trace/events/kmem.h |   18 ++++++++++++++++++
 mm/page_alloc.c             |    1 +
 2 files changed, 19 insertions(+)

--- a/include/trace/events/kmem.h~mm-page_alloc-add-trace-event-for-totalreserve_pages-calculation
+++ a/include/trace/events/kmem.h
@@ -402,6 +402,24 @@ TRACE_EVENT(mm_setup_per_zone_lowmem_res
 		  __entry->lowmem_reserve)
 );
 
+TRACE_EVENT(mm_calculate_totalreserve_pages,
+
+	TP_PROTO(unsigned long totalreserve_pages),
+
+	TP_ARGS(totalreserve_pages),
+
+	TP_STRUCT__entry(
+		__field(unsigned long, totalreserve_pages)
+	),
+
+	TP_fast_assign(
+		__entry->totalreserve_pages = totalreserve_pages;
+	),
+
+	TP_printk("totalreserve_pages=%lu", __entry->totalreserve_pages)
+);
+
+
 /*
  * Required for uniquely and securely identifying mm in rss_stat tracepoint.
  */
--- a/mm/page_alloc.c~mm-page_alloc-add-trace-event-for-totalreserve_pages-calculation
+++ a/mm/page_alloc.c
@@ -5914,6 +5914,7 @@ static void calculate_totalreserve_pages
 		}
 	}
 	totalreserve_pages = reserve_pages;
+	trace_mm_calculate_totalreserve_pages(totalreserve_pages);
 }
 
 /*
_

Patches currently in -mm which might be from liumartin@google.com are

mm-page_alloc-add-trace-event-for-per-zone-watermark-setup.patch
mm-page_alloc-add-trace-event-for-per-zone-lowmem-reserve-setup.patch
mm-page_alloc-add-trace-event-for-totalreserve_pages-calculation.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-12 20:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12 20:34 + mm-page_alloc-add-trace-event-for-totalreserve_pages-calculation.patch added to mm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.