public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: reduce "NMI watchdog enabled, takes one hw-pmu counter." messages
@ 2012-06-06 18:09 Nathan Zimmer
  2012-06-06 21:15 ` Don Zickus
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Zimmer @ 2012-06-06 18:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Don Zickus, Peter Zijlstra

 watchdog: reduces some noise on a large system
 The printk buffer can be flooded with with redundant
 "NMI watchdog enabled, takes one hw-pmu counter." messages.
 It doesn't add any value beyond the first.

 Note the message needs logged a second time if the watchdog was disabled then
 reenabled.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
---
 kernel/watchdog.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index e5e1d85..404b141 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -372,6 +372,8 @@ static int watchdog(void *unused)
 
 
 #ifdef CONFIG_HARDLOCKUP_DETECTOR
+static bool already_notified;
+
 static int watchdog_nmi_enable(int cpu)
 {
 	struct perf_event_attr *wd_attr;
@@ -391,7 +393,10 @@ static int watchdog_nmi_enable(int cpu)
 	/* Try to register using hardware perf events */
 	event = perf_event_create_kernel_counter(wd_attr, cpu, NULL, watchdog_overflow_callback, NULL);
 	if (!IS_ERR(event)) {
-		pr_info("enabled, takes one hw-pmu counter.\n");
+		if (!already_notified) {
+			pr_info("enabled, takes one hw-pmu counter.\n");
+			already_notified = true;
+		}
 		goto out_save;
 	}
 
@@ -426,6 +431,7 @@ static void watchdog_nmi_disable(int cpu)
 
 		/* should be in cleanup, but blocks oprofile */
 		perf_event_release_kernel(event);
+		already_notified = false;
 	}
 	return;
 }
-- 
1.6.0.2


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

end of thread, other threads:[~2012-06-07 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 18:09 [PATCH] watchdog: reduce "NMI watchdog enabled, takes one hw-pmu counter." messages Nathan Zimmer
2012-06-06 21:15 ` Don Zickus
2012-06-07 17:14   ` Nathan Zimmer

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