From: Mel Gorman <mgorman@techsingularity.net>
To: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Juri Lelli <juri.lelli@redhat.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>,
Valentin Schneider <valentin.schneider@arm.com>,
Lukasz Luba <lukasz.luba@arm.com>, Phil Auld <pauld@redhat.com>,
Hillf Danton <hdanton@sina.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Naresh Kamboju <naresh.kamboju@linaro.org>,
Paul McKenney <paulmck@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Mel Gorman <mgorman@techsingularity.net>
Subject: [PATCH 2/3] sched/fair: Fix kernel build warning in test_idle_cores() for !SMT NUMA
Date: Tue, 3 Mar 2020 11:02:57 +0000 [thread overview]
Message-ID: <20200303110258.1092-3-mgorman@techsingularity.net> (raw)
In-Reply-To: <20200303110258.1092-1-mgorman@techsingularity.net>
From: Valentin Schneider <valentin.schneider@arm.com>
From: Valentin Schneider <valentin.schneider@arm.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@techsingularity.net: Edit changelog, minor style change]
Reported-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reported-by: Lukasz Luba <lukasz.luba@arm.com>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.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
next prev parent reply other threads:[~2020-03-03 11:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 11:02 [PATCH 0/3] Accumulated fixes for Load/NUMA Balancing reconcilation series Mel Gorman
2020-03-03 11:02 ` [PATCH 1/3] sched/fair: Fix statistics for find_idlest_group() Mel Gorman
2020-03-03 11:14 ` Vincent Guittot
2020-03-03 11:44 ` Mel Gorman
2020-03-03 13:11 ` Vincent Guittot
2020-03-03 11:02 ` Mel Gorman [this message]
2020-03-06 14:42 ` [tip: sched/core] sched/fair: Fix kernel build warning in test_idle_cores() for !SMT NUMA tip-bot2 for Valentin Schneider
2020-03-03 11:02 ` [PATCH 3/3] sched/numa: Acquire RCU lock when checking idle cores during NUMA balancing Mel Gorman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200303110258.1092-3-mgorman@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=anshuman.khandual@arm.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=hdanton@sina.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=mingo@kernel.org \
--cc=naresh.kamboju@linaro.org \
--cc=pauld@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.