public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
	David Vernet <void@manifault.com>,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH v3 sched_ext/for-6.13] sched_ext: Do not enable LLC/NUMA optimizations when domains overlap
Date: Fri, 8 Nov 2024 20:39:15 +0100	[thread overview]
Message-ID: <Zy5o44PLucx52Fp1@gpd3> (raw)
In-Reply-To: <Zy5eadwAuQSzqp-1@slm.duckdns.org>

On Fri, Nov 08, 2024 at 08:54:33AM -1000, Tejun Heo wrote:
> On Fri, Nov 08, 2024 at 11:17:53AM -0700, Nathan Chancellor wrote:
> > 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.
> 
> Oops, that looks like a mistake. I don't see why it can't be &&.

Sorry, this is a mistake, it definitely needs to be &&.

Do you want me to send a fix on top of this one or a v4?

Thanks,
-Andrea

  reply	other threads:[~2024-11-08 19:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20241108000136.184909-1-arighi@nvidia.com>
2024-11-08 18:17 ` [PATCH v3 sched_ext/for-6.13] sched_ext: Do not enable LLC/NUMA optimizations when domains overlap Nathan Chancellor
2024-11-08 18:54   ` Tejun Heo
2024-11-08 19:39     ` Andrea Righi [this message]
2024-11-08 19:42       ` Tejun Heo
2024-11-08 19:54         ` Andrea Righi

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=Zy5o44PLucx52Fp1@gpd3 \
    --to=arighi@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --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