From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by aws-us-west-2-korg-lkml-1.web.codeaurora.org (Postfix) with ESMTP id 62F47C433EF for ; Wed, 13 Jun 2018 01:04:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17CCE208B2 for ; Wed, 13 Jun 2018 01:04:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17CCE208B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935139AbeFMBEJ (ORCPT ); Tue, 12 Jun 2018 21:04:09 -0400 Received: from mga14.intel.com ([192.55.52.115]:64685 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935003AbeFMBBj (ORCPT ); Tue, 12 Jun 2018 21:01:39 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2018 18:01:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,216,1526367600"; d="scan'208";a="47283508" Received: from voyager.sc.intel.com ([10.3.52.149]) by fmsmga008.fm.intel.com with ESMTP; 12 Jun 2018 18:01:34 -0700 From: Ricardo Neri To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Andi Kleen , Ashok Raj , Borislav Petkov , Tony Luck , "Ravi V. Shankar" , x86@kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Neri , Jacob Pan , "Rafael J. Wysocki" , Don Zickus , Nicholas Piggin , Michael Ellerman , Frederic Weisbecker , Alexei Starovoitov , Babu Moger , Paul Mackerras , Mathieu Desnoyers , Masami Hiramatsu , Peter Zijlstra , Andrew Morton , Philippe Ombredanne , Colin Ian King , Byungchul Park , "Paul E. McKenney" , "Luis R. Rodriguez" , Waiman Long , Josh Poimboeuf , Randy Dunlap , Davidlohr Bueso , Christoffer Dall , Marc Zyngier , Kai-Heng Feng , Konrad Rzeszutek Wilk , David Rientjes , "David S. Miller" , Benjamin Herrenschmidt , iommu@lists.linux-foundation.org Subject: [RFC PATCH 15/23] kernel/watchdog: Add a function to obtain the watchdog_allowed_mask Date: Tue, 12 Jun 2018 17:57:35 -0700 Message-Id: <1528851463-21140-16-git-send-email-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> References: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implementations of NMI watchdogs that use a single piece of hardware to monitor all the CPUs in the system (as opposed to per-CPU implementations such as perf) need to know which CPUs the watchdog is allowed to monitor. In this manner, non-maskable interrupts are directed only to the monitored CPUs. Cc: Ashok Raj Cc: Andi Kleen Cc: Tony Luck Cc: Borislav Petkov Cc: Jacob Pan Cc: "Rafael J. Wysocki" Cc: Don Zickus Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Frederic Weisbecker Cc: Alexei Starovoitov Cc: Babu Moger Cc: Paul Mackerras Cc: Mathieu Desnoyers Cc: Masami Hiramatsu Cc: Peter Zijlstra Cc: Andrew Morton Cc: Philippe Ombredanne Cc: Colin Ian King Cc: Byungchul Park Cc: "Paul E. McKenney" Cc: "Luis R. Rodriguez" Cc: Waiman Long Cc: Josh Poimboeuf Cc: Randy Dunlap Cc: Davidlohr Bueso Cc: Christoffer Dall Cc: Marc Zyngier Cc: Kai-Heng Feng Cc: Konrad Rzeszutek Wilk Cc: David Rientjes Cc: "Ravi V. Shankar" Cc: x86@kernel.org Cc: "David S. Miller" Cc: Benjamin Herrenschmidt Cc: iommu@lists.linux-foundation.org Cc: sparclinux@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Ricardo Neri --- include/linux/nmi.h | 1 + kernel/watchdog.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index e61b441..e608762 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -77,6 +77,7 @@ static inline void reset_hung_task_detector(void) { } #if defined(CONFIG_HARDLOCKUP_DETECTOR) extern void hardlockup_detector_disable(void); +extern struct cpumask *watchdog_get_allowed_cpumask(void); extern unsigned int hardlockup_panic; #else static inline void hardlockup_detector_disable(void) {} diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 5057376..b94bbe3 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -50,7 +50,7 @@ int __read_mostly nmi_watchdog_available; static struct nmi_watchdog_ops *nmi_wd_ops; -struct cpumask watchdog_allowed_mask __read_mostly; +static struct cpumask watchdog_allowed_mask __read_mostly; struct cpumask watchdog_cpumask __read_mostly; unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask); @@ -98,6 +98,11 @@ static int __init hardlockup_all_cpu_backtrace_setup(char *str) } __setup("hardlockup_all_cpu_backtrace=", hardlockup_all_cpu_backtrace_setup); # endif /* CONFIG_SMP */ + +struct cpumask *watchdog_get_allowed_cpumask(void) +{ + return &watchdog_allowed_mask; +} #endif /* CONFIG_HARDLOCKUP_DETECTOR */ /* -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Neri Date: Wed, 13 Jun 2018 00:57:35 +0000 Subject: [RFC PATCH 15/23] kernel/watchdog: Add a function to obtain the watchdog_allowed_mask Message-Id: <1528851463-21140-16-git-send-email-ricardo.neri-calderon@linux.intel.com> List-Id: References: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> In-Reply-To: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Andi Kleen , Ashok Raj , Borislav Petkov , Tony Luck , "Ravi V. Shankar" , x86@kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Neri , Jacob Pan , "Rafael J. Wysocki" , Don Zickus , Nicholas Piggin , Michael Ellerman , Frederic Weisbecker , Alexei Starovoitov , Babu Moger , Paul Mackerras , Mathieu Desnoyers , Masami Hiramatsu Implementations of NMI watchdogs that use a single piece of hardware to monitor all the CPUs in the system (as opposed to per-CPU implementations such as perf) need to know which CPUs the watchdog is allowed to monitor. In this manner, non-maskable interrupts are directed only to the monitored CPUs. Cc: Ashok Raj Cc: Andi Kleen Cc: Tony Luck Cc: Borislav Petkov Cc: Jacob Pan Cc: "Rafael J. Wysocki" Cc: Don Zickus Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Frederic Weisbecker Cc: Alexei Starovoitov Cc: Babu Moger Cc: Paul Mackerras Cc: Mathieu Desnoyers Cc: Masami Hiramatsu Cc: Peter Zijlstra Cc: Andrew Morton Cc: Philippe Ombredanne Cc: Colin Ian King Cc: Byungchul Park Cc: "Paul E. McKenney" Cc: "Luis R. Rodriguez" Cc: Waiman Long Cc: Josh Poimboeuf Cc: Randy Dunlap Cc: Davidlohr Bueso Cc: Christoffer Dall Cc: Marc Zyngier Cc: Kai-Heng Feng Cc: Konrad Rzeszutek Wilk Cc: David Rientjes Cc: "Ravi V. Shankar" Cc: x86@kernel.org Cc: "David S. Miller" Cc: Benjamin Herrenschmidt Cc: iommu@lists.linux-foundation.org Cc: sparclinux@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Ricardo Neri --- include/linux/nmi.h | 1 + kernel/watchdog.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index e61b441..e608762 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -77,6 +77,7 @@ static inline void reset_hung_task_detector(void) { } #if defined(CONFIG_HARDLOCKUP_DETECTOR) extern void hardlockup_detector_disable(void); +extern struct cpumask *watchdog_get_allowed_cpumask(void); extern unsigned int hardlockup_panic; #else static inline void hardlockup_detector_disable(void) {} diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 5057376..b94bbe3 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -50,7 +50,7 @@ int __read_mostly nmi_watchdog_available; static struct nmi_watchdog_ops *nmi_wd_ops; -struct cpumask watchdog_allowed_mask __read_mostly; +static struct cpumask watchdog_allowed_mask __read_mostly; struct cpumask watchdog_cpumask __read_mostly; unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask); @@ -98,6 +98,11 @@ static int __init hardlockup_all_cpu_backtrace_setup(char *str) } __setup("hardlockup_all_cpu_backtrace=", hardlockup_all_cpu_backtrace_setup); # endif /* CONFIG_SMP */ + +struct cpumask *watchdog_get_allowed_cpumask(void) +{ + return &watchdog_allowed_mask; +} #endif /* CONFIG_HARDLOCKUP_DETECTOR */ /* -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Neri Subject: [RFC PATCH 15/23] kernel/watchdog: Add a function to obtain the watchdog_allowed_mask Date: Tue, 12 Jun 2018 17:57:35 -0700 Message-ID: <1528851463-21140-16-git-send-email-ricardo.neri-calderon@linux.intel.com> References: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> Return-path: In-Reply-To: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Andi Kleen , Ashok Raj , Borislav Petkov , Tony Luck , "Ravi V. Shankar" , x86@kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Neri , Jacob Pan , "Rafael J. Wysocki" , Don Zickus , Nicholas Piggin , Michael Ellerman , Frederic Weisbecker , Alexei Starovoitov , Babu Moger , Paul Mackerras , Mathieu Desnoyers , Masami Hiramatsu List-Id: iommu@lists.linux-foundation.org Implementations of NMI watchdogs that use a single piece of hardware to monitor all the CPUs in the system (as opposed to per-CPU implementations such as perf) need to know which CPUs the watchdog is allowed to monitor. In this manner, non-maskable interrupts are directed only to the monitored CPUs. Cc: Ashok Raj Cc: Andi Kleen Cc: Tony Luck Cc: Borislav Petkov Cc: Jacob Pan Cc: "Rafael J. Wysocki" Cc: Don Zickus Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Frederic Weisbecker Cc: Alexei Starovoitov Cc: Babu Moger Cc: Paul Mackerras Cc: Mathieu Desnoyers Cc: Masami Hiramatsu Cc: Peter Zijlstra Cc: Andrew Morton Cc: Philippe Ombredanne Cc: Colin Ian King Cc: Byungchul Park Cc: "Paul E. McKenney" Cc: "Luis R. Rodriguez" Cc: Waiman Long Cc: Josh Poimboeuf Cc: Randy Dunlap Cc: Davidlohr Bueso Cc: Christoffer Dall Cc: Marc Zyngier Cc: Kai-Heng Feng Cc: Konrad Rzeszutek Wilk Cc: David Rientjes Cc: "Ravi V. Shankar" Cc: x86@kernel.org Cc: "David S. Miller" Cc: Benjamin Herrenschmidt Cc: iommu@lists.linux-foundation.org Cc: sparclinux@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Ricardo Neri --- include/linux/nmi.h | 1 + kernel/watchdog.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index e61b441..e608762 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -77,6 +77,7 @@ static inline void reset_hung_task_detector(void) { } #if defined(CONFIG_HARDLOCKUP_DETECTOR) extern void hardlockup_detector_disable(void); +extern struct cpumask *watchdog_get_allowed_cpumask(void); extern unsigned int hardlockup_panic; #else static inline void hardlockup_detector_disable(void) {} diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 5057376..b94bbe3 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -50,7 +50,7 @@ int __read_mostly nmi_watchdog_available; static struct nmi_watchdog_ops *nmi_wd_ops; -struct cpumask watchdog_allowed_mask __read_mostly; +static struct cpumask watchdog_allowed_mask __read_mostly; struct cpumask watchdog_cpumask __read_mostly; unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask); @@ -98,6 +98,11 @@ static int __init hardlockup_all_cpu_backtrace_setup(char *str) } __setup("hardlockup_all_cpu_backtrace=", hardlockup_all_cpu_backtrace_setup); # endif /* CONFIG_SMP */ + +struct cpumask *watchdog_get_allowed_cpumask(void) +{ + return &watchdog_allowed_mask; +} #endif /* CONFIG_HARDLOCKUP_DETECTOR */ /* -- 2.7.4