Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-19 Thread Rafael J. Wysocki
On Tue, Mar 19, 2019 at 11:49 AM Viresh Kumar wrote: > > On 19-03-19, 10:41, Rafael J. Wysocki wrote: > > On Tue, Mar 19, 2019 at 6:50 AM Viresh Kumar > > wrote: > > > > > > On 18-03-19, 12:49, Rafael J. Wysocki wrote: > > > > To summarize, I think that it would be sufficient to do this just for

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-19 Thread Viresh Kumar
On 19-03-19, 10:41, Rafael J. Wysocki wrote: > On Tue, Mar 19, 2019 at 6:50 AM Viresh Kumar wrote: > > > > On 18-03-19, 12:49, Rafael J. Wysocki wrote: > > > To summarize, I think that it would be sufficient to do this just for > > > policy->cpu and, as Peter said, warn once if there are more CPUs

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-19 Thread Rafael J. Wysocki
On Tue, Mar 19, 2019 at 6:50 AM Viresh Kumar wrote: > > On 18-03-19, 12:49, Rafael J. Wysocki wrote: > > To summarize, I think that it would be sufficient to do this just for > > policy->cpu and, as Peter said, warn once if there are more CPUs in > > the policy or policy->cpu is not the CPU runnin

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-18 Thread Viresh Kumar
On 18-03-19, 12:49, Rafael J. Wysocki wrote: > To summarize, I think that it would be sufficient to do this just for > policy->cpu and, as Peter said, warn once if there are more CPUs in > the policy or policy->cpu is not the CPU running this code. And mark > the TSC as unstable in both of these c

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-18 Thread Rafael J. Wysocki
On Fri, Mar 15, 2019 at 10:13 AM Viresh Kumar wrote: > > Currently we call these notifiers once for each CPU of the policy->cpus > cpumask. It would be more optimal if the notifier can be called only > once and all the relevant information be provided to it. Out of the 24 > drivers that register f

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-18 Thread Rafael J. Wysocki
On Mon, Mar 18, 2019 at 12:09 PM Rafael J. Wysocki wrote: > > On Mon, Mar 18, 2019 at 11:54 AM Peter Zijlstra wrote: > > > > On Mon, Mar 18, 2019 at 08:05:14AM +0530, Viresh Kumar wrote: > > > On 15-03-19, 13:29, Peter Zijlstra wrote: > > > > On Fri, Mar 15, 2019 at 02:43:07PM +0530, Viresh Kumar

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-18 Thread Rafael J. Wysocki
On Mon, Mar 18, 2019 at 11:54 AM Peter Zijlstra wrote: > > On Mon, Mar 18, 2019 at 08:05:14AM +0530, Viresh Kumar wrote: > > On 15-03-19, 13:29, Peter Zijlstra wrote: > > > On Fri, Mar 15, 2019 at 02:43:07PM +0530, Viresh Kumar wrote: > > > > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/ts

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-18 Thread Peter Zijlstra
On Mon, Mar 18, 2019 at 11:45:00AM +0100, Rafael J. Wysocki wrote: > On Fri, Mar 15, 2019 at 1:30 PM Peter Zijlstra wrote: > > On Fri, Mar 15, 2019 at 02:43:07PM +0530, Viresh Kumar wrote: > > > + for_each_cpu(cpu, cpus) > > > + set_cyc2ns_scale(tsc_khz, cpu, rdtsc

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-18 Thread Peter Zijlstra
On Mon, Mar 18, 2019 at 08:05:14AM +0530, Viresh Kumar wrote: > On 15-03-19, 13:29, Peter Zijlstra wrote: > > On Fri, Mar 15, 2019 at 02:43:07PM +0530, Viresh Kumar wrote: > > > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c > > > index 3fae23834069..cff8779fc0d2 100644 > > > --- a/arch

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-18 Thread Rafael J. Wysocki
On Fri, Mar 15, 2019 at 1:30 PM Peter Zijlstra wrote: > > On Fri, Mar 15, 2019 at 02:43:07PM +0530, Viresh Kumar wrote: > > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c > > index 3fae23834069..cff8779fc0d2 100644 > > --- a/arch/x86/kernel/tsc.c > > +++ b/arch/x86/kernel/tsc.c > > @@

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-17 Thread Viresh Kumar
On 15-03-19, 13:29, Peter Zijlstra wrote: > On Fri, Mar 15, 2019 at 02:43:07PM +0530, Viresh Kumar wrote: > > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c > > index 3fae23834069..cff8779fc0d2 100644 > > --- a/arch/x86/kernel/tsc.c > > +++ b/arch/x86/kernel/tsc.c > > @@ -956,28 +956,38

Re: [PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-15 Thread Peter Zijlstra
On Fri, Mar 15, 2019 at 02:43:07PM +0530, Viresh Kumar wrote: > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c > index 3fae23834069..cff8779fc0d2 100644 > --- a/arch/x86/kernel/tsc.c > +++ b/arch/x86/kernel/tsc.c > @@ -956,28 +956,38 @@ static int time_cpufreq_notifier(struct notifier_b

[PATCH V2] cpufreq: Call transition notifier only once for each policy

2019-03-15 Thread Viresh Kumar
Currently we call these notifiers once for each CPU of the policy->cpus cpumask. It would be more optimal if the notifier can be called only once and all the relevant information be provided to it. Out of the 24 drivers that register for the transition notifiers today, only 5 of them do per-cpu upd