Skip to content

Commit

Permalink
sched/deadline: Don't balance during wakeup if wakee is pinned
Browse files Browse the repository at this point in the history
Use nr_cpus_allowed to bail from select_task_rq() when only one cpu
can be used, and saves some cycles for pinned tasks.

Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1413253360-5318-2-git-send-email-wanpeng.li@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Wanpeng Li authored and Ingo Molnar committed Oct 28, 2014
1 parent 1d7e974 commit f4e9d94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/sched/deadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
struct task_struct *curr;
struct rq *rq;

if (p->nr_cpus_allowed == 1)
goto out;

if (sd_flag != SD_BALANCE_WAKE)
goto out;

Expand Down

0 comments on commit f4e9d94

Please sign in to comment.