X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=kernel%2Fwatchdog.c;h=c1e0b5f429b6b91c9b80c0173f8c8668541fbde8;hb=fd97ed8c874dc479d868ad33311ad227ff0c98ee;hp=18f34cf75f741e2a63db6dc6c522dfa2e03d1a54;hpb=665ddeb210c10f4daf8ffbe07072771c0020af3a;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 18f34cf75f74..c1e0b5f429b6 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -328,7 +328,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) @@ -907,6 +906,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: @@ -951,7 +953,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); @@ -971,6 +973,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) {