public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3 linux-next] cpufreq: conservative: Fix the logic in frequency decrease  checking
@ 2013-03-05 22:06 Stratos Karafotis
  2013-03-06  6:49 ` Viresh Kumar
  2013-03-06 19:35 ` David C Niemi
  0 siblings, 2 replies; 4+ messages in thread
From: Stratos Karafotis @ 2013-03-05 22:06 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: cpufreq, linux-pm, linux-kernel, Viresh Kumar

When we evaluate the CPU load for frequency decrease we have to compare
the load against down_threshold. There is no need to subtract 10 points
from down_threshold.

Instead, we have to use the default down_threshold or user's selection
unmodified.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
---
 drivers/cpufreq/cpufreq_conservative.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 1e3be56..08be431 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -92,12 +92,8 @@ static void cs_check_cpu(int cpu, unsigned int load)
 		return;
 	dbs_info->down_skip = 0;
 
-	/*
-	 * The optimal frequency is the frequency that is the lowest that can
-	 * support the current CPU usage without triggering the up policy. To be
-	 * safe, we focus 10 points under the threshold.
-	 */
-	if (load < (cs_tuners.down_threshold - 10)) {
+	/* Check for frequency decrease */
+	if (load < cs_tuners.down_threshold) {
 		freq_target = (cs_tuners.freq_step * policy->max) / 100;
 
 		dbs_info->requested_freq -= freq_target;
-- 
1.8.1.4


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

* Re: [PATCH 2/3 linux-next] cpufreq: conservative: Fix the logic in frequency decrease checking
  2013-03-05 22:06 [PATCH 2/3 linux-next] cpufreq: conservative: Fix the logic in frequency decrease checking Stratos Karafotis
@ 2013-03-06  6:49 ` Viresh Kumar
  2013-03-06 19:35 ` David C Niemi
  1 sibling, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2013-03-06  6:49 UTC (permalink / raw)
  To: Stratos Karafotis; +Cc: Rafael J. Wysocki, cpufreq, linux-pm, linux-kernel

On 6 March 2013 06:06, Stratos Karafotis <stratosk@semaphore.gr> wrote:
> When we evaluate the CPU load for frequency decrease we have to compare
> the load against down_threshold. There is no need to subtract 10 points
> from down_threshold.
>
> Instead, we have to use the default down_threshold or user's selection
> unmodified.
>
> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
> ---
>  drivers/cpufreq/cpufreq_conservative.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

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

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

* Re: [PATCH 2/3 linux-next] cpufreq: conservative: Fix the logic in frequency decrease  checking
  2013-03-05 22:06 [PATCH 2/3 linux-next] cpufreq: conservative: Fix the logic in frequency decrease checking Stratos Karafotis
  2013-03-06  6:49 ` Viresh Kumar
@ 2013-03-06 19:35 ` David C Niemi
  2013-03-06 20:10   ` Stratos Karafotis
  1 sibling, 1 reply; 4+ messages in thread
From: David C Niemi @ 2013-03-06 19:35 UTC (permalink / raw)
  To: Stratos Karafotis
  Cc: Rafael J. Wysocki, cpufreq, linux-pm, linux-kernel, Viresh Kumar

The "10" sounds like an attempt to add some hysteresis to the up/down decisionmaking.  If you take it out, you should make sure you don't get into situations where you're continually switching rapidly between two frequencies.  (In the ondemand governor some care was also taken to avoid the cost of doing a CPU idleness evaluation counting towards the CPU looking busy enough to upshift; I am not familiar enough with Conservative to know whether that is a problem for it too).

DCN

On 03/05/13 17:06, Stratos Karafotis wrote:
> When we evaluate the CPU load for frequency decrease we have to compare
> the load against down_threshold. There is no need to subtract 10 points
> from down_threshold.
>
> Instead, we have to use the default down_threshold or user's selection
> unmodified.
>
> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
> ---
>  drivers/cpufreq/cpufreq_conservative.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
> index 1e3be56..08be431 100644
> --- a/drivers/cpufreq/cpufreq_conservative.c
> +++ b/drivers/cpufreq/cpufreq_conservative.c
> @@ -92,12 +92,8 @@ static void cs_check_cpu(int cpu, unsigned int load)
>  		return;
>  	dbs_info->down_skip = 0;
>  
> -	/*
> -	 * The optimal frequency is the frequency that is the lowest that can
> -	 * support the current CPU usage without triggering the up policy. To be
> -	 * safe, we focus 10 points under the threshold.
> -	 */
> -	if (load < (cs_tuners.down_threshold - 10)) {
> +	/* Check for frequency decrease */
> +	if (load < cs_tuners.down_threshold) {
>  		freq_target = (cs_tuners.freq_step * policy->max) / 100;
>  
>  		dbs_info->requested_freq -= freq_target;


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

* Re: [PATCH 2/3 linux-next] cpufreq: conservative: Fix the logic in frequency decrease  checking
  2013-03-06 19:35 ` David C Niemi
@ 2013-03-06 20:10   ` Stratos Karafotis
  0 siblings, 0 replies; 4+ messages in thread
From: Stratos Karafotis @ 2013-03-06 20:10 UTC (permalink / raw)
  To: David C Niemi
  Cc: Rafael J. Wysocki, cpufreq, linux-pm, linux-kernel, Viresh Kumar

On 03/06/2013 09:35 PM, David C Niemi wrote:
> The "10" sounds like an attempt to add some hysteresis to the up/down decisionmaking.  If you take it out, you should make sure you don't get into situations where you're continually switching rapidly between two frequencies.  (In the ondemand governor some care was also taken to avoid the cost of doing a CPU idleness evaluation counting towards the CPU looking busy enough to upshift; I am not familiar enough with Conservative to know whether that is a problem for it too).
> 
> DCN

This is true for ondemand but, as you know, there is a separate tunable 
(down_threshold) in conservative with default value 20.
It's independent from up_threshold (default 80), so I believe there is no
need to add a hysteresis.
Also, if we subtract 10 from down_threshold, we change user's decision
about this threshold. For example, if user sets down_threshold to 25, wants
this value to 25 not to 15.

Checking the initial commit of conservative governor, we can see that it
was not use hysteresis factor. This was added later (by mistake in my opinion)
as an attempt to make conservative to function similar to ondemand.

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

end of thread, other threads:[~2013-03-06 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05 22:06 [PATCH 2/3 linux-next] cpufreq: conservative: Fix the logic in frequency decrease checking Stratos Karafotis
2013-03-06  6:49 ` Viresh Kumar
2013-03-06 19:35 ` David C Niemi
2013-03-06 20:10   ` Stratos Karafotis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox