diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-15 17:15:20 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-15 19:57:42 -0400 |
commit | 23637d477c1f53acbb176a02c241d60a25888fae (patch) | |
tree | 6d2e9e4a9f6fa2428e0ace29cf764212b823598a | |
parent | c01d4323309a90a298fd81cf3a059ee1b12be2e9 (diff) |
lockup_detector: Introduce CONFIG_HARDLOCKUP_DETECTOR
This new config is deemed to simplify even more the lockup detector
dependencies and can make it easier to bring a smooth sorting
between archs that support the new generic lockup detector and those
that still have their own, especially for those that are in the
middle of this migration.
Instead of checking whether we have CONFIG_LOCKUP_DETECTOR +
CONFIG_PERF_EVENTS_NMI each time an arch wants to know if it needs
to build its own lockup detector, take a shortcut with this new
config. It is enabled only if the hardlockup detection part of
the whole lockup detector is on.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | arch/Kconfig | 4 | ||||
-rw-r--r-- | init/Kconfig | 7 | ||||
-rw-r--r-- | kernel/watchdog.c | 14 | ||||
-rw-r--r-- | lib/Kconfig.debug | 3 |
4 files changed, 14 insertions, 14 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index 89b0efb50948..35084f280087 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -147,5 +147,9 @@ config HAVE_USER_RETURN_NOTIFIER | |||
147 | 147 | ||
148 | config HAVE_PERF_EVENTS_NMI | 148 | config HAVE_PERF_EVENTS_NMI |
149 | bool | 149 | bool |
150 | help | ||
151 | System hardware can generate an NMI using the perf event | ||
152 | subsystem. Also has support for calculating CPU cycle events | ||
153 | to determine how many clock cycles in a given period. | ||
150 | 154 | ||
151 | source "kernel/gcov/Kconfig" | 155 | source "kernel/gcov/Kconfig" |
diff --git a/init/Kconfig b/init/Kconfig index ab733c32292c..eb77e8ccde1c 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -942,13 +942,6 @@ config PERF_USE_VMALLOC | |||
942 | help | 942 | help |
943 | See tools/perf/design.txt for details | 943 | See tools/perf/design.txt for details |
944 | 944 | ||
945 | config PERF_EVENTS_NMI | ||
946 | def_bool PERF_EVENTS && HAVE_PERF_EVENTS_NMI | ||
947 | help | ||
948 | System hardware can generate an NMI using the perf event | ||
949 | subsystem. Also has support for calculating CPU cycle events | ||
950 | to determine how many clock cycles in a given period. | ||
951 | |||
952 | menu "Kernel Performance Events And Counters" | 945 | menu "Kernel Performance Events And Counters" |
953 | 946 | ||
954 | config PERF_EVENTS | 947 | config PERF_EVENTS |
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index be5e74e62be6..83fb63155cbc 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -37,7 +37,7 @@ static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer); | |||
37 | static DEFINE_PER_CPU(bool, softlockup_touch_sync); | 37 | static DEFINE_PER_CPU(bool, softlockup_touch_sync); |
38 | static DEFINE_PER_CPU(bool, hard_watchdog_warn); | 38 | static DEFINE_PER_CPU(bool, hard_watchdog_warn); |
39 | static DEFINE_PER_CPU(bool, soft_watchdog_warn); | 39 | static DEFINE_PER_CPU(bool, soft_watchdog_warn); |
40 | #ifdef CONFIG_PERF_EVENTS_NMI | 40 | #ifdef CONFIG_HARDLOCKUP_DETECTOR |
41 | static DEFINE_PER_CPU(unsigned long, hrtimer_interrupts); | 41 | static DEFINE_PER_CPU(unsigned long, hrtimer_interrupts); |
42 | static DEFINE_PER_CPU(unsigned long, hrtimer_interrupts_saved); | 42 | static DEFINE_PER_CPU(unsigned long, hrtimer_interrupts_saved); |
43 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); | 43 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); |
@@ -51,7 +51,7 @@ static int __initdata no_watchdog; | |||
51 | /* | 51 | /* |
52 | * Should we panic when a soft-lockup or hard-lockup occurs: | 52 | * Should we panic when a soft-lockup or hard-lockup occurs: |
53 | */ | 53 | */ |
54 | #ifdef CONFIG_PERF_EVENTS_NMI | 54 | #ifdef CONFIG_HARDLOCKUP_DETECTOR |
55 | static int hardlockup_panic; | 55 | static int hardlockup_panic; |
56 | 56 | ||
57 | static int __init hardlockup_panic_setup(char *str) | 57 | static int __init hardlockup_panic_setup(char *str) |
@@ -152,7 +152,7 @@ void touch_softlockup_watchdog_sync(void) | |||
152 | __raw_get_cpu_var(watchdog_touch_ts) = 0; | 152 | __raw_get_cpu_var(watchdog_touch_ts) = 0; |
153 | } | 153 | } |
154 | 154 | ||
155 | #ifdef CONFIG_PERF_EVENTS_NMI | 155 | #ifdef CONFIG_HARDLOCKUP_DETECTOR |
156 | /* watchdog detector functions */ | 156 | /* watchdog detector functions */ |
157 | static int is_hardlockup(int cpu) | 157 | static int is_hardlockup(int cpu) |
158 | { | 158 | { |
@@ -189,7 +189,7 @@ static struct notifier_block panic_block = { | |||
189 | .notifier_call = watchdog_panic, | 189 | .notifier_call = watchdog_panic, |
190 | }; | 190 | }; |
191 | 191 | ||
192 | #ifdef CONFIG_PERF_EVENTS_NMI | 192 | #ifdef CONFIG_HARDLOCKUP_DETECTOR |
193 | static struct perf_event_attr wd_hw_attr = { | 193 | static struct perf_event_attr wd_hw_attr = { |
194 | .type = PERF_TYPE_HARDWARE, | 194 | .type = PERF_TYPE_HARDWARE, |
195 | .config = PERF_COUNT_HW_CPU_CYCLES, | 195 | .config = PERF_COUNT_HW_CPU_CYCLES, |
@@ -239,7 +239,7 @@ static void watchdog_interrupt_count(void) | |||
239 | } | 239 | } |
240 | #else | 240 | #else |
241 | static inline void watchdog_interrupt_count(void) { return; } | 241 | static inline void watchdog_interrupt_count(void) { return; } |
242 | #endif /* CONFIG_PERF_EVENTS_NMI */ | 242 | #endif /* CONFIG_HARDLOCKUP_DETECTOR */ |
243 | 243 | ||
244 | /* watchdog kicker functions */ | 244 | /* watchdog kicker functions */ |
245 | static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) | 245 | static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) |
@@ -342,7 +342,7 @@ static int watchdog(void *__bind_cpu) | |||
342 | } | 342 | } |
343 | 343 | ||
344 | 344 | ||
345 | #ifdef CONFIG_PERF_EVENTS_NMI | 345 | #ifdef CONFIG_HARDLOCKUP_DETECTOR |
346 | static int watchdog_nmi_enable(int cpu) | 346 | static int watchdog_nmi_enable(int cpu) |
347 | { | 347 | { |
348 | struct perf_event_attr *wd_attr; | 348 | struct perf_event_attr *wd_attr; |
@@ -393,7 +393,7 @@ static void watchdog_nmi_disable(int cpu) | |||
393 | #else | 393 | #else |
394 | static int watchdog_nmi_enable(int cpu) { return 0; } | 394 | static int watchdog_nmi_enable(int cpu) { return 0; } |
395 | static void watchdog_nmi_disable(int cpu) { return; } | 395 | static void watchdog_nmi_disable(int cpu) { return; } |
396 | #endif /* CONFIG_PERF_EVENTS_NMI */ | 396 | #endif /* CONFIG_HARDLOCKUP_DETECTOR */ |
397 | 397 | ||
398 | /* prepare/enable/disable routines */ | 398 | /* prepare/enable/disable routines */ |
399 | static int watchdog_prepare_cpu(int cpu) | 399 | static int watchdog_prepare_cpu(int cpu) |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 3a18b0b856ce..e65e47d5c5e6 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -174,6 +174,9 @@ config LOCKUP_DETECTOR | |||
174 | generate interrupts and kick the watchdog task every 10-12 seconds. | 174 | generate interrupts and kick the watchdog task every 10-12 seconds. |
175 | An NMI is generated every 60 seconds or so to check for hardlockups. | 175 | An NMI is generated every 60 seconds or so to check for hardlockups. |
176 | 176 | ||
177 | config HARDLOCKUP_DETECTOR | ||
178 | def_bool LOCKUP_DETECTOR && PERF_EVENTS && HAVE_PERF_EVENTS_NMI | ||
179 | |||
177 | config BOOTPARAM_SOFTLOCKUP_PANIC | 180 | config BOOTPARAM_SOFTLOCKUP_PANIC |
178 | bool "Panic (Reboot) On Soft Lockups" | 181 | bool "Panic (Reboot) On Soft Lockups" |
179 | depends on LOCKUP_DETECTOR | 182 | depends on LOCKUP_DETECTOR |