linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lance Yang <lance.yang@linux.dev>
To: Feng Tang <feng.tang@linux.alibaba.com>
Cc: paulmck@kernel.org, john.ogness@linutronix.de,
	Petr Mladek <pmladek@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH V2 5/5] panic: add note that panic_print interface is deprecated
Date: Mon, 16 Jun 2025 09:45:16 +0800	[thread overview]
Message-ID: <0088c3f5-d2a0-48c4-b69a-fb385c527b32@linux.dev> (raw)
In-Reply-To: <20250616010840.38258-6-feng.tang@linux.alibaba.com>



On 2025/6/16 09:08, Feng Tang wrote:
> Long term wise, the 'panic_sys_info' should be the only controlling
> interface, which can be referred by other modules.
> 
> Suggested-by: Petr Mladek <pmladek@suse.com>
> Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
> ---
>   kernel/panic.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/panic.c b/kernel/panic.c
> index ea238f7d4b54..e8a05fc6b733 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -76,6 +76,13 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
>   EXPORT_SYMBOL(panic_notifier_list);
>   
>   #ifdef CONFIG_SYSCTL
> +static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
> +			   void *buffer, size_t *lenp, loff_t *ppos)
> +{
> +	printk_once("panic: 'panic_print' sysctl interface will be obsoleted by 'panic_sys_info' interface.\n");

Hmm... I would get scared for a second when I read messages prefixed 
with "panic:"
from dmesg. That prefix should have a very specific meaning ;)

Well, we can just change the prefix to something more neutral:

printk_once("Kernel: 'panic_print' sysctl interface will be obsoleted by 
'panic_sys_info' interface.\n");

Thanks,
Lance

> +	return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
> +}
> +
>   static const struct ctl_table kern_panic_table[] = {
>   #ifdef CONFIG_SMP
>   	{
> @@ -107,7 +114,7 @@ static const struct ctl_table kern_panic_table[] = {
>   		.data		= &panic_print,
>   		.maxlen		= sizeof(unsigned long),
>   		.mode		= 0644,
> -		.proc_handler	= proc_doulongvec_minmax,
> +		.proc_handler	= sysctl_panic_print_handler,
>   	},
>   	{
>   		.procname	= "panic_on_warn",


  reply	other threads:[~2025-06-16  1:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  1:08 [PATCH V2 0/5] generalize panic_print's dump function to be used by other kernel parts Feng Tang
2025-06-16  1:08 ` [PATCH V2 1/5] panic: clean up code for console replay Feng Tang
2025-06-20 14:19   ` Petr Mladek
2025-06-16  1:08 ` [PATCH V2 2/5] panic: generalize panic_print's function to show sys info Feng Tang
2025-06-20 15:21   ` Petr Mladek
2025-06-23  3:07     ` Feng Tang
2025-06-16  1:08 ` [PATCH V2 3/5] sys_info: add help to translate sys_info string to bitmap Feng Tang
2025-06-16  4:25   ` kernel test robot
2025-06-16 15:08     ` Feng Tang
2025-06-23 14:04   ` Petr Mladek
2025-06-24  1:48     ` Feng Tang
2025-06-16  1:08 ` [PATCH V2 4/5] panic: add 'panic_sys_info=' setup option for sysctl and kernel cmdline Feng Tang
2025-06-23 15:04   ` Petr Mladek
2025-06-24  1:55     ` Feng Tang
2025-06-16  1:08 ` [PATCH V2 5/5] panic: add note that panic_print interface is deprecated Feng Tang
2025-06-16  1:45   ` Lance Yang [this message]
2025-06-16  2:39     ` Feng Tang
2025-06-23 15:13     ` Petr Mladek
2025-06-23 15:22   ` Petr Mladek
2025-06-24  1:58     ` Feng Tang
2025-06-25  9:30     ` Feng Tang

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=0088c3f5-d2a0-48c4-b69a-fb385c527b32@linux.dev \
    --to=lance.yang@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=feng.tang@linux.alibaba.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.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).