lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202410260638.VpY4j0AB-lkp@intel.com>
Date: Sat, 26 Oct 2024 06:19:12 +0800
From: kernel test robot <lkp@...el.com>
To: Qi Xi <xiqi2@...wei.com>, kernel@...neuler.org,
	bobo.shaobowang@...wei.com, mingo@...hat.com, peterz@...radead.org,
	juri.lelli@...hat.com, vincent.guittot@...aro.org,
	dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
	mgorman@...e.de, vschneid@...hat.com, patrick.bellasi@....com,
	mkoutny@...e.com, tj@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: Fix compile warning about variable 'uclamp_mutex'

Hi Qi,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on linus/master v6.12-rc4 next-20241025]
[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/Qi-Xi/sched-Fix-compile-warning-about-variable-uclamp_mutex/20241025-115315
base:   tip/sched/core
patch link:    https://lore.kernel.org/r/20241025034740.546570-1-xiqi2%40huawei.com
patch subject: [PATCH] sched: Fix compile warning about variable 'uclamp_mutex'
config: i386-randconfig-053-20241026 (https://download.01.org/0day-ci/archive/20241026/202410260638.VpY4j0AB-lkp@intel.com/config)
compiler: clang version 19.1.2 (https://github.com/llvm/llvm-project 7ba7d8e2f7b6445b60679da826210cdde29eaf8b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241026/202410260638.VpY4j0AB-lkp@intel.com/reproduce)

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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410260638.VpY4j0AB-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/sched/core.c:10:
   In file included from include/linux/highmem.h:8:
   In file included from include/linux/cacheflush.h:5:
   In file included from arch/x86/include/asm/cacheflush.h:5:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> kernel/sched/core.c:1865:16: error: use of undeclared identifier 'uclamp_mutex'; did you mean 'uclamp_none'?
    1865 |         guard(mutex)(&uclamp_mutex);
         |                       ^~~~~~~~~~~~
         |                       uclamp_none
   kernel/sched/sched.h:3377:28: note: 'uclamp_none' declared here
    3377 | static inline unsigned int uclamp_none(enum uclamp_id clamp_id)
         |                            ^
   1 warning and 1 error generated.


vim +1865 kernel/sched/core.c

494dcdf46e5cde YueHaibing        2022-04-27  1857  
78eb4ea25cd5fd Joel Granados     2024-07-24  1858  static int sysctl_sched_uclamp_handler(const struct ctl_table *table, int write,
32927393dc1ccd Christoph Hellwig 2020-04-24  1859  				void *buffer, size_t *lenp, loff_t *ppos)
e8f14172c6b11e Patrick Bellasi   2019-06-21  1860  {
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1861  	bool update_root_tg = false;
13685c4a08fca9 Qais Yousef       2020-07-16  1862  	int old_min, old_max, old_min_rt;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1863  	int result;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1864  
0f92cdf36f848f Peter Zijlstra    2023-08-01 @1865  	guard(mutex)(&uclamp_mutex);
0f92cdf36f848f Peter Zijlstra    2023-08-01  1866  
e8f14172c6b11e Patrick Bellasi   2019-06-21  1867  	old_min = sysctl_sched_uclamp_util_min;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1868  	old_max = sysctl_sched_uclamp_util_max;
13685c4a08fca9 Qais Yousef       2020-07-16  1869  	old_min_rt = sysctl_sched_uclamp_util_min_rt_default;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1870  
e8f14172c6b11e Patrick Bellasi   2019-06-21  1871  	result = proc_dointvec(table, write, buffer, lenp, ppos);
e8f14172c6b11e Patrick Bellasi   2019-06-21  1872  	if (result)
e8f14172c6b11e Patrick Bellasi   2019-06-21  1873  		goto undo;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1874  	if (!write)
0f92cdf36f848f Peter Zijlstra    2023-08-01  1875  		return 0;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1876  
e8f14172c6b11e Patrick Bellasi   2019-06-21  1877  	if (sysctl_sched_uclamp_util_min > sysctl_sched_uclamp_util_max ||
13685c4a08fca9 Qais Yousef       2020-07-16  1878  	    sysctl_sched_uclamp_util_max > SCHED_CAPACITY_SCALE	||
13685c4a08fca9 Qais Yousef       2020-07-16  1879  	    sysctl_sched_uclamp_util_min_rt_default > SCHED_CAPACITY_SCALE) {
13685c4a08fca9 Qais Yousef       2020-07-16  1880  
e8f14172c6b11e Patrick Bellasi   2019-06-21  1881  		result = -EINVAL;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1882  		goto undo;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1883  	}
e8f14172c6b11e Patrick Bellasi   2019-06-21  1884  
e8f14172c6b11e Patrick Bellasi   2019-06-21  1885  	if (old_min != sysctl_sched_uclamp_util_min) {
e8f14172c6b11e Patrick Bellasi   2019-06-21  1886  		uclamp_se_set(&uclamp_default[UCLAMP_MIN],
a509a7cd797470 Patrick Bellasi   2019-06-21  1887  			      sysctl_sched_uclamp_util_min, false);
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1888  		update_root_tg = true;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1889  	}
e8f14172c6b11e Patrick Bellasi   2019-06-21  1890  	if (old_max != sysctl_sched_uclamp_util_max) {
e8f14172c6b11e Patrick Bellasi   2019-06-21  1891  		uclamp_se_set(&uclamp_default[UCLAMP_MAX],
a509a7cd797470 Patrick Bellasi   2019-06-21  1892  			      sysctl_sched_uclamp_util_max, false);
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1893  		update_root_tg = true;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1894  	}
e8f14172c6b11e Patrick Bellasi   2019-06-21  1895  
46609ce227039f Qais Yousef       2020-06-30  1896  	if (update_root_tg) {
46609ce227039f Qais Yousef       2020-06-30  1897  		static_branch_enable(&sched_uclamp_used);
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1898  		uclamp_update_root_tg();
46609ce227039f Qais Yousef       2020-06-30  1899  	}
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1900  
13685c4a08fca9 Qais Yousef       2020-07-16  1901  	if (old_min_rt != sysctl_sched_uclamp_util_min_rt_default) {
13685c4a08fca9 Qais Yousef       2020-07-16  1902  		static_branch_enable(&sched_uclamp_used);
13685c4a08fca9 Qais Yousef       2020-07-16  1903  		uclamp_sync_util_min_rt_default();
13685c4a08fca9 Qais Yousef       2020-07-16  1904  	}
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1905  
e8f14172c6b11e Patrick Bellasi   2019-06-21  1906  	/*
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1907  	 * We update all RUNNABLE tasks only when task groups are in use.
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1908  	 * Otherwise, keep it simple and do just a lazy update at each next
7274a5c1bbec45 Patrick Bellasi   2019-08-22  1909  	 * task enqueue time.
e8f14172c6b11e Patrick Bellasi   2019-06-21  1910  	 */
0f92cdf36f848f Peter Zijlstra    2023-08-01  1911  	return 0;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1912  
e8f14172c6b11e Patrick Bellasi   2019-06-21  1913  undo:
e8f14172c6b11e Patrick Bellasi   2019-06-21  1914  	sysctl_sched_uclamp_util_min = old_min;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1915  	sysctl_sched_uclamp_util_max = old_max;
13685c4a08fca9 Qais Yousef       2020-07-16  1916  	sysctl_sched_uclamp_util_min_rt_default = old_min_rt;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1917  	return result;
e8f14172c6b11e Patrick Bellasi   2019-06-21  1918  }
494dcdf46e5cde YueHaibing        2022-04-27  1919  #endif
e8f14172c6b11e Patrick Bellasi   2019-06-21  1920  

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