Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched/rt: Remove redundant nr_cpus_allowed test

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 <sbohrer@rgmadvisors.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Mike Galbraith <mgalbraith@suse.de>
Cc: tomk@rgmadvisors.com
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1380914693-24634-1-git-send-email-shawn.bohrer@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Shawn Bohrer and committed by
Ingo Molnar
6bfa687c fb869b6e

+1 -2
+1 -2
kernel/sched/rt.c
··· 1213 1213 */ 1214 1214 if (curr && unlikely(rt_task(curr)) && 1215 1215 (curr->nr_cpus_allowed < 2 || 1216 - curr->prio <= p->prio) && 1217 - (p->nr_cpus_allowed > 1)) { 1216 + curr->prio <= p->prio)) { 1218 1217 int target = find_lowest_rq(p); 1219 1218 1220 1219 if (target != -1)