Re: 3.5-rc6 printk formatting problem during oom-kill.

Linus Torvalds
2012-07-12T17:11:45Z

On Thu, Jul 12, 2012 at 7:05 AM, Dave Jones <davej@redhat.com> wrote:
>
> I've seen it a few times, always with the soft lockup trace.

I bet it's because you have tons of modules, and the line ends up
being *really* long. And overflows LOG_LINE_MAX. I suspect something
odd happens.

There are tons of odd special cases for LOG_LINE_MAX, and I bet Kay
doesn't see it for the simple reason that he's not totally insane, and
hasn't loaded hundreds of modules.

Kay, I suspect the "continuation line" logic could easily have a rule like

"If the old line is already > 80 characters, do a line break here
and add TAB to the beginning of the new line"

In fact, that could be really nice for things like stack dumps etc -
we wouldn't have to worry about line breaks and crap, if the printk
logic just makes "KERN_CONT" do a line break automatically if it
doesn't fit on the screen.

People who use KERN_CONT don't do it because they *need* things to be
on one line (it's not guaranteed anyway), they do it because they want
the output to be dense and readable. Doing auto-line-break would
actually *help*. And would mean that you never hit the odd
LOG_LINE_MAX cases just because somebody is printing lots of modules.

Linus