[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 3 Mar 2020 11:02:57 +0000
From: Mel Gorman <mgorman@...hsingularity.net>
To: Ingo Molnar <mingo@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>,
Valentin Schneider <valentin.schneider@....com>,
Lukasz Luba <lukasz.luba@....com>,
Phil Auld <pauld@...hat.com>, Hillf Danton <hdanton@...a.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Paul McKenney <paulmck@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Mel Gorman <mgorman@...hsingularity.net>
Subject: [PATCH 2/3] sched/fair: Fix kernel build warning in test_idle_cores() for !SMT NUMA
From: Valentin Schneider <valentin.schneider@....com>
From: Valentin Schneider <valentin.schneider@....com>
Building against the tip/sched/core as ff7db0bf24db ("sched/numa: Prefer
using an idle CPU as a migration target instead of comparing tasks") with
the arm64 defconfig (which doesn't have CONFIG_SCHED_SMT set) leads to:
kernel/sched/fair.c:1525:20: warning: 'test_idle_cores' declared 'static' but never defined [-Wunused-function]
static inline bool test_idle_cores(int cpu, bool def);
^~~~~~~~~~~~~~~
Rather than define it in its own CONFIG_SCHED_SMT #define island, bunch it
up with test_idle_cores().
Fixes: ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
[mgorman@...hsingularity.net: Edit changelog, minor style change]
Reported-by: Anshuman Khandual <anshuman.khandual@....com>
Reported-by: Lukasz Luba <lukasz.luba@....com>
Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
Signed-off-by: Valentin Schneider <valentin.schneider@....com>
Signed-off-by: Mel Gorman <mgorman@...hsingularity.net>
Reviewed-by: Lukasz Luba <lukasz.luba@....com>
---
kernel/sched/fair.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4b5d5e5e701e..33622bbfcea7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1520,9 +1520,6 @@ static inline bool is_core_idle(int cpu)
return true;
}
-/* Forward declarations of select_idle_sibling helpers */
-static inline bool test_idle_cores(int cpu, bool def);
-
struct task_numa_env {
struct task_struct *p;
@@ -1558,9 +1555,11 @@ numa_type numa_classify(unsigned int imbalance_pct,
return node_fully_busy;
}
+#ifdef CONFIG_SCHED_SMT
+/* Forward declarations of select_idle_sibling helpers */
+static inline bool test_idle_cores(int cpu, bool def);
static inline int numa_idle_core(int idle_core, int cpu)
{
-#ifdef CONFIG_SCHED_SMT
if (!static_branch_likely(&sched_smt_present) ||
idle_core >= 0 || !test_idle_cores(cpu, false))
return idle_core;
@@ -1571,10 +1570,15 @@ static inline int numa_idle_core(int idle_core, int cpu)
*/
if (is_core_idle(cpu))
idle_core = cpu;
-#endif
return idle_core;
}
+#else
+static inline int numa_idle_core(int idle_core, int cpu)
+{
+ return idle_core;
+}
+#endif
/*
* Gather all necessary information to make NUMA balancing placement
--
2.16.4
Powered by blists - more mailing lists