From: Baoquan He <bhe@redhat.com>
To: "d.hatayama@fujitsu.com" <d.hatayama@fujitsu.com>
Cc: "Guilherme G. Piccoli" <gpiccoli@igalia.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Petr Mladek <pmladek@suse.com>,
"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dyoung@redhat.com" <dyoung@redhat.com>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"vgoyal@redhat.com" <vgoyal@redhat.com>,
"stern@rowland.harvard.edu" <stern@rowland.harvard.edu>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>,
"corbet@lwn.net" <corbet@lwn.net>,
"halves@canonical.com" <halves@canonical.com>,
"kernel@gpiccoli.net" <kernel@gpiccoli.net>,
Will Deacon <will@kernel.org>, Kees Cook <keescook@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
John Ogness <john.ogness@linutronix.de>,
"Paul E. McKenney" <paulmck@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Juergen Gross <jgross@suse.com>,
"mikelley@microsoft.com" <mikelley@microsoft.com>
Subject: Re: [PATCH V4] notifier/panic: Introduce panic_notifier_filter
Date: Mon, 24 Jan 2022 22:15:39 +0800 [thread overview]
Message-ID: <20220124141539.GC8305@MiWiFi-R3L-srv> (raw)
In-Reply-To: <TYAPR01MB650732FAB4E24D839DFF9EFD955E9@TYAPR01MB6507.jpnprd01.prod.outlook.com>
On 01/24/22 at 11:43am, d.hatayama@fujitsu.com wrote:
>
> > On 01/21/22 at 05:31pm, Guilherme G. Piccoli wrote:
> > ......
> > > > IMHO, the right solution is to split the callbacks into 2 or more
> > > > notifier list. Then we might rework panic() to do:
> > > >
> > > > void panic(void)
> > > > {
> > > > [...]
> > > >
> > > > /* stop watchdogs + extra info */
> > > > atomic_notifier_call_chain(&panic_disable_watchdogs_notifier_list, 0, buf);
> > > > atomic_notifier_call_chain(&panic_info_notifier_list, 0, buf);
> > > > panic_print_sys_info();
> > > >
> > > > /* crash_kexec + kmsg_dump in configurable order */
> > > > if (!_crash_kexec_post_kmsg_dump) {
> > > > __crash_kexec(NULL);
> > > > smp_send_stop();
> > > > } else {
> > > > crash_smp_send_stop();
> > > > }
> > > >
> > > > kmsg_dump();
> > > > if (_crash_kexec_post_kmsg_dump)
> > > > __crash_kexec(NULL);
> > > >
> > > > /* infinite loop or reboot */
> > > > atomic_notifier_call_chain(&panic_hypervisor_notifier_list, 0, buf);
> > > > atomic_notifier_call_chain(&panic_rest_notifier_list, 0, buf);
> > > >
> > > > console_flush_on_panic(CONSOLE_FLUSH_PENDING);
> > > > [...]
> > > > Two notifier lists might be enough in the above scenario. I would call
> > > > them:
> > > >
> > > > panic_pre_dump_notifier_list
> > > > panic_post_dump_notifier_list
> > > >
> > > >
> > > > It is a real solution that will help everyone. It is more complicated now
> > > > but it will makes things much easier in the long term. And it might be done
> > > > step by step:
> > > >
> > > > 1. introduce the two notifier lists
> > > > 2. convert all users: one by one
> > > > 3. remove the original notifier list when there is no user
> > >
> > > That's a great idea! I'm into it, if we have a consensus. The thing that
> > > scares me most here is that this is a big change and consumes time to
> > > implement - I'd not risk such time if somebody is really against that.
> > > So, let's see more opinions, maybe the kdump maintainers have good input.
> >
> > I am fine with it. As long as thing is made clear, glad to see code is
> > refactored to be more understandable and improved. Earlier, during several
> > rounds of discussion between you and Petr, seveal pitfalls have been
> > pointed out and avoided.
> >
> > Meanwhile, I would suggest Masa and HATAYAMA to help give input about
> > panic_notifier usage and refactory. AFAIK, they contributed code and use
> > panic_notifier in their product or environment a lot, that will be very
> > helpful to get the first hand information from them.
> >
> > Hi Masa, HATAYANA,
> >
> > Any comment on this? (Please ignore this if it's not in your care.)
> >
>
> Thanks for CCing to me. I like this patch set. I have same motivation.
>
> For example, when I used crash_kexec_post_notifiers, I sometimes ran into
> deadlock in printk's exclusion logic during the call of panic notifiers since
> kaslr outputs kernel offset at panic by dump_kernel_offset() via panic notifers
> (although this might never happen now thanks to lockless implementation).
>
> The problem is that in the current design, we have to run all the
> tasks registered, although most of them are actually unnecessary for
> other users' requirements. Each user wants to call only their own handlers
> in order to keep kdump as reliable as possible.
If I unerstand you correclty, you are expressing your favour to the
panic_notifier filter this patch adds. I personally like it very much
either because I know users only expect to run those one or several
handlers they added or cared about, from discussing reported cases
realted to them, just as you said.
Now comments to patch lean to split and classify the current panic
notifiers list into two or several sub-lists and execute them in
different order. I think this improvement will benefit people who
defaults to execute all panic notifiers, while the panic notifier
fileter is also very helpful if can be added.
Hope I got you right, HATAYAMA. And thanks a lot for your quick
response.
next prev parent reply other threads:[~2022-01-24 14:15 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-08 15:34 [PATCH V4] notifier/panic: Introduce panic_notifier_filter Guilherme G. Piccoli
2022-01-14 19:03 ` Guilherme G. Piccoli
[not found] ` <CALu+AoR+GrCpf0gqsx_XYETBGUAfRyP+SPNarK179hT7iQmCqQ@mail.gmail.com>
2022-01-18 13:22 ` Guilherme G. Piccoli
2022-01-16 13:11 ` Baoquan He
2022-01-17 12:59 ` Guilherme G. Piccoli
2022-01-20 15:14 ` Petr Mladek
2022-01-21 20:31 ` Guilherme G. Piccoli
2022-01-22 10:55 ` Baoquan He
2022-01-23 13:07 ` Masami Hiramatsu
2022-01-24 13:59 ` Baoquan He
2022-01-24 14:48 ` Guilherme G. Piccoli
2022-01-26 3:10 ` Baoquan He
2022-01-26 12:20 ` d.hatayama
2022-01-26 13:20 ` Petr Mladek
2022-01-30 8:50 ` Baoquan He
2022-01-24 11:43 ` d.hatayama
2022-01-24 14:15 ` Baoquan He [this message]
2022-01-25 11:50 ` d.hatayama
2022-01-25 12:34 ` Guilherme G. Piccoli
2022-01-25 13:06 ` d.hatayama
2022-01-27 17:16 ` Guilherme G. Piccoli
2022-01-28 13:38 ` Petr Mladek
2022-02-08 18:51 ` Guilherme G. Piccoli
2022-02-09 0:31 ` bhe
2022-02-10 16:39 ` Guilherme G. Piccoli
2022-02-10 17:26 ` Michael Kelley (LINUX)
2022-02-10 17:50 ` Guilherme G. Piccoli
2022-03-06 14:21 ` Guilherme G. Piccoli
2022-03-07 3:42 ` bhe
2022-03-07 13:11 ` Guilherme G. Piccoli
2022-03-07 14:04 ` bhe
2022-03-07 14:25 ` Guilherme G. Piccoli
2022-03-08 12:54 ` Petr Mladek
2022-03-08 13:04 ` 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=20220124141539.GC8305@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=corbet@lwn.net \
--cc=d.hatayama@fujitsu.com \
--cc=dyoung@redhat.com \
--cc=gpiccoli@igalia.com \
--cc=halves@canonical.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=jgross@suse.com \
--cc=john.ogness@linutronix.de \
--cc=keescook@chromium.org \
--cc=kernel@gpiccoli.net \
--cc=kexec@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mikelley@microsoft.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=stern@rowland.harvard.edu \
--cc=vgoyal@redhat.com \
--cc=vkuznets@redhat.com \
--cc=will@kernel.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).