Skip to content

Commit

Permalink
sched: break out early if RT task cannot be migrated
Browse files Browse the repository at this point in the history
We don't need to bother searching if the task cannot be migrated

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Gregory Haskins authored and Ingo Molnar committed Jan 25, 2008
1 parent e1f47d8 commit 17b3279
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 17b3279

Please sign in to comment.