linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Xiaochen Shen <xiaochen.shen@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, Borislav Petkov <bp@suse.de>,
	Tony Luck <tony.luck@intel.com>
Subject: [tip:x86/cache 6/6] arch/x86/kernel/cpu/resctrl/monitor.c:291:6: warning: variable 'chunks' set but not used
Date: Thu, 10 Dec 2020 05:27:22 +0800	[thread overview]
Message-ID: <202012100516.H7sTNehL-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/cache
head:   2ba836dbe2467d31fffb439258c2f454c6f1a317
commit: 2ba836dbe2467d31fffb439258c2f454c6f1a317 [6/6] x86/resctrl: Fix incorrect local bandwidth when mba_sc is enabled
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=2ba836dbe2467d31fffb439258c2f454c6f1a317
        git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
        git fetch --no-tags tip x86/cache
        git checkout 2ba836dbe2467d31fffb439258c2f454c6f1a317
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   arch/x86/kernel/cpu/resctrl/monitor.c: In function '__mon_event_count':
>> arch/x86/kernel/cpu/resctrl/monitor.c:291:6: warning: variable 'chunks' set but not used [-Wunused-but-set-variable]
     291 |  u64 chunks, tval;
         |      ^~~~~~

vim +/chunks +291 arch/x86/kernel/cpu/resctrl/monitor.c

ba0f26d8529c2d arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2018-04-20  287  
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  288  static int __mon_event_count(u32 rmid, struct rmid_read *rr)
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  289  {
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  290  	struct mbm_state *m;
ba0f26d8529c2d arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2018-04-20 @291  	u64 chunks, tval;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  292  
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  293  	tval = __rmid_read(rmid, rr->evtid);
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  294  	if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL)) {
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  295  		rr->val = tval;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  296  		return -EINVAL;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  297  	}
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  298  	switch (rr->evtid) {
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  299  	case QOS_L3_OCCUP_EVENT_ID:
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  300  		rr->val += tval;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  301  		return 0;
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  302  	case QOS_L3_MBM_TOTAL_EVENT_ID:
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  303  		m = &rr->d->mbm_total[rmid];
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  304  		break;
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  305  	case QOS_L3_MBM_LOCAL_EVENT_ID:
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  306  		m = &rr->d->mbm_local[rmid];
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  307  		break;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  308  	default:
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  309  		/*
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  310  		 * Code would never reach here because
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  311  		 * an invalid event id would fail the __rmid_read.
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  312  		 */
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  313  		return -EINVAL;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  314  	}
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  315  
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  316  	if (rr->first) {
ba0f26d8529c2d arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2018-04-20  317  		memset(m, 0, sizeof(struct mbm_state));
ba0f26d8529c2d arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2018-04-20  318  		m->prev_bw_msr = m->prev_msr = tval;
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  319  		return 0;
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  320  	}
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  321  
46637d4570e108 arch/x86/kernel/cpu/resctrl/monitor.c   Reinette Chatre 2020-05-05  322  	chunks = mbm_overflow_count(m->prev_msr, tval, rr->r->mbm_width);
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  323  	m->prev_msr = tval;
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  324  
4868a61d498af3 arch/x86/kernel/cpu/resctrl/monitor.c   Fenghua Yu      2020-10-14  325  	rr->val += get_corrected_mbm_count(rmid, m->chunks);
4868a61d498af3 arch/x86/kernel/cpu/resctrl/monitor.c   Fenghua Yu      2020-10-14  326  
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       2017-07-25  327  	return 0;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  328  }
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  2017-07-25  329  

:::::: The code at line 291 was first introduced by commit
:::::: ba0f26d8529c2dfc9aa6d9e8a338180737f8c1be x86/intel_rdt/mba_sc: Prepare for feedback loop

:::::: TO: Vikas Shivappa <vikas.shivappa@linux.intel.com>
:::::: CC: Thomas Gleixner <tglx@linutronix.de>

---
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: 75876 bytes --]

                 reply	other threads:[~2020-12-09 21:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202012100516.H7sTNehL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bp@suse.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=xiaochen.shen@intel.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;
as well as URLs for NNTP newsgroup(s).