aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-12-08 11:28:04 -0500
committerTejun Heo <tj@kernel.org>2015-12-08 11:29:42 -0500
commit03e0d4610bf4d4a93bfa16b2474ed4fd5243aa71 (patch)
treed56940ac55c843628383a0f4e90c3dd2871f1d73 /kernel/watchdog.c
parentfca839c00a12d682cb59b3b620d109a1d850b262 (diff)
watchdog: introduce touch_softlockup_watchdog_sched()
touch_softlockup_watchdog() is used to tell watchdog that scheduler stall is expected. One group of usage is from paths where the task may not be able to yield for a long time such as performing slow PIO to finicky device and coming out of suspend. The other is to account for scheduler and timer going idle. For scheduler softlockup detection, there's no reason to distinguish the two cases; however, workqueue lockup detector is planned and it can use the same signals from the former group while the latter would spuriously prevent detection. This patch introduces a new function touch_softlockup_watchdog_sched() and convert the latter group to call it instead. For now, it just calls touch_softlockup_watchdog() and there's no functional difference. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Ulrich Obergfell <uobergfe@redhat.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 18f34cf75f74..9eaf3dbec7e8 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -225,7 +225,15 @@ static void __touch_watchdog(void)
225 __this_cpu_write(watchdog_touch_ts, get_timestamp()); 225 __this_cpu_write(watchdog_touch_ts, get_timestamp());
226} 226}
227 227
228void touch_softlockup_watchdog(void) 228/**
229 * touch_softlockup_watchdog_sched - touch watchdog on scheduler stalls
230 *
231 * Call when the scheduler may have stalled for legitimate reasons
232 * preventing the watchdog task from executing - e.g. the scheduler
233 * entering idle state. This should only be used for scheduler events.
234 * Use touch_softlockup_watchdog() for everything else.
235 */
236void touch_softlockup_watchdog_sched(void)
229{ 237{
230 /* 238 /*
231 * Preemption can be enabled. It doesn't matter which CPU's timestamp 239 * Preemption can be enabled. It doesn't matter which CPU's timestamp
@@ -233,6 +241,11 @@ void touch_softlockup_watchdog(void)
233 */ 241 */
234 raw_cpu_write(watchdog_touch_ts, 0); 242 raw_cpu_write(watchdog_touch_ts, 0);
235} 243}
244
245void touch_softlockup_watchdog(void)
246{
247 touch_softlockup_watchdog_sched();
248}
236EXPORT_SYMBOL(touch_softlockup_watchdog); 249EXPORT_SYMBOL(touch_softlockup_watchdog);
237 250
238void touch_all_softlockup_watchdogs(void) 251void touch_all_softlockup_watchdogs(void)