sched: Balance RT tasks when forked as well
[pandora-kernel.git] / kernel / sched_rt.c
index 70107a3..2153a87 100644 (file)
@@ -1017,10 +1017,12 @@ select_task_rq_rt(struct task_struct *p, int sd_flag, int flags)
        struct rq *rq;
        int cpu;
 
-       if (sd_flag != SD_BALANCE_WAKE)
-               return smp_processor_id();
-
        cpu = task_cpu(p);
+
+       /* For anything but wake ups, just return the task_cpu */
+       if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK)
+               goto out;
+
        rq = cpu_rq(cpu);
 
        rcu_read_lock();
@@ -1059,6 +1061,7 @@ select_task_rq_rt(struct task_struct *p, int sd_flag, int flags)
        }
        rcu_read_unlock();
 
+out:
        return cpu;
 }