Re: [PATCH v2 3/3] sched/fair: Add compile time check in fastpaths for CONFIG_SCHED_SMT=n
From: Shrikanth Hegde
Date: Wed May 13 2026 - 02:40:29 EST
Hi Prateek.
... I think the if() above can simply check for sched_smt_active()In addition, Do you think it makes sense to consolidate use of
before calling is_core_idle() like:
if (sched_smt_active() &&
!(env->sd->flags & SD_SHARE_CPUCAPACITY) &&
!is_core_idle(cpu)) {
...
}
That way, we ensure we don't call is_core_idle() and the cpumask_and()
unnecessarily on topologies that don't have SMT domain similar to how
sched_use_asym_prio() guards the call to is_core_idle().
Thoughts?
sched_smt_present always using sched_smt_active() ?
static __always_inline bool sched_smt_active(void)
{
return static_branch_likely(&sched_smt_present);
}
kernel/sched/core_sched.c: if (!static_branch_likely(&sched_smt_present))
kernel/sched/fair.c: if (!static_branch_likely(&sched_smt_present) ||
kernel/sched/sched.h: if (static_branch_unlikely(&sched_smt_present))
The last being differing with unlikely in update_idle_core.
Does it make sense to call sched_smt_active there as well?