Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17b3279b authored by Gregory Haskins's avatar Gregory Haskins Committed by Ingo Molnar
Browse files

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: default avatarGregory Haskins <ghaskins@novell.com>
Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e1f47d89
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -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
	 * that is just being woken and probably will have
	 * cold cache anyway.
	 * 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);
		int cpu = find_lowest_rq(p);


		return (cpu == -1) ? task_cpu(p) : cpu;
		return (cpu == -1) ? task_cpu(p) : cpu;