mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Mel Gorman <mgorman@techsingularity.net>, 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>,
	Phil Auld <pauld@redhat.com>, Hillf Danton <hdanton@sina.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched/fair: Fix kernel build warning in test_idle_cores() for !SMT NUMA
Date: Fri, 28 Feb 2020 10:02:24 +0000	[thread overview]
Message-ID: <9e7a3ed4-82ec-5691-807c-66a8a881f1ef@arm.com> (raw)
In-Reply-To: <20200227140222.GH3818@techsingularity.net>



On 2/27/20 2:02 PM, Mel Gorman wrote:
> Building against tip/sched/core as of 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]
> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> ---
>   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 fcc968669aea..10f9e6729fcf 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
> 

Looks good (apart from odd formatting got in '’') and calms down
yesterday's build of next (next-20200227 were I spotted it) and today's
also.

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

Regards,
Lukasz

  reply	other threads:[~2020-02-28 10:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 14:02 Mel Gorman
2020-02-28 10:02 ` Lukasz Luba [this message]
2020-03-03 10:08 ` Valentin Schneider
  -- strict thread matches above, loose matches on Subject: below --
2020-02-27 11:00 Lukasz Luba
2020-02-27 11:04 ` Valentin Schneider
2020-02-27 12:08   ` Lukasz Luba
2020-02-27 14:00     ` 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=9e7a3ed4-82ec-5691-807c-66a8a881f1ef@arm.com \
    --to=lukasz.luba@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=mgorman@techsingularity.net \
    --cc=mingo@kernel.org \
    --cc=pauld@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®