Re: [PATCH 4/2] sched/cpupri: Add CPUPRI_HIGHER

From: Peter Zijlstra
Date: Tue Oct 20 2020 - 03:37:25 EST


On Mon, Oct 19, 2020 at 04:15:01PM +0200, Dietmar Eggemann wrote:
> On 14/10/2020 21:54, Peter Zijlstra wrote:
> >
> > Add CPUPRI_HIGHER above the RT99 priority to denote the CPU is in use
> > by higher priority tasks (specifically deadline).
>
> sugov:X already triggers this now on our !fast-switching devices running
> schedutil.

Right, that would also be a nice test-case for:

> > XXX: we should probably drive PUSH-PULL from cpupri, that would
> > automagically result in an RT-PUSH when DL sets cpupri to CPUPRI_HIGHER.

This, once we get there..

> > @@ -54,6 +56,10 @@ static int convert_prio(int prio)
>
> The BUG_ON could be tightened:
>
> - BUG_ON(prio >= MAX_PRIO);
> + BUG_ON(prio > MAX_RT_PRIO);
>

Maybe I've not had enough wake-up juice, but I can't seem to locate
this.

> > case MAX_RT_PRIO-1:
> > cpupri = CPUPRI_NORMAL; /* 0 */
> > break;
> > +
> > + case MAX_RT_PRIO:
> > + cpupri = CPUPRI_HIGHER; /* 100 */
> > + break;
> > }
> >
> > return cpupri;
>
> Just saw that the comment for cpupri_set() needs changing:
>
> @@ -205,7 +208,7 @@ int cpupri_find_fitness(struct cpupri *cp, struct
> task_struct *p,
> * cpupri_set - update the CPU priority setting
> * @cp: The cpupri context
> * @cpu: The target CPU
> - * @newpri: The priority (INVALID-RT99) to assign to this CPU
> + * @newpri: The priority (INVALID-RT1-RT99-NORMAL-HIGHER) to assign to
> this CPU

I made that:

+ * @newpri: The priority (INVALID,NORMAL,RT1-RT99,HIGHER) to assign to this CPU

>
> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>

Thanks!