From: "Wysocki, Rafael J" <rafael.j.wysocki@intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
"Meng, Li (Jassmine)" <Li.Meng@amd.com>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: "Huang, Ray" <Ray.Huang@amd.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"Fontenot, Nathan" <Nathan.Fontenot@amd.com>,
"Sharma, Deepak" <Deepak.Sharma@amd.com>,
"Deucher, Alexander" <Alexander.Deucher@amd.com>,
"Limonciello, Mario" <Mario.Limonciello@amd.com>,
"Huang, Shimmer" <Shimmer.Huang@amd.com>,
"Yuan, Perry" <Perry.Yuan@amd.com>,
"Du, Xiaojian" <Xiaojian.Du@amd.com>,
"Viresh Kumar" <viresh.kumar@linaro.org>,
Borislav Petkov <bp@alien8.de>,
"Oleksandr Natalenko" <oleksandr@natalenko.name>,
"Karny, Wyes" <Wyes.Karny@amd.com>
Subject: Re: [RESEND PATCH V9 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting.
Date: Mon, 16 Oct 2023 19:27:03 +0200 [thread overview]
Message-ID: <e82fc689-5cc3-d799-6e5f-a9e4ac98e26f@intel.com> (raw)
In-Reply-To: <20231016105845.GA33217@noisy.programming.kicks-ass.net>
On 10/16/2023 12:58 PM, Peter Zijlstra wrote:
> On Mon, Oct 16, 2023 at 06:20:53AM +0000, Meng, Li (Jassmine) wrote:
>>>> +static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) {
>>>> + int ret, prio;
>>>> + u32 highest_perf;
>>>> + static u32 max_highest_perf = 0, min_highest_perf = U32_MAX;
>>> What serializes these things?
>>>
>>> Also, *why* are you using u32 here, what's wrong with something like:
>>>
>>> int max_hp = INT_MIN, min_hp = INT_MAX;
>>>
>> [Meng, Li (Jassmine)]
>> We use ITMT architecture to utilize preferred core features.
>> Therefore, we need to try to be consistent with Intel's implementation
>> as much as possible. For details, please refer to the
>> intel_pstate_set_itmt_prio function in file intel_pstate.c. (Line 355)
>>
>> I think using the data type of u32 is consistent with the data
>> structures of cppc_perf_ctrls and amd_cpudata etc.
> Rafael, should we fix intel_pstate too?
Srinivas should be more familiar with this code than I am, so adding him.
> The point is, that sched_asym_prefer(), the final consumer of these
> values uses int and thus an explicitly signed compare.
>
> Using u32 and U32_MAX anywhere near the setting the priority makes
> absolutely no sense.
>
> If you were to have the high bit set, things do not behave as expected.
Right, but in practice these values are always between 0 and 255
inclusive AFAICS.
It would have been better to use u8 I suppose.
> Also, same question as to the amd folks; what serializes those static
> variables?
That's a good one.
next prev parent reply other threads:[~2023-10-16 17:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-13 3:31 [RESEND PATCH V9 0/7] amd-pstate preferred core Meng Li
2023-10-13 3:31 ` [RESEND PATCH V9 1/7] x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion Meng Li
2023-10-13 3:31 ` [RESEND PATCH V9 2/7] acpi: cppc: Add get the highest performance cppc control Meng Li
2023-10-13 3:31 ` [RESEND PATCH V9 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting Meng Li
2023-10-13 16:01 ` Peter Zijlstra
2023-10-16 6:20 ` Meng, Li (Jassmine)
2023-10-16 10:58 ` Peter Zijlstra
2023-10-16 17:27 ` Wysocki, Rafael J [this message]
2023-10-16 18:50 ` srinivas pandruvada
2023-10-16 21:55 ` Peter Zijlstra
2023-10-17 8:22 ` Meng, Li (Jassmine)
2023-10-13 3:31 ` [RESEND PATCH V9 4/7] cpufreq: Add a notification message that the highest perf has changed Meng Li
2023-10-13 3:31 ` [RESEND PATCH V9 5/7] cpufreq: amd-pstate: Update amd-pstate preferred core ranking dynamically Meng Li
2023-10-13 3:31 ` [RESEND PATCH V9 6/7] Documentation: amd-pstate: introduce amd-pstate preferred core Meng Li
2023-10-13 3:31 ` [RESEND PATCH V9 7/7] Documentation: introduce amd-pstate preferrd core mode kernel command line options Meng Li
2023-10-13 15:45 ` [RESEND PATCH V9 0/7] amd-pstate preferred core Oleksandr Natalenko
2023-10-16 1:45 ` Meng, Li (Jassmine)
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=e82fc689-5cc3-d799-6e5f-a9e4ac98e26f@intel.com \
--to=rafael.j.wysocki@intel.com \
--cc=Alexander.Deucher@amd.com \
--cc=Deepak.Sharma@amd.com \
--cc=Li.Meng@amd.com \
--cc=Mario.Limonciello@amd.com \
--cc=Nathan.Fontenot@amd.com \
--cc=Perry.Yuan@amd.com \
--cc=Ray.Huang@amd.com \
--cc=Shimmer.Huang@amd.com \
--cc=Wyes.Karny@amd.com \
--cc=Xiaojian.Du@amd.com \
--cc=bp@alien8.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=oleksandr@natalenko.name \
--cc=peterz@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=srinivas.pandruvada@linux.intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox