Re: [RFC][PATCHv3 3/6] printk: introduce per-cpu safe_print seq buffer

2016-10-19 Thread Sergey Senozhatsky
On (10/19/16 00:40), Sergey Senozhatsky wrote: > -obj-y= printk.o > -obj-$(CONFIG_PRINTK_NMI) += printk_safe.o > +obj-y= printk_safe.o printk.o [..] d'oh... this breaks !PRINTK configs. will fix in v4. -ss

Re: [RFC][PATCHv3 3/6] printk: introduce per-cpu safe_print seq buffer

2016-10-18 Thread Sergey Senozhatsky
On (10/18/16 12:46), Steven Rostedt wrote: > > + > > +/* > > + * Returns with local IRQs disabled. > > + * Can be preempted by NMI. > > It does? How does it return with IRQs disabled? > > > + */ > > +void __printk_safe_enter(void) > > +{ > > + this_cpu_inc(printk_safe_context); > > +} > > + > >

Re: [RFC][PATCHv3 3/6] printk: introduce per-cpu safe_print seq buffer

2016-10-18 Thread Steven Rostedt
On Wed, 19 Oct 2016 00:40:42 +0900 Sergey Senozhatsky wrote: > + > +/* > + * Returns with local IRQs disabled. > + * Can be preempted by NMI. It does? How does it return with IRQs disabled? > + */ > +void __printk_safe_enter(void) > +{ > + this_cpu_inc(printk_safe_context); > +} > + > +/*

[RFC][PATCHv3 3/6] printk: introduce per-cpu safe_print seq buffer

2016-10-18 Thread Sergey Senozhatsky
This patch extends the idea of NMI per-cpu buffers to regions that may cause recursive printk() calls and possible deadlocks. Namely, printk() can't handle printk calls from schedule code or printk() calls from lock debugging code (spin_dump() for instance); because those may be called with `sem->l