Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-11 Thread Petr Mladek
On Tue 2016-10-11 16:35:28, Sergey Senozhatsky wrote: > On (10/10/16 13:17), Petr Mladek wrote: > [..] > > > it may look that lockdep *probably* can report the issues via 'safe' > > > printk, > > > but that's a notably huge behavior breakage -- if lockdep report comes > > > from > > > an about-to

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-11 Thread Sergey Senozhatsky
On (10/10/16 13:17), Petr Mladek wrote: [..] > > it may look that lockdep *probably* can report the issues via 'safe' printk, > > but that's a notably huge behavior breakage -- if lockdep report comes from > > an about-to-deadlock irq handler, then we won't see anything from that CPU > > unless the

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-10 Thread Petr Mladek
On Mon 2016-10-10 13:09:57, Sergey Senozhatsky wrote: > On (10/06/16 13:32), Petr Mladek wrote: > > On Thu 2016-10-06 13:22:48, Sergey Senozhatsky wrote: > > > On (10/05/16 11:50), Petr Mladek wrote: > > > [..] > > > > > well, it solves a number of problems that the existing implementation > > > >

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-09 Thread Sergey Senozhatsky
On (10/06/16 13:32), Petr Mladek wrote: > On Thu 2016-10-06 13:22:48, Sergey Senozhatsky wrote: > > On (10/05/16 11:50), Petr Mladek wrote: > > [..] > > > > well, it solves a number of problems that the existing implementation > > > > cannot handle. > > > > > > Please, provide a summary. I wonder

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-06 Thread Petr Mladek
On Thu 2016-10-06 13:22:48, Sergey Senozhatsky wrote: > On (10/05/16 11:50), Petr Mladek wrote: > [..] > > > well, it solves a number of problems that the existing implementation > > > cannot handle. > > > > Please, provide a summary. I wonder if these are real life problems. > > 1) some pathces/

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-05 Thread Sergey Senozhatsky
On (10/05/16 11:50), Petr Mladek wrote: [..] > > well, it solves a number of problems that the existing implementation > > cannot handle. > > Please, provide a summary. I wonder if these are real life problems. anything that starts from printk(). I'm trying to address printk() recursion only, by

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-05 Thread Petr Mladek
On Wed 2016-10-05 10:36:57, Sergey Senozhatsky wrote: > On (10/04/16 14:22), Petr Mladek wrote: > [..] > > if (retry && console_trylock()) > > goto again; > > > > with a safe variant, something like > > > > if (retry) { > > local_irq_save(flags); > > al

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-05 Thread Petr Mladek
On Wed 2016-10-05 10:27:14, Sergey Senozhatsky wrote: > On (10/04/16 16:52), Petr Mladek wrote: > > > > > > Or is there any other catch that I do not see at the moment? > > > > And there is :-( The above logic looked at the problem only from > > one side. It was about errors starting from the pri

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-04 Thread Sergey Senozhatsky
On (10/04/16 14:22), Petr Mladek wrote: [..] > if (retry && console_trylock()) > goto again; > > with a safe variant, something like > > if (retry) { > local_irq_save(flags); > alt_printk_enter(); > lock_failed = console_trylock(

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-04 Thread Sergey Senozhatsky
On (10/04/16 16:52), Petr Mladek wrote: > > > > Or is there any other catch that I do not see at the moment? > > And there is :-( The above logic looked at the problem only from > one side. It was about errors starting from the printk() > code itself, for example: yes, like I said - printk recur

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-04 Thread Petr Mladek
On Fri 2016-09-30 13:15:46, Petr Mladek wrote: > On Fri 2016-09-30 10:15:44, Sergey Senozhatsky wrote: > > On (09/29/16 15:00), Petr Mladek wrote: > > [..] > > > > @@ -1791,7 +1791,7 @@ asmlinkage int vprintk_emit(int facility, int > > > > level, > > > > zap_locks(); > > > >

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-04 Thread Petr Mladek
On Sat 2016-10-01 11:48:29, Sergey Senozhatsky wrote: > On (09/30/16 13:15), Petr Mladek wrote: > > > do you mean that, once alt_printk is done properly, we can drop > > > printk_deferred()? I was thinking of it, but decided not to > > > mention/touch it in this patch set. > > > > My understanding

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-10-03 Thread Sergey Senozhatsky
On (09/30/16 13:15), Petr Mladek wrote: [..] > > and the decision was to keep `unsigned long flags' on stack in the > > alt_enter/exit caller. besides in most of the cases we already have > > it (in vprintk_emit() and console_unlock()). > > I would pass the pointer to flags as alt_enter() paramete

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-09-30 Thread Sergey Senozhatsky
On (09/30/16 13:15), Petr Mladek wrote: [..] > > and the decision was to keep `unsigned long flags' on stack in the > > alt_enter/exit caller. besides in most of the cases we already have > > it (in vprintk_emit() and console_unlock()). > > I would pass the pointer to flags as alt_enter() paramete

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-09-30 Thread Petr Mladek
On Fri 2016-09-30 10:15:44, Sergey Senozhatsky wrote: > On (09/29/16 15:00), Petr Mladek wrote: > [..] > > > @@ -1791,7 +1791,7 @@ asmlinkage int vprintk_emit(int facility, int level, > > > zap_locks(); > > > } > > > > > > - lockdep_off(); > > > + alt_printk_enter(); > > > > IMHO, we

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-09-29 Thread Sergey Senozhatsky
On (09/29/16 15:00), Petr Mladek wrote: [..] > > @@ -1791,7 +1791,7 @@ asmlinkage int vprintk_emit(int facility, int level, > > zap_locks(); > > } > > > > - lockdep_off(); > > + alt_printk_enter(); > > IMHO, we could not longer enter vprintk_emit() recursively. The same > sec

Re: [RFC][PATCH 6/7] printk: use alternative printk buffers

2016-09-29 Thread Petr Mladek
On Tue 2016-09-27 23:22:36, Sergey Senozhatsky wrote: > Use alt_printk buffer in in printk recursion-prone blocks: > -- around logbuf_lock protected sections in vprintk_emit() and >console_unlock() > -- around down_trylock_console_sem() and up_console_sem() > > Note that it addresses deadlocks

[RFC][PATCH 6/7] printk: use alternative printk buffers

2016-09-27 Thread Sergey Senozhatsky
Use alt_printk buffer in in printk recursion-prone blocks: -- around logbuf_lock protected sections in vprintk_emit() and console_unlock() -- around down_trylock_console_sem() and up_console_sem() Note that it addresses deadlocks caused by recursiove printk() calls only. Examples: 1) printk()