Upgrade to 4.4.50-rt62
[kvmfornfv.git] / kernel / kernel / watchdog.c
index 201775b..fa2e079 100644 (file)
@@ -330,7 +330,6 @@ static void watchdog_overflow_callback(struct perf_event *event,
         */
        if (is_hardlockup()) {
                int this_cpu = smp_processor_id();
-               struct pt_regs *regs = get_irq_regs();
 
                /* only print hardlockups once */
                if (__this_cpu_read(hard_watchdog_warn) == true)
@@ -361,7 +360,7 @@ static void watchdog_overflow_callback(struct perf_event *event,
 
                raw_spin_unlock(&watchdog_output_lock);
                if (hardlockup_panic)
-                       panic("Hard LOCKUP");
+                       nmi_panic(regs, "Hard LOCKUP");
 
                __this_cpu_write(hard_watchdog_warn, true);
                return;
@@ -918,6 +917,9 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write,
                 * both lockup detectors are disabled if proc_watchdog_update()
                 * returns an error.
                 */
+               if (old == new)
+                       goto out;
+
                err = proc_watchdog_update();
        }
 out:
@@ -962,7 +964,7 @@ int proc_soft_watchdog(struct ctl_table *table, int write,
 int proc_watchdog_thresh(struct ctl_table *table, int write,
                         void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-       int err, old;
+       int err, old, new;
 
        get_online_cpus();
        mutex_lock(&watchdog_proc_mutex);
@@ -982,6 +984,10 @@ int proc_watchdog_thresh(struct ctl_table *table, int write,
        /*
         * Update the sample period. Restore on failure.
         */
+       new = ACCESS_ONCE(watchdog_thresh);
+       if (old == new)
+               goto out;
+
        set_sample_period();
        err = proc_watchdog_update();
        if (err) {