[PATCH] sched: fix idle at tick

Con Kolivas
2007-03-06T06:40:48Z

On Tuesday 06 March 2007 10:11, Andrew Morton wrote:
> On Mon, 5 Mar 2007 23:20:58 +0100
>
> "J.A. Magall__n" <jamagallon@ono.com> wrote:
> > On Fri, 2 Mar 2007 03:00:26 -0800, Andrew Morton <akpm@linux-foundation.org> wrote:
> > > Temporarily at
> > >
> > > http://userweb.kernel.org/~akpm/2.6.21-rc2-mm1/
> > >
> > > Will appear later at
> > >
> > >
> > > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21-rc
> > >2/2.6.21-rc2-mm1/
> >
> > I'm also noticing very bad behaviour wrt scheduling, I think. When I
> > launch my parallel cpu burning code, the system _really_ stalls, the
> > mouse in X11 is not jerky, it is _stuck_ for a couple or three seconds...
> >
> > The only diffrecence is that, trying to solve nVidia driver problems, I
> > disabled BKL preemption:
> >
> > werewolf:/usr/src/linux# grep PREEMPT .config
> > # CONFIG_PREEMPT_RCU is not set
> > # CONFIG_PREEMPT_NONE is not set
> > # CONFIG_PREEMPT_VOLUNTARY is not set
> > CONFIG_PREEMPT=y
> > # CONFIG_PREEMPT_BKL is not set
>
> Do you think that is a problem which is introduced by -rc1-mm1?
>
> It'd be good if you can capture the `top' output while this is happening -
> it could be the longstanding problem where an app's sleep/run pattern
> permits it to get a lot of dynamic priority boosting, even though it is
> CPU-intensive.

Haven't tried -mm in a while... but this could be more than a little hairy..

Call me crazy but I think the following might just be responsible...

---
Fix reverse idle at tick logic.

Signed-off-by: Con Kolivas <kernel@kolivas.org>
---
kernel/sched.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.21-rc2-mm1-base/kernel/sched.c
===================================================================
--- linux-2.6.21-rc2-mm1-base.orig/kernel/sched.c 2007-03-06 17:19:17.000000000 +1100
+++ linux-2.6.21-rc2-mm1-base/kernel/sched.c 2007-03-06 17:20:40.000000000 +1100
@@ -3444,7 +3444,7 @@ void scheduler_tick(void)

update_cpu_clock(p, rq, now);

- if (idle_at_tick)
+ if (!idle_at_tick)
task_running_tick(rq, p);
#ifdef CONFIG_SMP
update_load(rq);

--
-ck