Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757750Ab2FFSJs (ORCPT ); Wed, 6 Jun 2012 14:09:48 -0400 Received: from relay3.sgi.com ([192.48.152.1]:42908 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751773Ab2FFSJr (ORCPT ); Wed, 6 Jun 2012 14:09:47 -0400 Date: Wed, 6 Jun 2012 13:09:46 -0500 From: Nathan Zimmer To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Don Zickus , Peter Zijlstra Subject: [PATCH] watchdog: reduce "NMI watchdog enabled, takes one hw-pmu counter." messages Message-ID: <20120606180946.GA16566@gulag1.americas.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1778 Lines: 57 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 Cc: Don Zickus Cc: Peter Zijlstra Signed-off-by: Nathan Zimmer --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/