aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-09-12 15:37:15 -0400
committerIngo Molnar <mingo@kernel.org>2017-09-14 05:41:07 -0400
commit7feeb9cd4f5b34476ffb9e6d58d58c5416375b19 (patch)
treea4a1c3abb9eda23f977cf1e0ebd5a8f2c525760f /kernel
parent51d4052b01ca555e0d1d5fe297b309beb6c64aa0 (diff)
watchdog/sysctl: Clean up sysctl variable name space
Reflect that these variables are user interface related and remove the whitespace damage in the sysctl table while at it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Don Zickus <dzickus@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Siewior <bigeasy@linutronix.de> Cc: Ulrich Obergfell <uobergfe@redhat.com> Link: http://lkml.kernel.org/r/20170912194147.783210221@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sysctl.c16
-rw-r--r--kernel/watchdog.c41
2 files changed, 28 insertions, 29 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 539cb4e97bb8..4c08ed4a379e 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -871,9 +871,9 @@ static struct ctl_table kern_table[] = {
871#if defined(CONFIG_LOCKUP_DETECTOR) 871#if defined(CONFIG_LOCKUP_DETECTOR)
872 { 872 {
873 .procname = "watchdog", 873 .procname = "watchdog",
874 .data = &watchdog_user_enabled, 874 .data = &watchdog_user_enabled,
875 .maxlen = sizeof (int), 875 .maxlen = sizeof(int),
876 .mode = 0644, 876 .mode = 0644,
877 .proc_handler = proc_watchdog, 877 .proc_handler = proc_watchdog,
878 .extra1 = &zero, 878 .extra1 = &zero,
879 .extra2 = &one, 879 .extra2 = &one,
@@ -889,8 +889,8 @@ static struct ctl_table kern_table[] = {
889 }, 889 },
890 { 890 {
891 .procname = "nmi_watchdog", 891 .procname = "nmi_watchdog",
892 .data = &nmi_watchdog_enabled, 892 .data = &nmi_watchdog_user_enabled,
893 .maxlen = sizeof (int), 893 .maxlen = sizeof(int),
894 .mode = NMI_WATCHDOG_SYSCTL_PERM, 894 .mode = NMI_WATCHDOG_SYSCTL_PERM,
895 .proc_handler = proc_nmi_watchdog, 895 .proc_handler = proc_nmi_watchdog,
896 .extra1 = &zero, 896 .extra1 = &zero,
@@ -906,9 +906,9 @@ static struct ctl_table kern_table[] = {
906#ifdef CONFIG_SOFTLOCKUP_DETECTOR 906#ifdef CONFIG_SOFTLOCKUP_DETECTOR
907 { 907 {
908 .procname = "soft_watchdog", 908 .procname = "soft_watchdog",
909 .data = &soft_watchdog_enabled, 909 .data = &soft_watchdog_user_enabled,
910 .maxlen = sizeof (int), 910 .maxlen = sizeof(int),
911 .mode = 0644, 911 .mode = 0644,
912 .proc_handler = proc_soft_watchdog, 912 .proc_handler = proc_soft_watchdog,
913 .extra1 = &zero, 913 .extra1 = &zero,
914 .extra2 = &one, 914 .extra2 = &one,
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index ca8747221e87..baae9fc95031 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -31,8 +31,6 @@
31 31
32static DEFINE_MUTEX(watchdog_mutex); 32static DEFINE_MUTEX(watchdog_mutex);
33 33
34int __read_mostly nmi_watchdog_enabled;
35
36#if defined(CONFIG_HARDLOCKUP_DETECTOR) || defined(CONFIG_HAVE_NMI_WATCHDOG) 34#if defined(CONFIG_HARDLOCKUP_DETECTOR) || defined(CONFIG_HAVE_NMI_WATCHDOG)
37unsigned long __read_mostly watchdog_enabled = SOFT_WATCHDOG_ENABLED | 35unsigned long __read_mostly watchdog_enabled = SOFT_WATCHDOG_ENABLED |
38 NMI_WATCHDOG_ENABLED; 36 NMI_WATCHDOG_ENABLED;
@@ -40,6 +38,17 @@ unsigned long __read_mostly watchdog_enabled = SOFT_WATCHDOG_ENABLED |
40unsigned long __read_mostly watchdog_enabled = SOFT_WATCHDOG_ENABLED; 38unsigned long __read_mostly watchdog_enabled = SOFT_WATCHDOG_ENABLED;
41#endif 39#endif
42 40
41int __read_mostly nmi_watchdog_user_enabled;
42int __read_mostly soft_watchdog_user_enabled;
43int __read_mostly watchdog_user_enabled;
44int __read_mostly watchdog_thresh = 10;
45
46struct cpumask watchdog_allowed_mask __read_mostly;
47static bool softlockup_threads_initialized __read_mostly;
48
49struct cpumask watchdog_cpumask __read_mostly;
50unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask);
51
43#ifdef CONFIG_HARDLOCKUP_DETECTOR 52#ifdef CONFIG_HARDLOCKUP_DETECTOR
44/* 53/*
45 * Should we panic when a soft-lockup or hard-lockup occurs: 54 * Should we panic when a soft-lockup or hard-lockup occurs:
@@ -85,12 +94,6 @@ __setup("hardlockup_all_cpu_backtrace=", hardlockup_all_cpu_backtrace_setup);
85# endif /* CONFIG_SMP */ 94# endif /* CONFIG_SMP */
86#endif /* CONFIG_HARDLOCKUP_DETECTOR */ 95#endif /* CONFIG_HARDLOCKUP_DETECTOR */
87 96
88int __read_mostly watchdog_user_enabled;
89int __read_mostly watchdog_thresh = 10;
90
91struct cpumask watchdog_cpumask __read_mostly;
92unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask);
93
94/* 97/*
95 * These functions can be overridden if an architecture implements its 98 * These functions can be overridden if an architecture implements its
96 * own hardlockup detector. 99 * own hardlockup detector.
@@ -113,7 +116,7 @@ void __weak watchdog_nmi_disable(unsigned int cpu)
113 * watchdog_nmi_reconfigure can be implemented to be notified after any 116 * watchdog_nmi_reconfigure can be implemented to be notified after any
114 * watchdog configuration change. The arch hardlockup watchdog should 117 * watchdog configuration change. The arch hardlockup watchdog should
115 * respond to the following variables: 118 * respond to the following variables:
116 * - nmi_watchdog_enabled 119 * - watchdog_enabled
117 * - watchdog_thresh 120 * - watchdog_thresh
118 * - watchdog_cpumask 121 * - watchdog_cpumask
119 * - sysctl_hardlockup_all_cpu_backtrace 122 * - sysctl_hardlockup_all_cpu_backtrace
@@ -126,10 +129,6 @@ void __weak watchdog_nmi_reconfigure(void) { }
126/* Global variables, exported for sysctl */ 129/* Global variables, exported for sysctl */
127unsigned int __read_mostly softlockup_panic = 130unsigned int __read_mostly softlockup_panic =
128 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE; 131 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE;
129int __read_mostly soft_watchdog_enabled;
130
131struct cpumask watchdog_allowed_mask __read_mostly;
132static bool softlockup_threads_initialized __read_mostly;
133 132
134static u64 __read_mostly sample_period; 133static u64 __read_mostly sample_period;
135 134
@@ -606,14 +605,14 @@ static void proc_watchdog_update(void)
606/* 605/*
607 * common function for watchdog, nmi_watchdog and soft_watchdog parameter 606 * common function for watchdog, nmi_watchdog and soft_watchdog parameter
608 * 607 *
609 * caller | table->data points to | 'which' contains the flag(s) 608 * caller | table->data points to | 'which'
610 * -------------------|-----------------------|----------------------------- 609 * -------------------|----------------------------|--------------------------
611 * proc_watchdog | watchdog_user_enabled | NMI_WATCHDOG_ENABLED or'ed 610 * proc_watchdog | watchdog_user_enabled | NMI_WATCHDOG_ENABLED |
612 * | | with SOFT_WATCHDOG_ENABLED 611 * | | SOFT_WATCHDOG_ENABLED
613 * -------------------|-----------------------|----------------------------- 612 * -------------------|----------------------------|--------------------------
614 * proc_nmi_watchdog | nmi_watchdog_enabled | NMI_WATCHDOG_ENABLED 613 * proc_nmi_watchdog | nmi_watchdog_user_enabled | NMI_WATCHDOG_ENABLED
615 * -------------------|-----------------------|----------------------------- 614 * -------------------|----------------------------|--------------------------
616 * proc_soft_watchdog | soft_watchdog_enabled | SOFT_WATCHDOG_ENABLED 615 * proc_soft_watchdog | soft_watchdog_user_enabled | SOFT_WATCHDOG_ENABLED
617 */ 616 */
618static int proc_watchdog_common(int which, struct ctl_table *table, int write, 617static int proc_watchdog_common(int which, struct ctl_table *table, int write,
619 void __user *buffer, size_t *lenp, loff_t *ppos) 618 void __user *buffer, size_t *lenp, loff_t *ppos)