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-warni... 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-052-20241026 (https://download.01.org/0day-ci/archive/20241026/202410260511.Ky8AtElD-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241026/202410260511.Ky8AtElD-lkp@i...)
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 | Closes: https://lore.kernel.org/oe-kbuild-all/202410260511.Ky8AtElD-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/sched/core.c: In function 'sysctl_sched_uclamp_handler':
kernel/sched/core.c:1865:23: error: 'uclamp_mutex' undeclared (first use in this function); did you mean 'uclamp_none'?
1865 | guard(mutex)(&uclamp_mutex); | ^~~~~~~~~~~~ | uclamp_none kernel/sched/core.c:1865:23: note: each undeclared identifier is reported only once for each function it appears in
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