From: Shawn Bohrer Date: Fri, 4 Oct 2013 19:24:53 +0000 (-0500) Subject: sched/rt: Remove redundant nr_cpus_allowed test X-Git-Tag: submit/tizen_common/20140905.094502~448 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4aef0b11ba4fa4c2cd115c312dd9f0b64cad1bf1;p=sdk%2Femulator%2Femulator-kernel.git sched/rt: Remove redundant nr_cpus_allowed test commit 6bfa687c19b7ab8adee03f0d43c197c2945dd869 upstream. In 76854c7e8f3f4172fef091e78d88b3b751463ac6 ("sched: Use rt.nr_cpus_allowed to recover select_task_rq() cycles") an optimization was added to select_task_rq_rt() that immediately returns when p->nr_cpus_allowed == 1 at the beginning of the function. This makes the latter p->nr_cpus_allowed > 1 check redundant, which can now be removed. Signed-off-by: Shawn Bohrer Reviewed-by: Steven Rostedt Cc: Mike Galbraith Cc: tomk@rgmadvisors.com Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1380914693-24634-1-git-send-email-shawn.bohrer@gmail.com Signed-off-by: Ingo Molnar Signed-off-by: Jiri Slaby --- diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 0c7886ff263e..ff04e1a06412 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1229,8 +1229,7 @@ select_task_rq_rt(struct task_struct *p, int sd_flag, int flags) */ if (curr && unlikely(rt_task(curr)) && (curr->nr_cpus_allowed < 2 || - curr->prio <= p->prio) && - (p->nr_cpus_allowed > 1)) { + curr->prio <= p->prio)) { int target = find_lowest_rq(p); if (target != -1)