All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 1/3] cpufreq: Fix a typo in comment
@ 2013-02-28  5:38 Namhyung Kim
  2013-02-28  5:38 ` [PATCH -next 2/3] cpufreq: conservative: Break out earlier on the lowest frequency Namhyung Kim
  2013-02-28  5:38 ` [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency Namhyung Kim
  0 siblings, 2 replies; 6+ messages in thread
From: Namhyung Kim @ 2013-02-28  5:38 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: LKML, cpufreq, linux-pm, Namhyung Kim, Viresh Kumar

From: Namhyung Kim <namhyung.kim@lge.com>

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


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

* [PATCH -next 2/3] cpufreq: conservative: Break out earlier on the lowest frequency
  2013-02-28  5:38 [PATCH -next 1/3] cpufreq: Fix a typo in comment Namhyung Kim
@ 2013-02-28  5:38 ` Namhyung Kim
  2013-02-28  5:38 ` [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency Namhyung Kim
  1 sibling, 0 replies; 6+ messages in thread
From: Namhyung Kim @ 2013-02-28  5:38 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: LKML, cpufreq, linux-pm, Namhyung Kim, Viresh Kumar

From: Namhyung Kim <namhyung.kim@lge.com>

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


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

* [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency
  2013-02-28  5:38 [PATCH -next 1/3] cpufreq: Fix a typo in comment Namhyung Kim
  2013-02-28  5:38 ` [PATCH -next 2/3] cpufreq: conservative: Break out earlier on the lowest frequency Namhyung Kim
@ 2013-02-28  5:38 ` Namhyung Kim
  2013-02-28  5:47   ` Viresh Kumar
  1 sibling, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2013-02-28  5:38 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: LKML, cpufreq, linux-pm, Namhyung Kim, Viresh Kumar

From: Namhyung Kim <namhyung.kim@lge.com>

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


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

* Re: [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency
  2013-02-28  5:38 ` [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency Namhyung Kim
@ 2013-02-28  5:47   ` Viresh Kumar
  2013-02-28  5:59     ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Viresh Kumar @ 2013-02-28  5:47 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: Rafael J. Wysocki, LKML, cpufreq, linux-pm, Namhyung Kim

On 28 February 2013 11:08, Namhyung Kim <namhyung@kernel.org> wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
>
> 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?

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

* Re: [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency
  2013-02-28  5:47   ` Viresh Kumar
@ 2013-02-28  5:59     ` Namhyung Kim
  2013-02-28  6:05       ` Viresh Kumar
  0 siblings, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2013-02-28  5:59 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: Rafael J. Wysocki, LKML, cpufreq, linux-pm, Namhyung Kim

Hi Viresh,

On Thu, 28 Feb 2013 11:17:03 +0530, Viresh Kumar wrote:
> On 28 February 2013 11:08, Namhyung Kim <namhyung@kernel.org> wrote:
>> From: Namhyung Kim <namhyung.kim@lge.com>
>>
>> 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?

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

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

* Re: [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency
  2013-02-28  5:59     ` Namhyung Kim
@ 2013-02-28  6:05       ` Viresh Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Viresh Kumar @ 2013-02-28  6:05 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: Rafael J. Wysocki, LKML, cpufreq, linux-pm, Namhyung Kim

On 28 February 2013 11:29, Namhyung Kim <namhyung@kernel.org> wrote:
> 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:

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

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

end of thread, other threads:[~2013-02-28  6:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28  5:38 [PATCH -next 1/3] cpufreq: Fix a typo in comment Namhyung Kim
2013-02-28  5:38 ` [PATCH -next 2/3] cpufreq: conservative: Break out earlier on the lowest frequency Namhyung Kim
2013-02-28  5:38 ` [PATCH -next 3/3] cpufreq: conservative: Fix relation when decreasing frequency Namhyung Kim
2013-02-28  5:47   ` Viresh Kumar
2013-02-28  5:59     ` Namhyung Kim
2013-02-28  6:05       ` 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.