Re: [PATCH 2/2] printk: make sure to print log on console.

2018-06-01 Thread Sergey Senozhatsky
On (06/01/18 11:09), Petr Mladek wrote: > > [...] > > > > > So I'd say that most likely the following scenarios can suffer: > > > > > > - NMI comes in, sets loglevel to X, printk-s some data, restores the > > > loglevel back to Y > > > - IRQ comes in [like sysrq, etc] comes in and does the same

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-06-01 Thread Sergey Senozhatsky
Hello, On (06/01/18 14:12), Vaneet Narang wrote: > > CPU0CPU1 > > > > set console verbose > > > > dump_backtrace() > > { > > // for (;;) print frames > > printk("%pS\n", frame0); > > printk("%pS\n", frame1); > > printk("%pS\n", frame2); > > printk("%pS\n", frame3)

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-06-01 Thread Sergey Senozhatsky
On (06/01/18 10:53), Petr Mladek wrote: > [...] > > > So I'd say that most likely the following scenarios can suffer: > > > > - NMI comes in, sets loglevel to X, printk-s some data, restores the > > loglevel back to Y > > - IRQ comes in [like sysrq, etc] comes in and does the same thing > > - s

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-06-01 Thread Petr Mladek
On Fri 2018-06-01 10:53:56, Petr Mladek wrote: > On Fri 2018-06-01 13:40:50, Sergey Senozhatsky wrote: > > On (05/31/18 14:21), Petr Mladek wrote: > > > > > > > > Upstream printk has no printing kthread. And we also run > > > > printk()->console_unlock() with disabled preemption. > > > > > > Yes,

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-06-01 Thread Petr Mladek
On Fri 2018-06-01 13:40:50, Sergey Senozhatsky wrote: > On (05/31/18 14:21), Petr Mladek wrote: > > > > > > Upstream printk has no printing kthread. And we also run > > > printk()->console_unlock() with disabled preemption. > > > > Yes, the comment was wrong > > Yes, that was the only thing I me

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-06-01 Thread Vaneet Narang
Hi Sergey, >> but the problem is real. > >Yep, could be. But not exactly the way it is described in the commit >messages and the patch does not fully address the problem. > >The patch assumes that all those events happen sequentially. While >in reality they can happen in parallel on different CPUs

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-05-31 Thread Sergey Senozhatsky
On (05/31/18 14:21), Petr Mladek wrote: > > > > Upstream printk has no printing kthread. And we also run > > printk()->console_unlock() with disabled preemption. > > Yes, the comment was wrong Yes, that was the only thing I meant. I really didn't have any time to look at the patch yesterday, jus

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-05-31 Thread Petr Mladek
On Thu 2018-05-31 15:49:11, Maninder Singh wrote: > This patch make sure printing of log if loglevel at time of storing > log is greater than current console loglevel. > > @why > In case of async printk, printk thread can miss logs because it checks > current log level at time of console_unlock. >

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-05-31 Thread Petr Mladek
On Thu 2018-05-31 19:52:15, Sergey Senozhatsky wrote: > On (05/31/18 15:49), Maninder Singh wrote: > > > > This patch make sure printing of log if loglevel at time of storing > > log is greater than current console loglevel. > > > > @why > > In case of async printk, printk thread can miss logs be

Re: [PATCH 2/2] printk: make sure to print log on console.

2018-05-31 Thread Sergey Senozhatsky
On (05/31/18 15:49), Maninder Singh wrote: > > This patch make sure printing of log if loglevel at time of storing > log is greater than current console loglevel. > > @why > In case of async printk, printk thread can miss logs because it checks > current log level at time of console_unlock. Upst

[PATCH 2/2] printk: make sure to print log on console.

2018-05-31 Thread Maninder Singh
This patch make sure printing of log if loglevel at time of storing log is greater than current console loglevel. @why In case of async printk, printk thread can miss logs because it checks current log level at time of console_unlock. func() { console_verbose(); // user wants t