Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-14 Thread Patrick Bellasi
On 13-Sep 21:14, Peter Zijlstra wrote: > On Wed, Sep 12, 2018 at 06:52:02PM +0100, Patrick Bellasi wrote: > > On 12-Sep 19:42, Peter Zijlstra wrote: > > > On Wed, Sep 12, 2018 at 06:35:15PM +0100, Patrick Bellasi wrote: > > > > On 12-Sep 18:12, Peter Zijlstra wrote: > > > > > > > > No idea; but if

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-14 Thread Patrick Bellasi
On 13-Sep 21:20, Peter Zijlstra wrote: > On Wed, Sep 12, 2018 at 06:42:09PM +0100, Patrick Bellasi wrote: > > On 12-Sep 18:24, Peter Zijlstra wrote: > > > On Tue, Aug 28, 2018 at 02:53:10PM +0100, Patrick Bellasi wrote: > > > > > { > > > > + int group_id[UCLAMP_CNT] = { UCLAMP_NOT_VALID };

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-13 Thread Peter Zijlstra
On Wed, Sep 12, 2018 at 06:42:09PM +0100, Patrick Bellasi wrote: > On 12-Sep 18:24, Peter Zijlstra wrote: > > On Tue, Aug 28, 2018 at 02:53:10PM +0100, Patrick Bellasi wrote: > > > { > > > + int group_id[UCLAMP_CNT] = { UCLAMP_NOT_VALID }; > > > + int lower_bound, upper_bound; > > > + struct ucla

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-13 Thread Peter Zijlstra
On Wed, Sep 12, 2018 at 06:52:02PM +0100, Patrick Bellasi wrote: > On 12-Sep 19:42, Peter Zijlstra wrote: > > On Wed, Sep 12, 2018 at 06:35:15PM +0100, Patrick Bellasi wrote: > > > On 12-Sep 18:12, Peter Zijlstra wrote: > > > > > > No idea; but if you want to go all fancy you can replace he whole

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Patrick Bellasi
On 12-Sep 19:42, Peter Zijlstra wrote: > On Wed, Sep 12, 2018 at 06:35:15PM +0100, Patrick Bellasi wrote: > > On 12-Sep 18:12, Peter Zijlstra wrote: > > > > No idea; but if you want to go all fancy you can replace he whole > > > uclamp_map thing with something like: > > > > > > struct uclamp_map

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Peter Zijlstra
On Wed, Sep 12, 2018 at 06:35:15PM +0100, Patrick Bellasi wrote: > On 12-Sep 18:12, Peter Zijlstra wrote: > > No idea; but if you want to go all fancy you can replace he whole > > uclamp_map thing with something like: > > > > struct uclamp_map { > > union { > > struct { > >

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Patrick Bellasi
On 12-Sep 18:24, Peter Zijlstra wrote: > On Tue, Aug 28, 2018 at 02:53:10PM +0100, Patrick Bellasi wrote: > > static inline int __setscheduler_uclamp(struct task_struct *p, > > const struct sched_attr *attr) > > But large for inline now. Yes, Suren also alread

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Patrick Bellasi
On 12-Sep 18:12, Peter Zijlstra wrote: > On Wed, Sep 12, 2018 at 04:56:19PM +0100, Patrick Bellasi wrote: > > On 12-Sep 15:49, Peter Zijlstra wrote: > > > On Tue, Aug 28, 2018 at 02:53:10PM +0100, Patrick Bellasi wrote: > > > > > +/** > > > > + * uclamp_map: reference counts a utilization "clamp v

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Peter Zijlstra
On Tue, Aug 28, 2018 at 02:53:10PM +0100, Patrick Bellasi wrote: > static inline int __setscheduler_uclamp(struct task_struct *p, > const struct sched_attr *attr) But large for inline now. > { > + int group_id[UCLAMP_CNT] = { UCLAMP_NOT_VALID }; > +

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Peter Zijlstra
On Wed, Sep 12, 2018 at 04:56:19PM +0100, Patrick Bellasi wrote: > On 12-Sep 15:49, Peter Zijlstra wrote: > > On Tue, Aug 28, 2018 at 02:53:10PM +0100, Patrick Bellasi wrote: > > > +/** > > > + * uclamp_map: reference counts a utilization "clamp value" > > > + * @value:the utilization "clamp v

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Patrick Bellasi
On 12-Sep 15:49, Peter Zijlstra wrote: > On Tue, Aug 28, 2018 at 02:53:10PM +0100, Patrick Bellasi wrote: > > +/** > > + * Utilization's clamp group > > + * > > + * A utilization clamp group maps a "clamp value" (value), i.e. > > + * util_{min,max}, to a "clamp group index" (group_id). > > + */ > >

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Peter Zijlstra
On Tue, Aug 28, 2018 at 02:53:10PM +0100, Patrick Bellasi wrote: > +/** > + * Utilization's clamp group > + * > + * A utilization clamp group maps a "clamp value" (value), i.e. > + * util_{min,max}, to a "clamp group index" (group_id). > + */ > +struct uclamp_se { > + unsigned int value; > +

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-12 Thread Patrick Bellasi
Hi Suren, On 08-Sep 16:47, Suren Baghdasaryan wrote: [...] > > + * A clamp group is not free if there is at least one SE which is sing a > > clamp > > typo in the sentence Right, s/is sing/is using/ +1 [...] > > +static int > > +uclamp_group_find(int clamp_id, unsigned int clamp_value) > >

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-08 Thread Suren Baghdasaryan
Hi Patrick! On Tue, Aug 28, 2018 at 6:53 AM, Patrick Bellasi wrote: > Utilization clamping requires each CPU to know which clamp values are > assigned to tasks that are currently RUNNABLE on that CPU. > Multiple tasks can be assigned the same clamp value and tasks with > different clamp values ca

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-06 Thread Juri Lelli
On 06/09/18 14:48, Patrick Bellasi wrote: > Hi Juri! > > On 05-Sep 12:45, Juri Lelli wrote: > > Hi, > > > > On 28/08/18 14:53, Patrick Bellasi wrote: > > > > [...] > > > > > static inline int __setscheduler_uclamp(struct task_struct *p, > > > const struct sche

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-06 Thread Patrick Bellasi
On 06-Sep 10:17, Juri Lelli wrote: > On 28/08/18 14:53, Patrick Bellasi wrote: > > [...] > > > static inline int __setscheduler_uclamp(struct task_struct *p, > > const struct sched_attr *attr) > > { > > - if (attr->sched_util_min > attr->sched_util_max) > >

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-06 Thread Patrick Bellasi
Hi Juri! On 05-Sep 12:45, Juri Lelli wrote: > Hi, > > On 28/08/18 14:53, Patrick Bellasi wrote: > > [...] > > > static inline int __setscheduler_uclamp(struct task_struct *p, > > const struct sched_attr *attr) > > { > > - if (attr->sched_util_min > attr->

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-06 Thread Juri Lelli
On 28/08/18 14:53, Patrick Bellasi wrote: [...] > static inline int __setscheduler_uclamp(struct task_struct *p, > const struct sched_attr *attr) > { > - if (attr->sched_util_min > attr->sched_util_max) > - return -EINVAL; > - if (attr->

Re: [PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-09-05 Thread Juri Lelli
Hi, On 28/08/18 14:53, Patrick Bellasi wrote: [...] > static inline int __setscheduler_uclamp(struct task_struct *p, > const struct sched_attr *attr) > { > - if (attr->sched_util_min > attr->sched_util_max) > - return -EINVAL; > - if (a

[PATCH v4 02/16] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups

2018-08-28 Thread Patrick Bellasi
Utilization clamping requires each CPU to know which clamp values are assigned to tasks that are currently RUNNABLE on that CPU. Multiple tasks can be assigned the same clamp value and tasks with different clamp values can be concurrently active on the same CPU. Thus, a proper data structure is req