Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756173AbbGVG70 (ORCPT ); Wed, 22 Jul 2015 02:59:26 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:33186 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754083AbbGVG7X convert rfc822-to-8bit (ORCPT ); Wed, 22 Jul 2015 02:59:23 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: [PATCH] soft lockup: kill realtime threads before panic From: yalin wang In-Reply-To: <1437516477-30554-5-git-send-email-sbaugh@catern.com> Date: Wed, 22 Jul 2015 14:59:16 +0800 Cc: Don Zickus , Andrew Morton , Ulrich Obergfell , Ingo Molnar , Andrew Jones , chai wen , Chris Metcalf , Stephane Eranian , open list , Joern Engel , Spencer Baugh , Joern Engel Content-Transfer-Encoding: 8BIT Message-Id: References: <1437516477-30554-5-git-send-email-sbaugh@catern.com> To: Spencer Baugh X-Mailer: Apple Mail (2.2098) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1681 Lines: 52 > On Jul 22, 2015, at 06:07, Spencer Baugh wrote: > > From: Joern Engel > > 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 > Signed-off-by: Spencer Baugh > --- > 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 > -- just my advice about this patch, i think should add PF_KTHREAD condition like this: if (rt_prio(current->prio) && !(current->flags & PF_KTHREAD)) { + pr_emerg("killing realtime thread\n"); + send_sig(SIGILL, current, 0); + } else if (softlockup_panic) if soft lockup is caused by kthread, should still panic . Thanks -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/