Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-17 Thread Dietmar Eggemann
On 07/17/2018 04:19 PM, Quentin Perret wrote: Hi Dietmar, On Tuesday 17 Jul 2018 at 10:57:13 (+0200), Dietmar Eggemann wrote: On 07/16/2018 12:29 PM, Quentin Perret wrote: [...] So, I guess you see this overhead because of the extra division involved by computing 'cap = max_cap * cs->freque

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-17 Thread Quentin Perret
Hi Dietmar, On Tuesday 17 Jul 2018 at 10:57:13 (+0200), Dietmar Eggemann wrote: > On 07/16/2018 12:29 PM, Quentin Perret wrote: > I see an impact of 'calculating capacity on the fly' in > compute_energy()->em_fd_energy(). Running the first energy test case (# task > equal 10) on the Juno r0 board

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-17 Thread Dietmar Eggemann
On 07/16/2018 12:29 PM, Quentin Perret wrote: On Tuesday 10 Jul 2018 at 09:32:02 (+0100), Quentin Perret wrote: [...] Another thing to take into consideration here is basically that the thermal subsystem (IPA) will be impacted by the RCU protection on the cs_table. However, since the 'frequen

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-16 Thread Quentin Perret
On Tuesday 10 Jul 2018 at 09:32:02 (+0100), Quentin Perret wrote: > Indeed, having 'capacity' values in the EM framework is just an > optimization for the scheduler, so that it doesn't need to compute them > in the wake-up path. I could get rid of the whole > em_rescale_cpu_capacity() mess (and by

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-10 Thread Quentin Perret
On Monday 09 Jul 2018 at 20:07:31 (+0200), Dietmar Eggemann wrote: > On 06/28/2018 01:40 PM, Quentin Perret wrote: > This em_rescale_cpu_capacity() function is still very much specific to > systems with asymmetric cpu capacity (Arm big.Little/DynamIQ). Only after > cpufreq is up we can determine th

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-09 Thread Dietmar Eggemann
On 06/28/2018 01:40 PM, Quentin Perret wrote: [...] +/** + * em_rescale_cpu_capacity() - Re-scale capacity values of the Energy Model + * + * This re-scales the capacity values for all capacity states of all frequency + * domains of the Energy Model. This should be used when the capacity values

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-06 Thread Quentin Perret
On Friday 06 Jul 2018 at 12:03:53 (+0200), Peter Zijlstra wrote: > On Fri, Jul 06, 2018 at 11:57:37AM +0200, Vincent Guittot wrote: > > > > IIUC the formula above, you consider that all CPUs in a frequency > > domain has the same capacity. This sounds a reasonable assumption but > > it would be go

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-06 Thread Quentin Perret
Hi Vincent, On Friday 06 Jul 2018 at 11:57:37 (+0200), Vincent Guittot wrote: > On Thu, 28 Jun 2018 at 13:41, Quentin Perret wrote: > > +static inline unsigned long em_fd_energy(struct em_freq_domain *fd, > > + unsigned long max_util, unsigned long > > sum_util) > >

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-06 Thread Peter Zijlstra
On Fri, Jul 06, 2018 at 11:57:37AM +0200, Vincent Guittot wrote: > > IIUC the formula above, you consider that all CPUs in a frequency > domain has the same capacity. This sounds a reasonable assumption but > it would be good to write that somewhere Yes, I think there used to be a WARN and kill E

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-06 Thread Vincent Guittot
On Thu, 28 Jun 2018 at 13:41, Quentin Perret wrote: > > Several subsystems in the kernel (task scheduler and/or thermal at the > time of writing) can benefit from knowing about the energy consumed by > CPUs. Yet, this information can come from different sources (DT or > firmware for example), in d

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-05 Thread Quentin Perret
On Thursday 05 Jul 2018 at 17:06:29 (+0200), Peter Zijlstra wrote: > On Thu, Jun 28, 2018 at 12:40:34PM +0100, Quentin Perret wrote: > > +/* fd_update_cs_table() - Computes the capacity values of a cs_table > > + * > > + * This assumes a linear relation between capacity and frequency. As such, > >

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-05 Thread Quentin Perret
On Thursday 05 Jul 2018 at 16:31:51 (+0200), Peter Zijlstra wrote: > On Thu, Jun 28, 2018 at 12:40:34PM +0100, Quentin Perret wrote: > > +/** > > + * em_fd_energy() - Estimates the energy consumed by the CPUs of a freq. > > domain > > + * @fd : frequency domain for which energy has to

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-05 Thread Quentin Perret
On Thursday 05 Jul 2018 at 16:39:01 (+0200), Peter Zijlstra wrote: > On Thu, Jun 28, 2018 at 12:40:34PM +0100, Quentin Perret wrote: > > +/** > > + * em_fd_nr_cap_states() - Get the number of capacity states of a freq. > > domain > > + * @fd : frequency domain for which want to do this

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-05 Thread Peter Zijlstra
On Thu, Jun 28, 2018 at 12:40:34PM +0100, Quentin Perret wrote: > +/* fd_update_cs_table() - Computes the capacity values of a cs_table > + * > + * This assumes a linear relation between capacity and frequency. As such, > + * the capacity of a CPU at the n^th capacity state is computed as: > + *

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-05 Thread Peter Zijlstra
On Thu, Jun 28, 2018 at 12:40:34PM +0100, Quentin Perret wrote: > +/** > + * em_fd_nr_cap_states() - Get the number of capacity states of a freq. > domain > + * @fd : frequency domain for which want to do this > + * > + * Return: the number of capacity state in the frequency domain t

Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-07-05 Thread Peter Zijlstra
On Thu, Jun 28, 2018 at 12:40:34PM +0100, Quentin Perret wrote: > +/** > + * em_fd_energy() - Estimates the energy consumed by the CPUs of a freq. > domain > + * @fd : frequency domain for which energy has to be estimated > + * @max_util : highest utilization among CPUs of the domain

[RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

2018-06-28 Thread Quentin Perret
Several subsystems in the kernel (task scheduler and/or thermal at the time of writing) can benefit from knowing about the energy consumed by CPUs. Yet, this information can come from different sources (DT or firmware for example), in different formats, hence making it hard to exploit without a sta