Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-27 Thread Quentin Perret
On Tuesday 25 Sep 2018 at 17:49:56 (+0200), Peter Zijlstra wrote: > I really don't see how changing the unit changes anything. Either you > want to relate to OPPs and those are exposed in 1/1024 unit capacity > through the EAS files, or you don't and then the knob has no meaning. FWIW, with the la

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-26 Thread Patrick Bellasi
Hi Peter, On 21-Sep 11:13, Peter Zijlstra wrote: > On Mon, Sep 17, 2018 at 01:27:23PM +0100, Patrick Bellasi wrote: [...] While going back to one of our previous conversation, I noted these comments: > > Thus, the capacity of little CPUs, or the exact capacity of an OPP, is > > something we don

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-26 Thread Patrick Bellasi
On 25-Sep 17:49, Peter Zijlstra wrote: > On Mon, Sep 24, 2018 at 04:14:00PM +0100, Patrick Bellasi wrote: [...] > Well, with DL there are well defined rules for what to put in and what > to then expect. > > For this thing, not so much I feel. Maybe you'll prove me wrong, but that's not already

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-25 Thread Peter Zijlstra
On Mon, Sep 24, 2018 at 04:14:00PM +0100, Patrick Bellasi wrote: > > So why bother changing it around? > > For two main reasons: > > 1) to expose userspace a more generic interface: >a "performance percentage" is more generic then a "capacity value" >while keep translating and using a 10

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-24 Thread Patrick Bellasi
On 24-Sep 17:56, Peter Zijlstra wrote: > On Mon, Sep 24, 2018 at 04:14:00PM +0100, Patrick Bellasi wrote: > > On 21-Sep 11:13, Peter Zijlstra wrote: > > > Laptops with active cooling however... > > > > How do you see active cooling playing a role ? > > > > Are you thinking, for example, at reduce

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-24 Thread Patrick Bellasi
On 24-Sep 18:26, Peter Zijlstra wrote: > On Mon, Sep 24, 2018 at 04:14:00PM +0100, Patrick Bellasi wrote: > > > ... still it's difficult to give a precise definition of knee point, > > unless you know about platforms which have a sharp change in energy > > efficiency. > > > > The only cases we kn

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-24 Thread Peter Zijlstra
On Mon, Sep 24, 2018 at 04:14:00PM +0100, Patrick Bellasi wrote: > ... still it's difficult to give a precise definition of knee point, > unless you know about platforms which have a sharp change in energy > efficiency. > > The only cases we know about are those where: > > A) multiple frequencie

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-24 Thread Peter Zijlstra
On Mon, Sep 24, 2018 at 04:14:00PM +0100, Patrick Bellasi wrote: > On 21-Sep 11:13, Peter Zijlstra wrote: > > Laptops with active cooling however... > > How do you see active cooling playing a role ? > > Are you thinking, for example, at reduced fan noise if we remain below > a certain OPP ? > >

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-24 Thread Patrick Bellasi
On 21-Sep 11:13, Peter Zijlstra wrote: > On Mon, Sep 17, 2018 at 01:27:23PM +0100, Patrick Bellasi wrote: > > On 14-Sep 16:28, Peter Zijlstra wrote: > > > > The thing is, the values you'd want to use are for example the capacity > > > of the little CPUs. or the capacity of the most energy efficien

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-21 Thread Peter Zijlstra
On Mon, Sep 17, 2018 at 01:27:23PM +0100, Patrick Bellasi wrote: > On 14-Sep 16:28, Peter Zijlstra wrote: > > The thing is, the values you'd want to use are for example the capacity > > of the little CPUs. or the capacity of the most energy efficient OPP > > (the knee). > > I don't think so. > >

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-17 Thread Patrick Bellasi
On 14-Sep 16:28, Peter Zijlstra wrote: > Just a quick reply because I have to run.. > > On Fri, Sep 14, 2018 at 03:07:32PM +0100, Patrick Bellasi wrote: > > On 14-Sep 13:10, Peter Zijlstra wrote: > > > > I think the problem here is that the two are conflated in the very same > > > interface. > >

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-14 Thread Peter Zijlstra
Just a quick reply because I have to run.. On Fri, Sep 14, 2018 at 03:07:32PM +0100, Patrick Bellasi wrote: > On 14-Sep 13:10, Peter Zijlstra wrote: > > I think the problem here is that the two are conflated in the very same > > interface. > > > > Would it make sense to move the available clam

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-14 Thread Patrick Bellasi
On 14-Sep 13:10, Peter Zijlstra wrote: > On Thu, Sep 06, 2018 at 03:40:53PM +0100, Patrick Bellasi wrote: > > 1) _I think_ we don't want to depend on capable(CAP_SYS_NICE) but > >instead on capable(CAP_SYS_ADMIN) > > > >Does that make sense ? > > Neither of them really makes sense to me.

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-14 Thread Peter Zijlstra
On Thu, Sep 06, 2018 at 03:40:53PM +0100, Patrick Bellasi wrote: > 1) _I think_ we don't want to depend on capable(CAP_SYS_NICE) but >instead on capable(CAP_SYS_ADMIN) > >Does that make sense ? Neither of them really makes sense to me. The max clamp makes a task 'consume' less and you sh

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-06 Thread Patrick Bellasi
On 06-Sep 16:59, Juri Lelli wrote: > On 06/09/18 15:40, Patrick Bellasi wrote: > > On 04-Sep 15:47, Juri Lelli wrote: > > [...] > > > > Wondering if you want to fold the check below inside the > > > > > > if (user && !capable(CAP_SYS_NICE)) { > > >... > > > } > > > > > > block. It would a

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-06 Thread Juri Lelli
On 06/09/18 15:40, Patrick Bellasi wrote: > On 04-Sep 15:47, Juri Lelli wrote: [...] > > Wondering if you want to fold the check below inside the > > > > if (user && !capable(CAP_SYS_NICE)) { > >... > > } > > > > block. It would also save you from adding another parameter to the > > funct

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-06 Thread Patrick Bellasi
On 04-Sep 15:47, Juri Lelli wrote: > Hi, > > On 28/08/18 14:53, Patrick Bellasi wrote: > > The number of clamp groups supported is limited and defined at compile > > time. However, a malicious user can currently ask for many different > > Even if not malicious.. :-) Yeah... I should had write "a

Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-09-04 Thread Juri Lelli
Hi, On 28/08/18 14:53, Patrick Bellasi wrote: > The number of clamp groups supported is limited and defined at compile > time. However, a malicious user can currently ask for many different Even if not malicious.. :-) > clamp values thus consuming all the available clamp groups. > > Since on pr

[PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default

2018-08-28 Thread Patrick Bellasi
The number of clamp groups supported is limited and defined at compile time. However, a malicious user can currently ask for many different clamp values thus consuming all the available clamp groups. Since on properly configured systems we expect only a limited set of different clamp values, the p