X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=kernel%2Fwatchdog.c;h=1f1b05f5a94b8edaf014495a985168b39d73877f;hb=9aa987e46128bc063765af2a720561256cd69e32;hp=e864906af3fc7a733831542c52547acf7a4821d7;hpb=49f63e15598e09f24e0528e7cad18d6dec2ba804;p=firefly-linux-kernel-4.4.55.git diff --git a/kernel/watchdog.c b/kernel/watchdog.c index e864906af3fc..1f1b05f5a94b 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -1020,6 +1020,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: @@ -1064,7 +1067,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); @@ -1084,6 +1087,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) {