[tip:sched/core] sched/deadline: Don' t balance during wakeup if wakee is pinned

From: tip-bot for Wanpeng Li
Date: Tue Oct 28 2014 - 07:09:01 EST


Commit-ID: f4e9d94a5bf60193d45f92b136e3d166be3ec8d5
Gitweb: http://git.kernel.org/tip/f4e9d94a5bf60193d45f92b136e3d166be3ec8d5
Author: Wanpeng Li <wanpeng.li@xxxxxxxxxxxxxxx>
AuthorDate: Tue, 14 Oct 2014 10:22:40 +0800
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitDate: Tue, 28 Oct 2014 10:48:02 +0100

sched/deadline: Don't balance during wakeup if wakee is pinned

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@xxxxxxxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/1413253360-5318-2-git-send-email-wanpeng.li@xxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
kernel/sched/deadline.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index fab3bf8..2e31a30 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -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;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/