Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/page_alloc: add trace event for totalreserve_pages calculation

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>

authored by

Martin Liu and committed by
Andrew Morton
15766485 a293aba4

+19
+18
include/trace/events/kmem.h
··· 402 402 __entry->lowmem_reserve) 403 403 ); 404 404 405 + TRACE_EVENT(mm_calculate_totalreserve_pages, 406 + 407 + TP_PROTO(unsigned long totalreserve_pages), 408 + 409 + TP_ARGS(totalreserve_pages), 410 + 411 + TP_STRUCT__entry( 412 + __field(unsigned long, totalreserve_pages) 413 + ), 414 + 415 + TP_fast_assign( 416 + __entry->totalreserve_pages = totalreserve_pages; 417 + ), 418 + 419 + TP_printk("totalreserve_pages=%lu", __entry->totalreserve_pages) 420 + ); 421 + 422 + 405 423 /* 406 424 * Required for uniquely and securely identifying mm in rss_stat tracepoint. 407 425 */
+1
mm/page_alloc.c
··· 5914 5914 } 5915 5915 } 5916 5916 totalreserve_pages = reserve_pages; 5917 + trace_mm_calculate_totalreserve_pages(totalreserve_pages); 5917 5918 } 5918 5919 5919 5920 /*