From: kernel test robot <lkp@intel.com>
To: Breno Leitao <leitao@debian.org>
Cc: oe-kbuild-all@lists.linux.dev, Tejun Heo <tj@kernel.org>
Subject: [tj-wq:for-7.1 14/18] kernel/workqueue.c:8289:34: warning: array subscript 1 is above array bounds of 'int[1]'
Date: Fri, 03 Apr 2026 16:42:14 +0800 [thread overview]
Message-ID: <202604022343.GQtkF2vO-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-7.1
head: 41e3ccca00b374b7f39cf68e818b59a921cd7069
commit: 5920d046f7ae3bf9cf51b9d915c1fff13d299d84 [14/18] workqueue: add WQ_AFFN_CACHE_SHARD affinity scope
config: nios2-randconfig-001-20260402 (https://download.01.org/0day-ci/archive/20260402/202604022343.GQtkF2vO-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260402/202604022343.GQtkF2vO-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604022343.GQtkF2vO-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/workqueue.c: In function 'workqueue_init_topology':
>> kernel/workqueue.c:8289:34: warning: array subscript 1 is above array bounds of 'int[1]' [-Warray-bounds]
cpu_shard_id[c] = cpu_shard_id[cpumask_first(sibling_cpus)];
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +8289 kernel/workqueue.c
8251
8252 /**
8253 * llc_populate_cpu_shard_id - populate cpu_shard_id[] for each CPU in an LLC pod
8254 * @pod_cpus: the cpumask of CPUs in the LLC pod
8255 * @smt_pods: the SMT pod type, used to identify sibling groups
8256 * @nr_cores: number of distinct cores in @pod_cpus (from llc_count_cores())
8257 *
8258 * Walks @pod_cpus in order. At each SMT group leader, advances to the next
8259 * shard once the current shard is full. Results are written to cpu_shard_id[].
8260 */
8261 static void __init llc_populate_cpu_shard_id(const struct cpumask *pod_cpus,
8262 struct wq_pod_type *smt_pods,
8263 int nr_cores)
8264 {
8265 struct llc_shard_layout layout = llc_calc_shard_layout(nr_cores);
8266 const struct cpumask *sibling_cpus;
8267 /* Count the number of cores in the current shard_id */
8268 int cores_in_shard = 0;
8269 /* This is a cursor for the shards. Go from zero to nr_shards - 1*/
8270 int shard_id = 0;
8271 int c;
8272
8273 /* Iterate at every CPU for a given LLC pod, and assign it a shard */
8274 for_each_cpu(c, pod_cpus) {
8275 sibling_cpus = smt_pods->pod_cpus[smt_pods->cpu_pod[c]];
8276 if (cpumask_first(sibling_cpus) == c) {
8277 /* This is the CPU leader for the siblings */
8278 if (llc_shard_is_full(cores_in_shard, shard_id, &layout)) {
8279 shard_id++;
8280 cores_in_shard = 0;
8281 }
8282 cores_in_shard++;
8283 cpu_shard_id[c] = shard_id;
8284 } else {
8285 /*
8286 * The siblings' shard MUST be the same as the leader.
8287 * never split threads in the same core.
8288 */
> 8289 cpu_shard_id[c] = cpu_shard_id[cpumask_first(sibling_cpus)];
8290 }
8291 }
8292
8293 WARN_ON_ONCE(shard_id != (layout.nr_shards - 1));
8294 }
8295
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-04-03 8:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 8:42 kernel test robot [this message]
2026-04-09 15:27 ` [tj-wq:for-7.1 14/18] kernel/workqueue.c:8289:34: warning: array subscript 1 is above array bounds of 'int[1]' Breno Leitao
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=202604022343.GQtkF2vO-lkp@intel.com \
--to=lkp@intel.com \
--cc=leitao@debian.org \
--cc=oe-kbuild-all@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.