[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241108181753.GA2681424@thelio-3990X>
Date: Fri, 8 Nov 2024 11:17:53 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Andrea Righi <arighi@...dia.com>
Cc: Tejun Heo <tj@...nel.org>, David Vernet <void@...ifault.com>,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v3 sched_ext/for-6.13] sched_ext: Do not enable LLC/NUMA
optimizations when domains overlap
Hi Andrea,
On Fri, Nov 08, 2024 at 01:01:36AM +0100, Andrea Righi wrote:
...
> + /*
> + * Enable NUMA optimization only when there are multiple NUMA domains
> + * among the online CPUs and the NUMA domains don't perfectly overlaps
> + * with the LLC domains.
> + *
> + * If all CPUs belong to the same NUMA node and the same LLC domain,
> + * enabling both NUMA and LLC optimizations is unnecessary, as checking
> + * 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())
> + enable_numa = true;
With this hunk in next-20241108, I am seeing a clang warning (or error
since CONFIG_WERROR=y):
In file included from kernel/sched/build_policy.c:63:
kernel/sched/ext.c:3252:6: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
3252 | if ((cpumask_weight(cpus) < num_online_cpus()) & llc_numa_mismatch())
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| &&
kernel/sched/ext.c:3252:6: note: cast one or both operands to int to silence this warning
1 error generated.
Was use of a bitwise AND here intentional (i.e., should
llc_num_mismatch() always be called regardless of the outcome of the
first condition) or can it be switched to a logical AND to silence the
warning? I do not mind sending a patch but I did not want to be wrong
off bat. If there is some other better solution that I am not seeing,
please feel free to send a patch with this as just a report.
Cheers,
Nathan
Powered by blists - more mailing lists