cpufreq: Fix a typo in comment
PATCH 1/3 cpufreq: Fix a typo in comment
From: Namhyung Kim <[email protected]>
--- drivers/cpufreq/cpufreq_governor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq_governor.h +1 -1
@@ -64,7 +64,7 @@ static void *get_cpu_dbs_info_s(int cpu) \* dbs: used as a shortform for demand based switching It helps to keep variable * names smaller, simpler * cdbs: common dbs -* on_*: On-demand governor +* od_*: On-demand governor * cs_*: Conservative governor */
Signature · 1 line
1.7.11.7
PATCH 2/3 cpufreq: conservative: Break out earlier on the lowest frequency
From: Namhyung Kim <[email protected]>
If we're on the lowest frequency, no need to calculate new freq. Break out even earlier in this case.
--- drivers/cpufreq/cpufreq_conservative.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/cpufreq/cpufreq_conservative.c +6 -6
@@ -93,18 +93,18 @@ static void cs_check_cpu(int cpu, unsigned int load)* safe, we focus 10 points under the threshold. */ if (load < (cs_tuners.down_threshold -10 )) { - freq_target = (cs_tuners.freq_step * policy->max) /100 ; - - dbs_info->requested_freq -= freq_target; -if (dbs_info->requested_freq < policy->min) - dbs_info->requested_freq = policy->min; -/* * if we cannot reduce the frequency anymore, break out early */ if (policy->cur == policy->min)return ; + freq_target = (cs_tuners.freq_step * policy->max) /100 ; + + dbs_info->requested_freq -= freq_target; +if (dbs_info->requested_freq < policy->min) + dbs_info->requested_freq = policy->min; +__cpufreq_driver_target (policy, dbs_info->requested_freq,CPUFREQ_RELATION_H );return ;
Signature · 1 line
1.7.11.7
PATCH 3/3 cpufreq: conservative: Fix relation when decreasing frequency
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
The relation should be CPUFREQ_RELATION_L to find optimal frequency when decreasing.
--- drivers/cpufreq/cpufreq_conservative.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq_conservative.c +1 -1
@@ -106,7 +106,7 @@ static void cs_check_cpu(int cpu, unsigned int load) dbs_info->requested_freq = policy->min;__cpufreq_driver_target (policy, dbs_info->requested_freq, -CPUFREQ_RELATION_H ); +CPUFREQ_RELATION_L );return ; } }
Signature · 1 line
1.7.11.7
Viresh Kumar
maintainerRe: [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency
Quoted 16 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
The relation should be
CPUFREQ_RELATION_Lto find optimal frequency when decreasing.Cc Viresh Kumar <[email protected]>Signed-off-by Namhyung Kim <[email protected]>--- drivers/cpufreq/cpufreq_conservative.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/cpufreq_conservative.c +0
-0
drivers/cpufreq/cpufreq_conservative.c static void cs_check_cpu(int cpu, unsigned int load) · line 109
Quoted 5 lines
drivers/cpufreq/cpufreq_conservative.c +1
-1@@ -106,7 +106,7 @@ static void cs_check_cpu(int cpu, unsigned int load) dbs_info->requested_freq = policy->min;__cpufreq_driver_target (policy, dbs_info->requested_freq, -CPUFREQ_RELATION_H ); +CPUFREQ_RELATION_L );
Other two patches are fine but really not sure about this one. When decreasing freq, what do we want:
- lowest frequency at or above target, i.e. >= requested_freq
- highest frequency below or at target, i.e. <= requested_freq
I thought second option was better and so CPUFREQ_RELATION_H suits more. What made you do this change?
Re: [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency
Hi Viresh,
Quoted 28 lines · Viresh Kumar
Quoted 16 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
The relation should be
CPUFREQ_RELATION_Lto find optimal frequency when decreasing.Cc Viresh Kumar <[email protected]>Signed-off-by Namhyung Kim <[email protected]>--- drivers/cpufreq/cpufreq_conservative.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/cpufreq_conservative.c +0
-0drivers/cpufreq/cpufreq_conservative.c static void cs_check_cpu(int cpu, unsigned int load) · line 109
Quoted 5 lines
drivers/cpufreq/cpufreq_conservative.c +1
-1@@ -106,7 +106,7 @@ static void cs_check_cpu(int cpu, unsigned int load) dbs_info->requested_freq = policy->min;__cpufreq_driver_target (policy, dbs_info->requested_freq, -CPUFREQ_RELATION_H ); +CPUFREQ_RELATION_L );Other two patches are fine but really not sure about this one. When decreasing freq, what do we want:
- lowest frequency at or above target, i.e. >=requested_freq
- highest frequency below or at target, i.e. <=requested_freq
Quoted 2 lines
I thought second option was better and so
CPUFREQ_RELATION_Hsuits more. What made you do this change?
When decreasing, we were on a higher frequency than target so selecting above or equal to the target frequency seems to be "conservative". And AFAICS the ondemance governor also uses RELATION_L for decreasing.
Thanks,
Namhyung
Re: [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency
Quoted 2 lines · Namhyung Kim
When decreasing, we were on a higher frequency than target so selecting above or equal to the target frequency seems to be "conservative".
I will buy that. For all three patches: