From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Andrew Murray <amurray@thegoodpenguin.co.uk>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] printk: Use console_flush_one_record for legacy printer kthread
Date: Tue, 23 Sep 2025 16:22:44 +0200 [thread overview]
Message-ID: <aNKtNP-B3a0UAjHl@pathway.suse.cz> (raw)
In-Reply-To: <845xdak47j.fsf@jogness.linutronix.de>
On Mon 2025-09-22 15:33:12, John Ogness wrote:
> On 2025-09-19, Andrew Murray <amurray@thegoodpenguin.co.uk> wrote:
> >> I played with the code and came up with:
> >>
> >> static int legacy_kthread_func(void *unused)
> >> {
> >> bool any_progress;
> >>
> >> wait_for_event:
> >> wait_event_interruptible(legacy_wait, legacy_kthread_should_wakeup());
> >>
> >> do {
> >> bool any_usable;
> >> bool handover;
> >> u64 next_seq;
> >>
> >> if (kthread_should_stop())
> >> return 0;
> >
> > This changes the behaviour from the existing legacy_kthread_func. Thus
> > allowing the thread to exit mid way through printing remaining
> > records, whereas previously the whole set of unprinted records would
> > first be printed. But that's probably a good thing.
Good catch! I admit that I just copied this from nbcon_kthread_func()
and it looked reasonable.
> It does not matter. kthread_should_stop() will only return true from
> printk_kthreads_check_locked() when @have_legacy_console and
> @have_boot_console are both false. That means that whatever legacy or
> boot consoles there were, they are now unregistered, and were already
> flushed from within their unregister_console_locked().
Yup. I would keep it in the do/while loop to keep it consistent with
the nbcon kthread.
Best Regards,
Petr
next prev parent reply other threads:[~2025-09-23 14:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-15 12:43 [PATCH RFC 0/2] printk: Release console_lock between printing records in legacy thread Andrew Murray
2025-09-15 12:43 ` [PATCH RFC 1/2] printk: Introduce console_flush_one_record Andrew Murray
2025-09-18 15:22 ` Petr Mladek
2025-09-19 13:06 ` Andrew Murray
2025-09-23 13:30 ` Petr Mladek
2025-09-27 11:10 ` Andrew Murray
2025-09-15 12:43 ` [PATCH RFC 2/2] printk: Use console_flush_one_record for legacy printer kthread Andrew Murray
2025-09-18 16:27 ` Petr Mladek
2025-09-19 13:38 ` Andrew Murray
2025-09-22 13:27 ` John Ogness
2025-09-23 14:22 ` Petr Mladek [this message]
2025-09-27 12:10 ` Andrew Murray
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=aNKtNP-B3a0UAjHl@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=amurray@thegoodpenguin.co.uk \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--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®