From: Andrew Morton <akpm@linux-foundation.org>
To: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: bhe@redhat.com, pmladek@suse.com, linux-kernel@vger.kernel.org,
kexec@lists.infradead.org, dyoung@redhat.com,
d.hatayama@jp.fujitsu.com, feng.tang@intel.com,
hidehiro.kawai.ez@hitachi.com, keescook@chromium.org,
mikelley@microsoft.com, vgoyal@redhat.com, kernel-dev@igalia.com,
kernel@gpiccoli.net, stable@vger.kernel.org
Subject: Re: [PATCH v4] panic: Fixes the panic_print NMI backtrace setting
Date: Sat, 25 Feb 2023 21:44:54 -0800 [thread overview]
Message-ID: <20230225214454.5eb25ff8a937a99d357c44ad@linux-foundation.org> (raw)
In-Reply-To: <20230210203510.1734835-1-gpiccoli@igalia.com>
On Fri, 10 Feb 2023 17:35:10 -0300 "Guilherme G. Piccoli" <gpiccoli@igalia.com> wrote:
> Commit 8d470a45d1a6 ("panic: add option to dump all CPUs backtraces in panic_print")
> introduced a setting for the "panic_print" kernel parameter to allow
> users to request a NMI backtrace on panic. Problem is that the panic_print
> handling happens after the secondary CPUs are already disabled, hence
> this option ended-up being kind of a no-op - kernel skips the NMI trace
> in idling CPUs, which is the case of offline CPUs.
>
> Fix it by checking the NMI backtrace bit in the panic_print prior to
> the CPU disabling function.
>
> ...
>
> Notice that while at it, I got rid of the "crash_kexec_post_notifiers"
> local copy in panic(). This was introduced by commit b26e27ddfd2a
> ("kexec: use core_param for crash_kexec_post_notifiers boot option"),
> but it is not clear from comments or commit message why this local copy
> is required.
>
> My understanding is that it's a mechanism to prevent some concurrency,
> in case some other CPU modify this variable while panic() is running.
> I find it very unlikely, hence I removed it - but if people consider
> this copy needed, I can respin this patch and keep it, even providing a
> comment about that, in order to be explict about its need.
Only two sites change crash_kexec_post_notifiers, in
arch/powerpc/kernel/fadump.c and drivers/hv/hv_common.c. Yes, it's
very unlikely that this will be altered while panic() is running and
the consequences will be slight anyway.
But formally, we shouldn't do this, especially in a -stable
backportable patch. So please, let's have the minimal bugfix for now
and we can look at removing that local at a later time?
next prev parent reply other threads:[~2023-02-26 5:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 20:35 [PATCH v4] panic: Fixes the panic_print NMI backtrace setting Guilherme G. Piccoli
2023-02-14 14:46 ` Petr Mladek
2023-02-15 15:39 ` Guilherme G. Piccoli
2023-02-26 5:44 ` Andrew Morton [this message]
2023-02-26 16:11 ` 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=20230225214454.5eb25ff8a937a99d357c44ad@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=d.hatayama@jp.fujitsu.com \
--cc=dyoung@redhat.com \
--cc=feng.tang@intel.com \
--cc=gpiccoli@igalia.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=keescook@chromium.org \
--cc=kernel-dev@igalia.com \
--cc=kernel@gpiccoli.net \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=pmladek@suse.com \
--cc=stable@vger.kernel.org \
--cc=vgoyal@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