]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
watchdog: do not unpark threads in watchdog_park_threads() on error
authorUlrich Obergfell <uobergfe@redhat.com>
Fri, 6 Nov 2015 02:44:39 +0000 (18:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Nov 2015 03:34:48 +0000 (19:34 -0800)
If kthread_park() returns an error, watchdog_park_threads() should not
blindly 'roll back' the already parked threads to the unparked state.
Instead leave it up to the callers to handle such errors appropriately in
their context.  For example, it is redundant to unpark the threads if the
lockup detectors will soon be disabled by the callers anyway.

Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
Reviewed-by: Aaron Tomlin <atomlin@redhat.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/watchdog.c

index e8b19db9c14aaa3d457762c0ebb9767ac356df85..452e4ed507e5e3e2e48ad097082b2502a976ddc6 100644 (file)
@@ -654,6 +654,12 @@ static struct smp_hotplug_thread watchdog_threads = {
 
 /*
  * park all watchdog threads that are specified in 'watchdog_cpumask'
+ *
+ * This function returns an error if kthread_park() of a watchdog thread
+ * fails. In this situation, the watchdog threads of some CPUs can already
+ * be parked and the watchdog threads of other CPUs can still be runnable.
+ * Callers are expected to handle this special condition as appropriate in
+ * their context.
  */
 static int watchdog_park_threads(void)
 {
@@ -665,10 +671,6 @@ static int watchdog_park_threads(void)
                if (ret)
                        break;
        }
-       if (ret) {
-               for_each_watchdog_cpu(cpu)
-                       kthread_unpark(per_cpu(softlockup_watchdog, cpu));
-       }
        put_online_cpus();
 
        return ret;