Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8446f1d3 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds
Browse files

[PATCH] detect soft lockups



This patch adds a new kernel debug feature: CONFIG_DETECT_SOFTLOCKUP.

When enabled then per-CPU watchdog threads are started, which try to run
once per second.  If they get delayed for more than 10 seconds then a
callback from the timer interrupt detects this condition and prints out a
warning message and a stack dump (once per lockup incident).  The feature
is otherwise non-intrusive, it doesnt try to unlock the box in any way, it
only gets the debug info out, automatically, and on all CPUs affected by
the lockup.

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-Off-By: default avatarMatthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: default avatarRichard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4732efbe
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -478,6 +478,11 @@ void touch_nmi_watchdog (void)
	 */
	for (i = 0; i < NR_CPUS; i++)
		alert_counter[i] = 0;

	/*
	 * Tickle the softlockup detector too:
	 */
	touch_softlockup_watchdog();
}

extern void die_nmi(struct pt_regs *, const char *msg);
+1 −0
Original line number Diff line number Diff line
@@ -422,6 +422,7 @@ static int timer_resume(struct sys_device *dev)
		last_timer->resume();
	cur_timer = last_timer;
	last_timer = NULL;
	touch_softlockup_watchdog();
	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -463,6 +463,8 @@ void touch_nmi_watchdog (void)
	 */
	for (i = 0; i < NR_CPUS; i++)
		per_cpu(nmi_touch, i) = 1;

 	touch_softlockup_watchdog();
}

void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason)
+1 −0
Original line number Diff line number Diff line
@@ -1041,6 +1041,7 @@ static int timer_resume(struct sys_device *dev)
	write_sequnlock_irqrestore(&xtime_lock,flags);
	jiffies += sleep_length;
	wall_jiffies += sleep_length;
	touch_softlockup_watchdog();
	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -526,6 +526,7 @@ static void nand_wait_ready(struct mtd_info *mtd)
	do {
		if (this->dev_ready(mtd))
			return;
		touch_softlockup_watchdog();
	} while (time_before(jiffies, timeo));	
}

Loading