Re: [PATCH v6 03/16] sched/core: uclamp: Map TASK's clamp values into CPU's clamp buckets

2019-01-21 Thread Patrick Bellasi
On 21-Jan 16:05, Peter Zijlstra wrote: > On Tue, Jan 15, 2019 at 10:15:00AM +, Patrick Bellasi wrote: > > +static inline unsigned int uclamp_bucket_value(unsigned int clamp_value) > > +{ > > +#define UCLAMP_BUCKET_DELTA (SCHED_CAPACITY_SCALE / > > CONFIG_UCLAMP_BUCKETS_COUNT) > > +#define

Re: [PATCH v6 03/16] sched/core: uclamp: Map TASK's clamp values into CPU's clamp buckets

2019-01-21 Thread Peter Zijlstra
On Tue, Jan 15, 2019 at 10:15:00AM +, Patrick Bellasi wrote: > +static inline unsigned int uclamp_bucket_value(unsigned int clamp_value) > +{ > +#define UCLAMP_BUCKET_DELTA (SCHED_CAPACITY_SCALE / > CONFIG_UCLAMP_BUCKETS_COUNT) > +#define UCLAMP_BUCKET_UPPER (UCLAMP_BUCKET_DELTA * >

Re: [PATCH v6 03/16] sched/core: uclamp: Map TASK's clamp values into CPU's clamp buckets

2019-01-21 Thread Peter Zijlstra
On Mon, Jan 21, 2019 at 12:27:10PM +, Patrick Bellasi wrote: > On 21-Jan 11:15, Peter Zijlstra wrote: > > On Tue, Jan 15, 2019 at 10:15:00AM +, Patrick Bellasi wrote: > > > +/* > > > + * Number of utilization clamp buckets. > > > + * > > > + * The first clamp bucket (bucket_id=0) is used

Re: [PATCH v6 03/16] sched/core: uclamp: Map TASK's clamp values into CPU's clamp buckets

2019-01-21 Thread Patrick Bellasi
On 21-Jan 11:15, Peter Zijlstra wrote: > On Tue, Jan 15, 2019 at 10:15:00AM +, Patrick Bellasi wrote: > > +/* > > + * Number of utilization clamp buckets. > > + * > > + * The first clamp bucket (bucket_id=0) is used to track non clamped > > tasks, i.e. > > + * util_{min,max}

Re: [PATCH v6 03/16] sched/core: uclamp: Map TASK's clamp values into CPU's clamp buckets

2019-01-21 Thread Peter Zijlstra
On Tue, Jan 15, 2019 at 10:15:00AM +, Patrick Bellasi wrote: > +/* > + * Number of utilization clamp buckets. > + * > + * The first clamp bucket (bucket_id=0) is used to track non clamped tasks, > i.e. > + * util_{min,max} (0,SCHED_CAPACITY_SCALE). Thus we allocate one more bucket > in > + *

[PATCH v6 03/16] sched/core: uclamp: Map TASK's clamp values into CPU's clamp buckets

2019-01-15 Thread Patrick Bellasi
Utilization clamping requires each CPU to know which clamp values are assigned to tasks RUNNABLE on that CPU. A per-CPU array of reference counters can be used where each entry tracks how many RUNNABLE tasks require the same clamp value on each CPU. However, the range of clamp values is too wide