[PATCH RFC 0/4] mm/vmscan: move vmscan tracepoints to a local header
From: Ridong Chen
Date: Mon Sep 21 2026 - 08:25:48 EST
From: Ridong Chen <chenridong@xxxxxxxxxx>
Background:
This series started as an effort to add two tracepoints for MGLRU. In the
discussion, Steven suggested moving include/trace/events/vmscan.h to
mm/trace_vmscan.h [1], as several other subsystems already do. Once the
header lives under mm/, struct scan_control can be moved there too, letting
the trace events access its fields directly instead of having each callsite
copy the scalars out by hand.
The series builds in four small steps:
1) drop the now-unused vmscan trace include from memcontrol.c;
2) move include/trace/events/vmscan.h to mm/trace_vmscan.h, using a
relative TRACE_INCLUDE_PATH so no Makefile change is needed;
3) move struct scan_control into that header, guarded against the
multi-read that define_trace.h performs;
4) pass scan_control to the reclaim-begin tracepoints and pick the
fields out in TP_fast_assign.
There is no functional change and no ABI change: TP_STRUCT__entry and
TP_printk are untouched, so the exported event format is identical. This
was confirmed by diffing the tracefs format files before and after, and
by capturing the direct/memcg/node reclaim-begin events under load in a
QEMU guest (order, gfp_flags and memcg_id all match).
This RFC only converts the three reclaim-begin tracepoints
(direct/memcg/node) to take a scan_control pointer as a first,
self-contained step. Other vmscan tracepoints that currently spell out
individual sc->... fields can be converted the same way once the approach
is agreed upon;
[1] https://lore.kernel.org/linux-mm/20260916095122.50cbb620@robin/
Ridong Chen (4):
mm/memcontrol: drop unused vmscan tracepoint include
mm/vmscan: move vmscan tracepoints to a local header
mm/vmscan: move struct scan_control to the local trace header
mm/vmscan: pass scan_control to the reclaim-begin tracepoints
MAINTAINERS | 2 +
mm/memcontrol.c | 2 -
mm/shrinker.c | 2 +-
.../events/vmscan.h => mm/trace_vmscan.h | 143 ++++++++++++++++--
mm/vmscan.c | 117 +-------------
5 files changed, 138 insertions(+), 128 deletions(-)
rename include/trace/events/vmscan.h => mm/trace_vmscan.h (81%)
--
2.34.1