All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel/sched/fair.c:9070 select_slice_cpu() warn: missing error code? 'cpu'
@ 2026-10-05 14:29 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-05 14:29 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Vincent Guittot <vincent.guittot@linaro.org>
CC: 0day robot <lkp@intel.com>

tree:   https://github.com/intel-lab-lkp/linux/commits/Christian-Loehle/sched-eevdf-Cap-protection-when-current-has-the-shortest-slice/20260930-094737
head:   36883d29d7f46d450252ebe303f37131e2b837d2
commit: 8f8df1b98a5a60901a80f3f74b1c9ada4513f095 sched/eevdf: Add min slice check when selecting CPU
date:   2 weeks ago
:::::: branch date: 5 days ago
:::::: commit date: 2 weeks ago
config: arm-randconfig-r2201-20261005 (https://download.01.org/0day-ci/archive/20261005/202610051657.edNCMGy5-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project dbeca9a3a3ba0b46471efb339b0ea8f2194f6f68)
smatch: v0.5.0-9187-g5189e3fb

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/202610051657.edNCMGy5-lkp@intel.com/

smatch warnings:
kernel/sched/fair.c:9070 select_slice_cpu() warn: missing error code? 'cpu'

vim +/cpu +9070 kernel/sched/fair.c

b4c9c9f15649c9 Vincent Guittot 2020-10-29  9025  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9026  static int select_slice_cpu(struct task_struct *p, struct sched_domain *sd, int target)
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9027  {
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9028  	unsigned long task_util, util_min, util_max;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9029  	int cpu, nr = INT_MAX;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9030  	u64 slice = p->se.slice;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9031  	struct cpumask *cpus;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9032  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9033  	if (sched_feat(SIS_UTIL) && sd->shared) {
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9034  		/*
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9035  		 * Same nr_idle_scan hint as select_idle_cpu(), nr only limits
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9036  		 * the scan when not preferring an idle core.
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9037  		 */
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9038  		nr = READ_ONCE(sd->shared->nr_idle_scan) + 1;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9039  		/* overloaded domain is unlikely to have idle cpu/core */
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9040  		if (nr == 1)
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9041  			return -1;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9042  	}
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9043  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9044  	cpus = this_cpu_cpumask_var_ptr(select_rq_mask);
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9045  	cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9046  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9047  	if (sched_asym_cpucap_active()) {
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9048  		task_util = task_util_est(p);
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9049  		util_min = uclamp_eff_value(p, UCLAMP_MIN);
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9050  		util_max = uclamp_eff_value(p, UCLAMP_MAX);
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9051  	}
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9052  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9053  	/* Those CPUs have been tested not being idle and fiting */
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9054  	for_each_cpu_wrap(cpu, cpus, target) {
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9055  		/*
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9056  		 * Stop when the nr_idle_scan is exhausted (mirrors
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9057  		 * select_idle_cpu() logic).
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9058  		 */
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9059  		if (--nr <= 0)
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9060  			return -1;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9061  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9062  		if (slice >= get_rq_min_slice(cpu_rq(cpu)))
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9063  			continue;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9064  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9065  		if (sched_asym_cpucap_active()) {
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9066  			int fits = util_fits_cpu(task_util, util_min, util_max, cpu);
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9067  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9068  			/* Perfect fit: capacity satisfies util + uclamp */
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9069  			if (fits > 0)
8f8df1b98a5a60 Vincent Guittot 2026-09-21 @9070  				return cpu;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9071  		} else {
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9072  			return cpu;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9073  		}
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9074  	}
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9075  
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9076  	return -1;
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9077  }
8f8df1b98a5a60 Vincent Guittot 2026-09-21  9078  

--
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:[~2026-10-05 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-05 14:29 kernel/sched/fair.c:9070 select_slice_cpu() warn: missing error code? 'cpu' 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.