diff options
author | Yao Dongdong <yaodongdong@huawei.com> | 2014-10-28 04:08:06 +0000 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-11-04 07:17:51 +0100 |
commit | 9f96742a13135e6c609cc99a3a458402af3c8f31 (patch) | |
tree | 3bd38a1ec1a181848230d690e9736776e932ac65 /kernel/sched | |
parent | 67dfa1b756f250972bde31d65e3f8fde6aeddc5b (diff) | |
download | linux-stable-9f96742a13135e6c609cc99a3a458402af3c8f31.tar.gz linux-stable-9f96742a13135e6c609cc99a3a458402af3c8f31.tar.bz2 linux-stable-9f96742a13135e6c609cc99a3a458402af3c8f31.zip |
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>
Diffstat (limited to 'kernel/sched')
-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) latest_idle_timestamp = rq->idle_stamp; shallowest_idle_cpu = i; } - } else { + } else if (shallowest_idle_cpu == -1) { load = weighted_cpuload(i); if (load < min_load || (load == min_load && i == this_cpu)) { min_load = load; |