From: Andrea Righi Date: Fri, 8 Nov 2024 19:51:44 +0000 (+0100) Subject: sched_ext: Fix incorrect use of bitwise AND X-Git-Tag: v6.13-rc1~164^2~10 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6d594af5bff2e565cae538401142c69182026c38;p=linux.git sched_ext: Fix incorrect use of bitwise AND There is no reason to use a bitwise AND when checking the conditions to enable NUMA optimization for the built-in CPU idle selection policy, so use a logical AND instead. Fixes: f6ce6b949304 ("sched_ext: Do not enable LLC/NUMA optimizations when domains overlap") Reported-by: Nathan Chancellor Closes: https://lore.kernel.org/lkml/20241108181753.GA2681424@thelio-3990X/ Signed-off-by: Andrea Righi Signed-off-by: Tejun Heo --- diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index f154aaeb69e4..012a7fc77263 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -3221,7 +3221,7 @@ static void update_selcpu_topology(void) * for an idle CPU in the same domain twice is redundant. */ cpus = cpumask_of_node(cpu_to_node(cpu)); - if ((cpumask_weight(cpus) < num_online_cpus()) & llc_numa_mismatch()) + if ((cpumask_weight(cpus) < num_online_cpus()) && llc_numa_mismatch()) enable_numa = true; rcu_read_unlock();