mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Breno Leitao <leitao@debian.org>
Cc: Mike Galbraith <efault@gmx.de>, Simon Horman <horms@kernel.org>,
	kuba@kernel.org, calvin@wbinvd.org,
	Pavel Begunkov <asml.silence@gmail.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	paulmck@kernel.org, LKML <linux-kernel@vger.kernel.org>,
	netdev@vger.kernel.org, boqun.feng@gmail.com,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: netconsole: HARDIRQ-safe -> HARDIRQ-unsafe lock order warning
Date: Thu, 11 Sep 2025 15:19:53 +0206	[thread overview]
Message-ID: <84ecsdxhbi.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <cbvfyefqdyy6py2fswqp3licm3ynrsmc3jclgnbubp72elmai7@kwvks5yhkybc>

On 2025-09-10, Breno Leitao <leitao@debian.org> wrote:
>> d) Not implementing ->write_atomic() and instead implement a kmsg_dumper
>>    for netconsole. This registers a callback that is called during
>>    panic.
>> 
>>    Con: The kmsg_dumper interface has nothing to do with consoles, so it
>>         would require some effort coordinating with the console drivers.
>
> I am looking at kmsg_dumper interface, and it doesn't have the buffers
> that need to be dumper.
>
> So, if I understand corect, my kmsg_dumper callback needs to handle loop
> into the messages buffer and print the remaining messages, right?

Correct.

> In other words, do I need to track what messages were sent in
> netconsole, and then iterate in the kmsgs buffer 
> to find messages that hasn't been sent, and send from there?

Yes, right now it would not even be possible to do the proper tracking
since the sequence numbers are not exposed to the console printers and
they are not part of kmsg_dump interface.

As it is right now, the kmsg_dumper would just print what is available
in the ringbuffer, even if most of the messages have already been
printed during runtime. Certainly not optimal.

>>    Pro: There is absolute freedom for the dumper to implement its own
>>         panic-only solution to get messages out.
>
> What about calls to .write_atomic() calls that are not called during
> panic? Will those be lost in this approach?

In this approach you would not implement ->write_atomic(), so there
would be no such calls. All printing would be deferred to the dedicated
printing kthread.

Anyway, it looks like we have agreed to allow unsafe ->write_atomic()
callbacks.

John

  reply	other threads:[~2025-09-11 13:13 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13  4:14 Mike Galbraith
2025-08-14 10:16 ` Breno Leitao
2025-08-14 15:45   ` Pavel Begunkov
2025-08-15  0:23   ` Jakub Kicinski
2025-08-15 10:44     ` Pavel Begunkov
2025-08-15 16:42       ` Jakub Kicinski
2025-08-15 17:29         ` Breno Leitao
2025-08-15 17:33           ` Jakub Kicinski
2025-08-18 12:23             ` Breno Leitao
2025-08-15 19:10           ` Calvin Owens
2025-08-16  9:19             ` Mike Galbraith
2025-08-15 20:02           ` Pavel Begunkov
2025-08-18 12:10             ` Breno Leitao
2025-08-19 17:27               ` Breno Leitao
2025-08-20 12:31                 ` Mike Galbraith
2025-08-20 17:36                   ` Breno Leitao
2025-08-21  3:37                     ` Mike Galbraith
2025-08-21  3:51                       ` Mike Galbraith
2025-08-21 17:35                         ` Breno Leitao
2025-08-22  3:54                           ` Mike Galbraith
2025-08-26 12:43                             ` Breno Leitao
2025-08-26 13:56                               ` Mike Galbraith
2025-09-05 12:48                               ` John Ogness
2025-09-06  2:32                                 ` Mike Galbraith
2025-09-08 13:30                                   ` John Ogness
2025-09-08 15:18                                     ` Mike Galbraith
2025-09-08 20:27                                 ` Calvin Owens
2025-09-09 15:49                                   ` Mike Galbraith
2025-09-10 15:51                                   ` Petr Mladek
2025-09-09 12:50                                 ` Breno Leitao
2025-09-10 12:22                                   ` John Ogness
2025-09-10 15:12                                     ` Petr Mladek
2025-09-10 18:26                                       ` Breno Leitao
2025-09-30 13:57                                         ` Calvin Owens
2025-09-30 14:23                                           ` John Ogness
2025-09-30 14:30                                             ` Sebastian Siewior
2025-09-30 17:35                                               ` Mike Galbraith
2025-10-01  6:00                                                 ` Mike Galbraith
2025-09-11 13:03                                       ` John Ogness
2025-09-10 18:23                                     ` Breno Leitao
2025-09-11 13:13                                       ` John Ogness [this message]
2025-08-21 10:06                       ` Mike Galbraith
2025-08-21 13:12                         ` Mike Galbraith
2025-08-15 17:37         ` Calvin Owens
2025-08-26 14:10         ` Johannes Berg
2025-08-15 12:45     ` Mike Galbraith

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=84ecsdxhbi.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=asml.silence@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=calvin@wbinvd.org \
    --cc=efault@gmx.de \
    --cc=horms@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.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

all inboxes | Powered by JetHome®