summaryrefslogtreecommitdiff
path: root/kernel/sched/tune.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/tune.c')
-rw-r--r--kernel/sched/tune.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/sched/tune.c b/kernel/sched/tune.c
index 62d7a0f93cef..f8c4e29763d3 100644
--- a/kernel/sched/tune.c
+++ b/kernel/sched/tune.c
@@ -392,14 +392,12 @@ static void
schedtune_cpu_update(int cpu)
{
struct boost_groups *bg;
- int boost_max;
+ int boost_max = INT_MIN;
int idx;
bg = &per_cpu(cpu_boost_groups, cpu);
- /* The root boost group is always active */
- boost_max = bg->group[0].boost;
- for (idx = 1; idx < BOOSTGROUPS_COUNT; ++idx) {
+ for (idx = 0; idx < BOOSTGROUPS_COUNT; ++idx) {
/*
* A boost group affects a CPU only if it has
* RUNNABLE tasks on that CPU
@@ -409,10 +407,10 @@ schedtune_cpu_update(int cpu)
boost_max = max(boost_max, bg->group[idx].boost);
}
- /* Ensures boost_max is non-negative when all cgroup boost values
- * are neagtive. Avoids under-accounting of cpu capacity which may cause
- * task stacking and frequency spikes.*/
- boost_max = max(boost_max, 0);
+
+ /* If there are no active boost groups on the CPU, set no boost */
+ if (boost_max == INT_MIN)
+ boost_max = 0;
bg->boost_max = boost_max;
}