Re: [RFC][PATCH v9 1/2] printk: Make printk() completely async

From: Sergey Senozhatsky
Date: Fri Apr 01 2016 - 12:41:33 EST


On (04/01/16 17:00), Petr Mladek wrote:
> You need to move this assigment right above the console_lock()/console_unlock()
> calls. Otherwise, there is a race:
>
> CPU0: CPU1
>
> printk_kthread_func()
>
> console_unlock()
>
> printk()
>
> printk_kthread_need_flush_console = true;
> wake_up_process(printk_kthread);
>
> printk_kthread_need_flush_console = false;
>
> set_current_state(TASK_INTERRUPTIBLE);
> if (!printk_kthread_need_flush_console)
> schedule();

thanks. yeah, this can add latency to some messages.

-ss