From: Lukasz Luba <lukasz.luba@arm.com> To: Quentin Perret <qperret@google.com>, Viresh Kumar <viresh.kumar@linaro.org> Cc: Rafael Wysocki <rjw@rjwysocki.net>, Sudeep Holla <sudeep.holla@arm.com>, Cristian Marussi <cristian.marussi@arm.com>, linux-pm@vger.kernel.org, Vincent Guittot <vincent.guittot@linaro.org>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 9/9] cpufreq: scmi: Use .register_em() callback Date: Wed, 11 Aug 2021 15:09:13 +0100 [thread overview] Message-ID: <b02cff82-d242-f783-6f29-78e734f78e26@arm.com> (raw) In-Reply-To: <YRPN8zjp1wqkHg6t@google.com> On 8/11/21 2:17 PM, Quentin Perret wrote: > On Wednesday 11 Aug 2021 at 17:28:47 (+0530), Viresh Kumar wrote: >> Set the newly added .register_em() callback to register with the EM >> after the cpufreq policy is properly initialized. >> >> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> >> --- >> drivers/cpufreq/scmi-cpufreq.c | 55 ++++++++++++++++++++-------------- >> 1 file changed, 32 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c >> index 75f818d04b48..b916c9e22921 100644 >> --- a/drivers/cpufreq/scmi-cpufreq.c >> +++ b/drivers/cpufreq/scmi-cpufreq.c >> @@ -22,7 +22,9 @@ >> >> struct scmi_data { >> int domain_id; >> + int nr_opp; >> struct device *cpu_dev; >> + cpumask_var_t opp_shared_cpus; > > Can we use policy->related_cpus and friends directly in the callback Unfortunately not. This tricky setup code was introduced because we may have a platform with per-CPU policy, so single bit set in policy->related_cpus, but we want EAS to be still working on set of CPUs. That's why we construct temporary cpumask and pass it to EM. > instead? That should simplify the patch a bit. > > Also, we can probably afford calling dev_pm_opp_get_opp_count() from the > em_register callback as it is not a hot path, which would avoid wasting > some 'resident' memory here that is only used during init. > > Thanks, > Quentin >
WARNING: multiple messages have this Message-ID (diff)
From: Lukasz Luba <lukasz.luba@arm.com> To: Quentin Perret <qperret@google.com>, Viresh Kumar <viresh.kumar@linaro.org> Cc: Rafael Wysocki <rjw@rjwysocki.net>, Sudeep Holla <sudeep.holla@arm.com>, Cristian Marussi <cristian.marussi@arm.com>, linux-pm@vger.kernel.org, Vincent Guittot <vincent.guittot@linaro.org>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 9/9] cpufreq: scmi: Use .register_em() callback Date: Wed, 11 Aug 2021 15:09:13 +0100 [thread overview] Message-ID: <b02cff82-d242-f783-6f29-78e734f78e26@arm.com> (raw) In-Reply-To: <YRPN8zjp1wqkHg6t@google.com> On 8/11/21 2:17 PM, Quentin Perret wrote: > On Wednesday 11 Aug 2021 at 17:28:47 (+0530), Viresh Kumar wrote: >> Set the newly added .register_em() callback to register with the EM >> after the cpufreq policy is properly initialized. >> >> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> >> --- >> drivers/cpufreq/scmi-cpufreq.c | 55 ++++++++++++++++++++-------------- >> 1 file changed, 32 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c >> index 75f818d04b48..b916c9e22921 100644 >> --- a/drivers/cpufreq/scmi-cpufreq.c >> +++ b/drivers/cpufreq/scmi-cpufreq.c >> @@ -22,7 +22,9 @@ >> >> struct scmi_data { >> int domain_id; >> + int nr_opp; >> struct device *cpu_dev; >> + cpumask_var_t opp_shared_cpus; > > Can we use policy->related_cpus and friends directly in the callback Unfortunately not. This tricky setup code was introduced because we may have a platform with per-CPU policy, so single bit set in policy->related_cpus, but we want EAS to be still working on set of CPUs. That's why we construct temporary cpumask and pass it to EM. > instead? That should simplify the patch a bit. > > Also, we can probably afford calling dev_pm_opp_get_opp_count() from the > em_register callback as it is not a hot path, which would avoid wasting > some 'resident' memory here that is only used during init. > > Thanks, > Quentin > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-08-11 14:09 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-11 11:58 [PATCH V2 0/9] cpufreq: Auto-register with energy model Viresh Kumar 2021-08-11 11:58 ` Viresh Kumar 2021-08-11 11:58 ` Viresh Kumar 2021-08-11 11:58 ` [PATCH V2 1/9] cpufreq: Auto-register with energy model if asked Viresh Kumar 2021-08-11 13:02 ` Quentin Perret 2021-08-11 14:30 ` Lukasz Luba 2021-08-11 11:58 ` [PATCH V2 2/9] cpufreq: dt: Use auto-registration for energy model Viresh Kumar 2021-08-11 11:58 ` [PATCH V2 3/9] cpufreq: imx6q: " Viresh Kumar 2021-08-11 11:58 ` Viresh Kumar 2021-08-11 11:58 ` [PATCH V2 4/9] cpufreq: mediatek: " Viresh Kumar 2021-08-11 11:58 ` Viresh Kumar 2021-08-11 11:58 ` Viresh Kumar 2021-08-11 11:58 ` [PATCH V2 5/9] cpufreq: omap: " Viresh Kumar 2021-08-11 11:58 ` [PATCH V2 6/9] cpufreq: qcom-cpufreq-hw: " Viresh Kumar 2021-08-11 11:58 ` [PATCH V2 7/9] cpufreq: scpi: " Viresh Kumar 2021-08-11 11:58 ` Viresh Kumar 2021-08-11 11:58 ` [PATCH V2 8/9] cpufreq: vexpress: " Viresh Kumar 2021-08-11 11:58 ` Viresh Kumar 2021-08-11 11:58 ` [PATCH V2 9/9] cpufreq: scmi: Use .register_em() callback Viresh Kumar 2021-08-11 11:58 ` Viresh Kumar 2021-08-11 13:17 ` Quentin Perret 2021-08-11 13:17 ` Quentin Perret 2021-08-11 14:09 ` Lukasz Luba [this message] 2021-08-11 14:09 ` Lukasz Luba 2021-08-11 14:39 ` Quentin Perret 2021-08-11 14:39 ` Quentin Perret 2021-08-11 15:52 ` Lukasz Luba 2021-08-11 15:52 ` Lukasz Luba 2021-08-12 3:53 ` Viresh Kumar 2021-08-12 3:53 ` Viresh Kumar 2021-08-11 16:32 ` Lukasz Luba 2021-08-11 16:32 ` Lukasz Luba 2021-08-12 4:22 ` Viresh Kumar 2021-08-12 4:22 ` Viresh Kumar
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=b02cff82-d242-f783-6f29-78e734f78e26@arm.com \ --to=lukasz.luba@arm.com \ --cc=cristian.marussi@arm.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pm@vger.kernel.org \ --cc=qperret@google.com \ --cc=rjw@rjwysocki.net \ --cc=sudeep.holla@arm.com \ --cc=vincent.guittot@linaro.org \ --cc=viresh.kumar@linaro.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.