[PATCH 2/2] RT: remove "paranoid" limit in push_rt_task

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gregory Haskins
Date: Friday, October 3, 2008 - 5:43 am

A panic was discovered by Chirag Jog and investigated by Gilles Carry
to be originating in the fact that a task being pushed away
may get migrated away during a double_lock_balance.  The result was
that the pushable_tasks list may become corrupted.

The root cause is that the "paranoid" retry limit could cause us to
bail out of a retry, but still try to remove the item from the (now
potentially incorrect) list.  There are numerous ways to correct the
condition, but the paranoid feature is no longer relevant with the new
pushable logic (since pushable naturally limits the loop anyway), so
lets just remove it.

Reported By: Chirag Jog <chirag@linux.vnet.ibm.com>
Found-by: Gilles Carry <gilles.carry@bull.net>
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
---

 kernel/sched_rt.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 59ead84..5a754fe 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1056,7 +1056,6 @@ static int push_rt_task(struct rq *rq)
 {
 	struct task_struct *next_task;
 	struct rq *lowest_rq;
-	int paranoid = RT_MAX_TRIES;
 
 	if (!rq->rt.overloaded)
 		return 0;
@@ -1094,12 +1093,14 @@ static int push_rt_task(struct rq *rq)
 		 * If it has, then try again.
 		 */
 		task = pick_next_pushable_task(rq);
-		if (unlikely(task != next_task) && task && paranoid--) {
+		if (unlikely(task != next_task) && task) {
 			put_task_struct(next_task);
 			next_task = task;
 			goto retry;
 		}
 
+		BUG_ON(task_cpu(next_task) != rq->cpu);
+
 		/*
 		 * Once we have failed to push this task, we will not
 		 * try again, since the other cpus will pull from us

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang, Chirag Jog, (Thu Sep 25, 5:32 am)
Re: [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang, Gregory Haskins, (Mon Sep 29, 11:13 am)
Re: [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang, Gregory Haskins, (Mon Sep 29, 2:18 pm)
Re: [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang, Gregory Haskins, (Mon Sep 29, 2:34 pm)
Re: [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang, Gregory Haskins, (Mon Sep 29, 3:00 pm)
Re: [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang, Chirag Jog, (Mon Sep 29, 9:43 pm)
Re: [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang, Gilles Carry, (Mon Sep 29, 11:47 pm)
[PATCH] sched: add a stacktrace on enqueue_pushable error, Gregory Haskins, (Wed Oct 1, 7:22 am)
Re: [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang, Gilles Carry, (Thu Oct 2, 4:18 am)
[RT PATCH 0/2] fix for BUG_ON crash in 26.5-rt9 , Gregory Haskins, (Fri Oct 3, 5:42 am)
[PATCH 1/2] RT: Remove comment that is no longer true, Gregory Haskins, (Fri Oct 3, 5:43 am)
[PATCH 2/2] RT: remove "paranoid" limit in push_rt_task, Gregory Haskins, (Fri Oct 3, 5:43 am)
Re: [RT PATCH 0/2] fix for BUG_ON crash in 26.5-rt9, Gregory Haskins, (Fri Oct 3, 5:54 am)
[RT PATCH v2 0/2] Series short description, Gregory Haskins, (Fri Oct 3, 10:26 am)
[RT PATCH v2 1/2] RT: Remove comment that is no longer true, Gregory Haskins, (Fri Oct 3, 10:26 am)