Re: [PATCH v6 09/16] sched/cpufreq: uclamp: Add utilization clamping for RT tasks

From: Peter Zijlstra
Date: Thu Jan 24 2019 - 10:33:59 EST


On Thu, Jan 24, 2019 at 12:30:09PM +0000, Patrick Bellasi wrote:
> On 23-Jan 21:11, Peter Zijlstra wrote:

> > Anyway, once you get range composition defined; that should be something
> > like:
> >
> > R_p \Compose_g R_g
> >
> > Where R_p is the range of task-p, and R_g is the range of the g'th
> > cgroup of p (where you can make an identity between the root cgroup and
> > the system default).
> >
> > Now; as per the other email; I think the straight forward composition:
> >
> > struct range compose(struct range a, struct range b)
> > {
> > return (range){.min = clamp(a.min, b.min, b.max),
> > .max = clamp(a.max, b.min, b.max), };
> > }
>
> This composition is done in uclamp_effective_get() but it's
> slightly different, since we want to support a "nice policy" where
> tasks can always ask less then what they have got assigned.

Not sure I follow..

> Thus, from an abstract standpoint, if a task is in a cgroup:
>
> task.min <= R_g.min
> task.max <= R_g.max
>
> While, for tasks in the root cgroup system default applies and we
> enforece:
>
> task.min >= R_0.min
> task.max <= R_0.max
>
> ... where the "nice policy" is currently not more supported, but
> perhaps we can/should use the same for system defaults too.

That seems inconsistent at best.

OK, I'll go have another look. I never recognised that function for
doing that.