aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
authorUlrich Obergfell <uobergfe@redhat.com>2015-04-14 18:44:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 19:48:59 -0400
commit692297d8f96887f836d9049a653ed05a71cf48fb (patch)
tree1c19271d875a54dfbdb74bc35d4f386dbc20dc63 /kernel/watchdog.c
parentb2f57c3a0df9d168220be8848a303a32ef4d2e7d (diff)
watchdog: introduce the hardlockup_detector_disable() function
Have kvm_guest_init() use hardlockup_detector_disable() instead of watchdog_enable_hardlockup_detector(false). Remove the watchdog_hardlockup_detector_is_enabled() and the watchdog_enable_hardlockup_detector() function which are no longer needed. Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com> Signed-off-by: Don Zickus <dzickus@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 49d02250aaac..f2be11ab7e08 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -83,8 +83,6 @@ static unsigned long soft_lockup_nmi_warn;
83#ifdef CONFIG_HARDLOCKUP_DETECTOR 83#ifdef CONFIG_HARDLOCKUP_DETECTOR
84static int hardlockup_panic = 84static int hardlockup_panic =
85 CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE; 85 CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE;
86
87static bool hardlockup_detector_enabled = true;
88/* 86/*
89 * We may not want to enable hard lockup detection by default in all cases, 87 * We may not want to enable hard lockup detection by default in all cases,
90 * for example when running the kernel as a guest on a hypervisor. In these 88 * for example when running the kernel as a guest on a hypervisor. In these
@@ -93,14 +91,9 @@ static bool hardlockup_detector_enabled = true;
93 * kernel command line parameters are parsed, because otherwise it is not 91 * kernel command line parameters are parsed, because otherwise it is not
94 * possible to override this in hardlockup_panic_setup(). 92 * possible to override this in hardlockup_panic_setup().
95 */ 93 */
96void watchdog_enable_hardlockup_detector(bool val) 94void hardlockup_detector_disable(void)
97{
98 hardlockup_detector_enabled = val;
99}
100
101bool watchdog_hardlockup_detector_is_enabled(void)
102{ 95{
103 return hardlockup_detector_enabled; 96 watchdog_enabled &= ~NMI_WATCHDOG_ENABLED;
104} 97}
105 98
106static int __init hardlockup_panic_setup(char *str) 99static int __init hardlockup_panic_setup(char *str)
@@ -530,15 +523,6 @@ static int watchdog_nmi_enable(unsigned int cpu)
530 if (!(watchdog_enabled & NMI_WATCHDOG_ENABLED)) 523 if (!(watchdog_enabled & NMI_WATCHDOG_ENABLED))
531 goto out; 524 goto out;
532 525
533 /*
534 * Some kernels need to default hard lockup detection to
535 * 'disabled', for example a guest on a hypervisor.
536 */
537 if (!watchdog_hardlockup_detector_is_enabled()) {
538 event = ERR_PTR(-ENOENT);
539 goto handle_err;
540 }
541
542 /* is it already setup and enabled? */ 526 /* is it already setup and enabled? */
543 if (event && event->state > PERF_EVENT_STATE_OFF) 527 if (event && event->state > PERF_EVENT_STATE_OFF)
544 goto out; 528 goto out;
@@ -553,7 +537,6 @@ static int watchdog_nmi_enable(unsigned int cpu)
553 /* Try to register using hardware perf events */ 537 /* Try to register using hardware perf events */
554 event = perf_event_create_kernel_counter(wd_attr, cpu, NULL, watchdog_overflow_callback, NULL); 538 event = perf_event_create_kernel_counter(wd_attr, cpu, NULL, watchdog_overflow_callback, NULL);
555 539
556handle_err:
557 /* save cpu0 error for future comparision */ 540 /* save cpu0 error for future comparision */
558 if (cpu == 0 && IS_ERR(event)) 541 if (cpu == 0 && IS_ERR(event))
559 cpu0_err = PTR_ERR(event); 542 cpu0_err = PTR_ERR(event);