All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael Wysocki" <rjw@rjwysocki.net>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Russell King" <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	linux-pm@vger.kernel.org,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
	kvm@vger.kernel.org
Subject: Re: [PATCH V3] cpufreq: Call transition notifier only once for each policy
Date: Thu, 21 Mar 2019 16:49:37 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1903211645100.1784@nanos.tec.linutronix.de> (raw)
In-Reply-To: <1eb27e3bbcbb2c67e6eadc0893c9b41e5d76894b.1553057341.git.viresh.kumar@linaro.org>

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

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@linutronix.de>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael Wysocki" <rjw@rjwysocki.net>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Russell King" <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	linux-pm@vger.kernel.org,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
	kvm@vger.kernel.org
Subject: Re: [PATCH V3] cpufreq: Call transition notifier only once for each policy
Date: Thu, 21 Mar 2019 15:49:37 +0000	[thread overview]
Message-ID: <alpine.DEB.2.21.1903211645100.1784@nanos.tec.linutronix.de> (raw)
In-Reply-To: <1eb27e3bbcbb2c67e6eadc0893c9b41e5d76894b.1553057341.git.viresh.kumar@linaro.org>

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

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@linutronix.de>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Vincent Guittot" <vincent.guittot@linaro.org>,
	kvm@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	linux-pm@vger.kernel.org, x86@kernel.org,
	"Rafael Wysocki" <rjw@rjwysocki.net>,
	"Russell King" <linux@armlinux.org.uk>,
	linux-kernel@vger.kernel.org, "Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	sparclinux@vger.kernel.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V3] cpufreq: Call transition notifier only once for each policy
Date: Thu, 21 Mar 2019 16:49:37 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1903211645100.1784@nanos.tec.linutronix.de> (raw)
In-Reply-To: <1eb27e3bbcbb2c67e6eadc0893c9b41e5d76894b.1553057341.git.viresh.kumar@linaro.org>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-03-21 15:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20  4:52 [PATCH V3] cpufreq: Call transition notifier only once for each policy Viresh Kumar
2019-03-20  4:52 ` Viresh Kumar
2019-03-20  4:52 ` Viresh Kumar
2019-03-21 11:45 ` Peter Zijlstra
2019-03-21 11:45   ` Peter Zijlstra
2019-03-21 11:45   ` Peter Zijlstra
2019-03-21 11:45   ` Peter Zijlstra
2019-03-22  6:19   ` Viresh Kumar
2019-03-22  6:31     ` Viresh Kumar
2019-03-22  6:19     ` Viresh Kumar
2019-04-24  6:47     ` Viresh Kumar
2019-04-24  6:59       ` Viresh Kumar
2019-04-24  6:47       ` Viresh Kumar
2019-04-24  7:26       ` Rafael J. Wysocki
2019-04-24  7:26         ` Rafael J. Wysocki
2019-04-24  7:26         ` Rafael J. Wysocki
2019-03-21 15:49 ` Thomas Gleixner [this message]
2019-03-21 15:49   ` Thomas Gleixner
2019-03-21 15:49   ` Thomas Gleixner
2019-03-22  6:27   ` Viresh Kumar
2019-03-22  6:39     ` Viresh Kumar
2019-03-22  6:27     ` Viresh Kumar
2019-03-22  9:55     ` Rafael J. Wysocki
2019-03-22  9:55       ` Rafael J. Wysocki
2019-03-22  9:55       ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1903211645100.1784@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=rkrcmar@redhat.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.