diff options
author | Peter Zijlstra <peterz@infradead.org> | 2016-05-09 10:38:41 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-09-30 11:03:26 +0200 |
commit | 1b568f0aabf280555125bc7cefc08321ff0ebaba (patch) | |
tree | 5ca491fb2b8a7ff46af700bc64c2d83cea68eabb /kernel/sched/sched.h | |
parent | sched/core: Rewrite and improve select_idle_siblings() (diff) | |
download | linux-1b568f0aabf280555125bc7cefc08321ff0ebaba.tar.xz linux-1b568f0aabf280555125bc7cefc08321ff0ebaba.zip |
sched/core: Optimize SCHED_SMT
Avoid pointless SCHED_SMT code when running on !SMT hardware.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r-- | kernel/sched/sched.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index c917dcad82ad..01b5189235f2 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -36,12 +36,6 @@ extern void cpu_load_update_active(struct rq *this_rq); static inline void cpu_load_update_active(struct rq *this_rq) { } #endif -#ifdef CONFIG_SCHED_SMT -extern void update_idle_core(struct rq *rq); -#else -static inline void update_idle_core(struct rq *rq) { } -#endif - /* * Helpers for converting nanosecond timing to jiffy resolution */ @@ -730,6 +724,23 @@ static inline int cpu_of(struct rq *rq) #endif } + +#ifdef CONFIG_SCHED_SMT + +extern struct static_key_false sched_smt_present; + +extern void __update_idle_core(struct rq *rq); + +static inline void update_idle_core(struct rq *rq) +{ + if (static_branch_unlikely(&sched_smt_present)) + __update_idle_core(rq); +} + +#else +static inline void update_idle_core(struct rq *rq) { } +#endif + DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); #define cpu_rq(cpu) (&per_cpu(runqueues, (cpu))) |