Re: [PATCH -rt] printk: Don't emit console_cpu_notify() for CPU_DYING

From: Yong Zhang
Date: Thu Nov 17 2011 - 00:29:19 EST


On Wed, Nov 16, 2011 at 03:48:11PM +0100, Thomas Gleixner wrote:
> On Wed, 16 Nov 2011, Steven Rostedt wrote:
> > Thomas, doesn't printk not print to serial in atomic contexts? Or did

I guess you mean console_trylock_for_printk() will fail in atomic context?
If so, yeah, that doesn't change.

But the issue is console_cpu_notify() call console_lock() directly.
That means below scenario could also happen in mainline:

CPU A CPU B

doing printk with console_sem held
take_cpu_down();
cpu_notify(CPU_DYING);
console_cpu_notify();
console_lock();
down(&console_sem);
*bang*
up(&console_sem);

Sounds I should also send this patch to mainline.

Thanks,
Yong
--
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/