Re: [PATCH printk v3 11/19] printk: nbcon: Rely on kthreads for normal operation

From: John Ogness
Date: Wed Jul 31 2024 - 11:25:18 EST


On 2024-07-31, Petr Mladek <pmladek@xxxxxxxx> wrote:
>> @@ -4102,8 +4139,10 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre
>> * that they make forward progress, so only increment
>> * @diff for usable consoles.
>> */
>> - if (!console_is_usable(c, flags, true))
>> + if (!console_is_usable(c, flags, true) &&
>> + !console_is_usable(c, flags, false)) {
>
> This looks weird. nbcon console can't make progress when
> "write_atomic" is not implemented and the kthreads are not
> running.
>
> I should be:
>
> if (!((console_is_usable(c, flags, true)) ||
> (console_is_usable(c, flags, false) && printk_kthreads_running))) {

I would prefer to have the printk_kthreads_running check within
console_is_usable() for the !use_atomic case.

> That said. Do we really want to support nbcon consoles without
> @write_atomic() callback?

We must. Graphic consoles will not be able to implement
write_atomic(). Network and USB consoles probably will not be able to
implement it either.

John