Re: [PATCH] printk: stop spining waiter when console resume to flush prb

From: Sergey Senozhatsky
Date: Mon May 10 2021 - 08:51:56 EST


On (21/05/10 11:50), Petr Mladek wrote:
[..]
> The only problem is that it becomes the console_owner too late.
> It spends long time by flushing the accumulated messages. But
> they are its own messages after all.
>
> The only real solution is to pass the console work to a separate
> kthread and do not block any printk() caller.

Yeah, but even that thing is getting complex fairly quickly.
wake_up_process() queues kthread on the same CPU, so if the
printk() (ab)-user is in atomic context then printing kthread
won't get scheduled.