Re: [PATCH v2 3/3] printk: Use console_flush_one_record for legacy printer kthread
From: John Ogness
Date: Tue Sep 30 2025 - 09:03:50 EST
On 2025-09-27, Andrew Murray <amurray@xxxxxxxxxxxxxxxxxxxx> wrote:
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index e2c1cacdb4164489c60fe38f1e2837eb838107d6..2c9b9383df76de956a05211537264fd6e06366da 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -3668,17 +3668,29 @@ static bool legacy_kthread_should_wakeup(void)
>
> static int legacy_kthread_func(void *unused)
> {
> - for (;;) {
> - wait_event_interruptible(legacy_wait, legacy_kthread_should_wakeup());
> + bool any_progress;
> +
> +wait_for_event:
> + wait_event_interruptible(legacy_wait,
> + legacy_kthread_should_wakeup());
> +
> + do {
> + bool any_usable;
> + bool handover = false;
> + u64 next_seq;
Please sort by length. It looks nicer. ;-)
bool handover = false;
bool any_usable;
u64 next_seq;
Note that it is fine that @any_usable is not initialized here because
legacy_kthread_func() does not actually care about this variable.
John