Skip to content

Commit f2d6506

Browse files
pierregondoisPeter Zijlstra
authored andcommitted
sched/fair: Allow decaying util_est when util_avg > CPU capa
commit 10a35e6 ("sched/pelt: Skip updating util_est when utilization is higher than CPU's capacity") prevents util_est from being updated if util_avg is higher than the underlying CPU capacity to avoid overestimating the task when the CPU is capped (due to thermal issue for instance). In this scenario, the task will miss its deadlines and start overlapping its wake-up events for instance. The task will appear as always running when the CPU is just not powerful enough to allow having a good estimation of the task. commit b8c9636 ("sched/fair/util_est: Implement faster ramp-up EWMA on utilization increases") sets ewma to util_avg when ewma > util_avg, allowing ewma to quickly grow instead of slowly converge to the new util_avg value when a task profile changes from small to big. However, the 2 conditions: - Check util_avg against max CPU capacity - Check whether util_est > util_avg are placed in an order such as it is possible to set util_est to a value higher than the CPU capacity if util_est > util_avg, but util_est is prevented to decay as long as: CPU capacity < util_avg < util_est. Just remove the check as either: 1. There is idle time on the CPU. In that case the util_avg value of the task is actually correct. It is possible that the task missed a deadline and appears bigger, but this is also the case when the util_avg of the task is lower than the maximum CPU capacity. 2. There is no idle time. In that case, the util_avg value might aswell be an under estimation of the size of the task. It is possible that undesired frequency spikes will appear when the task is later enqueued with an inflated util_est value, but the frequency spike might aswell be deserved. The absence of idle time prevents from drawing any conclusion. Signed-off-by: Pierre Gondois <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Vincent Guittot <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ce29a7d commit f2d6506

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

kernel/sched/fair.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4932,13 +4932,6 @@ static inline void util_est_update(struct cfs_rq *cfs_rq,
49324932
if (last_ewma_diff < UTIL_EST_MARGIN)
49334933
goto done;
49344934

4935-
/*
4936-
* To avoid overestimation of actual task utilization, skip updates if
4937-
* we cannot grant there is idle time in this CPU.
4938-
*/
4939-
if (dequeued > arch_scale_cpu_capacity(cpu_of(rq_of(cfs_rq))))
4940-
return;
4941-
49424935
/*
49434936
* To avoid underestimate of task utilization, skip updates of EWMA if
49444937
* we cannot grant that thread got all CPU time it wanted.

0 commit comments

Comments
 (0)