[PATCH 0/3] Fix a couple of corner cases in feec() when using uclamp_max

From: Qais Yousef
Date: Sun Jan 29 2023 - 11:15:14 EST


Patch 1 addresses a bug because forcing a task on a small CPU to honour
uclamp_max hint means we can end up with spare_capacity = 0; but the logic is
constructed such that spare_capacity = 0 leads to ignoring this CPU as
a candidate to compute_energy().

Patch 2 addresses a bug due to an optimization in feec() that could lead to
ignoring tasks whose uclamp_max = 0 but task_util(0) != 0.

Patch 3 adds a new tracepoint in compute_energy() as it was helpful in
debugging these two problems.

This is based on tip/sched/core + Vincent's v4 of
Unlink util_fits_cpu()... patch [1]

[1] https://lore.kernel.org/lkml/20230119174244.2059628-1-vincent.guittot@xxxxxxxxxx/

Qais Yousef (3):
sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0
sched/uclamp: Ignore (util == 0) optimization in feec() when
p_util_max = 0
sched/tp: Add new tracepoint to track compute energy computation

include/trace/events/sched.h | 4 ++++
kernel/sched/core.c | 1 +
kernel/sched/fair.c | 23 +++++++++++++++--------
3 files changed, 20 insertions(+), 8 deletions(-)

--
2.25.1