Re: [PATCH] printk deadlocks if called with runqueue lock held

Steven Rostedt
2008-01-18T01:53:55Z

On Thu, 17 Jan 2008, Linus Torvalds wrote:

> IOW, I think this should be
>
> if (raw_irqs_disabled_flags(flags) && wake_klogd)
> wake_up_klogd();
>
> Of course, not all architectures seem to suport that thing (it's currently
> only used by the CONFIG_TRACE_IRQFLAGS config option).
>
> Damn. So close, yet so far away.

Perhaps we can define something like:

#ifdef CONFIG_HAS_RAW_IRQS_DISABLED_FLAGS
# define test_irqs_disabled_flags(flags) raw_irqs_disabled_flags(flags)
#else
# define test_irqs_disabled_flags(flags) \
({ (void)flags; irqs_disabled();})
#endif

then we could do

if (test_irqs_disabled_flags(flags) && wake_klogd)
wake_up_klogd();

Or is this asking too much ;-)

-- Steve