Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-16 Thread Sergey Senozhatsky
On (01/16/18 10:36), Petr Mladek wrote: [..] > > unfortunately disabling preemtion in console_unlock() is a bit > > dangerous :( we have paths that call console_unlock() exactly > > to flush everything (not only new pending messages, but everything) > > that is in logbuf and we cannot return from

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-16 Thread Sergey Senozhatsky
On (01/16/18 10:36), Petr Mladek wrote: [..] > > unfortunately disabling preemtion in console_unlock() is a bit > > dangerous :( we have paths that call console_unlock() exactly > > to flush everything (not only new pending messages, but everything) > > that is in logbuf and we cannot return from

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-16 Thread Petr Mladek
On Tue 2018-01-16 15:10:13, Sergey Senozhatsky wrote: > Hi, > > On (01/15/18 12:50), Petr Mladek wrote: > > On Mon 2018-01-15 11:17:43, Petr Mladek wrote: > > > PS: Sergey, you have many good points. The printk-stuff is very > > > complex and we could spend years discussing the perfect solution.

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-16 Thread Petr Mladek
On Tue 2018-01-16 15:10:13, Sergey Senozhatsky wrote: > Hi, > > On (01/15/18 12:50), Petr Mladek wrote: > > On Mon 2018-01-15 11:17:43, Petr Mladek wrote: > > > PS: Sergey, you have many good points. The printk-stuff is very > > > complex and we could spend years discussing the perfect solution.

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-16 Thread Petr Mladek
On Tue 2018-01-16 14:16:22, Sergey Senozhatsky wrote: > On (01/15/18 09:51), Petr Mladek wrote: > > On Sat 2018-01-13 16:31:00, Sergey Senozhatsky wrote: > > > On (01/12/18 13:55), Petr Mladek wrote: > > > [..] > > > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-16 Thread Petr Mladek
On Tue 2018-01-16 14:16:22, Sergey Senozhatsky wrote: > On (01/15/18 09:51), Petr Mladek wrote: > > On Sat 2018-01-13 16:31:00, Sergey Senozhatsky wrote: > > > On (01/12/18 13:55), Petr Mladek wrote: > > > [..] > > > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
Hi, On (01/15/18 12:50), Petr Mladek wrote: > On Mon 2018-01-15 11:17:43, Petr Mladek wrote: > > PS: Sergey, you have many good points. The printk-stuff is very > > complex and we could spend years discussing the perfect solution. > > BTW: One solution that comes to my mind is based on ideas >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
Hi, On (01/15/18 12:50), Petr Mladek wrote: > On Mon 2018-01-15 11:17:43, Petr Mladek wrote: > > PS: Sergey, you have many good points. The printk-stuff is very > > complex and we could spend years discussing the perfect solution. > > BTW: One solution that comes to my mind is based on ideas >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
Hi, On (01/15/18 11:17), Petr Mladek wrote: > Hi Sergey, > > I wonder if there is still some miss understanding. > > Steven and me are trying to get this patch in because we believe > that it is a step forward. We know that it is not perfect. But > we believe that it makes things better. In

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
Hi, On (01/15/18 11:17), Petr Mladek wrote: > Hi Sergey, > > I wonder if there is still some miss understanding. > > Steven and me are trying to get this patch in because we believe > that it is a step forward. We know that it is not perfect. But > we believe that it makes things better. In

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 09:51), Petr Mladek wrote: > On Sat 2018-01-13 16:31:00, Sergey Senozhatsky wrote: > > On (01/12/18 13:55), Petr Mladek wrote: > > [..] > > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 09:51), Petr Mladek wrote: > On Sat 2018-01-13 16:31:00, Sergey Senozhatsky wrote: > > On (01/12/18 13:55), Petr Mladek wrote: > > [..] > > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 07:08), Steven Rostedt wrote: > On Fri, 12 Jan 2018 13:55:37 +0100 > Petr Mladek wrote: > > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more about > > > PREEMPT kernels than

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 07:08), Steven Rostedt wrote: > On Fri, 12 Jan 2018 13:55:37 +0100 > Petr Mladek wrote: > > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more about > > > PREEMPT kernels than !PREEMPT ones. >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/16/18 11:23), Sergey Senozhatsky wrote: [..] > > Adding the preempt_disable() basically means to revert the already > > mentioned commit 6b97a20d3a7909daa06625 ("printk: set may_schedule > > for some of console_trylock() callers"). > > > > I originally wanted to solve this separately to

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/16/18 11:23), Sergey Senozhatsky wrote: [..] > > Adding the preempt_disable() basically means to revert the already > > mentioned commit 6b97a20d3a7909daa06625 ("printk: set may_schedule > > for some of console_trylock() callers"). > > > > I originally wanted to solve this separately to

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 15:45), Petr Mladek wrote: [..] > > With the preempt_disable() there really isn't a delay. I agree, we > > shouldn't let printk preempt (unless we have CONFIG_PREEMPT_RT enabled, > > but that's another story). > > > > > > > > so very schematically, for hand-off it's something like >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 15:45), Petr Mladek wrote: [..] > > With the preempt_disable() there really isn't a delay. I agree, we > > shouldn't let printk preempt (unless we have CONFIG_PREEMPT_RT enabled, > > but that's another story). > > > > > > > > so very schematically, for hand-off it's something like >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 07:06), Steven Rostedt wrote: > > > Yep, but I'm still not convinced you are seeing an issue with a single > > > printk. > > > > what do you mean by this? > > I'm not sure your issues happen because a single printk is locked up, > but you have many printks in one area. hm, need

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 07:06), Steven Rostedt wrote: > > > Yep, but I'm still not convinced you are seeing an issue with a single > > > printk. > > > > what do you mean by this? > > I'm not sure your issues happen because a single printk is locked up, > but you have many printks in one area. hm, need

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Petr Mladek
On Mon 2018-01-15 07:06:37, Steven Rostedt wrote: > On Sat, 13 Jan 2018 16:28:34 +0900 > Sergey Senozhatsky wrote: > > On (01/12/18 07:21), Steven Rostedt wrote: > > > > > An OOM does not do everything in one printk, it calls hundreds. > > > Having hundreds of

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Petr Mladek
On Mon 2018-01-15 07:06:37, Steven Rostedt wrote: > On Sat, 13 Jan 2018 16:28:34 +0900 > Sergey Senozhatsky wrote: > > On (01/12/18 07:21), Steven Rostedt wrote: > > > > > An OOM does not do everything in one printk, it calls hundreds. > > > Having hundreds of printks is an issue, especially in

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Steven Rostedt
On Fri, 12 Jan 2018 13:55:37 +0100 Petr Mladek wrote: > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more about > > PREEMPT kernels than !PREEMPT ones. > > I would say that the patch

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Steven Rostedt
On Fri, 12 Jan 2018 13:55:37 +0100 Petr Mladek wrote: > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more about > > PREEMPT kernels than !PREEMPT ones. > > I would say that the patch improves also

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Steven Rostedt
On Sat, 13 Jan 2018 16:28:34 +0900 Sergey Senozhatsky wrote: > On (01/12/18 07:21), Steven Rostedt wrote: > [..] > > Yep, but I'm still not convinced you are seeing an issue with a single > > printk. > > what do you mean by this? I'm not sure your issues happen

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Steven Rostedt
On Sat, 13 Jan 2018 16:28:34 +0900 Sergey Senozhatsky wrote: > On (01/12/18 07:21), Steven Rostedt wrote: > [..] > > Yep, but I'm still not convinced you are seeing an issue with a single > > printk. > > what do you mean by this? I'm not sure your issues happen because a single printk is

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Petr Mladek
On Mon 2018-01-15 11:17:43, Petr Mladek wrote: > PS: Sergey, you have many good points. The printk-stuff is very > complex and we could spend years discussing the perfect solution. BTW: One solution that comes to my mind is based on ideas already mentioned in this thread: void

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Petr Mladek
On Mon 2018-01-15 11:17:43, Petr Mladek wrote: > PS: Sergey, you have many good points. The printk-stuff is very > complex and we could spend years discussing the perfect solution. BTW: One solution that comes to my mind is based on ideas already mentioned in this thread: void

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Petr Mladek
Hi Sergey, I wonder if there is still some miss understanding. Steven and me are trying to get this patch in because we believe that it is a step forward. We know that it is not perfect. But we believe that it makes things better. In particular, it limits the time spent in console_unlock() in

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Petr Mladek
Hi Sergey, I wonder if there is still some miss understanding. Steven and me are trying to get this patch in because we believe that it is a step forward. We know that it is not perfect. But we believe that it makes things better. In particular, it limits the time spent in console_unlock() in

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 09:51), Petr Mladek wrote: > On Sat 2018-01-13 16:31:00, Sergey Senozhatsky wrote: > > On (01/12/18 13:55), Petr Mladek wrote: > > [..] > > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Sergey Senozhatsky
On (01/15/18 09:51), Petr Mladek wrote: > On Sat 2018-01-13 16:31:00, Sergey Senozhatsky wrote: > > On (01/12/18 13:55), Petr Mladek wrote: > > [..] > > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Petr Mladek
On Sat 2018-01-13 16:31:00, Sergey Senozhatsky wrote: > On (01/12/18 13:55), Petr Mladek wrote: > [..] > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more about > > > PREEMPT kernels than !PREEMPT ones. > > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-15 Thread Petr Mladek
On Sat 2018-01-13 16:31:00, Sergey Senozhatsky wrote: > On (01/12/18 13:55), Petr Mladek wrote: > [..] > > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more about > > > PREEMPT kernels than !PREEMPT ones. > > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Sergey Senozhatsky
On (01/12/18 13:55), Petr Mladek wrote: [..] > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more about > > PREEMPT kernels than !PREEMPT ones. > > I would say that the patch improves also console_unlock() but

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Sergey Senozhatsky
On (01/12/18 13:55), Petr Mladek wrote: [..] > > I'm not fixing console_unlock(), I'm fixing printk(). BTW, all my > > kernels are CONFIG_PREEMPT (I'm a RT guy), my mind thinks more about > > PREEMPT kernels than !PREEMPT ones. > > I would say that the patch improves also console_unlock() but

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Sergey Senozhatsky
On (01/12/18 07:21), Steven Rostedt wrote: [..] > Yep, but I'm still not convinced you are seeing an issue with a single > printk. what do you mean by this? > An OOM does not do everything in one printk, it calls hundreds. > Having hundreds of printks is an issue, especially in critical

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Sergey Senozhatsky
On (01/12/18 07:21), Steven Rostedt wrote: [..] > Yep, but I'm still not convinced you are seeing an issue with a single > printk. what do you mean by this? > An OOM does not do everything in one printk, it calls hundreds. > Having hundreds of printks is an issue, especially in critical

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Petr Mladek
On Fri 2018-01-12 07:21:23, Steven Rostedt wrote: > On Fri, 12 Jan 2018 19:05:44 +0900 > Sergey Senozhatsky wrote: > > 3) console_unlock(void) > >{ > > for (;;) { > > printk_safe_enter_irqsave(flags); > > // lock-unlock logbuf > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Petr Mladek
On Fri 2018-01-12 07:21:23, Steven Rostedt wrote: > On Fri, 12 Jan 2018 19:05:44 +0900 > Sergey Senozhatsky wrote: > > 3) console_unlock(void) > >{ > > for (;;) { > > printk_safe_enter_irqsave(flags); > > // lock-unlock logbuf > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Steven Rostedt
On Fri, 12 Jan 2018 19:05:44 +0900 Sergey Senozhatsky wrote: > Steven, we are having too many things in one email, I've dropped most > of them to concentrate on one topic only. I totally agree, and I believe this is the reason behind the tensions between us.

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Steven Rostedt
On Fri, 12 Jan 2018 19:05:44 +0900 Sergey Senozhatsky wrote: > Steven, we are having too many things in one email, I've dropped most > of them to concentrate on one topic only. I totally agree, and I believe this is the reason behind the tensions between us. We are not discussing the topic of

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Sergey Senozhatsky
Steven, we are having too many things in one email, I've dropped most of them to concentrate on one topic only. On (01/11/18 22:21), Steven Rostedt wrote: [..] > > After playing with the module in my last email, I think your trying to > solve multiple printks, not one that is stuck I wouldn't

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-12 Thread Sergey Senozhatsky
Steven, we are having too many things in one email, I've dropped most of them to concentrate on one topic only. On (01/11/18 22:21), Steven Rostedt wrote: [..] > > After playing with the module in my last email, I think your trying to > solve multiple printks, not one that is stuck I wouldn't

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Thu, 11 Jan 2018 21:55:47 -0500 Steven Rostedt wrote: > I ran this on a box with 4 CPUs and a serial console (so it has a slow > console). Again, all I have is each CPU doing exactly ONE printk()! > then sleeping for a full millisecond! It will cause a lot of output, >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Thu, 11 Jan 2018 21:55:47 -0500 Steven Rostedt wrote: > I ran this on a box with 4 CPUs and a serial console (so it has a slow > console). Again, all I have is each CPU doing exactly ONE printk()! > then sleeping for a full millisecond! It will cause a lot of output, > and perhaps slow the

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Fri, 12 Jan 2018 11:56:12 +0900 Sergey Senozhatsky wrote: > Hi, > > On (01/11/18 11:29), Steven Rostedt wrote: > [..] > > > - if the patch's goal is to bound (not necessarily to watchdog's > > > threshold) > > > the amount of time we spend in

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Fri, 12 Jan 2018 11:56:12 +0900 Sergey Senozhatsky wrote: > Hi, > > On (01/11/18 11:29), Steven Rostedt wrote: > [..] > > > - if the patch's goal is to bound (not necessarily to watchdog's > > > threshold) > > > the amount of time we spend in console_unlock(), then the patch is kinda > > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Sergey Senozhatsky
On (01/11/18 20:30), Steven Rostedt wrote: [..] > Today, printk() can print for a time of A * B, where, as you state > above: > >A is the amount of data to print in the worst case >B the time call_console_drivers() needs to print a single > char to all registered and enabled

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Sergey Senozhatsky
On (01/11/18 20:30), Steven Rostedt wrote: [..] > Today, printk() can print for a time of A * B, where, as you state > above: > >A is the amount of data to print in the worst case >B the time call_console_drivers() needs to print a single > char to all registered and enabled

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Sergey Senozhatsky
Hi, On (01/11/18 11:29), Steven Rostedt wrote: [..] > > - if the patch's goal is to bound (not necessarily to watchdog's threshold) > > the amount of time we spend in console_unlock(), then the patch is kinda > > overcomplicated. but no further questions in this case. > > It's goal is to keep

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Sergey Senozhatsky
Hi, On (01/11/18 11:29), Steven Rostedt wrote: [..] > > - if the patch's goal is to bound (not necessarily to watchdog's threshold) > > the amount of time we spend in console_unlock(), then the patch is kinda > > overcomplicated. but no further questions in this case. > > It's goal is to keep

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Thu, 11 Jan 2018 20:30:57 -0500 Steven Rostedt wrote: > I have to say that your analysis here really does point out the benefit > of my patch. > > Today, printk() can print for a time of A * B, where, as you state > above: > >A is the amount of data to print in the

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Thu, 11 Jan 2018 20:30:57 -0500 Steven Rostedt wrote: > I have to say that your analysis here really does point out the benefit > of my patch. > > Today, printk() can print for a time of A * B, where, as you state > above: > >A is the amount of data to print in the worst case >B the

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Thu, 11 Jan 2018 11:29:08 -0500 Steven Rostedt wrote: > > claiming that for any given A, B, C the following is always true > > > > A * B < C > > > > where > > A is the amount of data to print in the worst case > > B the time

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Thu, 11 Jan 2018 11:29:08 -0500 Steven Rostedt wrote: > > claiming that for any given A, B, C the following is always true > > > > A * B < C > > > > where > > A is the amount of data to print in the worst case > > B the time call_console_drivers() needs

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Thu, 11 Jan 2018 19:38:45 +0900 Sergey Senozhatsky wrote: > > the non-atomic -> atomic context console_sem transfer. we previously > would have kept the console_sem owner to its non-atomic owner. we now > will make sure that if printk from atomic context

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Steven Rostedt
On Thu, 11 Jan 2018 19:38:45 +0900 Sergey Senozhatsky wrote: > > the non-atomic -> atomic context console_sem transfer. we previously > would have kept the console_sem owner to its non-atomic owner. we now > will make sure that if printk from atomic context happens then it will > make it to

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Sergey Senozhatsky
On (01/11/18 12:24), Petr Mladek wrote: [..] > You might argue that we already know that Steven's solution will > not be enough. IMHO, the problem here is the term "real life example". this is really boring, how real life examples happen only on Steven's PC or Petr's qemu image. whatever.

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Sergey Senozhatsky
On (01/11/18 12:24), Petr Mladek wrote: [..] > You might argue that we already know that Steven's solution will > not be enough. IMHO, the problem here is the term "real life example". this is really boring, how real life examples happen only on Steven's PC or Petr's qemu image. whatever.

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Petr Mladek
On Thu 2018-01-11 19:38:45, Sergey Senozhatsky wrote: > On (01/11/18 10:34), Petr Mladek wrote: > [..] > > > except that handing off a console_sem to atomic task when there > > > is O(logbuf) > watchdog_thresh is a regression, basically... > > > it is what it is. > > > > How this could be a

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Petr Mladek
On Thu 2018-01-11 19:38:45, Sergey Senozhatsky wrote: > On (01/11/18 10:34), Petr Mladek wrote: > [..] > > > except that handing off a console_sem to atomic task when there > > > is O(logbuf) > watchdog_thresh is a regression, basically... > > > it is what it is. > > > > How this could be a

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Petr Mladek
On Thu 2018-01-11 16:36:18, Sergey Senozhatsky wrote: > Hi Mathieu, > > On (01/10/18 18:40), Mathieu Desnoyers wrote: > [..] > > > > There appears to be two problems at hand. One is making sure a console > > buffer owner only flushes a bounded amount of data. > > which, realistically, has quite

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Petr Mladek
On Thu 2018-01-11 16:36:18, Sergey Senozhatsky wrote: > Hi Mathieu, > > On (01/10/18 18:40), Mathieu Desnoyers wrote: > [..] > > > > There appears to be two problems at hand. One is making sure a console > > buffer owner only flushes a bounded amount of data. > > which, realistically, has quite

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Sergey Senozhatsky
On (01/11/18 10:34), Petr Mladek wrote: [..] > > except that handing off a console_sem to atomic task when there > > is O(logbuf) > watchdog_thresh is a regression, basically... > > it is what it is. > > How this could be a regression? Is not the victim that handles > other printk's random?

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Sergey Senozhatsky
On (01/11/18 10:34), Petr Mladek wrote: [..] > > except that handing off a console_sem to atomic task when there > > is O(logbuf) > watchdog_thresh is a regression, basically... > > it is what it is. > > How this could be a regression? Is not the victim that handles > other printk's random?

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Petr Mladek
On Thu 2018-01-11 13:58:17, Sergey Senozhatsky wrote: > On (01/10/18 13:05), Steven Rostedt wrote: > > The solution is simple, everyone at KS agreed with it, there should be > > no controversy here. > > frankly speaking, that's not what I recall ;) To be honest, I do not longer remember the

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-11 Thread Petr Mladek
On Thu 2018-01-11 13:58:17, Sergey Senozhatsky wrote: > On (01/10/18 13:05), Steven Rostedt wrote: > > The solution is simple, everyone at KS agreed with it, there should be > > no controversy here. > > frankly speaking, that's not what I recall ;) To be honest, I do not longer remember the

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
Hi Mathieu, On (01/10/18 18:40), Mathieu Desnoyers wrote: [..] > > There appears to be two problems at hand. One is making sure a console > buffer owner only flushes a bounded amount of data. which, realistically, has quite little to do with the "and thus it fixes the lockups". logbuf size is

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
Hi Mathieu, On (01/10/18 18:40), Mathieu Desnoyers wrote: [..] > > There appears to be two problems at hand. One is making sure a console > buffer owner only flushes a bounded amount of data. which, realistically, has quite little to do with the "and thus it fixes the lockups". logbuf size is

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
On (01/10/18 14:17), Steven Rostedt wrote: [..] > OK, lets start over. good. > Right now my focus is an incremental approach. I'm not trying to solve > all issues that printk has. I've focused on a single issue, and that is > that printk is unbounded. Coming from a Real Time background, I find >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
On (01/10/18 14:17), Steven Rostedt wrote: [..] > OK, lets start over. good. > Right now my focus is an incremental approach. I'm not trying to solve > all issues that printk has. I've focused on a single issue, and that is > that printk is unbounded. Coming from a Real Time background, I find >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
On (01/10/18 19:21), Peter Zijlstra wrote: > > On Wed, Jan 10, 2018 at 09:02:23AM -0800, Tejun Heo wrote: > > 2. System runs out of memory, OOM triggers. > > 3. OOM handler is printing out OOM debug info. > > 4. While trying to emit the messages for netconsole, the network stack > >/ driver

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
On (01/10/18 19:21), Peter Zijlstra wrote: > > On Wed, Jan 10, 2018 at 09:02:23AM -0800, Tejun Heo wrote: > > 2. System runs out of memory, OOM triggers. > > 3. OOM handler is printing out OOM debug info. > > 4. While trying to emit the messages for netconsole, the network stack > >/ driver

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
On (01/10/18 17:29), Petr Mladek wrote: [..] > The next versions used lazy offload from console_unlock() when > the thread spent there too much time. IMHO, this is one > very promising solution. It guarantees that softlockup > would never happen. But it tries hard to get the messages > out

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
On (01/10/18 17:29), Petr Mladek wrote: [..] > The next versions used lazy offload from console_unlock() when > the thread spent there too much time. IMHO, this is one > very promising solution. It guarantees that softlockup > would never happen. But it tries hard to get the messages > out

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
On (01/10/18 13:05), Steven Rostedt wrote: [..] > My solution takes printk from its current unbounded state, and makes it > fixed bounded. Which means printk() is now a O(1) algorithm. ^^^ O(logbuf)

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Sergey Senozhatsky
On (01/10/18 13:05), Steven Rostedt wrote: [..] > My solution takes printk from its current unbounded state, and makes it > fixed bounded. Which means printk() is now a O(1) algorithm. ^^^ O(logbuf)

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Tejun Heo
Hello, Steven. On Wed, Jan 10, 2018 at 02:44:55PM -0500, Steven Rostedt wrote: > Yes, there can be the case that printks are added via an interrupt, but > then again, it's an issue that a single CPU. And printks from interrupt > context should be considered critical, part of the ASAP category. If

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Tejun Heo
Hello, Steven. On Wed, Jan 10, 2018 at 02:44:55PM -0500, Steven Rostedt wrote: > Yes, there can be the case that printks are added via an interrupt, but > then again, it's an issue that a single CPU. And printks from interrupt > context should be considered critical, part of the ASAP category. If

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 11:34:51 -0800 Tejun Heo wrote: > > Right now my focus is an incremental approach. I'm not trying to solve > > all issues that printk has. I've focused on a single issue, and that is > > that printk is unbounded. Coming from a Real Time background, I find > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 11:34:51 -0800 Tejun Heo wrote: > > Right now my focus is an incremental approach. I'm not trying to solve > > all issues that printk has. I've focused on a single issue, and that is > > that printk is unbounded. Coming from a Real Time background, I find > > that is a big

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Tejun Heo
Hello, Steven. On Wed, Jan 10, 2018 at 02:17:58PM -0500, Steven Rostedt wrote: > > I'm not really sure why punting to a safe context is necessarily > > unacceptable in terms of #1 because there seems to be a pretty wide > > gap between printing useful messages synchronously and a system being > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Tejun Heo
Hello, Steven. On Wed, Jan 10, 2018 at 02:17:58PM -0500, Steven Rostedt wrote: > > I'm not really sure why punting to a safe context is necessarily > > unacceptable in terms of #1 because there seems to be a pretty wide > > gap between printing useful messages synchronously and a system being > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 10:57:47 -0800 Tejun Heo wrote: > Hello, Steven. > > On Wed, Jan 10, 2018 at 01:41:57PM -0500, Steven Rostedt wrote: > > The issue with the solution you want to do with printk is that it can > > break existing printk usages. As Petr said, people want printk

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 10:57:47 -0800 Tejun Heo wrote: > Hello, Steven. > > On Wed, Jan 10, 2018 at 01:41:57PM -0500, Steven Rostedt wrote: > > The issue with the solution you want to do with printk is that it can > > break existing printk usages. As Petr said, people want printk to do two > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Tejun Heo
Hello, On Wed, Jan 10, 2018 at 07:41:44PM +0100, Peter Zijlstra wrote: > Typically we (scheduler) have removed printk()s (on boot) when BIGSMP > folks say it creates boot pain. Much of it is now behind the sched_debug > parameter, others are compressed. > > I've also seen other people reduce

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Tejun Heo
Hello, On Wed, Jan 10, 2018 at 07:41:44PM +0100, Peter Zijlstra wrote: > Typically we (scheduler) have removed printk()s (on boot) when BIGSMP > folks say it creates boot pain. Much of it is now behind the sched_debug > parameter, others are compressed. > > I've also seen other people reduce

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Tejun Heo
Hello, Steven. On Wed, Jan 10, 2018 at 01:41:57PM -0500, Steven Rostedt wrote: > The issue with the solution you want to do with printk is that it can > break existing printk usages. As Petr said, people want printk to do two > things. 1 - print out data ASAP, 2 - not lock up the system. The two

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Tejun Heo
Hello, Steven. On Wed, Jan 10, 2018 at 01:41:57PM -0500, Steven Rostedt wrote: > The issue with the solution you want to do with printk is that it can > break existing printk usages. As Petr said, people want printk to do two > things. 1 - print out data ASAP, 2 - not lock up the system. The two

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 17:29:00 +0100 Petr Mladek wrote: > he next versions used lazy offload from console_unlock() when > the thread spent there too much time. IMHO, this is one > very promising solution. It guarantees that softlockup > would never happen. But it tries hard to

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 17:29:00 +0100 Petr Mladek wrote: > he next versions used lazy offload from console_unlock() when > the thread spent there too much time. IMHO, this is one > very promising solution. It guarantees that softlockup > would never happen. But it tries hard to get the messages >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 10:14:59 -0800 Tejun Heo wrote: > On Wed, Jan 10, 2018 at 10:12:52AM -0800, Tejun Heo wrote: > > Hello, Steven. > > > > So, everything else on your message, sure. You do what you have to > > do, but I really don't understand the following part, and this has

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 10:14:59 -0800 Tejun Heo wrote: > On Wed, Jan 10, 2018 at 10:12:52AM -0800, Tejun Heo wrote: > > Hello, Steven. > > > > So, everything else on your message, sure. You do what you have to > > do, but I really don't understand the following part, and this has > > been the

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Peter Zijlstra
On Wed, Jan 10, 2018 at 10:30:55AM -0800, Tejun Heo wrote: > > Why not kill recursive OOM (msgs) ? > > Sure, we can do that too, e.g. marking flushing thread and ignoring > new messages from it, although that does come with its own downsides. Typically we (scheduler) have removed printk()s (on

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Peter Zijlstra
On Wed, Jan 10, 2018 at 10:30:55AM -0800, Tejun Heo wrote: > > Why not kill recursive OOM (msgs) ? > > Sure, we can do that too, e.g. marking flushing thread and ignoring > new messages from it, although that does come with its own downsides. Typically we (scheduler) have removed printk()s (on

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 10:12:52 -0800 Tejun Heo wrote: > Hello, Steven. > > So, everything else on your message, sure. You do what you have to > do, but I really don't understand the following part, and this has > been the main source of frustration in the whole discussion. > >

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Steven Rostedt
On Wed, 10 Jan 2018 10:12:52 -0800 Tejun Heo wrote: > Hello, Steven. > > So, everything else on your message, sure. You do what you have to > do, but I really don't understand the following part, and this has > been the main source of frustration in the whole discussion. > > On Wed, Jan 10,

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Mathieu Desnoyers
- On Jan 10, 2018, at 12:02 PM, Tejun Heo t...@kernel.org wrote: > Hello, Linus, Andrew. > > On Wed, Jan 10, 2018 at 05:29:00PM +0100, Petr Mladek wrote: >> Where is the acceptable compromise? I am not sure. So far, the most >> forceful people (Linus) did not see softlockups as a big

Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

2018-01-10 Thread Mathieu Desnoyers
- On Jan 10, 2018, at 12:02 PM, Tejun Heo t...@kernel.org wrote: > Hello, Linus, Andrew. > > On Wed, Jan 10, 2018 at 05:29:00PM +0100, Petr Mladek wrote: >> Where is the acceptable compromise? I am not sure. So far, the most >> forceful people (Linus) did not see softlockups as a big

<    1   2   3   >