Re: [Announce] [patch] Modular Scheduler Core and Completely Fair Scheduler [CFS]

From: Ingo Molnar
Date: Sat Apr 14 2007 - 02:33:42 EST



* Nick Piggin <npiggin@xxxxxxx> wrote:

> > The CFS patch uses a completely different approach and implementation
> > from RSDL/SD. My goal was to make CFS's interactivity quality exceed
> > that of RSDL/SD, which is a high standard to meet :-) Testing
> > feedback is welcome to decide this one way or another. [ and, in any
> > case, all of SD's logic could be added via a kernel/sched_sd.c module
> > as well, if Con is interested in such an approach. ]
>
> Comment about the code: shouldn't you be requeueing the task in the
> rbtree wherever you change wait_runtime? eg. task_new_fair? [...]

yes: the task's position within the rbtree is updated every time
wherever wait_runtime is change. task_new_fair is the method during new
task creation, but indeed i forgot to requeue the parent. I've fixed
this in my tree (see the delta patch below) - thanks!

Ingo

----------->
From: Ingo Molnar <mingo@xxxxxxx>
Subject: [cfs] fix parent's rbtree position

Nick noticed that upon fork we change parent->wait_runtime but we do not
requeue it within the rbtree.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

Index: linux/kernel/sched_fair.c
===================================================================
--- linux.orig/kernel/sched_fair.c
+++ linux/kernel/sched_fair.c
@@ -524,6 +524,8 @@ static void task_new_fair(struct rq *rq,

p->wait_runtime = parent->wait_runtime/2;
parent->wait_runtime /= 2;
+ requeue_task_fair(rq, parent);
+
/*
* For the first timeslice we allow child threads
* to move their parent-inherited fairness back
-
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/