diff options
-rw-r--r-- | kernel/sched_rt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 7a27ef6308c0..9de5f18b92bf 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -1030,6 +1030,17 @@ static int select_task_rq_rt(struct task_struct *p, int sd_flag, int flags) | |||
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | /* | 1032 | /* |
1033 | * If the new task is an RT task, current is not an RT task | ||
1034 | * and the new one may run on the current CPU, run it here. | ||
1035 | * This avoids sending reschedule IPIs across CPUs. | ||
1036 | */ | ||
1037 | if (unlikely(rt_task(p)) && !rt_task(rq->curr)) { | ||
1038 | int cpu = smp_processor_id(); | ||
1039 | if (cpumask_test_cpu(cpu, &p->cpus_allowed)) | ||
1040 | return cpu; | ||
1041 | } | ||
1042 | |||
1043 | /* | ||
1033 | * Otherwise, just let it ride on the affined RQ and the | 1044 | * Otherwise, just let it ride on the affined RQ and the |
1034 | * post-schedule router will push the preempted task away | 1045 | * post-schedule router will push the preempted task away |
1035 | */ | 1046 | */ |