mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched_ext: Fix incorrect use of bitwise AND
@ 2024-11-08 19:51 Andrea Righi
  2024-11-08 19:57 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Righi @ 2024-11-08 19:51 UTC (permalink / raw)
  To: Tejun Heo, David Vernet; +Cc: Nathan Chancellor, linux-kernel

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>
---
 kernel/sched/ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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();
 
-- 
2.47.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sched_ext: Fix incorrect use of bitwise AND
  2024-11-08 19:51 [PATCH] sched_ext: Fix incorrect use of bitwise AND Andrea Righi
@ 2024-11-08 19:57 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-11-08 19:57 UTC (permalink / raw)
  To: Andrea Righi; +Cc: David Vernet, Nathan Chancellor, linux-kernel

On Fri, Nov 08, 2024 at 08:51:44PM +0100, Andrea Righi wrote:
> 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>

Applied to sched_ext/for-6.13.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-08 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-08 19:51 [PATCH] sched_ext: Fix incorrect use of bitwise AND Andrea Righi
2024-11-08 19:57 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®