From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752326AbdINKz0 (ORCPT ); Thu, 14 Sep 2017 06:55:26 -0400 Received: from terminus.zytor.com ([65.50.211.136]:45783 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752224AbdINKzY (ORCPT ); Thu, 14 Sep 2017 06:55:24 -0400 Date: Thu, 14 Sep 2017 03:49:47 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: cmetcalf@mellanox.com, bp@alien8.de, akpm@linux-foundation.org, uobergfe@redhat.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, npiggin@gmail.com, mingo@kernel.org, bigeasy@linutronix.de, hpa@zytor.com, peterz@infradead.org, dzickus@redhat.com Reply-To: torvalds@linux-foundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, npiggin@gmail.com, mingo@kernel.org, bp@alien8.de, cmetcalf@mellanox.com, akpm@linux-foundation.org, uobergfe@redhat.com, peterz@infradead.org, dzickus@redhat.com, bigeasy@linutronix.de, hpa@zytor.com In-Reply-To: <20170912194148.180215498@linutronix.de> References: <20170912194148.180215498@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] watchdog/hardlockup/perf: Implement CPU enable replacement Git-Commit-ID: 2a1b8ee4f5665b4291e43e4a25d964c3eb2f4c32 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 2a1b8ee4f5665b4291e43e4a25d964c3eb2f4c32 Gitweb: http://git.kernel.org/tip/2a1b8ee4f5665b4291e43e4a25d964c3eb2f4c32 Author: Thomas Gleixner AuthorDate: Tue, 12 Sep 2017 21:37:20 +0200 Committer: Ingo Molnar CommitDate: Thu, 14 Sep 2017 11:41:08 +0200 watchdog/hardlockup/perf: Implement CPU enable replacement watchdog_nmi_enable() is an unparseable mess, Provide a clean perf specific implementation, which will be used when the existing setup/teardown mess is replaced. Signed-off-by: Thomas Gleixner Reviewed-by: Don Zickus Cc: Andrew Morton Cc: Borislav Petkov Cc: Chris Metcalf Cc: Linus Torvalds Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Sebastian Siewior Cc: Ulrich Obergfell Link: http://lkml.kernel.org/r/20170912194148.180215498@linutronix.de Signed-off-by: Ingo Molnar --- include/linux/nmi.h | 2 ++ kernel/watchdog_hld.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 72c62a8..89ba8b2 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -92,12 +92,14 @@ extern void arch_touch_nmi_watchdog(void); extern void hardlockup_detector_perf_stop(void); extern void hardlockup_detector_perf_restart(void); extern void hardlockup_detector_perf_disable(void); +extern void hardlockup_detector_perf_enable(void); extern void hardlockup_detector_perf_cleanup(void); extern int hardlockup_detector_perf_init(void); #else static inline void hardlockup_detector_perf_stop(void) { } static inline void hardlockup_detector_perf_restart(void) { } static inline void hardlockup_detector_perf_disable(void) { } +static inline void hardlockup_detector_perf_enable(void) { } static inline void hardlockup_detector_perf_cleanup(void) { } # if !defined(CONFIG_HAVE_NMI_WATCHDOG) static inline int hardlockup_detector_perf_init(void) { return -ENODEV; } diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index f7e752e..99a3f22 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c @@ -260,6 +260,17 @@ static int hardlockup_detector_event_create(void) } /** + * hardlockup_detector_perf_enable - Enable the local event + */ +void hardlockup_detector_perf_enable(void) +{ + if (hardlockup_detector_event_create()) + return; + + perf_event_enable(this_cpu_read(watchdog_ev)); +} + +/** * hardlockup_detector_perf_disable - Disable the local event */ void hardlockup_detector_perf_disable(void)