Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-29 Thread John Ogness
On 2021-03-29, John Ogness wrote: >> Will you call console write() callback with irq enabled from the >> kthread? > > No. That defeats the fundamental purpose of this entire rework > excercise. ;-) Sorry, I misread your question. The answer is "yes". We want to avoid a local_irq_save() when

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-29 Thread John Ogness
On 2021-03-29, Petr Mladek wrote: > I wonder if some console drivers rely on the fact that the write() > callback is called with interrupts disabled. > > IMHO, it would be a bug when any write() callback expects that > callers disabled the interrupts. Agreed. > Do you plan to remove the

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-29 Thread Petr Mladek
On Fri 2021-03-26 12:12:37, John Ogness wrote: > On 2021-03-23, Petr Mladek wrote: > >> --- a/kernel/printk/printk.c > >> +++ b/kernel/printk/printk.c > >> - > >>if (seq != prb_next_seq(_rb_static)) { > >>pr_err("dropped %llu messages\n", > >>

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-26 Thread John Ogness
On 2021-03-23, Petr Mladek wrote: >> --- a/kernel/printk/printk.c >> +++ b/kernel/printk/printk.c >> @@ -1142,8 +1126,6 @@ void __init setup_log_buf(int early) >> new_descs, ilog2(new_descs_count), >> new_infos); >> >> -printk_safe_enter_irqsave(flags); >> - >>

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-23 Thread Petr Mladek
On Wed 2021-03-17 00:33:25, John Ogness wrote: > With @logbuf_lock removed, the high level printk functions for > storing messages are lockless. Messages can be stored from any > context, so there is no need for the NMI and safe buffers anymore. > Remove the NMI and safe buffers. > > Although the

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-23 Thread Petr Mladek
On Mon 2021-03-22 22:58:47, John Ogness wrote: > On 2021-03-22, Petr Mladek wrote: > > On Mon 2021-03-22 12:16:15, John Ogness wrote: > >> On 2021-03-21, Sergey Senozhatsky wrote: > >> >> @@ -369,7 +70,10 @@ __printf(1, 0) int vprintk_func(const char *fmt, > >> >> va_list args) > >> >>

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-22 Thread John Ogness
On 2021-03-22, Petr Mladek wrote: > On Mon 2021-03-22 12:16:15, John Ogness wrote: >> On 2021-03-21, Sergey Senozhatsky wrote: >> >> @@ -369,7 +70,10 @@ __printf(1, 0) int vprintk_func(const char *fmt, >> >> va_list args) >> >>* Use the main logbuf even in NMI. But avoid calling console >>

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-22 Thread Petr Mladek
On Mon 2021-03-22 12:16:15, John Ogness wrote: > On 2021-03-21, Sergey Senozhatsky wrote: > >> @@ -369,7 +70,10 @@ __printf(1, 0) int vprintk_func(const char *fmt, > >> va_list args) > >> * Use the main logbuf even in NMI. But avoid calling console > >> * drivers that might have their

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-22 Thread John Ogness
On 2021-03-21, Sergey Senozhatsky wrote: >> @@ -369,7 +70,10 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list >> args) >> * Use the main logbuf even in NMI. But avoid calling console >> * drivers that might have their own locks. >> */ >> -if

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-20 Thread Sergey Senozhatsky
On (21/03/17 00:33), John Ogness wrote: [..] > void printk_nmi_direct_enter(void) > { > @@ -324,27 +44,8 @@ void printk_nmi_direct_exit(void) > this_cpu_and(printk_context, ~PRINTK_NMI_DIRECT_CONTEXT_MASK); > } > > -#else > - > -static __printf(1, 0) int vprintk_nmi(const char *fmt,

[PATCH next v1 2/3] printk: remove safe buffers

2021-03-16 Thread John Ogness
With @logbuf_lock removed, the high level printk functions for storing messages are lockless. Messages can be stored from any context, so there is no need for the NMI and safe buffers anymore. Remove the NMI and safe buffers. Although the safe buffers are removed, the NMI and safe context