Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-22 Thread Rafael J. Wysocki
On Thu, Oct 22, 2020 at 1:58 PM Peter Zijlstra wrote: > > On Thu, Oct 22, 2020 at 01:30:01PM +0200, Rafael J. Wysocki wrote: > > > Many people use intel_pstate in the active mode with HWP enabled too. > > We now have HWP-passive supported, afaict. So we should discourage that. Which is kind of ha

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-22 Thread Peter Zijlstra
On Thu, Oct 22, 2020 at 01:30:01PM +0200, Rafael J. Wysocki wrote: > Many people use intel_pstate in the active mode with HWP enabled too. We now have HWP-passive supported, afaict. So we should discourage that. That is; I'll care less and less about people not using schedutil as time goes on.

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-22 Thread Peter Zijlstra
On Thu, Oct 22, 2020 at 04:36:56PM +0530, Viresh Kumar wrote: > On 22-10-20, 11:05, Peter Zijlstra wrote: > > On Thu, Oct 22, 2020 at 02:02:55PM +0530, Viresh Kumar wrote: > > > One of the issues I see with this is that schedutil may not be > > > available in all configurations and it is still abso

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-22 Thread Rafael J. Wysocki
On Thu, Oct 22, 2020 at 1:07 PM Viresh Kumar wrote: > > On 22-10-20, 11:05, Peter Zijlstra wrote: > > On Thu, Oct 22, 2020 at 02:02:55PM +0530, Viresh Kumar wrote: > > > One of the issues I see with this is that schedutil may not be > > > available in all configurations and it is still absolutely

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-22 Thread Viresh Kumar
On 22-10-20, 11:05, Peter Zijlstra wrote: > On Thu, Oct 22, 2020 at 02:02:55PM +0530, Viresh Kumar wrote: > > One of the issues I see with this is that schedutil may not be > > available in all configurations and it is still absolutely fine to > > using the suggested helper to get the energy number

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-22 Thread Peter Zijlstra
On Thu, Oct 22, 2020 at 02:02:55PM +0530, Viresh Kumar wrote: > On 16-07-20, 13:56, Peter Zijlstra wrote: > > Another point is that cpu_util() vs turbo is a bit iffy, and to that, > > things like x86-APERF/MPERF and ARM-AMU got mentioned. Those might also > > have the benefit of giving you values

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-22 Thread Viresh Kumar
Hi Peter, Since Lukasz asked me to hold on to this stuff so he can propose something in its place, I stayed away from discussing this patchset for sometime. But now that he agrees [1] that we may take this forward and he can work on top of it as and when he can, I am looking to find the way out to

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-19 Thread Lukasz Luba
On 10/19/20 8:40 AM, Viresh Kumar wrote: On 30-07-20, 12:16, Lukasz Luba wrote: Hi Viresh, On 7/30/20 7:24 AM, Viresh Kumar wrote: On 17-07-20, 11:46, Vincent Guittot wrote: On Thu, 16 Jul 2020 at 16:24, Lukasz Luba wrote: On 7/16/20 12:56 PM, Peter Zijlstra wrote: Currently cpufreq_coo

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-10-19 Thread Viresh Kumar
On 30-07-20, 12:16, Lukasz Luba wrote: > Hi Viresh, > > On 7/30/20 7:24 AM, Viresh Kumar wrote: > > On 17-07-20, 11:46, Vincent Guittot wrote: > > > On Thu, 16 Jul 2020 at 16:24, Lukasz Luba wrote: > > > > On 7/16/20 12:56 PM, Peter Zijlstra wrote: > > > > > Currently cpufreq_cooling appears to e

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-30 Thread Lukasz Luba
Hi Viresh, On 7/30/20 7:24 AM, Viresh Kumar wrote: On 17-07-20, 11:46, Vincent Guittot wrote: On Thu, 16 Jul 2020 at 16:24, Lukasz Luba wrote: On 7/16/20 12:56 PM, Peter Zijlstra wrote: Currently cpufreq_cooling appears to estimate the CPU energy usage by calculating the percentage of idle t

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-29 Thread Viresh Kumar
On 17-07-20, 11:46, Vincent Guittot wrote: > On Thu, 16 Jul 2020 at 16:24, Lukasz Luba wrote: > > On 7/16/20 12:56 PM, Peter Zijlstra wrote: > > > Currently cpufreq_cooling appears to estimate the CPU energy usage by > > > calculating the percentage of idle time using the per-cpu cpustat stuff, >

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-22 Thread Viresh Kumar
On 17-07-20, 11:43, Quentin Perret wrote: > On Friday 17 Jul 2020 at 11:33:05 (+0100), Quentin Perret wrote: > > On Friday 17 Jul 2020 at 11:14:38 (+0100), Quentin Perret wrote: > > > On Tuesday 14 Jul 2020 at 12:06:53 (+0530), Viresh Kumar wrote: > > > > /** > > > > - * get_load() - get load for

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-17 Thread Vincent Guittot
On Fri, 17 Jul 2020 at 12:30, Lukasz Luba wrote: > > > > On 7/17/20 10:46 AM, Vincent Guittot wrote: > > On Thu, 16 Jul 2020 at 16:24, Lukasz Luba wrote: > >> > >> Hi Peter, > >> > >> Thank you for summarizing this. I've put my comments below. > >> > >> On 7/16/20 12:56 PM, Peter Zijlstra wrote:

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-17 Thread Quentin Perret
On Friday 17 Jul 2020 at 11:33:05 (+0100), Quentin Perret wrote: > On Friday 17 Jul 2020 at 11:14:38 (+0100), Quentin Perret wrote: > > On Tuesday 14 Jul 2020 at 12:06:53 (+0530), Viresh Kumar wrote: > > > /** > > > - * get_load() - get load for a cpu since last updated > > > + * get_load() - get

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-17 Thread Quentin Perret
On Friday 17 Jul 2020 at 11:14:38 (+0100), Quentin Perret wrote: > On Tuesday 14 Jul 2020 at 12:06:53 (+0530), Viresh Kumar wrote: > > /** > > - * get_load() - get load for a cpu since last updated > > + * get_load() - get current load for a cpu > > * @cpufreq_cdev: &struct cpufreq_cooling_devi

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-17 Thread Lukasz Luba
On 7/17/20 10:46 AM, Vincent Guittot wrote: On Thu, 16 Jul 2020 at 16:24, Lukasz Luba wrote: Hi Peter, Thank you for summarizing this. I've put my comments below. On 7/16/20 12:56 PM, Peter Zijlstra wrote: On Tue, Jul 14, 2020 at 12:06:53PM +0530, Viresh Kumar wrote: /** + * get_load

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-17 Thread Quentin Perret
On Tuesday 14 Jul 2020 at 12:06:53 (+0530), Viresh Kumar wrote: > /** > - * get_load() - get load for a cpu since last updated > + * get_load() - get current load for a cpu > * @cpufreq_cdev:&struct cpufreq_cooling_device for this cpu > * @cpu: cpu number > - * @cpu_idx: index of the c

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-17 Thread Lukasz Luba
On 7/16/20 4:43 PM, Peter Zijlstra wrote: On Thu, Jul 16, 2020 at 03:24:37PM +0100, Lukasz Luba wrote: On 7/16/20 12:56 PM, Peter Zijlstra wrote: The second attempts to guesstimate power, and is the subject of this patch. Currently cpufreq_cooling appears to estimate the CPU energy usage

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-17 Thread Vincent Guittot
On Thu, 16 Jul 2020 at 16:24, Lukasz Luba wrote: > > Hi Peter, > > Thank you for summarizing this. I've put my comments below. > > On 7/16/20 12:56 PM, Peter Zijlstra wrote: > > On Tue, Jul 14, 2020 at 12:06:53PM +0530, Viresh Kumar wrote: > >> /** > >> + * get_load() - get current load for a cp

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-16 Thread Peter Zijlstra
On Thu, Jul 16, 2020 at 03:24:37PM +0100, Lukasz Luba wrote: > On 7/16/20 12:56 PM, Peter Zijlstra wrote: > > The second attempts to guesstimate power, and is the subject of this > > patch. > > > > Currently cpufreq_cooling appears to estimate the CPU energy usage by > > calculating the percentag

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-16 Thread Lukasz Luba
Hi Peter, Thank you for summarizing this. I've put my comments below. On 7/16/20 12:56 PM, Peter Zijlstra wrote: On Tue, Jul 14, 2020 at 12:06:53PM +0530, Viresh Kumar wrote: /** + * get_load() - get current load for a cpu * @cpufreq_cdev: &struct cpufreq_cooling_device for this cpu

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-16 Thread Peter Zijlstra
On Tue, Jul 14, 2020 at 12:06:53PM +0530, Viresh Kumar wrote: > /** > + * get_load() - get current load for a cpu > * @cpufreq_cdev:&struct cpufreq_cooling_device for this cpu > * @cpu: cpu number > + * @cpu_idx: index of the cpu > * > + * Return: The current load of cpu @cpu in perc

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-15 Thread Rafael J. Wysocki
On Wed, Jul 15, 2020 at 9:32 AM Viresh Kumar wrote: > > On 14-07-20, 15:05, Rafael J. Wysocki wrote: > > On Tue, Jul 14, 2020 at 8:37 AM Viresh Kumar > > wrote: > > > static u32 get_load(struct cpufreq_cooling_device *cpufreq_cdev, int cpu, > > > int cpu_idx) > > > { > > >

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-15 Thread Viresh Kumar
On 14-07-20, 15:05, Rafael J. Wysocki wrote: > On Tue, Jul 14, 2020 at 8:37 AM Viresh Kumar wrote: > > static u32 get_load(struct cpufreq_cooling_device *cpufreq_cdev, int cpu, > > int cpu_idx) > > { > > - u32 load; > > - u64 now, now_idle, delta_time, delta_idle;

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-14 Thread Rafael J. Wysocki
On Tue, Jul 14, 2020 at 8:37 AM Viresh Kumar wrote: > > Several parts of the kernel are already using the effective CPU > utilization to get the current load on the CPU, do the same here instead > of depending on the idle time of the CPU, which isn't that accurate > comparatively. > > Note that, t

Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-14 Thread Peter Zijlstra
On Tue, Jul 14, 2020 at 12:06:53PM +0530, Viresh Kumar wrote: > Several parts of the kernel are already using the effective CPU > utilization to get the current load on the CPU, do the same here instead > of depending on the idle time of the CPU, which isn't that accurate > comparatively. > > Note

[PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

2020-07-13 Thread Viresh Kumar
Several parts of the kernel are already using the effective CPU utilization to get the current load on the CPU, do the same here instead of depending on the idle time of the CPU, which isn't that accurate comparatively. Note that, this (and CPU frequency scaling in general) doesn't work that well