[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <844is9pdxw.fsf@jogness.linutronix.de>
Date: Wed, 08 Oct 2025 18:21:39 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Petr Mladek <pmladek@...e.com>, Andrew Murray
<amurray@...goodpenguin.co.uk>
Cc: Steven Rostedt <rostedt@...dmis.org>, Sergey Senozhatsky
<senozhatsky@...omium.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] printk: Use console_flush_one_record for legacy
printer kthread
On 2025-10-03, Petr Mladek <pmladek@...e.com> wrote:
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 6c846d2d37d9..885506fa0178 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -3644,17 +3644,27 @@ 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 try_again;
> +
> +wait_for_event:
> + wait_event_interruptible(legacy_wait,
> + legacy_kthread_should_wakeup());
This should be on one line. Even with an 80-character limit it would
fit. ;-)
> +
> + do {
> + bool handover = false;
> + u64 next_seq;
Even though legacy_kthread_func() does not care, @next_seq should be
initialized to something since console_flush_one_record() reads this
value to decide if it should be increased. It really doesn't matter what
it is initialized to, but I guess 0 makes the most sense.
John
Powered by blists - more mailing lists