All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Notify hrtimer users of switches to NOHZ mode
@ 2011-01-19  6:46 Stephen Boyd
  2011-01-19 11:43 ` Peter Zijlstra
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stephen Boyd @ 2011-01-19  6:46 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Peter Zijlstra, Andrew Morton

When NOHZ=y and high res timers are disabled (via cmdline or
Kconfig) tick_nohz_switch_to_nohz() will notify the user about
switching into NOHZ mode. Nothing is printed for the case where
HIGH_RES_TIMERS=y. Fix this for the HIGH_RES_TIMERS=y case by
duplicating the printk from the low res NOHZ path in the high res
NOHZ path.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This confused me since I was thinking 'dmesg | grep -i NOHZ' would
tell me if NOHZ was enabled, but if I have hrtimers there is
nothing. If we don't do this we should probably remove the original
printk.

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

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 3e216e0..6c012c5 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -795,8 +795,11 @@ void tick_setup_sched_timer(void)
 	}
 
 #ifdef CONFIG_NO_HZ
-	if (tick_nohz_enabled)
+	if (tick_nohz_enabled) {
 		ts->nohz_mode = NOHZ_MODE_HIGHRES;
+		pr_info("Switched to NOHz mode on CPU #%d\n",
+				smp_processor_id());
+	}
 #endif
 }
 #endif /* HIGH_RES_TIMERS */
-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.


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

* Re: [PATCH] sched: Notify hrtimer users of switches to NOHZ mode
  2011-01-19  6:46 [PATCH] sched: Notify hrtimer users of switches to NOHZ mode Stephen Boyd
@ 2011-01-19 11:43 ` Peter Zijlstra
  2011-01-19 12:04   ` Ingo Molnar
  2011-01-19 19:03 ` [tip:timers/urgent] hrtimers: " tip-bot for Stephen Boyd
  2011-01-19 19:09 ` tip-bot for Stephen Boyd
  2 siblings, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2011-01-19 11:43 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Ingo Molnar, linux-kernel, Andrew Morton, tglx

On Tue, 2011-01-18 at 22:46 -0800, Stephen Boyd wrote:
> When NOHZ=y and high res timers are disabled (via cmdline or
> Kconfig) tick_nohz_switch_to_nohz() will notify the user about
> switching into NOHZ mode. Nothing is printed for the case where
> HIGH_RES_TIMERS=y. Fix this for the HIGH_RES_TIMERS=y case by
> duplicating the printk from the low res NOHZ path in the high res
> NOHZ path.
> 
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> 
> This confused me since I was thinking 'dmesg | grep -i NOHZ' would
> tell me if NOHZ was enabled, but if I have hrtimers there is
> nothing. If we don't do this we should probably remove the original
> printk.

I'm not quite sure we want _more_ dmesg chatter, how about you look at
the output of:

grep -e "^cpu" -e "nohz" /proc/timer_list

instead?

>  kernel/time/tick-sched.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index 3e216e0..6c012c5 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -795,8 +795,11 @@ void tick_setup_sched_timer(void)
>  	}
>  
>  #ifdef CONFIG_NO_HZ
> -	if (tick_nohz_enabled)
> +	if (tick_nohz_enabled) {
>  		ts->nohz_mode = NOHZ_MODE_HIGHRES;
> +		pr_info("Switched to NOHz mode on CPU #%d\n",
> +				smp_processor_id());
> +	}
>  #endif
>  }
>  #endif /* HIGH_RES_TIMERS */



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

* Re: [PATCH] sched: Notify hrtimer users of switches to NOHZ mode
  2011-01-19 11:43 ` Peter Zijlstra
@ 2011-01-19 12:04   ` Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2011-01-19 12:04 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Stephen Boyd, linux-kernel, Andrew Morton, tglx


* Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

> On Tue, 2011-01-18 at 22:46 -0800, Stephen Boyd wrote:
> > When NOHZ=y and high res timers are disabled (via cmdline or
> > Kconfig) tick_nohz_switch_to_nohz() will notify the user about
> > switching into NOHZ mode. Nothing is printed for the case where
> > HIGH_RES_TIMERS=y. Fix this for the HIGH_RES_TIMERS=y case by
> > duplicating the printk from the low res NOHZ path in the high res
> > NOHZ path.
> > 
> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> > ---
> > 
> > This confused me since I was thinking 'dmesg | grep -i NOHZ' would
> > tell me if NOHZ was enabled, but if I have hrtimers there is
> > nothing. If we don't do this we should probably remove the original
> > printk.
> 
> I'm not quite sure we want _more_ dmesg chatter, [...]

Well, we used to have bugs in the past where the system locked up after changing the 
main hrtimer mode, so the messages are useful.

This patch completes the messages in that sense and makes them consistent. If we 
want to remove them altogether that would be another patch.

Thanks,

	Ingo

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

* [tip:timers/urgent] hrtimers: Notify hrtimer users of switches to NOHZ mode
  2011-01-19  6:46 [PATCH] sched: Notify hrtimer users of switches to NOHZ mode Stephen Boyd
  2011-01-19 11:43 ` Peter Zijlstra
