[lkml]   [2015]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v4 2/2] watchdog: add watchdog_exclude sysctl to assist nohz


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.



 \ /
  Last update: 2015-04-05 19:01    [W:0.070 / U:1.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site