All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] rcu-tasks: Fix access non-existent percpu rtpcp variable in rcu_tasks_need_gpcb()
Date: Mon, 3 Jun 2024 19:27:08 +0800	[thread overview]
Message-ID: <202406031955.KTGAW4fl-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240603055229.23601-1-qiang.zhang1211@gmail.com>
References: <20240603055229.23601-1-qiang.zhang1211@gmail.com>
TO: Zqiang <qiang.zhang1211@gmail.com>
TO: paulmck@kernel.org
TO: frederic@kernel.org
TO: neeraj.upadhyay@kernel.org
TO: joel@joelfernandes.org
TO: urezki@gmail.com
CC: qiang.zhang1211@gmail.com
CC: rcu@vger.kernel.org
CC: linux-kernel@vger.kernel.org

Hi Zqiang,

kernel test robot noticed the following build warnings:

[auto build test WARNING on paulmck-rcu/dev]
[also build test WARNING on linus/master v6.10-rc2 next-20240603]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Zqiang/rcu-tasks-Fix-access-non-existent-percpu-rtpcp-variable-in-rcu_tasks_need_gpcb/20240603-135610
base:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev
patch link:    https://lore.kernel.org/r/20240603055229.23601-1-qiang.zhang1211%40gmail.com
patch subject: [PATCH] rcu-tasks: Fix access non-existent percpu rtpcp variable in rcu_tasks_need_gpcb()
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: i386-randconfig-141-20240603 (https://download.01.org/0day-ci/archive/20240603/202406031955.KTGAW4fl-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202406031955.KTGAW4fl-lkp@intel.com/

smatch warnings:
kernel/rcu/tasks.h:278 cblist_init_generic() error: uninitialized symbol 'maxcpu'.

vim +/maxcpu +278 kernel/rcu/tasks.h

af051ca4e4231f Paul E. McKenney 2020-03-16  242  
cafafd67765b21 Paul E. McKenney 2021-11-05  243  // Initialize per-CPU callback lists for the specified flavor of
cb88f7f51bc6f3 Paul E. McKenney 2023-07-28  244  // Tasks RCU.  Do not enqueue callbacks before this function is invoked.
cafafd67765b21 Paul E. McKenney 2021-11-05  245  static void cblist_init_generic(struct rcu_tasks *rtp)
cafafd67765b21 Paul E. McKenney 2021-11-05  246  {
cafafd67765b21 Paul E. McKenney 2021-11-05  247  	int cpu;
8610b65680390a Paul E. McKenney 2021-11-12  248  	int lim;
da123016ca8cb5 Paul E. McKenney 2022-01-26  249  	int shift;
db390456e3abf6 Zqiang           2024-06-03  250  	int maxcpu;
cafafd67765b21 Paul E. McKenney 2021-11-05  251  
ab97152f88a4d5 Paul E. McKenney 2021-11-24  252  	if (rcu_task_enqueue_lim < 0) {
ab97152f88a4d5 Paul E. McKenney 2021-11-24  253  		rcu_task_enqueue_lim = 1;
ab97152f88a4d5 Paul E. McKenney 2021-11-24  254  		rcu_task_cb_adjust = true;
ab97152f88a4d5 Paul E. McKenney 2021-11-24  255  	} else if (rcu_task_enqueue_lim == 0) {
8610b65680390a Paul E. McKenney 2021-11-12  256  		rcu_task_enqueue_lim = 1;
ab97152f88a4d5 Paul E. McKenney 2021-11-24  257  	}
8610b65680390a Paul E. McKenney 2021-11-12  258  	lim = rcu_task_enqueue_lim;
8610b65680390a Paul E. McKenney 2021-11-12  259  
cafafd67765b21 Paul E. McKenney 2021-11-05  260  	for_each_possible_cpu(cpu) {
cafafd67765b21 Paul E. McKenney 2021-11-05  261  		struct rcu_tasks_percpu *rtpcp = per_cpu_ptr(rtp->rtpcpu, cpu);
cafafd67765b21 Paul E. McKenney 2021-11-05  262  
cafafd67765b21 Paul E. McKenney 2021-11-05  263  		WARN_ON_ONCE(!rtpcp);
cafafd67765b21 Paul E. McKenney 2021-11-05  264  		if (cpu)
381a4f3b38603a Paul E. McKenney 2021-11-08  265  			raw_spin_lock_init(&ACCESS_PRIVATE(rtpcp, lock));
9b073de1c7a354 Paul E. McKenney 2021-11-08  266  		if (rcu_segcblist_empty(&rtpcp->cblist))
9b073de1c7a354 Paul E. McKenney 2021-11-08  267  			rcu_segcblist_init(&rtpcp->cblist);
d363f833c6d883 Paul E. McKenney 2021-11-10  268  		INIT_WORK(&rtpcp->rtp_work, rcu_tasks_invoke_cbs_wq);
d363f833c6d883 Paul E. McKenney 2021-11-10  269  		rtpcp->cpu = cpu;
d363f833c6d883 Paul E. McKenney 2021-11-10  270  		rtpcp->rtpp = rtp;
434c9eefb959c3 Paul E. McKenney 2022-05-16  271  		if (!rtpcp->rtp_blkd_tasks.next)
434c9eefb959c3 Paul E. McKenney 2022-05-16  272  			INIT_LIST_HEAD(&rtpcp->rtp_blkd_tasks);
46faf9d8e1d52e Paul E. McKenney 2024-02-05  273  		if (!rtpcp->rtp_exit_list.next)
46faf9d8e1d52e Paul E. McKenney 2024-02-05  274  			INIT_LIST_HEAD(&rtpcp->rtp_exit_list);
db390456e3abf6 Zqiang           2024-06-03  275  		maxcpu = cpu;
cafafd67765b21 Paul E. McKenney 2021-11-05  276  	}
5fc8cbe4cf0fd3 Shigeru Yoshida  2022-08-03  277  
db390456e3abf6 Zqiang           2024-06-03 @278  	rcu_task_cpu_ids = maxcpu + 1;
db390456e3abf6 Zqiang           2024-06-03  279  	if (lim > rcu_task_cpu_ids)
db390456e3abf6 Zqiang           2024-06-03  280  		lim = rcu_task_cpu_ids;
db390456e3abf6 Zqiang           2024-06-03  281  	shift = ilog2(rcu_task_cpu_ids / lim);
db390456e3abf6 Zqiang           2024-06-03  282  	if (((rcu_task_cpu_ids - 1) >> shift) >= lim)
db390456e3abf6 Zqiang           2024-06-03  283  		shift++;
db390456e3abf6 Zqiang           2024-06-03  284  	WRITE_ONCE(rtp->percpu_enqueue_shift, shift);
db390456e3abf6 Zqiang           2024-06-03  285  	WRITE_ONCE(rtp->percpu_dequeue_lim, lim);
db390456e3abf6 Zqiang           2024-06-03  286  	smp_store_release(&rtp->percpu_enqueue_lim, lim);
db390456e3abf6 Zqiang           2024-06-03  287  	pr_info("%s: Setting shift to %d and lim to %d rcu_task_cb_adjust=%d rcu_task_cpu_ids=%d.\n",
db390456e3abf6 Zqiang           2024-06-03  288  			rtp->name, data_race(rtp->percpu_enqueue_shift), data_race(rtp->percpu_enqueue_lim),
db390456e3abf6 Zqiang           2024-06-03  289  			rcu_task_cb_adjust, rcu_task_cpu_ids);
cafafd67765b21 Paul E. McKenney 2021-11-05  290  }
cafafd67765b21 Paul E. McKenney 2021-11-05  291  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2024-06-03 11:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 11:27 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-03  5:52 [PATCH] rcu-tasks: Fix access non-existent percpu rtpcp variable in rcu_tasks_need_gpcb() Zqiang
2024-06-03 23:45 ` Paul E. McKenney
2024-06-04  2:26   ` Z qiang
2024-06-04  3:16     ` Paul E. McKenney

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=202406031955.KTGAW4fl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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.