From 132bb8cfc9e081238e7e2fd0c37c8c75ad0d2963 Mon Sep 17 00:00:00 2001 From: Yafang Shao Date: Mon, 13 May 2019 17:17:53 -0700 Subject: mm/vmscan: add tracepoints for node reclaim The page alloc fast path it may perform node reclaim, which may cause a latency spike. We should add tracepoint for this event, and also measure the latency it causes. So bellow two tracepoints are introduced, mm_vmscan_node_reclaim_begin mm_vmscan_node_reclaim_end Link: http://lkml.kernel.org/r/1551421452-5385-1-git-send-email-laoar.shao@gmail.com Signed-off-by: Yafang Shao Acked-by: Michal Hocko Cc: Vlastimil Babka Cc: Souptick Joarder Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/trace/events/vmscan.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include/trace') diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index cb2add69301a..b8b9d42944f9 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h @@ -469,6 +469,38 @@ TRACE_EVENT(mm_vmscan_inactive_list_is_low, __entry->ratio, show_reclaim_flags(__entry->reclaim_flags)) ); + +TRACE_EVENT(mm_vmscan_node_reclaim_begin, + + TP_PROTO(int nid, int order, gfp_t gfp_flags), + + TP_ARGS(nid, order, gfp_flags), + + TP_STRUCT__entry( + __field(int, nid) + __field(int, order) + __field(gfp_t, gfp_flags) + ), + + TP_fast_assign( + __entry->nid = nid; + __entry->order = order; + __entry->gfp_flags = gfp_flags; + ), + + TP_printk("nid=%d order=%d gfp_flags=%s", + __entry->nid, + __entry->order, + show_gfp_flags(__entry->gfp_flags)) +); + +DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_node_reclaim_end, + + TP_PROTO(unsigned long nr_reclaimed), + + TP_ARGS(nr_reclaimed) +); + #endif /* _TRACE_VMSCAN_H */ /* This part must be outside protection */ -- cgit v1.2.1