[tip:x86/cache 6/6] arch/x86/kernel/cpu/resctrl/monitor.c:291:6: warning: variable 'chunks' set but not used

From: kernel test robot
Date: Wed Dec 09 2020 - 16:28:50 EST


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@xxxxxxxxx>

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@xxxxxxxxxxxxxxx>
:::::: CC: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip