public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soft lockup: kill realtime threads before panic
@ 2015-07-21 22:07 Spencer Baugh
  2015-07-22  4:36 ` Mike Galbraith
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Spencer Baugh @ 2015-07-21 22:07 UTC (permalink / raw)
  To: Don Zickus, Andrew Morton, Ulrich Obergfell, Ingo Molnar,
	Andrew Jones, chai wen, Chris Metcalf, Stephane Eranian,
	open list
  Cc: Joern Engel, Spencer Baugh, Joern Engel, Spencer Baugh

From: Joern Engel <joern@logfs.org>

We have observed cases where the soft lockup detector triggered, but no
kernel bug existed.  Instead we had a buggy realtime thread that
monopolized a cpu.  So let's kill the responsible party and not panic
the entire system.

Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Spencer Baugh <sbaugh@catern.com>
---
 kernel/watchdog.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index a6ffa43..2355bd5 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -428,7 +428,10 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
 		}
 
 		add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK);
-		if (softlockup_panic)
+		if (rt_prio(current->prio)) {
+			pr_emerg("killing realtime thread\n");
+			send_sig(SIGILL, current, 0);
+		} else if (softlockup_panic)
 			panic("softlockup: hung tasks");
 		__this_cpu_write(soft_watchdog_warn, true);
 	} else
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-07-22 23:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21 22:07 [PATCH] soft lockup: kill realtime threads before panic Spencer Baugh
2015-07-22  4:36 ` Mike Galbraith
2015-07-22  5:18   ` Jörn Engel
2015-07-22  5:41     ` Mike Galbraith
2015-07-22  6:33       ` Jörn Engel
2015-07-22  7:35         ` Mike Galbraith
2015-07-22 13:52           ` Don Zickus
2015-07-22 16:35           ` Jörn Engel
2015-07-22  6:59 ` yalin wang
2015-07-22 22:54 ` Andrew Morton
2015-07-22 23:29   ` Jörn Engel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox