All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NOHZ: Properly feed cpufreq ondemand governor
@ 2009-05-25  6:57 ext-eero.nurkkala
  2009-05-26 15:17 ` Rik van Riel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: ext-eero.nurkkala @ 2009-05-25  6:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, Eero Nurkkala

From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>

A call from irq_exit() may occasionally pause the timing
info for cpufreq ondemand governor. This results in the
cpufreq ondemand governor to fail to calculate the 
system load properly. Thus, relocate the checks for this
particular case to keep the governor always functional.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Reported-by: Tero Kristo <tero.kristo@nokia.com>
---
 kernel/time/tick-sched.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index d3f1ef4..a3562ce 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -222,6 +222,15 @@ void tick_nohz_stop_sched_tick(int inidle)
 
 	cpu = smp_processor_id();
 	ts = &per_cpu(tick_cpu_sched, cpu);
+
+	/*
+	 * Call to tick_nohz_start_idle stops the last_update_time from being
+	 * updated. Thus, it must not be called in the event we are called from
+	 * irq_exit() with the prior state different than idle.
+	 */
+	if (!inidle && !ts->inidle)
+		goto end;
+
 	now = tick_nohz_start_idle(ts);
 
 	/*
@@ -239,9 +248,6 @@ void tick_nohz_stop_sched_tick(int inidle)
 	if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
 		goto end;
 
-	if (!inidle && !ts->inidle)
-		goto end;
-
 	ts->inidle = 1;
 
 	if (need_resched())
-- 
1.5.6.3


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

* Re: [PATCH] NOHZ: Properly feed cpufreq ondemand governor
  2009-05-25  6:57 [PATCH] NOHZ: Properly feed cpufreq ondemand governor ext-eero.nurkkala
@ 2009-05-26 15:17 ` Rik van Riel
  2009-05-26 17:47   ` Pallipadi, Venkatesh
  2009-05-27 11:57 ` [tip:timers/urgent] " tip-bot for Eero Nurkkala
  2009-05-27 12:54 ` tip-bot for Eero Nurkkala
  2 siblings, 1 reply; 9+ messages in thread
From: Rik van Riel @ 2009-05-26 15:17 UTC (permalink / raw)
  To: ext-eero.nurkkala; +Cc: linux-kernel, tglx

ext-eero.nurkkala@nokia.com wrote:
> From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> 
> A call from irq_exit() may occasionally pause the timing
> info for cpufreq ondemand governor. This results in the
> cpufreq ondemand governor to fail to calculate the 
> system load properly. Thus, relocate the checks for this
> particular case to keep the governor always functional.
> 
> Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> Reported-by: Tero Kristo <tero.kristo@nokia.com>

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All rights reversed.

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

* Re: [PATCH] NOHZ: Properly feed cpufreq ondemand governor
  2009-05-26 15:17 ` Rik van Riel
@ 2009-05-26 17:47   ` Pallipadi, Venkatesh
  0 siblings, 0 replies; 9+ messages in thread
From: Pallipadi, Venkatesh @ 2009-05-26 17:47 UTC (permalink / raw)
  To: Rik van Riel; +Cc: ext-eero.nurkkala, linux-kernel, tglx

On Tue, 2009-05-26 at 08:17 -0700, Rik van Riel wrote:
> ext-eero.nurkkala@nokia.com wrote:
> > From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> > 
> > A call from irq_exit() may occasionally pause the timing
> > info for cpufreq ondemand governor. This results in the
> > cpufreq ondemand governor to fail to calculate the 
> > system load properly. Thus, relocate the checks for this
> > particular case to keep the governor always functional.
> > 
> > Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> > Reported-by: Tero Kristo <tero.kristo@nokia.com>
> 
> Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>


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

* [tip:timers/urgent] NOHZ: Properly feed cpufreq ondemand governor
  2009-05-25  6:57 [PATCH] NOHZ: Properly feed cpufreq ondemand governor ext-eero.nurkkala
  2009-05-26 15:17 ` Rik van Riel
