From: Aaron Rainbolt <arainbolt@kfocus.org>
To: Mario Limonciello <mario.limonciello@amd.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: rafael@kernel.org, lenb@kernel.org, mmikowski@kfocus.org,
Perry.Yuan@amd.com
Subject: Re: [PATCH V2 RFC] acpi: Allow ignoring _OSC CPPC v2 bit via kernel parameter
Date: Tue, 18 Jun 2024 16:47:11 -0500 [thread overview]
Message-ID: <ZnIAX9P5XSco4cZw@kf-XE> (raw)
In-Reply-To: <c6bda238-166e-4de6-b0c7-4bddfb8ef6f4@amd.com>
On Tue, Jun 18, 2024 at 04:24:22PM -0500, Mario Limonciello wrote:
> On 6/18/2024 15:25, Aaron Rainbolt wrote:
> > acpi: Allow ignoring _OSC CPPC v2 bit via kernel parameter
> >
> > The _OSC is supposed to contain a bit indicating whether the hardware
> > supports CPPC v2 or not. This bit is not always set, causing CPPC v2 to
> > be considered absent. This results in severe single-core performance
> > issues with the EEVDF scheduler on heterogenous-core Intel processors.
> >
> > To work around this, provide a new kernel parameter, "ignore_osc_cppc_bit",
> > which may be used to ignore the _OSC CPPC v2 bit and act as if the bit was
> > enabled. This allows CPPC to be properly detected even if not "enabled" by
> > _OSC, allowing users with problematic hardware to obtain decent single-core
> > performance.
> >
> > Signed-off-by: Aaron Rainbolt <arainbolt@kfocus.org>
> >
> > ---
> >
> > V1 -> V2: Rewrite to work in cpc_supported_by_cpu.
> >
> > RFC: I have not yet tested this patch to ensure it functions properly,
> > nor have I attempted to compile it against mainline. My system takes
> > a couple of hours or so to build a kernel, and I'd like to submit this
> > for feedback now and test once it's sent.
>
> Thanks, this matches what I suggested, hopefully it works when you test it.
>
> One comment below though.
>
> >
> > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > index b600df82669d..af2d8973ba3a 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -2063,6 +2063,12 @@
> > could change it dynamically, usually by
> > /sys/module/printk/parameters/ignore_loglevel.
> > + ignore_osc_cppc_bit
> > + Assume CPPC is present and ignore the CPPC v2 bit from
> > + the ACPI _OSC method. This is useful for working
> > + around buggy firmware where CPPC is supported, but
> > + _OSC incorrectly reports it as being absent.
> > +
> > ignore_rlimit_data
> > Ignore RLIMIT_DATA setting for data mappings,
> > print warning at first misuse. Can be changed via
> > diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c
> > index ff8f25faca3d..7346a25e68ce 100644
> > --- a/arch/x86/kernel/acpi/cppc.c
> > +++ b/arch/x86/kernel/acpi/cppc.c
> > @@ -11,6 +11,14 @@
> > /* Refer to drivers/acpi/cppc_acpi.c for the description of functions */
> > +static bool ignore_osc_cppc_bit;
> > +static int __init parse_ignore_osc_cppc_bit(char *arg)
> > +{
> > + ignore_osc_cppc_bit = true;
> > + return 0;
> > +}
> > +early_param("ignore_osc_cppc_bit", parse_ignore_osc_cppc_bit);
> > +
> > bool cpc_supported_by_cpu(void)
> > {
> > switch (boot_cpu_data.x86_vendor) {
> > @@ -24,6 +32,10 @@ bool cpc_supported_by_cpu(void)
> > return true;
> > return boot_cpu_has(X86_FEATURE_CPPC);
> > }
> > +
> > + if (ignore_osc_cppc_bit) {
> > + return true;
> > + }
>
> I think you should move this check before the switch statement.
> The reason is that such a workaround could then apply to any CPU
> vendors and models that are AMD or Hygon too.
Oh good catch, I thought it would apply to everyone but missed an extra
'return' in the switch statement. I'll make sure to fix that in v3.
> > return false;
> > }
>
next prev parent reply other threads:[~2024-06-18 21:47 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 2:54 [PATCH] acpi: Allow ignoring _OSC CPPC v2 bit via kernel parameter Aaron Rainbolt
2024-06-18 17:09 ` Mario Limonciello
2024-06-18 18:30 ` Aaron Rainbolt
2024-06-18 18:35 ` Mario Limonciello
2024-06-18 18:52 ` Aaron Rainbolt
2024-06-18 18:58 ` Mario Limonciello
2024-06-18 19:25 ` Aaron Rainbolt
2024-06-18 19:27 ` Mario Limonciello
2024-06-18 20:25 ` [PATCH V2 RFC] " Aaron Rainbolt
2024-06-18 20:58 ` Aaron Rainbolt
2024-06-18 21:24 ` Mario Limonciello
2024-06-18 21:47 ` Aaron Rainbolt [this message]
2024-06-19 4:33 ` [PATCH V3] " Aaron Rainbolt
2024-06-19 5:08 ` Mario Limonciello
2024-06-19 17:09 ` Rafael J. Wysocki
2024-06-19 17:30 ` Rafael J. Wysocki
2024-06-19 17:44 ` Aaron Rainbolt
2024-06-19 17:56 ` Aaron Rainbolt
2024-06-19 21:39 ` Aaron Rainbolt
2024-06-19 22:19 ` Aaron Rainbolt
2024-06-20 1:05 ` Aaron Rainbolt
2024-06-20 15:40 ` Rafael J. Wysocki
2024-06-19 17:34 ` Aaron Rainbolt
2024-06-19 17:37 ` Rafael J. Wysocki
2024-06-18 18:31 ` [PATCH] " kernel test robot
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=ZnIAX9P5XSco4cZw@kf-XE \
--to=arainbolt@kfocus.org \
--cc=Perry.Yuan@amd.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mmikowski@kfocus.org \
--cc=rafael@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