diff options
| author | Srivatsa Vaddagiri <vatsa@codeaurora.org> | 2014-07-24 03:19:50 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:00:04 -0700 |
| commit | 07a758521c1e8431cfbce9fabf790750cf4fe93d (patch) | |
| tree | 1c807322988be80fc2b687445802b174223fde54 /kernel | |
| parent | 1ffae4dc94bded073868b760fafa443a44303f55 (diff) | |
sched: Extend boost benefit for small and low-prio tasks
Allow small and low-prio tasks to benefit from boost, which is
expected to last for a short duration. Any task that wishes to run
during that short period is allowed boost benefit.
Change-Id: I02979a0c5feeba0f1256b7ee3d73f6b283fcfafa
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/fair.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c4e57cf18443..11c6269600d4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2827,16 +2827,17 @@ static int task_will_fit(struct task_struct *p, int cpu) int upmigrate = sched_upmigrate; int nice = task_nice(p); - /* Todo: Provide cgroup-based control as well? */ - if (nice > sysctl_sched_upmigrate_min_nice || - rq->capacity == max_capacity) + if (rq->capacity == max_capacity) return 1; if (sched_boost()) { if (rq->capacity > prev_rq->capacity) return 1; - } else { + /* Todo: Provide cgroup-based control as well? */ + if (nice > sysctl_sched_upmigrate_min_nice) + return 1; + load = scale_load_to_cpu(task_load(p), cpu); if (prev_rq->capacity > rq->capacity) @@ -3020,7 +3021,7 @@ static int select_best_cpu(struct task_struct *p, int target) trace_sched_task_load(p); - if (small_task) { + if (small_task && !sched_boost()) { best_cpu = best_small_task_cpu(p); goto done; } @@ -3314,8 +3315,13 @@ static inline int migration_needed(struct rq *rq, struct task_struct *p) { int nice = task_nice(p); - if (is_small_task(p) || p->state != TASK_RUNNING || - !sched_enable_hmp) + if (!sched_enable_hmp || p->state != TASK_RUNNING) + return 0; + + if (sched_boost()) + return (rq->capacity != max_capacity); + + if (is_small_task(p)) return 0; /* Todo: cgroup-based control? */ |
