RE: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-15 Thread David Laight
From: Joe Perches > Sent: 15 August 2020 00:52 ... > > This is why I think any discussion that says "people should buffer > > their lines themselves and we should get rid if pr_cont()" is > > fundamentally broken. > > > > Don't go down that hole. I won't take it. It's wrong. > > I don't think

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-15 Thread Linus Torvalds
On Fri, Aug 14, 2020 at 4:52 PM Joe Perches wrote: > > On Fri, 2020-08-14 at 15:46 -0700, Linus Torvalds wrote: > > > > This is why I think any discussion that says "people should buffer > > their lines themselves and we should get rid if pr_cont()" is > > fundamentally broken. > > > > Don't go

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-15 Thread Joe Perches
On Fri, 2020-08-14 at 19:33 -0700, Linus Torvalds wrote: > On Fri, Aug 14, 2020 at 4:52 PM Joe Perches wrote: > > On Fri, 2020-08-14 at 15:46 -0700, Linus Torvalds wrote: > > > This is why I think any discussion that says "people should buffer > > > their lines themselves and we should get rid if

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-15 Thread Sergey Senozhatsky
On (20/08/14 15:46), Linus Torvalds wrote: > On Thu, Aug 13, 2020 at 4:54 AM Sergey Senozhatsky > wrote: > > > > I think what Linus said a long time ago was that the initial purpose of > > pr_cont was > > > > pr_info("Initialize feature foo..."); > > if (init_feature_foo() == 0) >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-14 Thread Joe Perches
On Fri, 2020-08-14 at 15:46 -0700, Linus Torvalds wrote: > On Thu, Aug 13, 2020 at 4:54 AM Sergey Senozhatsky > wrote: > > I think what Linus said a long time ago was that the initial purpose of > > pr_cont was > > > > pr_info("Initialize feature foo..."); > > if

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-14 Thread Linus Torvalds
On Thu, Aug 13, 2020 at 4:54 AM Sergey Senozhatsky wrote: > > I think what Linus said a long time ago was that the initial purpose of > pr_cont was > > pr_info("Initialize feature foo..."); > if (init_feature_foo() == 0) > pr_cont("ok\n"); > else >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-14 Thread Petr Mladek
On Fri 2020-08-14 10:22:35, John Ogness wrote: > On 2020-08-14, Sergey Senozhatsky wrote: > > One thing that we need to handle here, I believe, is that the context > > which crashes the kernel should flush its cont buffer, because the > > information there is relevant to the crash: > > > >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-14 Thread Petr Mladek
On Thu 2020-08-13 20:54:35, Sergey Senozhatsky wrote: > On (20/08/13 10:41), Petr Mladek wrote: > > > My concerns about this idea: > > > > > > - What if the printk user does not correctly terminate the cont message? > > > There is no mechanism to allow that open record to be force-finalized > >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-14 Thread John Ogness
On 2020-08-14, Sergey Senozhatsky wrote: > One thing that we need to handle here, I believe, is that the context > which crashes the kernel should flush its cont buffer, because the > information there is relevant to the crash: > > pr_cont_alloc_info(); > pr_cont(, "1"); >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-13 Thread Sergey Senozhatsky
On (20/08/13 12:35), John Ogness wrote: > I believe I failed to recognize the fundamental problem. The fundamental > problem is that the pr_cont() semantics are very poor. The semantics is pretty clear - use it only in UP early bootup, anything else is broken :) /* * Annotation for a

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-13 Thread Sergey Senozhatsky
On (20/08/13 10:41), Petr Mladek wrote: > > My concerns about this idea: > > > > - What if the printk user does not correctly terminate the cont message? > > There is no mechanism to allow that open record to be force-finalized > > so that readers can read newer records. > > This is a real

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-13 Thread Petr Mladek
On Thu 2020-08-13 12:35:47, John Ogness wrote: > On 2020-08-13, Petr Mladek wrote: > > On Thu 2020-08-13 09:50:25, John Ogness wrote: > >> On 2020-08-13, Sergey Senozhatsky wrote: > >> > This is not an unseen pattern, I'm afraid. And the problem here can > >> > be more general: > >> > > >> >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-13 Thread John Ogness
On 2020-08-13, Petr Mladek wrote: > On Thu 2020-08-13 09:50:25, John Ogness wrote: >> On 2020-08-13, Sergey Senozhatsky wrote: >> > This is not an unseen pattern, I'm afraid. And the problem here can >> > be more general: >> > >> >pr_info("text"); >> >pr_cont("1"); >> >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-13 Thread Petr Mladek
On Thu 2020-08-13 09:50:25, John Ogness wrote: > On 2020-08-13, Sergey Senozhatsky wrote: > > This is not an unseen pattern, I'm afraid. And the problem here can > > be more general: > > > > pr_info("text"); > > pr_cont("1"); > > exception/IRQ/NMI > > pr_alert("text\n"); >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-13 Thread Petr Mladek
On Thu 2020-08-13 14:18:53, Sergey Senozhatsky wrote: > On (20/08/13 02:30), John Ogness wrote: > > 2. I haven't yet figured out how to preserve calling context when a > > newline appears. For example: > > > > pr_info("text"); > > pr_cont(" 1"); > > pr_cont(" 2\n"); > > pr_cont("3"); > >

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-13 Thread John Ogness
On 2020-08-13, Sergey Senozhatsky wrote: > This is not an unseen pattern, I'm afraid. And the problem here can > be more general: > > pr_info("text"); > pr_cont("1"); > exception/IRQ/NMI > pr_alert("text\n"); > pr_cont("2"); > pr_cont("\n"); > > I guess

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-13 Thread Petr Mladek
On Thu 2020-08-13 02:30:02, John Ogness wrote: > On 2020-08-12, Petr Mladek wrote: > > So, I have one crazy idea to add one more state bit so that we > > could have: > > > > + committed: set when the data are written into the data ring. > > + final: set when the data block could not longer

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-12 Thread Sergey Senozhatsky
On (20/08/13 02:30), John Ogness wrote: > 2. I haven't yet figured out how to preserve calling context when a > newline appears. For example: > > pr_info("text"); > pr_cont(" 1"); > pr_cont(" 2\n"); > pr_cont("3"); > pr_cont(" 4\n"); > > For "3" the calling context (info, timestamp) is lost

Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling

2020-08-12 Thread John Ogness
On 2020-08-12, Petr Mladek wrote: > So, I have one crazy idea to add one more state bit so that we > could have: > > + committed: set when the data are written into the data ring. > + final: set when the data block could not longer get reopened > + reuse: set when the desctiptor/data block