summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlav Haugan <ohaugan@codeaurora.org>2015-02-05 11:13:08 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:01:36 -0700
commite1e5891538e59dc86915c424a5bc132f2acc5a44 (patch)
treeca7b54cd06dcd92eb5e43b6fd1e7d8998bc9baba
parenta6c5eb13da7663ce7e9fcfeb9f1e33019ac8e73c (diff)
sched/fair: Respect wake to idle over sync wakeup
Sync wakeup currently takes precedence over wake to idle flag. A sync wakeup causes a task to be placed on a non-idle CPU because we expect this CPU to become idle very shortly. However, even though the sync flag is set there is no guarantee that the task will go to sleep right away As a consequence performance suffers. Fix this by preferring an idle CPU over a potential busy cpu when both wake to idle and sync wakeup are set. Change-Id: I6b40a44e2b4d5b5fa6088e4f16428f9867bd928d CRs-fixed: 794424 Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
-rw-r--r--kernel/sched/fair.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fced56a17acf..2eebdd524a52 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3313,6 +3313,11 @@ static int select_best_cpu(struct task_struct *p, int target, int reason,
prefer_idle = 1;
prefer_idle_override = 1;
small_task = 0;
+ /*
+ * If wake to idle and sync are both set prefer wake to idle
+ * since sync is a weak hint that might not always be correct.
+ */
+ sync = 0;
}
if (small_task && !boost) {