mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: yalin wang <yalin.wang2010@gmail.com>
To: Spencer Baugh <sbaugh@catern.com>
Cc: Don Zickus <dzickus@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ulrich Obergfell <uobergfe@redhat.com>,
	Ingo Molnar <mingo@kernel.org>, Andrew Jones <drjones@redhat.com>,
	chai wen <chaiw.fnst@cn.fujitsu.com>,
	Chris Metcalf <cmetcalf@ezchip.com>,
	Stephane Eranian <eranian@google.com>,
	open list <linux-kernel@vger.kernel.org>,
	Joern Engel <joern@purestorage.com>,
	Spencer Baugh <Spencer.baugh@purestorage.com>,
	Joern Engel <joern@logfs.org>
Subject: Re: [PATCH] soft lockup: kill realtime threads before panic
Date: Wed, 22 Jul 2015 14:59:16 +0800	[thread overview]
Message-ID: <CF86E0FB-4803-459E-8F26-435DF0458591@gmail.com> (raw)
In-Reply-To: <1437516477-30554-5-git-send-email-sbaugh@catern.com>


> On Jul 22, 2015, at 06:07, Spencer Baugh <sbaugh@catern.com> wrote:
> 
> 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
> -- 
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




  parent reply	other threads:[~2015-07-22  6:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21 22:07 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 [this message]
2015-07-22 22:54 ` Andrew Morton
2015-07-22 23:29   ` Jörn Engel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CF86E0FB-4803-459E-8F26-435DF0458591@gmail.com \
    --to=yalin.wang2010@gmail.com \
    --cc=Spencer.baugh@purestorage.com \
    --cc=akpm@linux-foundation.org \
    --cc=chaiw.fnst@cn.fujitsu.com \
    --cc=cmetcalf@ezchip.com \
    --cc=drjones@redhat.com \
    --cc=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=joern@logfs.org \
    --cc=joern@purestorage.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sbaugh@catern.com \
    --cc=uobergfe@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®