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: Move avg_scan_cost calculations under SIS_PROP

As noted by Vincent Guittot, avg_scan_costs are calculated for SIS_PROP
even if SIS_PROP is disabled. Move the time calculations under a SIS_PROP
check and while we are at it, exclude the cost of initialising the CPU
mask from the average scan cost.

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-3-mgorman@techsingularity.net

authored by

Mel Gorman and committed by
Peter Zijlstra
bae4ec13 e6e0dc2d

+8 -6
+8 -6
kernel/sched/fair.c
··· 6166 6166 if (!this_sd) 6167 6167 return -1; 6168 6168 6169 + cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); 6170 + 6169 6171 if (sched_feat(SIS_PROP)) { 6170 6172 u64 avg_cost, avg_idle, span_avg; 6171 6173 ··· 6183 6181 nr = div_u64(span_avg, avg_cost); 6184 6182 else 6185 6183 nr = 4; 6184 + 6185 + time = cpu_clock(this); 6186 6186 } 6187 - 6188 - time = cpu_clock(this); 6189 - 6190 - cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); 6191 6187 6192 6188 for_each_cpu_wrap(cpu, cpus, target) { 6193 6189 if (!--nr) ··· 6194 6194 break; 6195 6195 } 6196 6196 6197 - time = cpu_clock(this) - time; 6198 - update_avg(&this_sd->avg_scan_cost, time); 6197 + if (sched_feat(SIS_PROP)) { 6198 + time = cpu_clock(this) - time; 6199 + update_avg(&this_sd->avg_scan_cost, time); 6200 + } 6199 6201 6200 6202 return cpu; 6201 6203 }