Re: [PATCH printk v4 08/17] printk: nbcon: Use thread callback if in task context for legacy

From: Petr Mladek
Date: Tue Aug 27 2024 - 11:09:49 EST


On Tue 2024-08-27 06:49:24, John Ogness wrote:
> When printing via console_lock, the write_atomic() callback is
> used for nbcon consoles. However, if it is known that the
> current context is a task context, the write_thread() callback
> can be used instead.
>
> Using write_thread() instead of write_atomic() helps to reduce
> large disabled preemption regions when the device_lock does not
> disable preemption.
>
> This is mainly a preparatory change to allow avoiding
> write_atomic() completely during normal operation if boot
> consoles are registered.
>
> As a side-effect, it also allows consolidating the printing
> code for legacy printing and the kthread printer.
>
> Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

Best Regards,
Petr