]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched_ext: Fix incorrect use of bitwise AND
authorAndrea Righi <arighi@nvidia.com>
Fri, 8 Nov 2024 19:51:44 +0000 (20:51 +0100)
committerTejun Heo <tj@kernel.org>
Fri, 8 Nov 2024 19:56:38 +0000 (09:56 -1000)
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 <nathan@kernel.org>
Closes: https://lore.kernel.org/lkml/20241108181753.GA2681424@thelio-3990X/
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c

index f154aaeb69e4ed56984eceb17c426e58480bc08f..012a7fc77263037141a361cb3883585b95589dee 100644 (file)
@@ -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();