Re: [BUG] 2.6.23-git8 kernel oops at __rb_rotate_left+0x7/0x70

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: Kamalesh Babulal <kamalesh@...>, LKML <linux-kernel@...>, <torvalds@...>, Andrew Morton <akpm@...>, Andy Whitcroft <apw@...>, Dmitry Adamushko <dmitry.adamushko@...>, Peter Zijlstra <a.p.zijlstra@...>, Srivatsa Vaddagiri <vatsa@...>, Mike Galbraith <efault@...>, Dhaval Giani <dhaval@...>
Date: Wednesday, October 17, 2007 - 11:00 am

On Wed, Oct 17, 2007 at 04:21:40PM +0200, Ingo Molnar wrote:


I don't see a fundamental reason why it would be invalid to call
task_new_fair() when this_cpu != task_cpu(p). Besides, calling 
activate_task->enqueue_task->enqueue_task_fair() on a new born task (as
is being done in the patch you have sent) is slightly buggy in the sense that 
its p->se.vruntime is not properly calculated (because we set wakeup argument 
as 0).

We (myself, Kamalesh and Dhaval) have tested the patch below, w/o being
able to recreate the problem. The patch allows for task_new_fair() to be
called even for the case when child is being added to another cpu's
runqueue.

--

Child task may be added on a different cpu that the one on which parent
is running. In which case, task_new_fair() should check whether the new
born task's parent entity should be added as well on the cfs_rq.

Patch below fixes the problem in task_new_fair.

Signed-off-by : Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>


---
 kernel/sched.c      |    2 +-
 kernel/sched_fair.c |    6 +-----
 2 files changed, 2 insertions(+), 6 deletions(-)

Index: current/kernel/sched.c
===================================================================
--- current.orig/kernel/sched.c
+++ current/kernel/sched.c
@@ -1712,7 +1712,7 @@ void fastcall wake_up_new_task(struct ta
 
 	p->prio = effective_prio(p);
 
-	if (!p->sched_class->task_new || !current->se.on_rq || !rq->cfs.curr) {
+	if (!p->sched_class->task_new || !current->se.on_rq) {
 		activate_task(rq, p, 0);
 	} else {
 		/*
Index: current/kernel/sched_fair.c
===================================================================
--- current.orig/kernel/sched_fair.c
+++ current/kernel/sched_fair.c
@@ -1031,12 +1031,8 @@ static void task_new_fair(struct rq *rq,
 		swap(curr->vruntime, se->vruntime);
 	}
 
-	update_stats_enqueue(cfs_rq, se);
-	check_spread(cfs_rq, se);
-	check_spread(cfs_rq, curr);
-	__enqueue_entity(cfs_rq, se);
-	account_entity_enqueue(cfs_rq, se);
 	se->peer_preempt = 0;
+	enqueue_task_fair(rq, p, 0);
 	resched_task(rq->curr);
 }
 
-- 
Regards,
vatsa
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[BUG] 2.6.23-git8 kernel oops at __rb_rotate_left+0x7/0x70, Kamalesh Babulal, (Tue Oct 16, 1:25 am)
Re: [BUG] 2.6.23-git8 kernel oops at __rb_rotate_left+0x7/0x70, Srivatsa Vaddagiri, (Wed Oct 17, 11:00 am)
Re: [BUG] 2.6.23-git8 kernel oops at __rb_rotate_left+0x7/0x70, Srivatsa Vaddagiri, (Tue Oct 16, 2:42 pm)