aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-02-05 15:29:12 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-02-05 15:29:11 -0800
commit1a5ee7e451790950f137dd4ea8b1f388e14555ea (patch)
treeea78a26005c903a76b504a1aa2ab33c6b8b2fef9 /kernel
parent38cf85dfefe0bd8127696436e48c2e8c1dcae5fc (diff)
parentf729de63b867372ba58a890e6653a544cd46ed68 (diff)
downloadqcom-msm-v3.10-1a5ee7e451790950f137dd4ea8b1f388e14555ea.tar.gz
Merge "sched: Consider PF_WAKE_UP_IDLE in select_best_cpu()"
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 967e77faef5..abb602575be 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1840,6 +1840,17 @@ static int select_best_cpu(struct task_struct *p, int target, int reason,
int small_task = is_small_task(p);
int boost = sched_boost();
int cstate, min_cstate = INT_MAX;
+ int prefer_idle = reason ? 1 : sysctl_sched_prefer_idle;
+
+ /*
+ * PF_WAKE_UP_IDLE is a hint to scheduler that the thread waking up
+ * (p) needs to be placed on idle cpu.
+ */
+ if ((current->flags & PF_WAKE_UP_IDLE) ||
+ (p->flags & PF_WAKE_UP_IDLE)) {
+ prefer_idle = 1;
+ small_task = 0;
+ }
trace_sched_task_load(p, small_task, boost, reason, sync);
@@ -1950,7 +1961,7 @@ static int select_best_cpu(struct task_struct *p, int target, int reason,
}
if (min_cstate_cpu >= 0 &&
- (sysctl_sched_prefer_idle ||
+ (prefer_idle ||
!(best_cpu >= 0 && mostly_idle_cpu_sync(best_cpu, sync))))
best_cpu = min_cstate_cpu;
done: