[PATCH -next 1/3] cpufreq: Fix a typo in comment

Subsystems: cpu frequency scaling framework, the rest

STALE4910d

4 messages, 2 authors, 2013-02-28 · open the first message on its own page

[PATCH -next 1/3] cpufreq: Fix a typo in comment

From: Namhyung Kim <namhyung@kernel.org>
Date: 2013-02-28 05:38:12

From: Namhyung Kim <redacted>

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 drivers/cpufreq/cpufreq_governor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
index d2ac91150600..46bde01eee62 100644
--- a/drivers/cpufreq/cpufreq_governor.h
+++ b/drivers/cpufreq/cpufreq_governor.h
@@ -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
  */
 
-- 
1.7.11.7

[PATCH -next 2/3] cpufreq: conservative: Break out earlier on the lowest frequency

From: Namhyung Kim <namhyung@kernel.org>
Date: 2013-02-28 05:38:29

From: Namhyung Kim <redacted>

If we're on the lowest frequency, no need to calculate new freq.
Break out even earlier in this case.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 drivers/cpufreq/cpufreq_conservative.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 4fd0006b1291..dd2fd9094819 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -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;
-- 
1.7.11.7

[PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency

From: Namhyung Kim <namhyung@kernel.org>
Date: 2013-02-28 05:38:32

From: Namhyung Kim <redacted>

The relation should be CPUFREQ_RELATION_L to find optimal frequency
when decreasing.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 drivers/cpufreq/cpufreq_conservative.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index dd2fd9094819..0d582811d66c 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -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;
 	}
 }
-- 
1.7.11.7

Re: [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: 2013-02-28 05:47:07

On 28 February 2013 11:08, Namhyung Kim [off-list ref] wrote:
quoted hunk
From: Namhyung Kim <redacted>

The relation should be CPUFREQ_RELATION_L to find optimal frequency
when decreasing.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 drivers/cpufreq/cpufreq_conservative.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index dd2fd9094819..0d582811d66c 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help