All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	pablomh@gmail.com
Subject: Re: [PATCH] cpufreq: intel_pstate: Process HWP Guaranteed change notification
Date: Fri, 1 Oct 2021 21:04:35 +0200	[thread overview]
Message-ID: <CAJZ5v0iVMfz2joKiWK05FLpDyQTQj4RFAoE9Mc_RHbaUA1qRvw@mail.gmail.com> (raw)
In-Reply-To: <5b5f8adcf441494c5e17b9fb47dc42f345c737f2.camel@linux.intel.com>

On Fri, Oct 1, 2021 at 9:01 PM Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
>
> On Fri, 2021-10-01 at 20:52 +0200, Rafael J. Wysocki wrote:
> > On Tue, Sep 28, 2021 at 6:42 PM Srinivas Pandruvada
> > <srinivas.pandruvada@linux.intel.com> wrote:
> > >
> > > It is possible that HWP guaranteed ratio is changed in response to
> > > change in power and thermal limits. For example when Intel Speed
> > > Select
> > > performance profile is changed or there is change in TDP, hardware
> > > can
> > > send notifications. It is possible that the guaranteed ratio is
> > > increased. This creates an issue when turbo is disabled, as the old
> > > limits set in MSR_HWP_REQUEST are still lower and hardware will
> > > clip
> > > to older limits.
> > >
> > > This change enables HWP interrupt and process HWP interrupts. When
> > > guaranteed is changed, calls cpufreq_update_policy() so that driver
> > > callbacks are called to update to new HWP limits. This callback
> > > is called from a delayed workqueue of 10ms to avoid frequent
> > > updates.
> > >
> > > Although the scope of IA32_HWP_INTERRUPT is per logical cpu, on
> > > some
> > > plaforms interrupt is generated on all CPUs. This is particularly a
> > > problem during initialization, when the driver didn't allocated
> > > data for other CPUs. So this change uses a cpumask of enabled CPUs
> > > and
> > > process interrupts on those CPUs only.
> > >
> > > When the cpufreq offline() or suspend()callback is called, HWP
> > > interrupt
> > > is disabled on those CPUs and also cancels any pending work item.
> > >
> > > Spin lock is used to protect data and processing shared with
> > > interrupt
> > > handler. Here READ_ONCE(), WRITE_ONCE() macros are used to
> > > designate
> > > shared data, even though spin lock act as an optmization barrier
> > > here.
> > >
> > > Signed-off-by: Srinivas Pandruvada <
> > > srinivas.pandruvada@linux.intel.com>
> > > ---
> > > This patch is a replacement from the patch submitted to 5.15 and
> > > later
> > > reverted.
> >
> > Applied as 5.16 material, thanks!
> I got email that pablo (pablomh@gmail.com) tested this. So he can added
> Tested-by also pointed out typo in "optmization".
> Shall I send a patch with this change?

No need, I will update the commit in the tree.

      reply	other threads:[~2021-10-01 19:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 16:42 [PATCH] cpufreq: intel_pstate: Process HWP Guaranteed change notification Srinivas Pandruvada
2021-10-01 18:52 ` Rafael J. Wysocki
2021-10-01 18:58   ` Srinivas Pandruvada
2021-10-01 19:01   ` Srinivas Pandruvada
2021-10-01 19:04     ` Rafael J. Wysocki [this message]

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=CAJZ5v0iVMfz2joKiWK05FLpDyQTQj4RFAoE9Mc_RHbaUA1qRvw@mail.gmail.com \
    --to=rafael@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pablomh@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=viresh.kumar@linaro.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.