linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Deepak Sharma <deepak.sharma@amd.com>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [RESEND PATCH] x86: ACPI: cstate: Optimize C3 entry on AMD CPUs
Date: Wed, 29 Sep 2021 11:20:54 +0200	[thread overview]
Message-ID: <YVQv9tkwOZSP+Ruc@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAJZ5v0iS+TnkoqCxLa92Na=By53PXY-qW=k4utr_84KYaw+sVQ@mail.gmail.com>

On Fri, Sep 24, 2021 at 06:48:48PM +0200, Rafael J. Wysocki wrote:
> On Fri, Sep 24, 2021 at 8:12 AM Deepak Sharma <deepak.sharma@amd.com> wrote:
> >
> > All Zen or newer CPU which support C3 shares cache. Its not necessary to
> > flush the caches in software before entering C3. This will cause drop in
> > performance for the cores which share some caches. ARB_DIS is not used
> > with current AMD C state implementation. So set related flags correctly.
> >
> > Signed-off-by: Deepak Sharma <deepak.sharma@amd.com>
> 
> I'm planning to take this one unless the x86 maintainers have concerns, thanks.
> 
> > ---
> >  arch/x86/kernel/acpi/cstate.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
> > index 7de599eba7f0..7945eae5b315 100644
> > --- a/arch/x86/kernel/acpi/cstate.c
> > +++ b/arch/x86/kernel/acpi/cstate.c
> > @@ -79,6 +79,21 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
> >                  */
> >                 flags->bm_control = 0;
> >         }
> > +       if (c->x86_vendor == X86_VENDOR_AMD && c->x86 >= 0x17) {
> > +               /*
> > +                * For all AMD Zen or newer CPUs that support C3, caches
> > +                * should not be flushed by software while entering C3
> > +                * type state. Set bm->check to 1 so that kernel doesn't
> > +                * need to execute cache flush operation.
> > +                */
> > +               flags->bm_check = 1;
> > +               /*
> > +                * In current AMD C state implementation ARB_DIS is no longer
> > +                * used. So set bm_control to zero to indicate ARB_DIS is not
> > +                * required while entering C3 type state.
> > +                */
> > +               flags->bm_control = 0;
> > +       }

My only concern is the blatant code duplication between AMD and ZHAOXIN
here. Other than that, this is obviously correct since the ZHAOXIN thing
is basically rebranded AMD IP.

      parent reply	other threads:[~2021-09-29  9:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24  6:12 [RESEND PATCH] x86: ACPI: cstate: Optimize C3 entry on AMD CPUs Deepak Sharma
2021-09-24 16:48 ` Rafael J. Wysocki
2021-09-26 15:12   ` Thomas Gleixner
2021-10-01 18:46     ` Rafael J. Wysocki
2021-09-29  9:20   ` Peter Zijlstra [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=YVQv9tkwOZSP+Ruc@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@alien8.de \
    --cc=deepak.sharma@amd.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).