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: Remove SIS_AVG_CPU

SIS_AVG_CPU was introduced as a means of avoiding a search when the
average search cost indicated that the search would likely fail. It was
a blunt instrument and disabled by commit 4c77b18cf8b7 ("sched/fair: Make
select_idle_cpu() more aggressive") and later replaced with a proportional
search depth by commit 1ad3aaf3fcd2 ("sched/core: Implement new approach
to scale select_idle_cpu()").

While there are corner cases where SIS_AVG_CPU is better, it has now been
disabled for almost three years. As the intent of SIS_PROP is to reduce
the time complexity of select_idle_cpu(), lets drop SIS_AVG_CPU and focus
on SIS_PROP as a throttling mechanism.

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20210125085909.4600-2-mgorman@techsingularity.net

authored by

Mel Gorman and committed by
Peter Zijlstra
e6e0dc2d 1875dc5b

+10 -13
+10 -12
kernel/sched/fair.c
··· 6158 6158 { 6159 6159 struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask); 6160 6160 struct sched_domain *this_sd; 6161 - u64 avg_cost, avg_idle; 6162 6161 u64 time; 6163 6162 int this = smp_processor_id(); 6164 6163 int cpu, nr = INT_MAX; ··· 6166 6167 if (!this_sd) 6167 6168 return -1; 6168 6169 6169 - /* 6170 - * Due to large variance we need a large fuzz factor; hackbench in 6171 - * particularly is sensitive here. 6172 - */ 6173 - avg_idle = this_rq()->avg_idle / 512; 6174 - avg_cost = this_sd->avg_scan_cost + 1; 6175 - 6176 - if (sched_feat(SIS_AVG_CPU) && avg_idle < avg_cost) 6177 - return -1; 6178 - 6179 6170 if (sched_feat(SIS_PROP)) { 6180 - u64 span_avg = sd->span_weight * avg_idle; 6171 + u64 avg_cost, avg_idle, span_avg; 6172 + 6173 + /* 6174 + * Due to large variance we need a large fuzz factor; 6175 + * hackbench in particularly is sensitive here. 6176 + */ 6177 + avg_idle = this_rq()->avg_idle / 512; 6178 + avg_cost = this_sd->avg_scan_cost + 1; 6179 + 6180 + span_avg = sd->span_weight * avg_idle; 6181 6181 if (span_avg > 4*avg_cost) 6182 6182 nr = div_u64(span_avg, avg_cost); 6183 6183 else
-1
kernel/sched/features.h
··· 54 54 /* 55 55 * When doing wakeups, attempt to limit superfluous scans of the LLC domain. 56 56 */ 57 - SCHED_FEAT(SIS_AVG_CPU, false) 58 57 SCHED_FEAT(SIS_PROP, true) 59 58 60 59 /*