Re: [PATCH v9 3/3] sched/uclamp: Fix race condition leading to imbalanced uclamp_rq

From: kernel test robot

Date: Sun Nov 29 2026 - 21:43:07 EST


Hi Qais,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on tip/master peterz-queue/sched/core linus/master v7.4-rc4 next-20261127]
[cannot apply to tip/auto-latest]
[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/Qais-Yousef/sched-uclamp-Use-wrappers-instead-of-open-coding-UCLAMP_FLAG_IDLE/20261129-184050
base: tip/sched/core
patch link: https://lore.kernel.org/r/20261129184052.15594-4-qyousef%40layalina.io
patch subject: [PATCH v9 3/3] sched/uclamp: Fix race condition leading to imbalanced uclamp_rq
config: powerpc-randconfig-1001-20261130 (https://download.01.org/0day-ci/archive/20261130/20261130101002.Z9w2mfyr-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 12.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261130/20261130101002.Z9w2mfyr-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261130101002.Z9w2mfyr-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

kernel/sched/core.c: In function 'uclamp_update_active':
>> kernel/sched/core.c:1982:13: error: implicit declaration of function 'task_is_throttled'; did you mean 'task_is_traced'? [-Werror=implicit-function-declaration]
1982 | task_is_throttled(p)) {
| ^~~~~~~~~~~~~~~~~
| task_is_traced
cc1: some warnings being treated as errors


vim +1982 kernel/sched/core.c

1951
1952 static inline void
1953 uclamp_update_active(struct task_struct *p)
1954 {
1955 enum uclamp_id clamp_id;
1956 struct rq_flags rf;
1957 struct rq *rq;
1958
1959 /*
1960 * Lock the task and the rq where the task is (or was) queued.
1961 *
1962 * We might lock the (previous) rq of a !RUNNABLE task, but that's the
1963 * price to pay to safely serialize util_{min,max} updates with
1964 * enqueues, dequeues and migration operations.
1965 * This is the same locking schema used by __set_cpus_allowed_ptr().
1966 */
1967 rq = task_rq_lock(p, &rf);
1968
1969 /*
1970 * Setting the clamp bucket is serialized by task_rq_lock().
1971 * If the task is not yet RUNNABLE and its task_struct is not
1972 * affecting a valid clamp bucket, the next time it's enqueued,
1973 * it will already see the updated clamp bucket value.
1974 *
1975 * Skip tasks that are not queued on rq, or have already been
1976 * decremented by delayed dequeue or CFS bandwidth throttling; if a
1977 * task missed uclamp_rq_dec() during the static-key enabling race,
1978 * clear its stale active flag instead of decrementing a potentially
1979 * reset rq.
1980 */
1981 if (!task_on_rq_queued(p) || p->se.sched_delayed ||
> 1982 task_is_throttled(p)) {
1983 for_each_clamp_id(clamp_id)
1984 p->uclamp[clamp_id].active = false;
1985 goto unlock;
1986 }
1987
1988 for_each_clamp_id(clamp_id)
1989 uclamp_rq_reinc_id(rq, p, clamp_id);
1990
1991 unlock:
1992 task_rq_unlock(rq, p, &rf);
1993 }
1994

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