[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-985d3a4c11cd28251bcc7925aa2d7a9038910384@git.kernel.org>
Date: Mon, 3 Aug 2015 10:05:18 -0700
From: tip-bot for Yuyang Du <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: umgwanakikbuti@...il.com, mingo@...nel.org,
linux-kernel@...r.kernel.org, peterz@...radead.org,
morten.rasmussen@....com, tglx@...utronix.de, efault@....de,
pjt@...gle.com, torvalds@...ux-foundation.org, yuyang.du@...el.com,
bsegall@...gle.com, hpa@...or.com, rabin.vincent@...s.com
Subject: [tip:sched/core] sched/fair:
Avoid pulling all tasks in idle balancing
Commit-ID: 985d3a4c11cd28251bcc7925aa2d7a9038910384
Gitweb: http://git.kernel.org/tip/985d3a4c11cd28251bcc7925aa2d7a9038910384
Author: Yuyang Du <yuyang.du@...el.com>
AuthorDate: Mon, 6 Jul 2015 06:11:51 +0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 3 Aug 2015 12:21:19 +0200
sched/fair: Avoid pulling all tasks in idle balancing
In idle balancing where a CPU going idle pulls tasks from another CPU,
a livelock may happen if the CPU pulls all tasks from another, makes
it idle, and this iterates. So just avoid this.
Reported-by: Rabin Vincent <rabin.vincent@...s.com>
Signed-off-by: Yuyang Du <yuyang.du@...el.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Ben Segall <bsegall@...gle.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mike Galbraith <efault@....de>
Cc: Mike Galbraith <umgwanakikbuti@...il.com>
Cc: Morten Rasmussen <morten.rasmussen@....com>
Cc: Paul Turner <pjt@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/20150705221151.GF5197@intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/fair.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 587a2f6..8b384b8d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5863,6 +5863,13 @@ static int detach_tasks(struct lb_env *env)
return 0;
while (!list_empty(tasks)) {
+ /*
+ * We don't want to steal all, otherwise we may be treated likewise,
+ * which could at worst lead to a livelock crash.
+ */
+ if (env->idle != CPU_NOT_IDLE && env->src_rq->nr_running <= 1)
+ break;
+
p = list_first_entry(tasks, struct task_struct, se.group_node);
env->loop++;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists