From: Gregory Haskins Date: Fri, 25 Jan 2008 20:08:13 +0000 (+0100) Subject: sched: break out early if RT task cannot be migrated X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=17b3279b48835eb522d842eae16f541da3729c8a;p=linux-beck.git sched: break out early if RT task cannot be migrated We don't need to bother searching if the task cannot be migrated Signed-off-by: Gregory Haskins Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 9becc3710b60..72c81322fb9a 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -176,7 +176,8 @@ static int select_task_rq_rt(struct task_struct *p, int sync) * that is just being woken and probably will have * cold cache anyway. */ - if (unlikely(rt_task(rq->curr))) { + if (unlikely(rt_task(rq->curr)) && + (p->nr_cpus_allowed > 1)) { int cpu = find_lowest_rq(p); return (cpu == -1) ? task_cpu(p) : cpu;