Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched/fair: Simplify the entry condition for update_idle_cpu_scan()

Only the topmost SD_SHARE_LLC domain has the "sd->shared" assigned.
Simply use "sd->shared" as an indicator for load balancing at the highest
SD_SHARE_LLC domain in update_idle_cpu_scan() instead of relying on
llc_size.

Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Chen Yu <yu.c.chen@intel.com>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://patch.msgid.link/20260312044434.1974-9-kprateek.nayak@amd.com

authored by

K Prateek Nayak and committed by
Peter Zijlstra
f1320a8d fa6874df

+4 -6
+4 -6
kernel/sched/fair.c
··· 11234 11234 unsigned long sum_util) 11235 11235 { 11236 11236 struct sched_domain_shared *sd_share; 11237 + struct sched_domain *sd = env->sd; 11237 11238 int llc_weight, pct; 11238 11239 u64 x, y, tmp; 11239 11240 /* ··· 11248 11247 if (!sched_feat(SIS_UTIL) || env->idle == CPU_NEWLY_IDLE) 11249 11248 return; 11250 11249 11251 - llc_weight = per_cpu(sd_llc_size, env->dst_cpu); 11252 - if (env->sd->span_weight != llc_weight) 11253 - return; 11254 - 11255 - sd_share = rcu_dereference_all(per_cpu(sd_llc_shared, env->dst_cpu)); 11250 + sd_share = sd->shared; 11256 11251 if (!sd_share) 11257 11252 return; 11258 11253 ··· 11282 11285 */ 11283 11286 /* equation [3] */ 11284 11287 x = sum_util; 11288 + llc_weight = sd->span_weight; 11285 11289 do_div(x, llc_weight); 11286 11290 11287 11291 /* equation [4] */ 11288 - pct = env->sd->imbalance_pct; 11292 + pct = sd->imbalance_pct; 11289 11293 tmp = x * x * pct * pct; 11290 11294 do_div(tmp, 10000 * SCHED_CAPACITY_SCALE); 11291 11295 tmp = min_t(long, tmp, SCHED_CAPACITY_SCALE);