[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-bced76aeaca03b45e3b4bdb868cada328e497847@git.kernel.org>
Date: Wed, 11 Jan 2012 22:17:09 -0800
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
eric.dumazet@...il.com, torvalds@...ux-foundation.org,
a.p.zijlstra@...llo.nl, schwidefsky@...ibm.com, fweisbec@...il.com,
suresh.b.siddha@...el.com, dsahern@...il.com, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:sched/urgent] sched:
Fix lockup by limiting load-balance retries on lock-break
Commit-ID: bced76aeaca03b45e3b4bdb868cada328e497847
Gitweb: http://git.kernel.org/tip/bced76aeaca03b45e3b4bdb868cada328e497847
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Wed, 11 Jan 2012 13:11:12 +0100
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 11 Jan 2012 17:15:12 +0100
sched: Fix lockup by limiting load-balance retries on lock-break
Eric and David reported dead machines and traced it to commit
a195f004 ("sched: Fix load-balance lock-breaking"), it turns out
there's still a scenario where we can end up re-trying forever.
Since there is no strict forward progress guarantee in the
load-balance iteration we can get stuck re-retrying the same
task-set over and over.
Creating a forward progress guarantee with the existing
structure is somewhat non-trivial, for now simply terminate the
retry loop after a few tries.
Reported-by: Eric Dumazet <eric.dumazet@...il.com>
Tested-by: Eric Dumazet <eric.dumazet@...il.com>
Reported-by: David Ahern <dsahern@...il.com>
[ logic cleanup as suggested by Eric ]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Suresh Siddha <suresh.b.siddha@...el.com>
Link: http://lkml.kernel.org/r/1326297936.2442.157.camel@twins
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/sched/fair.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8e42de9..84adb2d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3130,8 +3130,10 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
}
#define LBF_ALL_PINNED 0x01
-#define LBF_NEED_BREAK 0x02
-#define LBF_ABORT 0x04
+#define LBF_NEED_BREAK 0x02 /* clears into HAD_BREAK */
+#define LBF_HAD_BREAK 0x04
+#define LBF_HAD_BREAKS 0x0C /* count HAD_BREAKs overflows into ABORT */
+#define LBF_ABORT 0x10
/*
* can_migrate_task - may task p from runqueue rq be migrated to this_cpu?
@@ -4508,7 +4510,9 @@ redo:
goto out_balanced;
if (lb_flags & LBF_NEED_BREAK) {
- lb_flags &= ~LBF_NEED_BREAK;
+ lb_flags += LBF_HAD_BREAK - LBF_NEED_BREAK;
+ if (lb_flags & LBF_ABORT)
+ goto out_balanced;
goto redo;
}
--
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