All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ANDROID: cpufreq: times: record fast switch frequency transitions
@ 2022-10-08 12:16 hongchengwen
  2022-10-10  6:32 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: hongchengwen @ 2022-10-08 12:16 UTC (permalink / raw)
  To: hongchengwen, rafael, viresh.kumar; +Cc: linux-pm, linux-kernel, zhengding chen

From: zhengding chen <chenzhengding@oppo.com>

cpufreq_times_record_transition() is not called when fast switch is
enabled, leading /proc/[pid]/time_in_state to attribute all time on a
cluster to a single frequency. To fix this, add a call to
cpufreq_times_record_transition() in the fast switch path.

Test: /proc/[pid]/time_in_state shows times for more than one freq per
cluster

Bug: 204726690
Signed-off-by: zhengding chen <chenzhengding@oppo.com>
---
 drivers/cpufreq/cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 69b3d61..1caaf63 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2128,6 +2128,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
        arch_set_freq_scale(policy->related_cpus, freq,
                            policy->cpuinfo.max_freq);
        cpufreq_stats_record_transition(policy, freq);
+       cpufreq_times_record_transition(policy, freq);

        if (trace_cpu_frequency_enabled()) {
                for_each_cpu(cpu, policy->cpus)
--
2.7.4

________________________________
OPPO

本电子邮件及其附件含有OPPO公司的保密信息,仅限于邮件指明的收件人使用(包含个人及群组)。禁止任何人在未经授权的情况下以任何形式使用。如果您错收了本邮件,请立即以电子邮件通知发件人并删除本邮件及其附件。

This e-mail and its attachments contain confidential information from OPPO, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ANDROID: cpufreq: times: record fast switch frequency transitions
  2022-10-08 12:16 [PATCH] ANDROID: cpufreq: times: record fast switch frequency transitions hongchengwen
@ 2022-10-10  6:32 ` Viresh Kumar
       [not found]   ` <HK0PR02MB3379062A9BE6515D1DADB306A0229@HK0PR02MB3379.apcprd02.prod.outlook.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2022-10-10  6:32 UTC (permalink / raw)
  To: hongchengwen; +Cc: rafael, linux-pm, linux-kernel, zhengding chen

On 08-10-22, 20:16, hongchengwen wrote:
> From: zhengding chen <chenzhengding@oppo.com>
> 
> cpufreq_times_record_transition() is not called when fast switch is
> enabled, leading /proc/[pid]/time_in_state to attribute all time on a
> cluster to a single frequency. To fix this, add a call to
> cpufreq_times_record_transition() in the fast switch path.
> 
> Test: /proc/[pid]/time_in_state shows times for more than one freq per
> cluster
> 
> Bug: 204726690
> Signed-off-by: zhengding chen <chenzhengding@oppo.com>
> ---
>  drivers/cpufreq/cpufreq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 69b3d61..1caaf63 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2128,6 +2128,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
>         arch_set_freq_scale(policy->related_cpus, freq,
>                             policy->cpuinfo.max_freq);
>         cpufreq_stats_record_transition(policy, freq);
> +       cpufreq_times_record_transition(policy, freq);
> 
>         if (trace_cpu_frequency_enabled()) {
>                 for_each_cpu(cpu, policy->cpus)

zhengding chen,

You have sent your email to linux kernel lists, which don't have the
same code base as Android. Please send your patch to the relevant
lists/gerrit for Android.

Thanks.

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 回复: [PATCH] ANDROID: cpufreq: times: record fast switch frequency transitions
       [not found]   ` <HK0PR02MB3379062A9BE6515D1DADB306A0229@HK0PR02MB3379.apcprd02.prod.outlook.com>
@ 2022-10-12  6:19     ` Viresh Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2022-10-12  6:19 UTC (permalink / raw)
  To: 洪成文(Keven)
  Cc: rafael, linux-pm, linux-kernel, 陈征鼎

On 12-10-22, 06:17, 洪成文(Keven) wrote:
> Viresh Kumar
> 
> This is a modification based on the Linux kernel, not an Android version.
> You may have misunderstood some fields in the commit message.

Linux doesn't have cpufreq_times_record_transition().

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-12  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08 12:16 [PATCH] ANDROID: cpufreq: times: record fast switch frequency transitions hongchengwen
2022-10-10  6:32 ` Viresh Kumar
     [not found]   ` <HK0PR02MB3379062A9BE6515D1DADB306A0229@HK0PR02MB3379.apcprd02.prod.outlook.com>
2022-10-12  6:19     ` 回复: " Viresh Kumar

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.