@ 2009-05-27 11:57 ` tip-bot for Eero Nurkkala
  2009-05-27 12:18   ` Eero Nurkkala
  2009-05-27 12:54 ` tip-bot for Eero Nurkkala
  2 siblings, 1 reply; 9+ messages in thread
From: tip-bot for Eero Nurkkala @ 2009-05-27 11:57 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, venkatesh.pallipadi, riel, tero.kristo,
	ext-eero.nurkkala, tglx

Commit-ID:  4e67ac87c460a3c876019fa05149591122ec5287
Gitweb:     http://git.kernel.org/tip/4e67ac87c460a3c876019fa05149591122ec5287
Author:     Eero Nurkkala <ext-eero.nurkkala@nokia.com>
AuthorDate: Mon, 25 May 2009 09:57:37 +0300
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 27 May 2009 13:55:00 +0200

NOHZ: Properly feed cpufreq ondemand governor

A call from irq_exit() may occasionally pause the timing
info for cpufreq ondemand governor. This results in the
cpufreq ondemand governor to fail to calculate the
system load properly. Thus, relocate the checks for this
particular case to keep the governor always functional.

[ tglx: moved the check to the top of the function ]

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Reported-by: Tero Kristo <tero.kristo@nokia.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
LKML-Reference: <12432346571351-git-send-email-ext-eero.nurkkala@nokia.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>


---
 kernel/time/tick-sched.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index d3f1ef4..d3d6f3f 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -218,8 +218,15 @@ void tick_nohz_stop_sched_tick(int inidle)
 	struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
 	int cpu;
 
-	local_irq_save(flags);
+	/*
+	 * Call to tick_nohz_start_idle stops the last_update_time from being
+	 * updated. Thus, it must not be called in the event we are called from
+	 * irq_exit() with the prior state different than idle.
+	 */
+	if (!inidle && !ts->inidle)
+		return;
 
+	local_irq_save(flags);
 	cpu = smp_processor_id();
 	ts = &per_cpu(tick_cpu_sched, cpu);
 	now = tick_nohz_start_idle(ts);
@@ -239,9 +246,6 @@ void tick_nohz_stop_sched_tick(int inidle)
 	if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
 		goto end;
 
-	if (!inidle && !ts->inidle)
-		goto end;
-
 	ts->inidle = 1;
 
 	if (need_resched())

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

* Re: [tip:timers/urgent] NOHZ: Properly feed cpufreq ondemand governor
  2009-05-27 11:57 ` [tip:timers/urgent] " tip-bot for Eero Nurkkala
@ 2009-05-27 12:18   ` Eero Nurkkala
  2009-05-27 12:49     ` Thomas Gleixner
  0 siblings, 1 reply; 9+ messages in thread
From: Eero Nurkkala @ 2009-05-27 12:18 UTC (permalink / raw)
  To: riel, mingo, hpa, linux-kernel, Kristo Tero (Nokia-D/Tampere),
	venkatesh.pallipadi, tglx

On Wed, 2009-05-27 at 13:57 +0200, Nurkkala Eero.An (EXT-Offcode/Oulu)
wrote:
> Commit-ID:  4e67ac87c460a3c876019fa05149591122ec5287
> Gitweb:     http://git.kernel.org/tip/4e67ac87c460a3c876019fa05149591122ec5287
> Author:     Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> AuthorDate: Mon, 25 May 2009 09:57:37 +0300
> Committer:  Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Wed, 27 May 2009 13:55:00 +0200
> 
> NOHZ: Properly feed cpufreq ondemand governor
> 
> A call from irq_exit() may occasionally pause the timing
> info for cpufreq ondemand governor. This results in the
> cpufreq ondemand governor to fail to calculate the
> system load properly. Thus, relocate the checks for this
> particular case to keep the governor always functional.
> 
> [ tglx: moved the check to the top of the function ]
> 
> Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> Reported-by: Tero Kristo <tero.kristo@nokia.com>
> Acked-by: Rik van Riel <riel@redhat.com>
> Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> LKML-Reference: <12432346571351-git-send-email-ext-eero.nurkkala@nokia.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> 
> ---
>  kernel/time/tick-sched.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index d3f1ef4..d3d6f3f 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -218,8 +218,15 @@ void tick_nohz_stop_sched_tick(int inidle)
>  	struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
>  	int cpu;
>  
> -	local_irq_save(flags);
> +	/*
> +	 * Call to tick_nohz_start_idle stops the last_update_time from being
> +	 * updated. Thus, it must not be called in the event we are called from
> +	 * irq_exit() with the prior state different than idle.
> +	 */
> +	if (!inidle && !ts->inidle)
> +		return;
>  
> +	local_irq_save(flags);
>  	cpu = smp_processor_id();
>  	ts = &per_cpu(tick_cpu_sched, cpu);
>  	now = tick_nohz_start_idle(ts);
> @@ -239,9 +246,6 @@ void tick_nohz_stop_sched_tick(int inidle)
>  	if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
>  		goto end;
>  
> -	if (!inidle && !ts->inidle)
> -		goto end;
> -
>  	ts->inidle = 1;
>  
>  	if (need_resched())

