Re: [PATCH v6 1/3] printk: Add line-buffered printk() API.
From: Petr Mladek
Date: Wed Nov 07 2018 - 06:45:26 EST
On Wed 2018-11-07 19:52:53, Tetsuo Handa wrote:
> On 2018/11/06 23:35, Sergey Senozhatsky wrote:
> > - Do not allocate seq_buf if we are in printk-safe or in printk-nmi mode.
> > To avoid "buffering for the sake of buffering". IOW, when in printk-safe
> > use printk-safe.
>
> Why? Since printk_safe_flush_buffer() forcibly flushes the partial line,
> calling printk_safe_log_store() after line buffering can reduce possibility of
> flushing partial lines, can't it?
Good point.
Well, printk_safe buffers are flushed via irqwork scheduled on the
same CPU. It might get flushed prematurely from other CPU but
I am not sure if this risk is worth the double buffering.
Best Regards,
Petr