lkml.org 
[lkml]   [2019]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH V3] cpufreq: Call transition notifier only once for each policy
On Wed, 20 Mar 2019, Viresh Kumar wrote:

> Currently we call these notifiers once for each CPU of the policy->cpus

Nitpick: We call nothing. The notifiers are called ....

> 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 23
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 3fae23834069..b2fe665878f7 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -958,10 +958,15 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
> struct cpufreq_freqs *freq = data;
> unsigned long *lpj;
>
> + if (WARN_ON_ONCE(cpumask_weight(freq->policy->related_cpus) != 1)) {
> + mark_tsc_unstable("cpufreq changes: related CPUs affected");
> + return 0;
> + }

You might add a check which ensures that policy->cpu == smp_processor_id()
because if this is not the case ....

Thanks,

tglx

\
 
 \ /
  Last update: 2019-03-21 16:50    [W:0.091 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site