Re: [PATCH] printk(): add KERN_CONT where needed

From: Andrew Morton
Date: Mon Apr 09 2012 - 19:08:04 EST


On Tue, 3 Apr 2012 05:00:10 +0200
Kay Sievers <kay@xxxxxxxx> wrote:

> > Maybe it'd be better to aggregate content rather like
> > printk does. __Aggregate until you get a newline or a
> > new KERN_<LEVEL>
>
> The continuation printk() can can always go wrong when multiple
> threads do that in parallel. We can try to make it better with a
> per-cpu buffer, but I guess there will always be a situation where
> this can happen.

Maybe we can be a bit smarter. For example, if `current' is unchanged
and __builtin_return_address(0) is unchanged, keep on buffering.

It's all a bit hacky, but weeding out all those thousands of printks
which never get printed anyway doesn't sound much fun either.

> - printk(")");
> + printk(KERN_CONT ")");

And I do think we should avoid doing it that way, if only because it
consumes 10 display columns and makes a mess. Maybe use pr_cont()?
But that implies that the affected code is using the pr_foo()
facilities, and a lot of it doesn't. So maybe a new macro.

All a bit of a pain.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/