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

Ingo Molnar
2007-04-14T06:33:10Z

* Nick Piggin <npiggin@suse.de> 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@elte.hu>
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@elte.hu>

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