A quick note:
Now ts is uninitialized? So ts->inidle could cause troubles, no?



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

* Re: [tip:timers/urgent] NOHZ: Properly feed cpufreq ondemand governor
  2009-05-27 12:18   ` Eero Nurkkala
@ 2009-05-27 12:49     ` Thomas Gleixner
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Gleixner @ 2009-05-27 12:49 UTC (permalink / raw)
  To: Eero Nurkkala
  Cc: riel, mingo, hpa, linux-kernel, Kristo Tero (Nokia-D/Tampere),
	venkatesh.pallipadi

On Wed, 27 May 2009, Eero Nurkkala wrote:
> 
> A quick note:
> Now ts is uninitialized? So ts->inidle could cause troubles, no?

/me is a moron. 

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

* [tip:timers/urgent] NOHZ: Properly feed cpufreq ondemand governor
  2009-05-25  6:57 [PATCH] NOHZ: Properly feed cpufreq ondemand governor ext-eero.nurkkala
  2009-05-26 15:17 ` Rik van Riel
  2009-05-27 11:57 ` [tip:timers/urgent] " tip-bot for Eero Nurkkala
@ 2009-05-27 12:54 ` tip-bot for Eero Nurkkala
  2009-05-27 13:23   ` Rik van Riel
  2 siblings, 1 reply; 9+ messages in thread
From: tip-bot for Eero Nurkkala @ 2009-05-27 12:54 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, venkatesh.pallipadi, riel, tero.kristo,
	ext-eero.nurkkala, tglx

Commit-ID:  cf1240033cc81216a18eec0ca71466f7fe4eeda8
Gitweb:     http://git.kernel.org/tip/cf1240033cc81216a18eec0ca71466f7fe4eeda8
Author:     Eero Nurkkala <ext-eero.nurkkala@nokia.com>
AuthorDate: Mon, 25 May 2009 09:57:37 +0300
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 27 May 2009 14:51:47 +0200

NOHZ: Properly feed cpufreq ondemand governor

A call from irq_exit() may occasionally pause the timing
info for cpufreq ondemand governor. This results in the
cpufreq ondemand governor to fail to calculate the
system load properly. Thus, relocate the checks for this
particular case to keep the governor always functional.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Reported-by: Tero Kristo <tero.kristo@nokia.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
LKML-Reference: <12432346571351-git-send-email-ext-eero.nurkkala@nokia.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>


---
 kernel/time/tick-sched.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index d3f1ef4..233b4e7 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -222,6 +222,15 @@ void tick_nohz_stop_sched_tick(int inidle)
 
 	cpu = smp_processor_id();
 	ts = &per_cpu(tick_cpu_sched, cpu);
