watchdog: Add comments to explain the watchdog_disabled variable
authoranish kumar <anish198519851985@gmail.com>
Tue, 12 Mar 2013 18:44:08 +0000 (14:44 -0400)
committerIngo Molnar <mingo@kernel.org>
Thu, 14 Mar 2013 07:24:05 +0000 (08:24 +0100)
The watchdog_disabled flag is a bit cryptic. However it's
usefulness is multifold. Uses are:

 1. Check if smpboot_register_percpu_thread function passed.

 2. Makes sure that user enables and disables the watchdog in
    sequence i.e. enable watchdog->disable watchdog->enable watchdog
    Unlike enable watchdog->enable watchdog which is wrong.

Signed-off-by: anish kumar <anish198519851985@gmail.com>
[small text cleanups]
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: chuansheng.liu@intel.com
Cc: paulmck@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/1363113848-18344-1-git-send-email-dzickus@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/watchdog.c

index 4a944676358e841821a4b0d9a53ff312d2de9521..05039e348f07e242c63392a8758b8371c1a42beb 100644 (file)
@@ -517,6 +517,11 @@ int proc_dowatchdog(struct ctl_table *table, int write,
                return ret;
 
        set_sample_period();
+       /*
+        * Watchdog threads shouldn't be enabled if they are
+        * disabled. The 'watchdog_disabled' variable check in
+        * watchdog_*_all_cpus() function takes care of this.
+        */
        if (watchdog_enabled && watchdog_thresh)
                watchdog_enable_all_cpus();
        else