|
@@ -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) {
|