瀏覽代碼

sched/dl: Simplify pick_dl_task()

1) Nobody calls pick_dl_task() with negative cpu, it's old RT leftover.

2) If p->nr_cpus_allowed is 1, than the affinity has just been changed
  in set_cpus_allowed_ptr(); we'll pick it just earlier than migration
  thread.

Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1410529340.3569.27.camel@tkhai
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Kirill Tkhai 11 年之前
父節點
當前提交
1ba93d4272
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      kernel/sched/deadline.c

+ 1 - 3
kernel/sched/deadline.c

@@ -1121,10 +1121,8 @@ static void set_curr_task_dl(struct rq *rq)
 static int pick_dl_task(struct rq *rq, struct task_struct *p, int cpu)
 static int pick_dl_task(struct rq *rq, struct task_struct *p, int cpu)
 {
 {
 	if (!task_running(rq, p) &&
 	if (!task_running(rq, p) &&
-	    (cpu < 0 || cpumask_test_cpu(cpu, &p->cpus_allowed)) &&
-	    (p->nr_cpus_allowed > 1))
+	    cpumask_test_cpu(cpu, tsk_cpus_allowed(p)))
 		return 1;
 		return 1;
-
 	return 0;
 	return 0;
 }
 }