sched/fair: Fix util_est UTIL_AVG_UNCHANGED behaviour
The util_est internal UTIL_AVG_UNCHANGED flag which is used to prevent unnecessary util_est updates uses the LSB of util_est.enqueued. It is exposed via _task_util_est() (and task_util_est()). Commit 92a801e5 ("sched/fair: Mask UTIL_AVG_UNCHANGED usages") mentions that the LSB is lost for util_est resolution but find_energy_efficient_cpu() checks if task_util_est() returns 0 to return prev_cpu early. Because of _task_util_est() returning the actual util est value or'ed w/ UTIL_AVG_UNCHANGED for a dequeued task this can never be true w/ SCHED_FEAT(UTIL_EST, true). To fix this use the MSB of util_est.enqueued instead and keep the flag util_est internal, i.e. don't export it via _task_util_est(). MSB of unsigned int util_est.enqueued shouldn't be used for a task since the maximal possible util_avg value for a task is 1024. Signed-off-by:Dietmar Eggemann <dietmar.eggemann@arm.com>
Loading
Please register or sign in to comment