diff options
author | Ulrich Obergfell <uobergfe@redhat.com> | 2015-09-04 18:45:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-04 19:54:41 -0400 |
commit | ec6a90661a0d6ce1461d05c7a58a0a151154e14a (patch) | |
tree | 54dcb55b4d38eb60c4eef1366b7d5d8ef4ea2d5d /kernel/watchdog.c | |
parent | 999bbe49ea0118b70ddf3f5d679f51dc7a97ae55 (diff) |
watchdog: rename watchdog_suspend() and watchdog_resume()
Rename watchdog_suspend() to lockup_detector_suspend() and
watchdog_resume() to lockup_detector_resume() to avoid confusion with the
watchdog subsystem and to be consistent with the existing name
lockup_detector_init().
Also provide comment blocks to explain the watchdog_running and
watchdog_suspended variables and their relationship.
Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
Reviewed-by: Aaron Tomlin <atomlin@redhat.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Stephane Eranian <eranian@google.com>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r-- | kernel/watchdog.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 69666f4b8e8f..64ed1c37bd1f 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -67,8 +67,26 @@ unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask); | |||
67 | #define for_each_watchdog_cpu(cpu) \ | 67 | #define for_each_watchdog_cpu(cpu) \ |
68 | for_each_cpu_and((cpu), cpu_online_mask, &watchdog_cpumask) | 68 | for_each_cpu_and((cpu), cpu_online_mask, &watchdog_cpumask) |
69 | 69 | ||
70 | static int __read_mostly watchdog_suspended; | 70 | /* |
71 | * The 'watchdog_running' variable is set to 1 when the watchdog threads | ||
72 | * are registered/started and is set to 0 when the watchdog threads are | ||
73 | * unregistered/stopped, so it is an indicator whether the threads exist. | ||
74 | */ | ||
71 | static int __read_mostly watchdog_running; | 75 | static int __read_mostly watchdog_running; |
76 | /* | ||
77 | * If a subsystem has a need to deactivate the watchdog temporarily, it | ||
78 | * can use the suspend/resume interface to achieve this. The content of | ||
79 | * the 'watchdog_suspended' variable reflects this state. Existing threads | ||
80 | * are parked/unparked by the lockup_detector_{suspend|resume} functions | ||
81 | * (see comment blocks pertaining to those functions for further details). | ||
82 | * | ||
83 | * 'watchdog_suspended' also prevents threads from being registered/started | ||
84 | * or unregistered/stopped via parameters in /proc/sys/kernel, so the state | ||
85 | * of 'watchdog_running' cannot change while the watchdog is deactivated | ||
86 | * temporarily (see related code in 'proc' handlers). | ||
87 | */ | ||
88 | static int __read_mostly watchdog_suspended; | ||
89 | |||
72 | static u64 __read_mostly sample_period; | 90 | static u64 __read_mostly sample_period; |
73 | 91 | ||
74 | static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts); | 92 | static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts); |
@@ -669,7 +687,7 @@ static void watchdog_unpark_threads(void) | |||
669 | /* | 687 | /* |
670 | * Suspend the hard and soft lockup detector by parking the watchdog threads. | 688 | * Suspend the hard and soft lockup detector by parking the watchdog threads. |
671 | */ | 689 | */ |
672 | int watchdog_suspend(void) | 690 | int lockup_detector_suspend(void) |
673 | { | 691 | { |
674 | int ret = 0; | 692 | int ret = 0; |
675 | 693 | ||
@@ -679,7 +697,7 @@ int watchdog_suspend(void) | |||
679 | * the 'watchdog_suspended' variable). If the watchdog threads are | 697 | * the 'watchdog_suspended' variable). If the watchdog threads are |
680 | * running, the first caller takes care that they will be parked. | 698 | * running, the first caller takes care that they will be parked. |
681 | * The state of 'watchdog_running' cannot change while a suspend | 699 | * The state of 'watchdog_running' cannot change while a suspend |
682 | * request is active (see related changes in 'proc' handlers). | 700 | * request is active (see related code in 'proc' handlers). |
683 | */ | 701 | */ |
684 | if (watchdog_running && !watchdog_suspended) | 702 | if (watchdog_running && !watchdog_suspended) |
685 | ret = watchdog_park_threads(); | 703 | ret = watchdog_park_threads(); |
@@ -695,7 +713,7 @@ int watchdog_suspend(void) | |||
695 | /* | 713 | /* |
696 | * Resume the hard and soft lockup detector by unparking the watchdog threads. | 714 | * Resume the hard and soft lockup detector by unparking the watchdog threads. |
697 | */ | 715 | */ |
698 | void watchdog_resume(void) | 716 | void lockup_detector_resume(void) |
699 | { | 717 | { |
700 | mutex_lock(&watchdog_proc_mutex); | 718 | mutex_lock(&watchdog_proc_mutex); |
701 | 719 | ||