lkml.org 
[lkml]   [2018]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 1/3] printk: Add line-buffered printk() API.
From
Date
On 2018/11/12 16:59, Sergey Senozhatsky wrote:
> Tetsuo, lockdep report with buffered printks looks a bit different:
>
> kernel: Possible unsafe locking scenario:
> kernel: CPU0 CPU1
> kernel: ---- ----
> kernel: lock(bar_lock);
> kernel: lock(
> kernel: foo_lock);
> kernel: lock(bar_lock);
> kernel: lock(foo_lock);
> kernel:
>

Yes. That is because vprintk_buffered() eliminated KERN_CONT.
Since there was pending partial printk() output, vprintk_buffered()
should not eliminate KERN_CONT. Petr Mladek commented

1. The mixing of normal and buffered printk calls is a bit confusing
and error prone. It would make sense to use the buffered printk
everywhere in the given section of code even when it is not
strictly needed.

and I made a draft version for how the code would look like if we try to
avoid the mixing of normal and buffered printk calls. The required changes
seem to be too large to apply tree wide. And I suggested try_buffered_printk().

\
 
 \ /
  Last update: 2018-11-12 11:42    [W:0.141 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site