Skip to content

Commit

Permalink
sched/cass: Honor uclamp even when no CPUs can satisfy the requirement
Browse files Browse the repository at this point in the history
When all CPUs available to a uclamp'd process are thermal throttled, it is
possible for them to be throttled below the uclamp minimum requirement. In
this case, CASS only considers uclamp when it compares relative utilization
and nowhere else; i.e., CASS essentially ignores the most important aspect
of uclamp.

Fix it so that CASS tries to honor uclamp even when no CPUs available to a
uclamp'd process are capable of fully meeting the uclamp minimum.

Signed-off-by: Sultan Alsawaf <[email protected]>
  • Loading branch information
kerneltoast authored and mylove90 committed May 16, 2024
1 parent 025e759 commit c2bc70e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched/cass.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ static int cass_best_cpu(struct task_struct *p, int prev_cpu, bool sync, bool rt
/* Get the _current_, throttled maximum capacity of this CPU */
curr->cap_max = curr->cap_orig - thermal_load_avg(rq);

/* Prefer the CPU that meets the uclamp minimum requirement */
if (curr->cap_max < uc_min && best->cap_max >= uc_min)
/* Prefer the CPU that more closely meets the uclamp minimum */
if (curr->cap_max < uc_min && curr->cap_max < best->cap_max)
continue;

/*
Expand Down

0 comments on commit c2bc70e

Please sign in to comment.