Re: [PATCH]sched/core: Return possibility to set RT and DL classes back

From: Juri Lelli
Date: Sat Mar 01 2014 - 13:19:27 EST


On Fri, 28 Feb 2014 14:50:43 +0400
Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> wrote:

> Thomas, have you seen this?
>
> Nothing works at the moment:
>

Noticed the same once rebased on tip/master as of today.

> now
>
> 21 root 20 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/3
> 16 root 20 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/2
> 11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
> 10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
>
> 22 root 20 0 0 0 0 S 0.0 0.0 0:00.00 migration/3
> 17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 migration/2
> 12 root 20 0 0 0 0 S 0.0 0.0 0:00.04 migration/1
> 9 root 20 0 0 0 0 S 0.0 0.0 0:00.20 migration/0
>
> with fix
>
> 21 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/3
> 16 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/2
> 11 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
> 10 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
>
> 22 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/3
> 17 root RT 0 0 0 0 S 0.0 0.0 0:00.03 migration/2
> 12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1
> 9 root RT 0 0 0 0 S 0.0 0.0 0:00.24 migration/0
>
> Ð ÐÑ, 27/02/2014 Ð 14:24 +0400, Kirill Tkhai ÐÐÑÐÑ:
> > [PATCH]sched/core: Return possibility to set RT and DL classes back
> >
> > I found that it's impossible to set RT policy for tasks at the moment.
> >
> > This is regression after commit [sched: Consider pi boosting in setscheduler()]
> > [c365c292d05908c6ea6f32708f331e21033fe71d ]
> > Fix that.
> >
> > Signed-off-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>
> > CC: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > CC: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > CC: Ingo Molnar <mingo@xxxxxxxxxx>
> > ---
> > kernel/sched/core.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 84b23ce..30cf9ad 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -3193,6 +3193,10 @@ static void __setscheduler_params(struct task_struct *p,
> > * getparam()/getattr() don't report silly values for !rt tasks.
> > */
> > p->rt_priority = attr->sched_priority;
> > +
> > + p->normal_prio = normal_prio(p);
> > + p->prio = rt_mutex_getprio(p);
> > +
> > set_load_weight(p);
> > }
> >
> >

I'd propose what follows, so that we can still use
__setscheduler_params() as it is.

Regards,

- Juri