Call specific smt functions only if smt siblings are detected at boot. -ck --- kernel/sched/bfs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) Index: linux-4.7-ck4/kernel/sched/bfs.c =================================================================== --- linux-4.7-ck4.orig/kernel/sched/bfs.c 2016-09-13 17:21:52.117252643 +1000 +++ linux-4.7-ck4/kernel/sched/bfs.c 2016-09-13 17:21:52.115252688 +1000 @@ -7144,6 +7144,9 @@ void __init sched_init_smp(void) { struct sched_domain *sd; int cpu, other_cpu; +#ifdef CONFIG_SCHED_SMT + bool smt_threads = false; +#endif cpumask_var_t non_isolated_cpus; @@ -7216,13 +7219,16 @@ void __init sched_init_smp(void) cpumask_copy(&rq->thread_mask, thread_cpumask(cpu)); cpumask_clear_cpu(cpu, &rq->thread_mask); rq->siblings_idle = siblings_cpu_idle; + smt_threads = true; } #endif } #ifdef CONFIG_SMT_NICE - check_siblings = &check_smt_siblings; - wake_siblings = &wake_smt_siblings; - smt_schedule = &smt_should_schedule; + if (smt_threads) { + check_siblings = &check_smt_siblings; + wake_siblings = &wake_smt_siblings; + smt_schedule = &smt_should_schedule; + } #endif grq_unlock_irq(); mutex_unlock(&sched_domains_mutex);