History

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.

Shawn Bohrer committed 13 years ago

Commit 6bfa6871 parent fb869b61 file · +1 −2Browse files

Unified · Split

kernel/sched/rt.c+1−2
@@ -1213,8 +1213,7 @@ select_task_rq_rt(struct task_struct *p, int sd_flag, int flags) · 1212 unmodified lines
12131213 */
12141214 if (curr && unlikely(rt_task(curr)) &&
12151215 (curr->nr_cpus_allowed < 2 ||
1216− curr->prio <= p->prio) &&
1217− (p->nr_cpus_allowed > 1)) {
1216+ curr->prio <= p->prio)) {
12181217 int target = find_lowest_rq(p);
12191218
12201219 if (target != -1)