[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtAh0mgPyQLe9W3iPt_7eUZWqa1x+kTmdsP2+qxi_5icWw@mail.gmail.com>
Date: Tue, 21 Apr 2020 09:17:50 +0200
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Chen Yu <yu.c.chen@...el.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2][v2] sched: Make newidle_balance() static again
On Mon, 20 Apr 2020 at 17:01, Chen Yu <yu.c.chen@...el.com> wrote:
>
> After Commit 6e2df0581f56 ("sched: Fix pick_next_task() vs 'change'
> pattern race"), there is no need to expose newidle_balance() as it
> is only used within fair.c file. Change this function back to static again.
>
> No functional change.
>
> Suggested-by: Peter Zijlstra <peterz@...radead.org>
> Reported-by: kbuild test robot <lkp@...el.com>
> Signed-off-by: Chen Yu <yu.c.chen@...el.com>
Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>
> ---
> v2: Rename the remaining idle_balance() to newidle_balance()
> to fix an compile error when CONFIG_SMP is not set.
> ---
> kernel/sched/fair.c | 6 ++++--
> kernel/sched/sched.h | 4 ----
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 02f323b85b6d..cca5c9b7b5ae 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3873,6 +3873,8 @@ static inline unsigned long cfs_rq_load_avg(struct cfs_rq *cfs_rq)
> return cfs_rq->avg.load_avg;
> }
>
> +static int newidle_balance(struct rq *this_rq, struct rq_flags *rf);
> +
> static inline unsigned long task_util(struct task_struct *p)
> {
> return READ_ONCE(p->se.avg.util_avg);
> @@ -4054,7 +4056,7 @@ attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) {}
> static inline void
> detach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) {}
>
> -static inline int idle_balance(struct rq *rq, struct rq_flags *rf)
> +static inline int newidle_balance(struct rq *rq, struct rq_flags *rf)
> {
> return 0;
> }
> @@ -10425,7 +10427,7 @@ static inline void nohz_newidle_balance(struct rq *this_rq) { }
> * 0 - failed, no new tasks
> * > 0 - success, new (fair) tasks present
> */
> -int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
> +static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
> {
> unsigned long next_balance = jiffies + HZ;
> int this_cpu = this_rq->cpu;
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index db3a57675ccf..be83f88495fb 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -1504,14 +1504,10 @@ static inline void unregister_sched_domain_sysctl(void)
> }
> #endif
>
> -extern int newidle_balance(struct rq *this_rq, struct rq_flags *rf);
> -
> #else
>
> static inline void sched_ttwu_pending(void) { }
>
> -static inline int newidle_balance(struct rq *this_rq, struct rq_flags *rf) { return 0; }
> -
> #endif /* CONFIG_SMP */
>
> #include "stats.h"
> --
> 2.17.1
>
Powered by blists - more mailing lists