[RFC PATCH 15/23] kernel/watchdog: Add a function to obtain the watchdog_allowed_mask
From: Ricardo Neri <hidden>
Date: 2018-06-13 01:04:58
Also in:
linux-iommu, lkml, sparclinux
Subsystem:
the rest · Maintainer:
Linus Torvalds
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 <redacted> Cc: Andi Kleen <redacted> Cc: Tony Luck <tony.luck@intel.com> Cc: Borislav Petkov <redacted> Cc: Jacob Pan <redacted> Cc: "Rafael J. Wysocki" <redacted> Cc: Don Zickus <redacted> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Frederic Weisbecker <frederic@kernel.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Babu Moger <redacted> Cc: Paul Mackerras <redacted> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Philippe Ombredanne <redacted> Cc: Colin Ian King <redacted> Cc: Byungchul Park <redacted> Cc: "Paul E. McKenney" <redacted> Cc: "Luis R. Rodriguez" <mcgrof@kernel.org> Cc: Waiman Long <longman@redhat.com> Cc: Josh Poimboeuf <redacted> Cc: Randy Dunlap <redacted> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Christoffer Dall <redacted> Cc: Marc Zyngier <redacted> Cc: Kai-Heng Feng <redacted> Cc: Konrad Rzeszutek Wilk <redacted> Cc: David Rientjes <rientjes@google.com> Cc: "Ravi V. Shankar" <redacted> Cc: x86@kernel.org Cc: "David S. Miller" <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: iommu@lists.linux-foundation.org Cc: sparclinux@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Ricardo Neri <redacted> --- 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