LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: "Guilherme G. Piccoli" <gpiccoli@canonical.com>,
	linux-kernel@vger.kernel.org
Cc: linux-doc@vger.kernel.org, mcgrof@kernel.org,
	keescook@chromium.org, yzaikin@google.com, tglx@linutronix.de,
	akpm@linux-foundation.org, kernel@gpiccoli.net
Subject: Re: [PATCH] panic: Add sysctl/cmdline to dump all CPUs backtraces on oops event
Date: Tue, 10 Mar 2020 13:59:15 -0700	[thread overview]
Message-ID: <93f20e59-41b1-48ad-b0eb-e670b18994d5@infradead.org> (raw)
In-Reply-To: <20200310163700.19186-1-gpiccoli@canonical.com>

Hi-

On 3/10/20 9:37 AM, Guilherme G. Piccoli wrote:
> 
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com>
> ---
> 
> As a P.S. note, my choice to put the backtrace dump in the end of
> oops_enter() was from previous experience (in which I used this
> approach in a kprobes to collect more data on oops), but I'd
> gladly accept suggestion in case there's a better place to dump
> this. Thanks in advance for the reviews!
> Cheers,
> 
> Guilherme
> 
> 
>  .../admin-guide/kernel-parameters.txt         |  8 +++++++
>  Documentation/admin-guide/sysctl/kernel.rst   | 15 +++++++++++++
>  include/linux/kernel.h                        |  6 ++++++
>  kernel/panic.c                                | 21 +++++++++++++++++++
>  kernel/sysctl.c                               | 11 ++++++++++
>  5 files changed, 61 insertions(+)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 4c6595b5f6c8..888b1fab3f6e 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -3333,6 +3333,14 @@
>  			This will also cause panics on machine check exceptions.
>  			Useful together with panic=30 to trigger a reboot.
>  
> +	oops_all_cpu_backtrace=
> +			[KNL] Should kernel generates backtraces on all cpus

			                    generate backtraces on all CPUs

> +			when oops occurs - this should be a last measure resort
> +			in case	a kdump cannot be collected, for example.
> +			Defaults to 0 and can be controlled by the sysctl
> +			kernel.oops_all_cpu_backtrace.
> +			Format: <integer>
> +
>  	page_alloc.shuffle=
>  			[KNL] Boolean flag to control whether the page allocator
>  			should randomize its free lists. The randomization may
> diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
> index 218c717c1354..460112c3f656 100644
> --- a/Documentation/admin-guide/sysctl/kernel.rst
> +++ b/Documentation/admin-guide/sysctl/kernel.rst
> @@ -573,6 +574,20 @@ numa_balancing_scan_size_mb is how many megabytes worth of pages are
>  scanned for a given scan.
>  
>  
> +oops_all_cpu_backtrace:
> +================
> +
> +Determines if kernel should NMI all CPUs to dump their backtraces when

I would much prefer that to be written without using NMI as a verb.

> +an oops event occurs. It should be used as a last resort in case a panic
> +cannot be triggered (to protect VMs running, for example) or kdump can't
> +be collected. This file shows up if CONFIG_SMP is enabled.
> +
> +0: Won't show all CPUs backtraces when an oops is detected.
> +This is the default behavior.
> +
> +1: Will NMI all CPUs and dump their backtraces when an oops is detected.

Same here.

> +
> +
>  osrelease, ostype & version:
>  ============================
>  



Thanks.
-- 
~Randy


  reply	other threads:[~2020-03-10 20:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 16:37 Guilherme G. Piccoli
2020-03-10 20:59 ` Randy Dunlap [this message]
2020-03-11  1:26   ` Andrew Morton
2020-03-11 12:46     ` Guilherme G. Piccoli
2020-03-14 14:28   ` Matthew Wilcox
2020-03-14 21:18     ` Randy Dunlap
2020-03-16 13:51       ` Guilherme G. Piccoli

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=93f20e59-41b1-48ad-b0eb-e670b18994d5@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=gpiccoli@canonical.com \
    --cc=keescook@chromium.org \
    --cc=kernel@gpiccoli.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=yzaikin@google.com \
    --subject='Re: [PATCH] panic: Add sysctl/cmdline to dump all CPUs backtraces on oops event' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).