From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>
Cc: Nathan Chancellor <nathan@kernel.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] sched_ext: Fix incorrect use of bitwise AND
Date: Fri, 8 Nov 2024 20:51:44 +0100 [thread overview]
Message-ID: <20241108195144.55747-1-arighi@nvidia.com> (raw)
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
next reply other threads:[~2024-11-08 19:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 19:51 Andrea Righi [this message]
2024-11-08 19:57 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241108195144.55747-1-arighi@nvidia.com \
--to=arighi@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®