Re: [PATCH] defer printks in irqs

From: Tim Bird
Date: Thu Jan 24 2008 - 18:17:55 EST


Peter Zijlstra wrote:
> I suspect these features reduce the chance a crash messages makes it out
> onto the console, but fail to spot any of the copious text mention this
> critical issue.

Anything not in interrupts would not be deferred.
The following code is meant to avoid deferring in oops as well.
I'm not sure if that covers all crash cases or not.
If you know of other cases, and ways to detect them, please advise.

>> +#ifdef CONFIG_PRINTK_DEFER_IN_IRQ
>> + /*
>> + * If we're in an interrupt and it's not an emergency,
>> + * don't emit to console just yet.
>> + */
>> + if ((irqs_disabled() || in_interrupt()) && !oops_in_progress) {
>> + defer = 1;
>> + }
>> +#endif

I made the code conditional because printk messages are pretty
critical for debugging, and I wanted someone to be aware if they
altered the behavior in any way. I suspect that only in embedded,
when people are having realtime performance problems, would this
change be of interest.

Please recognize that I'm not submitting this for kernel inclusion
at this time. Please see the larger thread for context. That said,
I appreciate the feedback on the code.
-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================

--
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/