From: Mel Gorman Date: Mon, 24 Feb 2020 09:52:12 +0000 (+0000) Subject: sched/numa: Trace when no candidate CPU was found on the preferred node X-Git-Tag: v5.7-rc1~179^2~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f22aef4afb0d6cc22e408d8254cf6d02d7982ef1;p=thirdparty%2Fkernel%2Flinux.git sched/numa: Trace when no candidate CPU was found on the preferred node sched:sched_stick_numa is meant to fire when a task is unable to migrate to the preferred node. The case where no candidate CPU could be found is not traced which is an important gap. The tracepoint is not fired when the task is not allowed to run on any CPU on the preferred node or the task is already running on the target CPU but neither are interesting corner cases. Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Cc: Steven Rostedt Cc: Vincent Guittot Cc: Juri Lelli Cc: Dietmar Eggemann Cc: Valentin Schneider Cc: Phil Auld Cc: Hillf Danton Link: https://lore.kernel.org/r/20200224095223.13361-3-mgorman@techsingularity.net --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f38ff5a335d3e..f524ce3cea823 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1848,8 +1848,10 @@ static int task_numa_migrate(struct task_struct *p) } /* No better CPU than the current one was found. */ - if (env.best_cpu == -1) + if (env.best_cpu == -1) { + trace_sched_stick_numa(p, env.src_cpu, -1); return -EAGAIN; + } best_rq = cpu_rq(env.best_cpu); if (env.best_task == NULL) {