diff options
| -rw-r--r-- | kernel/sched.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index e4a5888549a5..e60786eb731c 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -1406,7 +1406,16 @@ static int wake_idle(int cpu, struct task_struct *p) | |||
| 1406 | struct sched_domain *sd; | 1406 | struct sched_domain *sd; |
| 1407 | int i; | 1407 | int i; |
| 1408 | 1408 | ||
| 1409 | if (idle_cpu(cpu)) | 1409 | /* |
| 1410 | * If it is idle, then it is the best cpu to run this task. | ||
| 1411 | * | ||
| 1412 | * This cpu is also the best, if it has more than one task already. | ||
| 1413 | * Siblings must be also busy(in most cases) as they didn't already | ||
| 1414 | * pickup the extra load from this cpu and hence we need not check | ||
| 1415 | * sibling runqueue info. This will avoid the checks and cache miss | ||
| 1416 | * penalities associated with that. | ||
| 1417 | */ | ||
| 1418 | if (idle_cpu(cpu) || cpu_rq(cpu)->nr_running > 1) | ||
| 1410 | return cpu; | 1419 | return cpu; |
| 1411 | 1420 | ||
| 1412 | for_each_domain(cpu, sd) { | 1421 | for_each_domain(cpu, sd) { |
