From: Baoquan He <bhe@redhat.com>
To: kexec@lists.infradead.org
Subject: [PATCH V3] panic: Move panic_print before kmsg dumpers
Date: Wed, 26 Jan 2022 11:29:19 +0800 [thread overview]
Message-ID: <20220126032919.GB2086@MiWiFi-R3L-srv> (raw)
In-Reply-To: <ed18ba1e-4792-22c5-3ece-4d518a8a4a2d@igalia.com>
On 01/22/22 at 10:49am, Guilherme G. Piccoli wrote:
> On 22/01/2022 07:31, Baoquan He wrote:
> > [...]
> > From my old POV, I took pstore as a necessity on handheld devices or
> > embeded system, e.g on Andriod. In that case, reserving crashkernel
> > memory to enable kdump to save kernel log, it sounds not so
> > cost-effective, since memory on those systems is usually not big.
> > I am also interested in any new use case where people deploy these
> > and why it's needed, to widen my view.
>
> Hi Baoquan, that's great to hear. Indeed, I feel pstore is unfortunately
> not very used in non-embedded devices - if you see kdump/error-report
> userspace tooling, like on Red Hat/Fedora, Debian/Ubuntu and so on, they
> never rely on pstore. And the configuration is not straightforward for
> the users...I think that's a good thing to change, since pstore is much
> less resource consuming than kdump.
> But of course, not a discussion related to this patch specifically, just
> me thinking out loud heh
>
>
> > [...]
> > It's my bad. My thought is panic_print and kmsg_dump can be coupled, but
> > they should decouple with panic_notifier. When panic_print is enabled,
> > we do not expect to execute panic_notifier? My personal opinion.
> >
> > I missed the change at line 8, sorry for the caused misunderstanding.
> > Now the chance of holding C-programmer-prize of the year comes back
> > again.
> >
> > void panic()
> > {
> > 1 if (!_crash_kexec_post_notifiers && !panic_print) {
> > 2 __crash_kexec(NULL);
> > 3 smp_send_stop();
> > 4 } else {
> > 5 crash_smp_send_stop();
> > 6 }
> >
> > if (_crash_kexec_post_notifiers)
> > 8 atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
> > 9 panic_print_sys_info(false);
> > 10 kmsg_dump(KMSG_DUMP_PANIC);
> > 11 if (_crash_kexec_post_notifiers || panic_print)
> > 12 __crash_kexec(NULL);
> > ...
> > debug_locks_off();
> > console_flush_on_panic(CONSOLE_FLUSH_PENDING);
> > panic_print_sys_info(true);
>
> Hmm, yeah, I still don't think I'm a brilliant C programmer heh
> Again, in the code above, I can't see how we would reach
> "__crash_kexec(NULL)" after printing the extra info of panic_print, if
> we don't have panic notifiers enabled.
Missed this one.
Above code will allow any of _crash_kexec_post_notifiers and panic_print
to execute, then crash dump in L11.
L5 -> L11
Since you have posted v4, let's ignore it anyway.
>
> So, indeed the code currently don't really tightly couple "panic_print"
> with the panic notifiers. We could change that in another patch series,
> based on what Petr suggested in the filter thread (I know you're
> following there as well, thanks bu the way!), but for now, they are
> completely independent. My plan, following Petr suggestions here and if
> you agree, is to re-submit this patch with some changes, but in the end
> the code will allow users that have kdump enabled + panic_print
> -"crash_kexec_post_notifiers" to have "panic_print_sys_info(false)"
> executing before the "__crash_kexec(NULL)".
>
> But also, we can add "crash_kexec_post_notifiers" and it will still
> work; finally, pstore is gonna be able to collect the logs from
> "panic_print" as well (the main purpose of this patch).
>
> Once that's all resolved, my goal is to jump into the panic notifiers
> refactor suggested in the other thread. Let me know if you agree with
> these steps/plans, and I'll work them.
I am glad to see any improvement from refactory. As for panic_notifier,
I have expressed my concern and worry about the plan. So, if no any
new action added before kdump switching, it's welcomed.
next prev parent reply other threads:[~2022-01-26 3:29 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-14 18:30 [PATCH V3] panic: Move panic_print before kmsg dumpers Guilherme G. Piccoli
2022-01-17 3:33 ` Baoquan He
2022-01-17 6:13 ` Baoquan He
2022-01-17 12:58 ` Guilherme G. Piccoli
2022-01-19 7:13 ` Baoquan He
2022-01-19 12:57 ` Guilherme G. Piccoli
2022-01-19 15:48 ` Petr Mladek
2022-01-19 16:03 ` Guilherme G. Piccoli
2022-01-20 9:39 ` Petr Mladek
2022-01-20 15:51 ` Guilherme G. Piccoli
2022-01-20 8:51 ` Baoquan He
2022-01-20 21:36 ` Guilherme G. Piccoli
2022-01-21 2:31 ` Baoquan He
2022-01-21 13:17 ` Guilherme G. Piccoli
2022-01-22 10:31 ` Baoquan He
2022-01-22 13:49 ` Guilherme G. Piccoli
2022-01-26 3:29 ` Baoquan He [this message]
2022-01-21 15:00 ` Michael Kelley
2022-01-22 4:33 ` Baoquan He
2022-01-24 16:57 ` Michael Kelley
2022-01-26 11:51 ` Petr Mladek
2022-01-29 8:00 ` Baoquan He
2022-02-02 17:43 ` Michael Kelley
2022-02-07 8:33 ` Baoquan He
2022-01-28 9:03 ` Baoquan He
2022-01-28 18:24 ` Michael Kelley
2022-01-29 7:42 ` Baoquan He
2022-01-19 18:38 ` Petr Mladek
2022-01-19 19: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=20220126032919.GB2086@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=kexec@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).