sched/sched_avg: make number of running tasks conservative

Right now if a task ran 15% in the previous window, that task is
considered as part of number of running tasks as well as while
calculating misfit tasks on smaller capacity clusters which
agressively un-isolates higher capacity CPUs and may lead to
more power consumption. To avoid such issues, make number of
running tasks conservative by changing threshold to 85%.

Change-Id: Ic82724b822bb605fbda385ddeb50a591757d2c9d
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Satya Durga Srinivasu Prabhala 2018-05-29 21:55:13 -07:00 committed by Gerrit - the friendly Code Review server
parent 746245c894
commit 43980276ec

View File

@ -35,7 +35,7 @@ static s64 last_get_time;
static DEFINE_PER_CPU(atomic64_t, last_busy_time) = ATOMIC64_INIT(0);
#define NR_THRESHOLD_PCT 85
#define NR_THRESHOLD_PCT 15
/**
* sched_get_nr_running_avg
@ -76,7 +76,7 @@ void sched_get_nr_running_avg(struct sched_avg_stats *stats)
/*
* NR_THRESHOLD_PCT is to make sure that the task ran
* at least 15% in the last window to compensate any
* at least 85% in the last window to compensate any
* over estimating being done.
*/
stats[cpu].nr = (int)div64_u64((tmp_nr + NR_THRESHOLD_PCT),