From: Aaron Rainbolt <arainbolt@kfocus.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
lenb@kernel.org, mmikowski@kfocus.org, Perry.Yuan@amd.com,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: Re: [PATCH V3] acpi: Allow ignoring _OSC CPPC v2 bit via kernel parameter
Date: Wed, 19 Jun 2024 16:39:35 -0500 [thread overview]
Message-ID: <ZnNQF0ussBRSAt1g@kf-XE> (raw)
In-Reply-To: <12457165.O9o76ZdvQC@rjwysocki.net>
On Wed, Jun 19, 2024 at 07:30:55PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, June 19, 2024 7:09:35 PM CEST Rafael J. Wysocki wrote:
> > On Wed, Jun 19, 2024 at 6:33 AM Aaron Rainbolt <arainbolt@kfocus.org> 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.
> >
> > While some things can be affected by this, I don't immediately see a
> > connection between CPPC v2, Intel hybrid processors and EEVDF.
> >
> > In particular, why would EEVDF alone be affected?
> >
> > Care to explain this?
>
> And the reason why I am asking is because I think that you really need
> something like this (untested beyond compilation):
Alright, our team has compiled and tested the patch.
Results were mixed - with my patch, both CPPC and ITMT were enabled. This
patch appears to enable only ITMT. (To be specific, running
"find /proc /sys | grep '(cppc|itmt)'" shows only ITMT enabled under
/proc, and no CPPC directories under /sys.) This causes a performance hit
in benchmarking - using my patch with 'ignore_osc_cppc_bit', we were
getting Geekbench 5 scores of at least 1907 single-core, and 10500
multi-core. With this patch, we only are getting approximately 1700
single-core, and less than 9000 multi-core. (With an entirely unpatched
kernel, we were getting less than 1000 single-core, and about 10000
multi-core.)
Ultimately this is an upgrade over unpatched performance, but a
downgrade from the previous patch. It seems having CPPC and ITMT
available at the same time made things work noticeably faster.
Is there some way that can get both CPPC and ITMT to work with an approach
like this? Our hardware does support both, it just has an incorrectly set
bit in _OSC.
> ---
> drivers/cpufreq/intel_pstate.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> Index: linux-pm/drivers/cpufreq/intel_pstate.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/intel_pstate.c
> +++ linux-pm/drivers/cpufreq/intel_pstate.c
> @@ -355,16 +355,16 @@ static void intel_pstate_set_itmt_prio(i
> int ret;
>
> ret = cppc_get_perf_caps(cpu, &cppc_perf);
> - if (ret)
> - return;
> -
> /*
> - * On some systems with overclocking enabled, CPPC.highest_perf is hardcoded to 0xff.
> - * In this case we can't use CPPC.highest_perf to enable ITMT.
> - * In this case we can look at MSR_HWP_CAPABILITIES bits [8:0] to decide.
> + * If CPPC is not available, fall back to MSR_HWP_CAPABILITIES bits [8:0].
> + *
> + * Also, on some systems with overclocking enabled, CPPC.highest_perf is
> + * hardcoded to 0xff, so CPPC.highest_perf cannot be used to enable ITMT.
> + * Fall back to MSR_HWP_CAPABILITIES then too.
> */
> - if (cppc_perf.highest_perf == CPPC_MAX_PERF)
> - cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached));
> + if (ret || cppc_perf.highest_perf == CPPC_MAX_PERF)
> + cppc_perf.highest_perf =
> + HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached));
>
> /*
> * The priorities can be set regardless of whether or not
>
>
>
next prev parent reply other threads:[~2024-06-19 21:39 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
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 [this message]
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=ZnNQF0ussBRSAt1g@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 \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@linux.intel.com \
/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