Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-07 Thread Pavel Machek
Hi! > On (04/07/17 09:21), Pavel Machek wrote: > > > spin_dump() and trigger_all_cpu_backtrace() result in a bunch of > > > additional printk()-s so CPU0 has even more job to do in console_unlock(), > > > while it still holds the contended spin_lock. and so on; there are > > > many other

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-07 Thread Pavel Machek
Hi! > On (04/07/17 09:21), Pavel Machek wrote: > > > spin_dump() and trigger_all_cpu_backtrace() result in a bunch of > > > additional printk()-s so CPU0 has even more job to do in console_unlock(), > > > while it still holds the contended spin_lock. and so on; there are > > > many other

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-07 Thread Sergey Senozhatsky
Hello, On (04/07/17 09:21), Pavel Machek wrote: > > spin_dump() and trigger_all_cpu_backtrace() result in a bunch of > > additional printk()-s so CPU0 has even more job to do in console_unlock(), > > while it still holds the contended spin_lock. and so on; there are > > many other examples. > >

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-07 Thread Sergey Senozhatsky
Hello, On (04/07/17 09:21), Pavel Machek wrote: > > spin_dump() and trigger_all_cpu_backtrace() result in a bunch of > > additional printk()-s so CPU0 has even more job to do in console_unlock(), > > while it still holds the contended spin_lock. and so on; there are > > many other examples. > >

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-07 Thread Pavel Machek
Hi! > spin_dump() and trigger_all_cpu_backtrace() result in a bunch of > additional printk()-s so CPU0 has even more job to do in console_unlock(), > while it still holds the contended spin_lock. and so on; there are > many other examples. > > so should we declare a "we can spend only 2 seconds

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-07 Thread Pavel Machek
Hi! > spin_dump() and trigger_all_cpu_backtrace() result in a bunch of > additional printk()-s so CPU0 has even more job to do in console_unlock(), > while it still holds the contended spin_lock. and so on; there are > many other examples. > > so should we declare a "we can spend only 2 seconds

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-06 Thread Sergey Senozhatsky
Hello, On (04/06/17 19:14), Pavel Machek wrote: [..] > > @@ -1765,17 +1803,40 @@ asmlinkage int vprintk_emit(int facility, int level, > > > > printed_len += log_output(facility, level, lflags, dict, dictlen, text, > > text_len); > > > > + /* > > +* Emergency level indicates that

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-06 Thread Sergey Senozhatsky
Hello, On (04/06/17 19:14), Pavel Machek wrote: [..] > > @@ -1765,17 +1803,40 @@ asmlinkage int vprintk_emit(int facility, int level, > > > > printed_len += log_output(facility, level, lflags, dict, dictlen, text, > > text_len); > > > > + /* > > +* Emergency level indicates that

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-06 Thread Pavel Machek
Hi! > printk() is quite complex internally and, basically, it does two > slightly independent things: > a) adds a new message to a kernel log buffer (log_store()) > b) prints kernel log messages to serial consoles (console_unlock()) > > while (a) is guaranteed to be executed by printk(), (b)

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-06 Thread Pavel Machek
Hi! > printk() is quite complex internally and, basically, it does two > slightly independent things: > a) adds a new message to a kernel log buffer (log_store()) > b) prints kernel log messages to serial consoles (console_unlock()) > > while (a) is guaranteed to be executed by printk(), (b)

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-04 Thread Sergey Senozhatsky
On (04/04/17 11:01), Petr Mladek wrote: [..] > > +static atomic_t printk_emergency __read_mostly; > > +/* > > + * Disable printk_kthread permanently. Unlike `oops_in_progress' > > + * it doesn't go back to 0. > > + */ > > The comment is not valid once we allow to modify the variable using > the

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-04 Thread Sergey Senozhatsky
On (04/04/17 11:01), Petr Mladek wrote: [..] > > +static atomic_t printk_emergency __read_mostly; > > +/* > > + * Disable printk_kthread permanently. Unlike `oops_in_progress' > > + * it doesn't go back to 0. > > + */ > > The comment is not valid once we allow to modify the variable using > the

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-04 Thread Petr Mladek
On Wed 2017-03-29 18:25:05, Sergey Senozhatsky wrote: > This patch introduces a dedicated printing kernel thread - printk_kthread. > The main purpose of this kthread is to offload printing to a non-atomic > and always scheduleable context, which eliminates 4) and makes 1)-3) less > critical.

Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-04-04 Thread Petr Mladek
On Wed 2017-03-29 18:25:05, Sergey Senozhatsky wrote: > This patch introduces a dedicated printing kernel thread - printk_kthread. > The main purpose of this kthread is to offload printing to a non-atomic > and always scheduleable context, which eliminates 4) and makes 1)-3) less > critical.

[RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-03-29 Thread Sergey Senozhatsky
printk() is quite complex internally and, basically, it does two slightly independent things: a) adds a new message to a kernel log buffer (log_store()) b) prints kernel log messages to serial consoles (console_unlock()) while (a) is guaranteed to be executed by printk(), (b) is not, for a

[RFC][PATCHv2 2/8] printk: introduce printing kernel thread

2017-03-29 Thread Sergey Senozhatsky
printk() is quite complex internally and, basically, it does two slightly independent things: a) adds a new message to a kernel log buffer (log_store()) b) prints kernel log messages to serial consoles (console_unlock()) while (a) is guaranteed to be executed by printk(), (b) is not, for a