mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
sched/cass: Don't pack tasks with uclamp boosts below minimum CPU capacity
To save energy, CASS may prefer non-idle CPUs for uclamp-boosted tasks in order to pack them onto a single performance domain rather than spreading them across multiple performance domains. This way, it is more likely for only one performance domain to be boosted a higher P-state when there is more than one uclamp-boosted task running. However, when a task has a uclamp boost value that is below a CPU's minimum capacity, it is nearly the same thing as not having a uclamp boost at all. In spite of that, CASS may still prefer non-idle CPUs for tasks with bogus uclamp boost values. This is not only worse for latency, but also energy efficiency since the load on the CPU is spread less evenly as a result. Therefore, don't pack tasks with uclamp boosts below a CPU's minimum configured capacity, since such tasks do not force the CPU to run at a higher P-state. Change-Id: Ide8f62162723dc0c509fa5cccf92b8124f20f4aa Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
parent
aaf602d464
commit
c752733d47
@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2023-2024 Sultan Alsawaf <sultan@kerneltoast.com>.
|
||||
* Copyright (C) 2023-2025 Sultan Alsawaf <sultan@kerneltoast.com>.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -183,12 +183,12 @@ static int cass_best_cpu(struct task_struct *p, int prev_cpu, bool sync, bool rt
|
||||
if ((sync && cpu == this_cpu && rq->nr_running == 1) ||
|
||||
idle_cpu(cpu) || sched_idle_cpu(cpu)) {
|
||||
/*
|
||||
* A non-idle candidate may be better when @p is uclamp
|
||||
* boosted. Otherwise, always prefer idle candidates.
|
||||
* A non-idle candidate may be better for energy
|
||||
* efficiency when @p is uclamp boosted above @curr's
|
||||
* minimum capacity. Otherwise, prefer idle candidates.
|
||||
*/
|
||||
if (!uc_min) {
|
||||
if (!has_idle && uc_min <= arch_scale_min_freq_capacity(cpu)) {
|
||||
/* Discard any previous non-idle candidate */
|
||||
if (!has_idle)
|
||||
best = curr;
|
||||
has_idle = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user