Skip to contentSkip to conversation

sched_ext: Fix incorrect use of bitwise AND

PATCH Applied Andrea Righi 2 participants 2 messages Nov 8, 2024 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 kernel/sched/ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/ext.c +1 -1
index f154aaeb69e4..012a7fc77263 100644
@@ -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();
 
Signature · 1 line
2.47.0
Applied
#1 lore raw
Quoted 8 lines · Andrea Righi

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")

Applied to sched_ext/for-6.13.

Thanks.

Signature · 1 line
tejun