diff mbox

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

Message ID 1362029882-28993-3-git-send-email-namhyung@kernel.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Namhyung Kim Feb. 28, 2013, 5:38 a.m. UTC
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(-)

Comments

Viresh Kumar Feb. 28, 2013, 5:47 a.m. UTC | #1
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?
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Namhyung Kim Feb. 28, 2013, 5:59 a.m. UTC | #2
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
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Viresh Kumar Feb. 28, 2013, 6:05 a.m. UTC | #3
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>
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 	}
 }