From: Huang Ying <ying.huang(a)intel.com>
ANBZ: #80
cherry-picked from
https://git.kernel.org/pub/scm/linux/kernel/git/vishal/tiering.git/commit/?…
To help to debug the threshold adjustment algorithm.
Signed-off-by: "Huang, Ying" <ying.huang(a)intel.com>
Signed-off-by: Baolin Wang <baolin.wang(a)linux.alibaba.com>
---
include/trace/events/sched.h | 24 ++++++++++++++++++++++++
kernel/sched/fair.c | 1 +
2 files changed, 25 insertions(+)
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 9a4bdfa..d36b9a3 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -51,6 +51,30 @@
TP_printk("ret=%d", __entry->ret)
);
+TRACE_EVENT(autonuma_threshold,
+
+ TP_PROTO(int nid,
+ long nr_candidate,
+ int threshold),
+
+ TP_ARGS(nid, nr_candidate, threshold),
+
+ TP_STRUCT__entry(
+ __field( int, nid )
+ __field( long, nr_candidate )
+ __field( int, threshold )
+ ),
+
+ TP_fast_assign(
+ __entry->nid = nid;
+ __entry->nr_candidate = nr_candidate;
+ __entry->threshold = threshold;
+ ),
+
+ TP_printk("nid=%d nr_candidate=%ld threshold=%d",
+ __entry->nid, __entry->nr_candidate, __entry->threshold)
+);
+
/*
* Tracepoint for waking up a task:
*/
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 143d689..fc954e1 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2949,6 +2949,7 @@ static void numa_migration_adjust_threshold(struct pglist_data
*pgdat,
th = min(th + unit_th, ref_th);
pgdat->numa_threshold_nr_candidate = nr_cand;
pgdat->numa_threshold = th;
+ trace_autonuma_threshold(pgdat->node_id, diff_cand, th);
}
}
--
1.8.3.1