@ 2011-01-19 19:03 ` tip-bot for Stephen Boyd
  2011-01-19 19:09 ` tip-bot for Stephen Boyd
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Stephen Boyd @ 2011-01-19 19:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, tglx, sboyd, mingo

Commit-ID:  fe96565ce90aca25786d709ebb5fb5e49b8bbafe
Gitweb:     http://git.kernel.org/tip/fe96565ce90aca25786d709ebb5fb5e49b8bbafe
Author:     Stephen Boyd <sboyd@codeaurora.org>
AuthorDate: Tue, 18 Jan 2011 22:46:34 -0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 19 Jan 2011 12:08:44 +0100

hrtimers: Notify hrtimer users of switches to NOHZ mode

When NOHZ=y and high res timers are disabled (via cmdline or
Kconfig) tick_nohz_switch_to_nohz() will notify the user about
switching into NOHZ mode. Nothing is printed for the case where
HIGH_RES_TIMERS=y. Fix this for the HIGH_RES_TIMERS=y case by
duplicating the printk from the low res NOHZ path in the high
res NOHZ path.

This confused me since I was thinking 'dmesg | grep -i NOHZ' would
tell me if NOHZ was enabled, but if I have hrtimers there is
nothing.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1295419594-13085-1-git-send-email-sboyd@codeaurora.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/time/tick-sched.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 3e216e0..9760f4f 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -640,10 +640,8 @@ static void tick_nohz_switch_to_nohz(void)
 			break;
 		next = ktime_add(next, tick_period);
 	}
+	printk(KERN_INFO "Switched to NOHz mode on CPU #%d\n", smp_processor_id());
 	local_irq_enable();
-
-	printk(KERN_INFO "Switched to NOHz mode on CPU #%d\n",
-	       smp_processor_id());
 }
 
 /*
@@ -795,8 +793,11 @@ void tick_setup_sched_timer(void)
 	}
 
 #ifdef CONFIG_NO_HZ
-	if (tick_nohz_enabled)
+	if (tick_nohz_enabled) {
 		ts->nohz_mode = NOHZ_MODE_HIGHRES;
+		pr_info("Switched to NOHz mode on CPU #%d\n",
+				smp_processor_id());
+	}
 #endif
 }
 #endif /* HIGH_RES_TIMERS */

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

* [tip:timers/urgent] hrtimers: Notify hrtimer users of switches to NOHZ mode
  2011-01-19  6:46 [PATCH] sched: Notify hrtimer users of switches to NOHZ mode Stephen Boyd
  2011-01-19 11:43 ` Peter Zijlstra
  2011-01-19 19:03 ` [tip:timers/urgent] hrtimers: " tip-bot for Stephen Boyd
@ 2011-01-19 19:09 ` tip-bot for Stephen Boyd
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Stephen Boyd @ 2011-01-19 19:09 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, tglx, sboyd, mingo

Commit-ID:  2d0640b47da74cff7c11642c798d40de861ed524
Gitweb:     http://git.kernel.org/tip/2d0640b47da74cff7c11642c798d40de861ed524
Author:     Stephen Boyd <sboyd@codeaurora.org>
AuthorDate: Tue, 18 Jan 2011 22:46:34 -0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 19 Jan 2011 20:08:15 +0100

hrtimers: Notify hrtimer users of switches to NOHZ mode

When NOHZ=y and high res timers are disabled (via cmdline or
Kconfig) tick_nohz_switch_to_nohz() will notify the user about
switching into NOHZ mode. Nothing is printed for the case where
HIGH_RES_TIMERS=y. Fix this for the HIGH_RES_TIMERS=y case by
duplicating the printk from the low res NOHZ path in the high
res NOHZ path.

This confused me since I was thinking 'dmesg | grep -i NOHZ' would
tell me if NOHZ was enabled, but if I have hrtimers there is
nothing.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1295419594-13085-1-git-send-email-sboyd@codeaurora.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/time/tick-sched.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 3e216e0..c55ea24 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -642,8 +642,7 @@ static void tick_nohz_switch_to_nohz(void)
 	}
 	local_irq_enable();
 
-	printk(KERN_INFO "Switched to NOHz mode on CPU #%d\n",
-	       smp_processor_id());
+	printk(KERN_INFO "Switched to NOHz mode on CPU #%d\n", smp_processor_id());
 }
 
 /*
@@ -795,8 +794,10 @@ void tick_setup_sched_timer(void)
 	}
 
 #ifdef CONFIG_NO_HZ
-	if (tick_nohz_enabled)
+	if (tick_nohz_enabled) {
 		ts->nohz_mode = NOHZ_MODE_HIGHRES;
+		printk(KERN_INFO "Switched to NOHz mode on CPU #%d\n", smp_processor_id());
+	}
 #endif
 }
 #endif /* HIGH_RES_TIMERS */

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

end of thread, other threads:[~2011-01-19 19:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-19  6:46 [PATCH] sched: Notify hrtimer users of switches to NOHZ mode Stephen Boyd
2011-01-19 11:43 ` Peter Zijlstra
2011-01-19 12:04   ` Ingo Molnar
2011-01-19 19:03 ` [tip:timers/urgent] hrtimers: " tip-bot for Stephen Boyd
2011-01-19 19:09 ` tip-bot for Stephen Boyd

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.