linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <yujie.liu@intel.com>
To: Mel Gorman <mgorman@suse.de>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: [mel:sched-sisdepth-v1r3 3/3] kernel/sched/fair.c:6287:4: warning: Value stored to 'nr' is never read [clang-analyzer-deadcode.DeadStores]
Date: Wed, 24 Nov 2021 11:51:03 +0800	[thread overview]
Message-ID: <b83342cc-b38d-208f-f7f5-51f9321d22b5@intel.com> (raw)
In-Reply-To: <202111200358.JOiCQRbJ-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 6037 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git sched-sisdepth-v1r3
head:   29b51054eca8c8c58122830b8a747df1a4605045
commit: 29b51054eca8c8c58122830b8a747df1a4605045 [3/3] SIS_DEPTH
config: riscv-randconfig-c006-20211027 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
reproduce (this is a W=1 build):
         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # install riscv cross compiling tool for clang build
         # apt-get install binutils-riscv64-linux-gnu
         # https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git/commit/?id=29b51054eca8c8c58122830b8a747df1a4605045
         git remote add mel https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git
         git fetch --no-tags mel sched-sisdepth-v1r3
         git checkout 29b51054eca8c8c58122830b8a747df1a4605045
         # save the attached .config to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <yujie.liu@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)

 >> kernel/sched/fair.c:6287:4: warning: Value stored to 'nr' is never read [clang-analyzer-deadcode.DeadStores]
                            nr *= sched_smt_weight;
                            ^

vim +/nr +6287 kernel/sched/fair.c

8335aa1277b644 Mel Gorman        2021-06-17  6265
10e2f1acd0106c Peter Zijlstra    2016-05-09  6266  /*
10e2f1acd0106c Peter Zijlstra    2016-05-09  6267   * Scan the LLC domain for idle CPUs; this is dynamically regulated by
29b51054eca8c8 Mel Gorman        2021-10-11  6268   * the success or failure of previous scans;
10e2f1acd0106c Peter Zijlstra    2016-05-09  6269   */
c722f35b513f80 Rik van Riel      2021-03-26  6270  static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool has_idle_core, int target)
10e2f1acd0106c Peter Zijlstra    2016-05-09  6271  {
60588bfa223ff6 Cheng Jian        2019-12-13  6272  	struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask);
9fe1f127b91331 Mel Gorman        2021-01-27  6273  	int i, cpu, idle_cpu = -1, nr = INT_MAX;
9cfb38a7ba5a9c Wanpeng Li        2016-10-09  6274  	struct sched_domain *this_sd;
29b51054eca8c8 Mel Gorman        2021-10-11  6275  	int depth = 0;
10e2f1acd0106c Peter Zijlstra    2016-05-09  6276
9cfb38a7ba5a9c Wanpeng Li        2016-10-09  6277  	this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc));
9cfb38a7ba5a9c Wanpeng Li        2016-10-09  6278  	if (!this_sd)
9cfb38a7ba5a9c Wanpeng Li        2016-10-09  6279  		return -1;
9cfb38a7ba5a9c Wanpeng Li        2016-10-09  6280
bae4ec13640b09 Mel Gorman        2021-01-25  6281  	cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
bae4ec13640b09 Mel Gorman        2021-01-25  6282
29b51054eca8c8 Mel Gorman        2021-10-11  6283  	if (sched_feat(SIS_DEPTH)) {
29b51054eca8c8 Mel Gorman        2021-10-11  6284  		depth = min_t(int, this_sd->sis_scan_depth, nr);
1ad3aaf3fcd244 Peter Zijlstra    2017-05-17  6285
b1168d8cf90943 Mel Gorman        2021-06-18  6286  		if (!has_idle_core)
8335aa1277b644 Mel Gorman        2021-06-17 @6287  			nr *= sched_smt_weight;
29b51054eca8c8 Mel Gorman        2021-10-11  6288  		nr = depth;
bae4ec13640b09 Mel Gorman        2021-01-25  6289  	}
60588bfa223ff6 Cheng Jian        2019-12-13  6290
29b51054eca8c8 Mel Gorman        2021-10-11  6291  	cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
29b51054eca8c8 Mel Gorman        2021-10-11  6292
56498cfb045d71 Mel Gorman        2021-08-04  6293  	for_each_cpu_wrap(cpu, cpus, target + 1) {
29b51054eca8c8 Mel Gorman        2021-10-11  6294  		if (--nr < 0) {
29b51054eca8c8 Mel Gorman        2021-10-11  6295  			depth = clamp(depth - 1, 1, sis_min_cores * sched_smt_weight);
b1168d8cf90943 Mel Gorman        2021-06-18  6296  			break;
29b51054eca8c8 Mel Gorman        2021-10-11  6297  		}
b1168d8cf90943 Mel Gorman        2021-06-18  6298
c722f35b513f80 Rik van Riel      2021-03-26  6299  		if (has_idle_core) {
9fe1f127b91331 Mel Gorman        2021-01-27  6300  			i = select_idle_core(p, cpu, cpus, &idle_cpu);
9fe1f127b91331 Mel Gorman        2021-01-27  6301  			if ((unsigned int)i < nr_cpumask_bits)
b1168d8cf90943 Mel Gorman        2021-06-18  6302  				break;
9fe1f127b91331 Mel Gorman        2021-01-27  6303  		} else {
97886d9dcd8682 Aubrey Li         2021-03-24  6304  			idle_cpu = __select_idle_cpu(cpu, p);
9fe1f127b91331 Mel Gorman        2021-01-27  6305  			if ((unsigned int)idle_cpu < nr_cpumask_bits)
10e2f1acd0106c Peter Zijlstra    2016-05-09  6306  				break;
10e2f1acd0106c Peter Zijlstra    2016-05-09  6307  		}
9fe1f127b91331 Mel Gorman        2021-01-27  6308  	}
10e2f1acd0106c Peter Zijlstra    2016-05-09  6309
29b51054eca8c8 Mel Gorman        2021-10-11  6310  	if ((unsigned int)idle_cpu < nr_cpumask_bits && has_idle_core)
02dbb7246c5bbb Gautham R. Shenoy 2021-05-11  6311  		set_idle_cores(target, false);
9fe1f127b91331 Mel Gorman        2021-01-27  6312
29b51054eca8c8 Mel Gorman        2021-10-11  6313  	if (sched_feat(SIS_DEPTH)) {
29b51054eca8c8 Mel Gorman        2021-10-11  6314  		if (idle_cpu)
29b51054eca8c8 Mel Gorman        2021-10-11  6315  			depth = min_t(int, depth + 1, sd->span_weight / sched_smt_weight);
29b51054eca8c8 Mel Gorman        2021-10-11  6316  		if (this_sd->sis_scan_depth != depth)
29b51054eca8c8 Mel Gorman        2021-10-11  6317  			this_sd->sis_scan_depth = depth;
b1168d8cf90943 Mel Gorman        2021-06-18  6318  	}
10e2f1acd0106c Peter Zijlstra    2016-05-09  6319
9fe1f127b91331 Mel Gorman        2021-01-27  6320  	return idle_cpu;
10e2f1acd0106c Peter Zijlstra    2016-05-09  6321  }
10e2f1acd0106c Peter Zijlstra    2016-05-09  6322

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31915 bytes --]

           reply	other threads:[~2021-11-24  3:51 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <202111200358.JOiCQRbJ-lkp@intel.com>]

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=b83342cc-b38d-208f-f7f5-51f9321d22b5@intel.com \
    --to=yujie.liu@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mgorman@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).