From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
linux-kernel@vger.kernel.org, bhe@redhat.com, pmladek@suse.com,
akpm@linux-foundation.org, anton@enomsg.org, ccross@android.com,
dyoung@redhat.com, feng.tang@intel.com,
john.ogness@linutronix.de, keescook@chromium.org,
kernel@gpiccoli.net, kexec@lists.infradead.org,
rostedt@goodmis.org, tony.luck@intel.com, vgoyal@redhat.com
Subject: Re: [PATCH V6] panic: Move panic_print before kmsg dumpers
Date: Thu, 24 Feb 2022 11:52:46 +0900 [thread overview]
Message-ID: <Yhby/n4P+E15zjKj@google.com> (raw)
In-Reply-To: <5eeba935-d73a-5539-4eb1-298fb6ee0578@igalia.com>
Hi,
On (22/02/23 10:15), Guilherme G. Piccoli wrote:
> On 22/02/2022 22:27, Sergey Senozhatsky wrote:
> > [...]
> > Hmm. Yeah, well, that's a bit of a tricky interface now
> >
> > panic()
> > // everything (if corresponding bits set), no console flush
> > panic_print_sys_info(false)
> > ...
> > // console flush only if corresponding bit set
> > panic_print_sys_info(true)
> >
> >
> >
> > If everyone is fine then OK.
> >
> > But I _personally_ would look into changing this to something like this:
> >
> > #define EARLY_PANIC_MASK (PANIC_PRINT_FOO | PANIC_PRINT_BAR | ...)
> > #define LATE_PANIC_MASK (PANIC_PRINT_ALL_PRINTK_MSG)
> > panic()
> > panic_print_sys_info(panic_print & EARLY_PANIC_MASK)
> > ...
> > panic_print_sys_info(panic_print & LATE_PANIC_MASK)
>
> Hi Sergey, notice that panic_print_sys_info() currently doesn't have a
> parameter! The prototype (without this patch) is:
Correct.
> static void panic_print_sys_info(void);
>
> So, it consumes the "panic_print" global variable (which matches the
> command-line parameter / sysctl), hence to implement your suggestion
> either we need a refactor in panic_print_sys_info(), adding a parameter
Correct. That's the idea. Since you are already adding a parameter,
what I'm talking is turning that parameter from true/false to something
more verbose.
> (more or less what the patch is already doing, but with a bit more
> changes) or we override the global variable twice in panic(), before the
> function calls.
We don't need to overwrite the global var. We pass "permitted bits at
this stage of panic" mask to panic_print_sys_info(). The global var
stays intact.
> As you said, it's possible and a matter of personal coding style. I'd be
> fine if more people ask that, but if everyone is fine with the current
> implementation, I'd rather get this patch merged as is, since we need it
> and couldn't even make it for 5.17 heh
Sure, works for me.
next prev parent reply other threads:[~2022-02-24 2:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 14:13 [PATCH V6] panic: Move panic_print before kmsg dumpers Guilherme G. Piccoli
2022-02-15 16:14 ` Petr Mladek
2022-02-23 11:41 ` Sergey Senozhatsky
2022-02-23 12:30 ` Guilherme G. Piccoli
2022-02-22 1:45 ` Sergey Senozhatsky
2022-02-22 14:08 ` Guilherme G. Piccoli
2022-02-23 1:35 ` Sergey Senozhatsky
2022-02-22 2:06 ` Sergey Senozhatsky
2022-02-22 2:10 ` Sergey Senozhatsky
2022-02-22 14:10 ` Guilherme G. Piccoli
2022-02-23 1:27 ` Sergey Senozhatsky
2022-02-23 13:15 ` Guilherme G. Piccoli
2022-02-24 2:52 ` Sergey Senozhatsky [this message]
2022-02-24 14:33 ` Petr Mladek
2022-02-24 14:45 ` Guilherme G. Piccoli
2022-02-25 5:18 ` Sergey Senozhatsky
2022-02-25 5:23 ` Sergey Senozhatsky
2022-02-25 12:16 ` Petr Mladek
2022-02-26 2:23 ` Sergey Senozhatsky
2022-02-28 12:33 ` 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=Yhby/n4P+E15zjKj@google.com \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=anton@enomsg.org \
--cc=bhe@redhat.com \
--cc=ccross@android.com \
--cc=dyoung@redhat.com \
--cc=feng.tang@intel.com \
--cc=gpiccoli@igalia.com \
--cc=john.ogness@linutronix.de \
--cc=keescook@chromium.org \
--cc=kernel@gpiccoli.net \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=tony.luck@intel.com \
--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