From a1adf2b1f42095723f35368c874afd29fdbe19bf Mon Sep 17 00:00:00 2001 From: "Siddha, Suresh B" Date: Tue, 8 May 2007 00:33:01 -0700 Subject: [PATCH] --- yaml --- r: 54759 b: refs/heads/master c: 4953198b6ce07b008b0f1c2edd41c9d027a118b4 h: refs/heads/master i: 54757: c04ac4cb2bfaf0fb45485fb3b1c6e3fe1269308d 54755: 053cfa9fdcf6018306b9383406882d5a3fb51fdc 54751: 9f8bc2e09714cbb963afe7f355eaf59395eca08c v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index e45a7b20c7c8..f132c6d9385a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5517d86bea237c1d7078840182d9ebc0fe4c1afc +refs/heads/master: 4953198b6ce07b008b0f1c2edd41c9d027a118b4 diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index e4a5888549a5..e60786eb731c 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -1406,7 +1406,16 @@ static int wake_idle(int cpu, struct task_struct *p) struct sched_domain *sd; int i; - if (idle_cpu(cpu)) + /* + * If it is idle, then it is the best cpu to run this task. + * + * This cpu is also the best, if it has more than one task already. + * Siblings must be also busy(in most cases) as they didn't already + * pickup the extra load from this cpu and hence we need not check + * sibling runqueue info. This will avoid the checks and cache miss + * penalities associated with that. + */ + if (idle_cpu(cpu) || cpu_rq(cpu)->nr_running > 1) return cpu; for_each_domain(cpu, sd) {