summaryrefslogtreecommitdiff
path: root/kernel/sched/rt.c
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-12-19 17:04:54 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-19 17:04:54 -0800
commite26b0777dc92ab47d16b0134e57cd1c9e1083a9a (patch)
tree6896cfb7a25310fb4f871b86d74f939d9727c3d4 /kernel/sched/rt.c
parentaf833ae6a86db02de5cd1347779470485f80f5ce (diff)
parent0dee0d1411e4ba837089a769a5bcce57a5a14df2 (diff)
Merge "sched: Avoid waking idle cpu for short-burst tasks"
Diffstat (limited to 'kernel/sched/rt.c')
-rw-r--r--kernel/sched/rt.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index f8bc34c31c42..3fe00d6fa335 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1723,6 +1723,7 @@ static int find_lowest_rq_hmp(struct task_struct *task)
int i;
int restrict_cluster;
int boost_on_big;
+ int pack_task, wakeup_latency, least_wakeup_latency = INT_MAX;
boost_on_big = sched_boost() == FULL_THROTTLE_BOOST &&
sched_boost_policy() == SCHED_BOOST_ON_BIG;
@@ -1739,6 +1740,8 @@ static int find_lowest_rq_hmp(struct task_struct *task)
if (!cpupri_find(&task_rq(task)->rd->cpupri, task, lowest_mask))
return best_cpu; /* No targets found */
+ pack_task = is_short_burst_task(task);
+
/*
* At this point we have built a mask of cpus representing the
* lowest priority tasks in the system. Now we want to elect
@@ -1764,6 +1767,20 @@ static int find_lowest_rq_hmp(struct task_struct *task)
if (!restrict_cluster)
cpu_load = scale_load_to_cpu(cpu_load, i);
+ if (pack_task) {
+ wakeup_latency = cpu_rq(i)->wakeup_latency;
+
+ if (wakeup_latency > least_wakeup_latency)
+ continue;
+
+ if (wakeup_latency < least_wakeup_latency) {
+ least_wakeup_latency = wakeup_latency;
+ min_load = cpu_load;
+ best_cpu = i;
+ continue;
+ }
+ }
+
if (cpu_load < min_load ||
(cpu_load == min_load &&
(i == prev_cpu || (best_cpu != prev_cpu &&
@@ -1772,6 +1789,7 @@ static int find_lowest_rq_hmp(struct task_struct *task)
best_cpu = i;
}
}
+
if (restrict_cluster && best_cpu != -1)
break;
}