Skip to content

Commit 7a4c779

Browse files
yu-chen-surfPeter Zijlstra
authored andcommitted
sched: Make newidle_balance() static again
After Commit b8b66e3 ("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. Reported-by: kbuild test robot <lkp@intel.com> Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Chen Yu <yu.c.chen@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/83cd3030b031ca5d646cd5e225be10e7a0fdd8f5.1587464698.git.yu.c.chen@intel.com
1 parent 67cfe43 commit 7a4c779

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

kernel/sched/fair.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3873,6 +3873,8 @@ static inline unsigned long cfs_rq_load_avg(struct cfs_rq *cfs_rq)
38733873
return cfs_rq->avg.load_avg;
38743874
}
38753875

3876+
static int newidle_balance(struct rq *this_rq, struct rq_flags *rf);
3877+
38763878
static inline unsigned long task_util(struct task_struct *p)
38773879
{
38783880
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) {}
40544056
static inline void
40554057
detach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) {}
40564058

4057-
static inline int idle_balance(struct rq *rq, struct rq_flags *rf)
4059+
static inline int newidle_balance(struct rq *rq, struct rq_flags *rf)
40584060
{
40594061
return 0;
40604062
}
@@ -10414,7 +10416,7 @@ static inline void nohz_newidle_balance(struct rq *this_rq) { }
1041410416
* 0 - failed, no new tasks
1041510417
* > 0 - success, new (fair) tasks present
1041610418
*/
10417-
int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
10419+
static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
1041810420
{
1041910421
unsigned long next_balance = jiffies + HZ;
1042010422
int this_cpu = this_rq->cpu;

kernel/sched/sched.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,14 +1503,10 @@ static inline void unregister_sched_domain_sysctl(void)
15031503
}
15041504
#endif
15051505

1506-
extern int newidle_balance(struct rq *this_rq, struct rq_flags *rf);
1507-
15081506
#else
15091507

15101508
static inline void sched_ttwu_pending(void) { }
15111509

1512-
static inline int newidle_balance(struct rq *this_rq, struct rq_flags *rf) { return 0; }
1513-
15141510
#endif /* CONFIG_SMP */
15151511

15161512
#include "stats.h"

0 commit comments

Comments
 (0)