[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aNKtNP-B3a0UAjHl@pathway.suse.cz>
Date: Tue, 23 Sep 2025 16:22:44 +0200
From: Petr Mladek <pmladek@...e.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Andrew Murray <amurray@...goodpenguin.co.uk>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 2/2] printk: Use console_flush_one_record for legacy
printer kthread
On Mon 2025-09-22 15:33:12, John Ogness wrote:
> On 2025-09-19, Andrew Murray <amurray@...goodpenguin.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
Powered by blists - more mailing lists