2008-06-19 12:36:06

by Peter Zijlstra

[permalink] [raw]
Subject: [PATCH 10/10] sched: rt: dont stop the period timer when there are tasks wanting to run

When a runnable group failed to get any runtime within a period it would be
found idle and the period timer would be stopped.

So if the group ever gets throttled, it will never wake up again.

Signed-off-by: Peter Zijlstra <[email protected]>
Reported-by: "Daniel K." <[email protected]>
---
kernel/sched_rt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/kernel/sched_rt.c
===================================================================
--- linux-2.6.orig/kernel/sched_rt.c
+++ linux-2.6/kernel/sched_rt.c
@@ -408,7 +408,8 @@ static int do_sched_rt_period_timer(stru
if (rt_rq->rt_time || rt_rq->rt_nr_running)
idle = 0;
spin_unlock(&rt_rq->rt_runtime_lock);
- }
+ } else if (rt_rq->rt_nr_running)
+ idle = 0;

if (enqueue)
sched_rt_rq_enqueue(rt_rq);

--


2008-06-19 20:12:45

by Daniel K.

[permalink] [raw]
Subject: Re: [PATCH 10/10] sched: rt: dont stop the period timer when there are tasks wanting to run

Peter Zijlstra wrote:
> When a runnable group failed to get any runtime within a period it would be
> found idle and the period timer would be stopped.
>
> So if the group ever gets throttled, it will never wake up again.
>
> Signed-off-by: Peter Zijlstra <[email protected]>
> Reported-by: "Daniel K." <[email protected]>
Tested-by: Daniel K. <[email protected]>

I think this should go into .26 as well, due to the non-intuitiveness
of the knobs that cause this if they are fiddled with in the wrong way.


Daniel K.

> ---
> kernel/sched_rt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: linux-2.6/kernel/sched_rt.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched_rt.c
> +++ linux-2.6/kernel/sched_rt.c
> @@ -408,7 +408,8 @@ static int do_sched_rt_period_timer(stru
> if (rt_rq->rt_time || rt_rq->rt_nr_running)
> idle = 0;
> spin_unlock(&rt_rq->rt_runtime_lock);
> - }
> + } else if (rt_rq->rt_nr_running)
> + idle = 0;
>
> if (enqueue)
> sched_rt_rq_enqueue(rt_rq);
>

2008-06-19 20:16:59

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH 10/10] sched: rt: dont stop the period timer when there are tasks wanting to run

On Thu, 2008-06-19 at 20:10 +0000, Daniel K. wrote:
> Peter Zijlstra wrote:
> > When a runnable group failed to get any runtime within a period it would be
> > found idle and the period timer would be stopped.
> >
> > So if the group ever gets throttled, it will never wake up again.
> >
> > Signed-off-by: Peter Zijlstra <[email protected]>
> > Reported-by: "Daniel K." <[email protected]>
> Tested-by: Daniel K. <[email protected]>
>
> I think this should go into .26 as well, due to the non-intuitiveness
> of the knobs that cause this if they are fiddled with in the wrong way.

Sounds reasonable, Ingo?

> > ---
> > kernel/sched_rt.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > Index: linux-2.6/kernel/sched_rt.c
> > ===================================================================
> > --- linux-2.6.orig/kernel/sched_rt.c
> > +++ linux-2.6/kernel/sched_rt.c
> > @@ -408,7 +408,8 @@ static int do_sched_rt_period_timer(stru
> > if (rt_rq->rt_time || rt_rq->rt_nr_running)
> > idle = 0;
> > spin_unlock(&rt_rq->rt_runtime_lock);
> > - }
> > + } else if (rt_rq->rt_nr_running)
> > + idle = 0;
> >
> > if (enqueue)
> > sched_rt_rq_enqueue(rt_rq);
> >
>

2008-06-20 09:06:47

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 10/10] sched: rt: dont stop the period timer when there are tasks wanting to run


* Peter Zijlstra <[email protected]> wrote:

> On Thu, 2008-06-19 at 20:10 +0000, Daniel K. wrote:
> > Peter Zijlstra wrote:
> > > When a runnable group failed to get any runtime within a period it would be
> > > found idle and the period timer would be stopped.
> > >
> > > So if the group ever gets throttled, it will never wake up again.
> > >
> > > Signed-off-by: Peter Zijlstra <[email protected]>
> > > Reported-by: "Daniel K." <[email protected]>
> > Tested-by: Daniel K. <[email protected]>
> >
> > I think this should go into .26 as well, due to the non-intuitiveness
> > of the knobs that cause this if they are fiddled with in the wrong way.
>
> Sounds reasonable, Ingo?

agreed - i've put it into tip/sched/urgent as well.

Ingo