[lkml]   [2012]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] printk: Add printk_flush() to force buffered text to console

* Joe Perches <> wrote:

> On Sat, 2012-06-23 at 08:13 +0200, Ingo Molnar wrote:
> > * Andrew Morton <> wrote:
> >
> > > On Thu, 21 Jun 2012 19:52:03 -0400
> > > Steven Rostedt <> wrote:
> > >
> > > > But with the new printk() changes, text without a newline
> > > > gets buffered and does not print out to the console at the
> > > > location of the printk.
> > >
> > > uh, how about we fix that? The old behaviour was good, the
> > > new behaviour is noxious.
> >
> > Absolutely.
> >
> > pr_flush() really seems to be a workaround.
> I think the new behavior an overall improvement.
> It helps avoid multiple thread interleaving.
> I suggested a fix to enable a printk buffered/non-buffered
> mechanism with an optional printk_flush/pr_flush.

Ugh, so you suggest a global toggle to turn buffering on/off?

That approach really misses thole whole *point* of printk() and
debug logging in particular. In most cases when users are
triggering and reporting problems they don't go around toggling
various rarely used switches to see whether they make a
difference. They and kernel developers just take printk output
at face value and trust it.

Even if people are aware of this global toggle there are
frequent cases where a hang is probabilistic and occurs only
very rarely. If a once a year bug triggers then it's obviously
useful to have good debug output on the screen or in the serial
log and not wait another year with the debug option turned on

If I cannot trust printk output anymore and would have to toggle
global switches to make it work then printk() has lost value for
debugging kernel problems and that would be sad.

So NAK on your patch, really. We should either fix this
regression in behavior, or, as a second best alternative we
should at least give a deterministic way to flush the printk
output, which works all the time.



 \ /
  Last update: 2012-06-25 11:22    [W:0.107 / U:8.632 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site