Re: printk: what is going on with additional newlines?

From: Sergey Senozhatsky
Date: Tue Sep 05 2017 - 06:01:57 EST


On (09/05/17 11:44), Petr Mladek wrote:
[..]
> > Tetsuo wants this, for instance,
> > for OOM reports and backtraces. SCIS/ATA people want it as well.
>
> The mixing of related lines might cause problems. But I am not sure
> if it can be fixed a safe way on the printk side. Especially I am
> afraid of an extensive buffering.
>
> My underestanding, of the discussion about printk kthread patchset,
> is that printk() has the following priorities

this discussion is not related to printk ktrehad. it's just the
first messages was posted as a reply to printk kthread patch set,
other than that it's unrelated.


> Any buffering would delay showing the message. It increases
> the risk that nobody will see it at all. It is acceptable
> in printk_safe() and printk_safe_nmi() because we did not
> find a better way to avoid the deadlock.

that's why I want buffered printk to re-use the printk-safe buffer
on that particular CPU [ if buffered printk will ever land ].
printk-safe buffer is not allocated on stack, or kmalloc-ed for
temp usafe, and, more importantly, we flush it from panic().

and I'm not sure that lost messages due to missing panic flush()
can really be an option even for a single cont line buffer. well,
may be it can. printk has a sort of guarantee that messages will
be at some well known location when pr_foo or printk function
returns. buffered printk kills it. and I don't want to have
several "flavors" of printk. printk-safe buffer seems to be the
way to preserve that guarantee.

-ss