+
+	/*
+	 * Call to tick_nohz_start_idle stops the last_update_time from being
+	 * updated. Thus, it must not be called in the event we are called from
+	 * irq_exit() with the prior state different than idle.
+	 */
+	if (!inidle && !ts->inidle)
+		return;
+
 	now = tick_nohz_start_idle(ts);
 
 	/*
@@ -239,9 +248,6 @@ void tick_nohz_stop_sched_tick(int inidle)
 	if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
 		goto end;
 
-	if (!inidle && !ts->inidle)
-		goto end;
-
 	ts->inidle = 1;
 
 	if (need_resched())

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

* Re: [tip:timers/urgent] NOHZ: Properly feed cpufreq ondemand governor
  2009-05-27 12:54 ` tip-bot for Eero Nurkkala
@ 2009-05-27 13:23   ` Rik van Riel
  2009-05-27 13:33     ` Thomas Gleixner
  0 siblings, 1 reply; 9+ messages in thread
From: Rik van Riel @ 2009-05-27 13:23 UTC (permalink / raw)
  To: mingo, hpa, linux-kernel, tero.kristo, ext-eero.nurkkala,
	venkatesh.pallipadi, tglx

tip-bot for Eero Nurkkala wrote:
> Commit-ID:  cf1240033cc81216a18eec0ca71466f7fe4eeda8
> Gitweb:     http://git.kernel.org/tip/cf1240033cc81216a18eec0ca71466f7fe4eeda8
> Author:     Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> AuthorDate: Mon, 25 May 2009 09:57:37 +0300
> Committer:  Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Wed, 27 May 2009 14:51:47 +0200
> 
> NOHZ: Properly feed cpufreq ondemand governor
> 
> A call from irq_exit() may occasionally pause the timing
> info for cpufreq ondemand governor. This results in the
> cpufreq ondemand governor to fail to calculate the
> system load properly. Thus, relocate the checks for this
> particular case to keep the governor always functional.
> 
> Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> Reported-by: Tero Kristo <tero.kristo@nokia.com>
> Acked-by: Rik van Riel <riel@redhat.com>
> Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> LKML-Reference: <12432346571351-git-send-email-ext-eero.nurkkala@nokia.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> 
> ---
>  kernel/time/tick-sched.c |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index d3f1ef4..233b4e7 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -222,6 +222,15 @@ void tick_nohz_stop_sched_tick(int inidle)
>  
>  	cpu = smp_processor_id();
>  	ts = &per_cpu(tick_cpu_sched, cpu);
> +
> +	/*
> +	 * Call to tick_nohz_start_idle stops the last_update_time from being
> +	 * updated. Thus, it must not be called in the event we are called from
> +	 * irq_exit() with the prior state different than idle.
> +	 */
> +	if (!inidle && !ts->inidle)
> +		return;

Calling return without restoring the
local_irq_save(flags) right above the
line where you get the CPU number seems
like a bad idea.

-- 
All rights reversed.

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

* Re: [tip:timers/urgent] NOHZ: Properly feed cpufreq ondemand governor
  2009-05-27 13:23   ` Rik van Riel
@ 2009-05-27 13:33     ` Thomas Gleixner
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Gleixner @ 2009-05-27 13:33 UTC (permalink / raw)
  To: Rik van Riel
  Cc: mingo, hpa, linux-kernel, tero.kristo, ext-eero.nurkkala,
	venkatesh.pallipadi

On Wed, 27 May 2009, Rik van Riel wrote:
> Calling return without restoring the
> local_irq_save(flags) right above the
> line where you get the CPU number seems
> like a bad idea.

I should probably stay away from keyboard today. :(

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

end of thread, other threads:[~2009-05-27 13:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-25  6:57 [PATCH] NOHZ: Properly feed cpufreq ondemand governor ext-eero.nurkkala
2009-05-26 15:17 ` Rik van Riel
2009-05-26 17:47   ` Pallipadi, Venkatesh
2009-05-27 11:57 ` [tip:timers/urgent] " tip-bot for Eero Nurkkala
2009-05-27 12:18   ` Eero Nurkkala
2009-05-27 12:49     ` Thomas Gleixner
2009-05-27 12:54 ` tip-bot for Eero Nurkkala
2009-05-27 13:23   ` Rik van Riel
2009-05-27 13:33     ` Thomas Gleixner

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.