diff options
author | Yao Dongdong <yaodongdong@huawei.com> | 2014-10-28 00:08:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-11-04 01:17:51 -0500 |
commit | 9f96742a13135e6c609cc99a3a458402af3c8f31 (patch) | |
tree | 3bd38a1ec1a181848230d690e9736776e932ac65 | |
parent | 67dfa1b756f250972bde31d65e3f8fde6aeddc5b (diff) |
sched: Check if we got a shallowest_idle_cpu before searching for least_loaded_cpu
Idle cpu is idler than non-idle cpu, so we needn't search for least_loaded_cpu
after we have found an idle cpu.
Signed-off-by: Yao Dongdong <yaodongdong@huawei.com>
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1414469286-6023-1-git-send-email-yaodongdong@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/sched/fair.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ec32c26d7fb6..d03d76de7aff 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -4641,7 +4641,7 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu) | |||
4641 | latest_idle_timestamp = rq->idle_stamp; | 4641 | latest_idle_timestamp = rq->idle_stamp; |
4642 | shallowest_idle_cpu = i; | 4642 | shallowest_idle_cpu = i; |
4643 | } | 4643 | } |
4644 | } else { | 4644 | } else if (shallowest_idle_cpu == -1) { |
4645 | load = weighted_cpuload(i); | 4645 | load = weighted_cpuload(i); |
4646 | if (load < min_load || (load == min_load && i == this_cpu)) { | 4646 | if (load < min_load || (load == min_load && i == this_cpu)) { |
4647 | min_load = load; | 4647 | min_load = load; |