aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-09-12 15:37:07 -0400
committerIngo Molnar <mingo@kernel.org>2017-09-14 05:41:05 -0400
commit368a7e2ce8ff0ddcdcb37eadb76530b033f6eb2d (patch)
tree0666f7c585b509ce2e2550b84e0fedb7a297ab3d
parent2b9d7f233b835663cbc7b6b3f88dd20f61118d1e (diff)
watchdog/core: Clean up the #ifdef maze
The #ifdef maze in this file is horrible, group stuff at least a bit so one can figure out what belongs to what. 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.139629546@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/watchdog.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index af37c040436c..a9bdfde73e4b 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -41,7 +41,6 @@ unsigned long __read_mostly watchdog_enabled = SOFT_WATCHDOG_ENABLED;
41#endif 41#endif
42 42
43#ifdef CONFIG_HARDLOCKUP_DETECTOR 43#ifdef CONFIG_HARDLOCKUP_DETECTOR
44/* boot commands */
45/* 44/*
46 * Should we panic when a soft-lockup or hard-lockup occurs: 45 * Should we panic when a soft-lockup or hard-lockup occurs:
47 */ 46 */
@@ -74,19 +73,21 @@ static int __init hardlockup_panic_setup(char *str)
74} 73}
75__setup("nmi_watchdog=", hardlockup_panic_setup); 74__setup("nmi_watchdog=", hardlockup_panic_setup);
76 75
77#endif 76# ifdef CONFIG_SMP
77int __read_mostly sysctl_hardlockup_all_cpu_backtrace;
78 78
79#ifdef CONFIG_SOFTLOCKUP_DETECTOR 79static int __init hardlockup_all_cpu_backtrace_setup(char *str)
80int __read_mostly soft_watchdog_enabled; 80{
81#endif 81 sysctl_hardlockup_all_cpu_backtrace = !!simple_strtol(str, NULL, 0);
82 return 1;
83}
84__setup("hardlockup_all_cpu_backtrace=", hardlockup_all_cpu_backtrace_setup);
85# endif /* CONFIG_SMP */
86#endif /* CONFIG_HARDLOCKUP_DETECTOR */
82 87
83int __read_mostly watchdog_user_enabled; 88int __read_mostly watchdog_user_enabled;
84int __read_mostly watchdog_thresh = 10; 89int __read_mostly watchdog_thresh = 10;
85 90
86#ifdef CONFIG_SMP
87int __read_mostly sysctl_softlockup_all_cpu_backtrace;
88int __read_mostly sysctl_hardlockup_all_cpu_backtrace;
89#endif
90struct cpumask watchdog_cpumask __read_mostly; 91struct cpumask watchdog_cpumask __read_mostly;
91unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask); 92unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask);
92 93
@@ -173,22 +174,14 @@ static int __init nosoftlockup_setup(char *str)
173__setup("nosoftlockup", nosoftlockup_setup); 174__setup("nosoftlockup", nosoftlockup_setup);
174 175
175#ifdef CONFIG_SMP 176#ifdef CONFIG_SMP
177int __read_mostly sysctl_softlockup_all_cpu_backtrace;
178
176static int __init softlockup_all_cpu_backtrace_setup(char *str) 179static int __init softlockup_all_cpu_backtrace_setup(char *str)
177{ 180{
178 sysctl_softlockup_all_cpu_backtrace = 181 sysctl_softlockup_all_cpu_backtrace = !!simple_strtol(str, NULL, 0);
179 !!simple_strtol(str, NULL, 0);
180 return 1; 182 return 1;
181} 183}
182__setup("softlockup_all_cpu_backtrace=", softlockup_all_cpu_backtrace_setup); 184__setup("softlockup_all_cpu_backtrace=", softlockup_all_cpu_backtrace_setup);
183#ifdef CONFIG_HARDLOCKUP_DETECTOR
184static int __init hardlockup_all_cpu_backtrace_setup(char *str)
185{
186 sysctl_hardlockup_all_cpu_backtrace =
187 !!simple_strtol(str, NULL, 0);
188 return 1;
189}
190__setup("hardlockup_all_cpu_backtrace=", hardlockup_all_cpu_backtrace_setup);
191#endif
192#endif 185#endif
193 186
194static void __lockup_detector_cleanup(void); 187static void __lockup_detector_cleanup(void);