From: Pierre Gondois <pierre.gondois@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org, Ionela.Voinescu@arm.com,
Lukasz.Luba@arm.com, Morten.Rasmussen@arm.com,
Dietmar.Eggemann@arm.com, maz@kernel.org,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Ard Biesheuvel <ardb@kernel.org>, Fuad Tabba <tabba@google.com>,
Valentin Schneider <valentin.schneider@arm.com>,
Rob Herring <robh@kernel.org>,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH v2 1/3] cpufreq: CPPC: Add cppc_cpufreq_search_cpu_data
Date: Mon, 11 Apr 2022 12:34:18 +0200 [thread overview]
Message-ID: <a6bea108-5e3b-be13-5852-4607544985a2@arm.com> (raw)
In-Reply-To: <20220411031015.skh3dw6vcbtn5f4u@vireshk-i7>
On 4/11/22 05:10, Viresh Kumar wrote:
> On 07-04-22, 10:16, Pierre Gondois wrote:
>> From: Pierre Gondois <Pierre.Gondois@arm.com>
>>
>> cppc_cpufreq_get_cpu_data() allocates a new struct cppc_cpudata
>> for the input CPU at each call.
>>
>> To search the struct associated with a cpu without allocating
>> a new one, add cppc_cpufreq_search_cpu_data().
>> Also add an early prototype.
>>
>> This will be used in a later patch, when generating artificial
>> performance states to register an artificial Energy Model in the
>> cppc_cpufreq driver and enable the Energy Aware Scheduler for ACPI
>> based systems.
>>
>> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
>> ---
>> drivers/cpufreq/cppc_cpufreq.c | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
>> index 82d370ae6a4a..ffcd9704add2 100644
>> --- a/drivers/cpufreq/cppc_cpufreq.c
>> +++ b/drivers/cpufreq/cppc_cpufreq.c
>> @@ -41,6 +41,8 @@
>> */
>> static LIST_HEAD(cpu_data_list);
>>
>> +static struct cppc_cpudata *cppc_cpufreq_search_cpu_data(unsigned int cpu);
>> +
>> static bool boost_supported;
>>
>> struct cppc_workaround_oem_info {
>> @@ -479,6 +481,19 @@ static void cppc_cpufreq_put_cpu_data(struct cpufreq_policy *policy)
>> policy->driver_data = NULL;
>> }
>>
>> +static struct cppc_cpudata *
>> +cppc_cpufreq_search_cpu_data(unsigned int cpu)
>> +{
>> + struct cppc_cpudata *iter, *tmp;
>> +
>> + list_for_each_entry_safe(iter, tmp, &cpu_data_list, node) {
>> + if (cpumask_test_cpu(cpu, iter->shared_cpu_map))
>> + return iter;
>> + }
>> +
>> + return NULL;
>> +}
>
> Did you miss this in cppc_cpufreq_cpu_init() ?
>
> policy->driver_data = cpu_data;
>
> The data is saved inside the policy and it shouldn't be difficult to
> fetch it from there, instead of going through the list.
>
A previous (internal) implementation required this function,
but this is not necessary anymore indeed. I will drop this patch,
Thanks for the review,
Pierre
next prev parent reply other threads:[~2022-04-11 10:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 8:16 [PATCH v2 0/3] Enable EAS for CPPC/ACPI based systems Pierre Gondois
2022-04-07 8:16 ` [PATCH v2 1/3] cpufreq: CPPC: Add cppc_cpufreq_search_cpu_data Pierre Gondois
2022-04-11 3:10 ` Viresh Kumar
2022-04-11 10:34 ` Pierre Gondois [this message]
2022-04-07 8:16 ` [PATCH v2 2/3] cpufreq: CPPC: Add per_cpu efficiency_class Pierre Gondois
2022-04-07 11:20 ` Catalin Marinas
2022-04-07 8:16 ` [PATCH v2 3/3] cpufreq: CPPC: Register EM based on efficiency class information Pierre Gondois
2022-04-11 3:12 ` Viresh Kumar
2022-04-11 10:33 ` Pierre Gondois
[not found] ` <CANW9uytEOhRX4-TcOYThYFJ0UvrsYETzNp2YiH4zGDn_yb3a9A@mail.gmail.com>
2022-04-07 10:00 ` [PATCH v2 0/3] Enable EAS for CPPC/ACPI based systems Pierre Gondois
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=a6bea108-5e3b-be13-5852-4607544985a2@arm.com \
--to=pierre.gondois@arm.com \
--cc=Dietmar.Eggemann@arm.com \
--cc=Ionela.Voinescu@arm.com \
--cc=Lukasz.Luba@arm.com \
--cc=Morten.Rasmussen@arm.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=tabba@google.com \
--cc=valentin.schneider@arm.com \
--cc=viresh.kumar@linaro.org \
--cc=will@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
all inboxes | Powered by JetHome®