public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Tejun Heo <tj@kernel.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>,
	linux-kernel@vger.kernel.org,  kernel-team@meta.com,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] workqueue: validate cpumask_first() result in llc_populate_cpu_shard_id()
Date: Mon, 13 Apr 2026 07:21:14 -0700	[thread overview]
Message-ID: <adz4IVO4Ury-bu-S@gmail.com> (raw)
In-Reply-To: <adk1CtVuElIw5bxo@slm.duckdns.org>

On Fri, Apr 10, 2026 at 07:36:10AM -1000, Tejun Heo wrote:
> Hello,
> 
> On Fri, Apr 10, 2026 at 03:42:00AM -0700, Breno Leitao wrote:
> > @@ -8318,7 +8319,17 @@ static void __init llc_populate_cpu_shard_id(const struct cpumask *pod_cpus,
> >                          * The siblings' shard MUST be the same as the leader.
> >                          * never split threads in the same core.
> >                          */
> > -                       cpu_shard_id[c] = cpu_shard_id[cpumask_first(sibling_cpus)];
> > +                       leader = cpumask_first(sibling_cpus);
> > +
> > +                       /*
> > +                        * sibling_cpus cannot be empty here since 'c'
> > +                        * is always set in it. This check silences a
> > +                        * compiler warning about using the unchecked
> > +                        * cpumask_first() result as an array index.
> > +                        */
> 
> Can you add more details on the warning and update the patch desc
> accordingly?

Ack!

> This only triggers on UP configs, right?

yes, this only triggers on UP configs (like nios2) because on SMP
NR_CPUS > 1 and the compiler can't prove the index is out of bounds.

      reply	other threads:[~2026-04-13 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10  8:49 [PATCH] workqueue: validate cpumask_first() result in llc_populate_cpu_shard_id() Breno Leitao
2026-04-10  9:00 ` Tejun Heo
2026-04-10 10:42   ` Breno Leitao
2026-04-10 17:36     ` Tejun Heo
2026-04-13 14:21       ` Breno Leitao [this message]

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=adz4IVO4Ury-bu-S@gmail.com \
    --to=leitao@debian.org \
    --cc=jiangshanlai@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=tj@kernel.org \
    /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