Re: [PATCH v4 2/2] watchdog: add watchdog_exclude sysctl to assist nohz

From: Ulrich Obergfell
Date: Sun Apr 05 2015 - 12:47:52 EST


I'd like to comment on the following proposed change:

+int proc_dowatchdog_exclude(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
+ int err;
+ mutex_lock(&watchdog_proc_mutex);
+ err = proc_do_large_bitmap(table, write, buffer, lenp, ppos);
+ if (!err && write && watchdog_user_enabled) {
+ watchdog_disable_all_cpus();
+ watchdog_enable_all_cpus(false);
+ }
+ mutex_unlock(&watchdog_proc_mutex);
+ return err;

The watchdog mechanism is enabled if watchdog_user_enabled and watchdog_thresh
are both non-zero. Hence, I think the if-statement in the above snippet of code
should look like this:

if (!err && write && watchdog_user_enabled && watchdog_thresh)

Please see proc_dowatchdog() which checks the content of both variables before
it calls watchdog_enable_all_cpus():

For completeness, I'd also like to point out that if the patch series at gets accepted upstream, the if-statement
will have to be adjusted. I think it should then look like this:

if (!err && write && watchdog_enabled && watchdog_thresh) {

Please see proc_watchdog_update() here which is similar to the above.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at