lkml.org 
[lkml]   [2016]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][RFC] printk: make pr_cont buffer per-cpu
On Thu 2016-08-25 23:27:40, Petr Mladek wrote:
> On Wed 2016-08-24 23:27:29, Sergey Senozhatsky wrote:
> > On (08/24/16 10:19), Petr Mladek wrote:
> > > > On (08/23/16 13:47), Petr Mladek wrote:
> > > > [..]
> > > > > > if (!(lflags & LOG_NEWLINE)) {
> > > > > > + if (!this_cpu_read(cont_printing)) {
> > > > > > + if (system_state == SYSTEM_RUNNING) {
> > > > > > + this_cpu_write(cont_printing, true);
> > > > > > + preempt_disable();
> > > > > > + }
> > > > > > + }
> > > > >
> > > > > I am afraid that this is not acceptable. It means that printk() will have
> > > > > an unexpected side effect. The missing "\n" at the end of a printed
> > > > > string would disable preemption. See below for more.
> > > >
> > > > missing '\n' must WARN about "sched while atomic" eventually, so it
> > > > shouldn't go unnoticed or stay hidden.
> > >
> > > Well, it will still force people to rebuilt a test kernel because they
> > > forget to use '\n" and the test kernel is unusable.
> >
> > you are right. misusage of printk() will now force user to go and fix
> > it. the kernel most likely will be rebuilt anyway - there is a missing
> > \n after all.

> Of course, it would be great to fix it transparently. But if there must
> be a burden, I would prefer to keep it on the "corner" case users
> rather than to push it on everyday users.

Not to say that a messed log is much less painful than a locked system.

Best Regards,
Petr

\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.044 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site