All of lore.kernel.org
 help / color / mirror / Atom feed
* [openeuler:OLK-6.6 1351/1351] fs/resctrl/monitor.c:222 resctrl_find_cleanest_closid() warn: iterator 'i' not incremented
@ 2024-11-05 14:44 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-11-05 14:44 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: kernel@openeuler.org
TO: Zeng Heng <zengheng4@huawei.com>

tree:   https://gitee.com/openeuler/kernel.git OLK-6.6
head:   be25139622a639593fdb2e34ef7c259833956980
commit: 13e249bf4944afceae17195b7bb77c767ff61384 [1351/1351] x86/resctrl: Move the filesystem portions of resctrl to live in '/fs/'
:::::: branch date: 5 hours ago
:::::: commit date: 10 months ago
config: x86_64-randconfig-161-20241103 (https://download.01.org/0day-ci/archive/20241106/202411060018.LrrsbbHA-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.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/202411060018.LrrsbbHA-lkp@intel.com/

smatch warnings:
fs/resctrl/monitor.c:222 resctrl_find_cleanest_closid() warn: iterator 'i' not incremented

vim +/i +222 fs/resctrl/monitor.c

13e249bf4944af James Morse 2024-01-22  206  
13e249bf4944af James Morse 2024-01-22  207  /**
13e249bf4944af James Morse 2024-01-22  208   * resctrl_find_cleanest_closid() - Find a CLOSID where all the associated
13e249bf4944af James Morse 2024-01-22  209   *                                  RMID are clean, or the CLOSID that has
13e249bf4944af James Morse 2024-01-22  210   *                                  the most clean RMID.
13e249bf4944af James Morse 2024-01-22  211   *
13e249bf4944af James Morse 2024-01-22  212   * MPAM's equivalent of RMID are per-CLOSID, meaning a freshly allocated CLOSID
13e249bf4944af James Morse 2024-01-22  213   * may not be able to allocate clean RMID. To avoid this the allocator will
13e249bf4944af James Morse 2024-01-22  214   * choose the CLOSID with the most clean RMID.
13e249bf4944af James Morse 2024-01-22  215   *
13e249bf4944af James Morse 2024-01-22  216   * When the CLOSID and RMID are independent numbers, the first free CLOSID will
13e249bf4944af James Morse 2024-01-22  217   * be returned.
13e249bf4944af James Morse 2024-01-22  218   */
13e249bf4944af James Morse 2024-01-22  219  int resctrl_find_cleanest_closid(void)
13e249bf4944af James Morse 2024-01-22  220  {
13e249bf4944af James Morse 2024-01-22  221  	u32 cleanest_closid = ~0;
13e249bf4944af James Morse 2024-01-22 @222  	int i = 0;
13e249bf4944af James Morse 2024-01-22  223  
13e249bf4944af James Morse 2024-01-22  224  	lockdep_assert_held(&rdtgroup_mutex);
13e249bf4944af James Morse 2024-01-22  225  
13e249bf4944af James Morse 2024-01-22  226  	if (!IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID))
13e249bf4944af James Morse 2024-01-22  227  		return -EIO;
13e249bf4944af James Morse 2024-01-22  228  
13e249bf4944af James Morse 2024-01-22  229  	for (i = 0; i < closids_supported(); i++) {
13e249bf4944af James Morse 2024-01-22  230  		int num_dirty;
13e249bf4944af James Morse 2024-01-22  231  
13e249bf4944af James Morse 2024-01-22  232  		if (closid_allocated(i))
13e249bf4944af James Morse 2024-01-22  233  			continue;
13e249bf4944af James Morse 2024-01-22  234  
13e249bf4944af James Morse 2024-01-22  235  		num_dirty = closid_num_dirty_rmid[i];
13e249bf4944af James Morse 2024-01-22  236  		if (num_dirty == 0)
13e249bf4944af James Morse 2024-01-22  237  			return i;
13e249bf4944af James Morse 2024-01-22  238  
13e249bf4944af James Morse 2024-01-22  239  		if (cleanest_closid == ~0)
13e249bf4944af James Morse 2024-01-22  240  			cleanest_closid = i;
13e249bf4944af James Morse 2024-01-22  241  
13e249bf4944af James Morse 2024-01-22  242  		if (num_dirty < closid_num_dirty_rmid[cleanest_closid])
13e249bf4944af James Morse 2024-01-22  243  			cleanest_closid = i;
13e249bf4944af James Morse 2024-01-22  244  	}
13e249bf4944af James Morse 2024-01-22  245  
13e249bf4944af James Morse 2024-01-22  246  	if (cleanest_closid == ~0)
13e249bf4944af James Morse 2024-01-22  247  		return -ENOSPC;
13e249bf4944af James Morse 2024-01-22  248  
13e249bf4944af James Morse 2024-01-22  249  	return cleanest_closid;
13e249bf4944af James Morse 2024-01-22  250  }
13e249bf4944af James Morse 2024-01-22  251  

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-05 14:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 14:44 [openeuler:OLK-6.6 1351/1351] fs/resctrl/monitor.c:222 resctrl_find_cleanest_closid() warn: iterator 'i' not incremented kernel test robot

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.