Re: printk() with a spin-lock held.

From: Lee Revell
Date: Sat Oct 23 2004 - 02:06:57 EST


On Fri, 2004-10-22 at 22:27 -0700, Andrew Morton wrote:
> Lee Revell <rlrevell@xxxxxxxxxxx> wrote:
> >
> > On Fri, 2004-10-22 at 15:07 -0400, Richard B. Johnson wrote:
> > > Linux-2.6.9 will bug-check and halt if my code executes
> > > a printk() with a spin-lock held.
> > >
> > > Is this the intended behavior?
> >
> > Yes. printk() can sleep. No sleeping with a spinlock held.
> >
>
> printk() does not sleep and may be called from any context except
>
> a) NMI handlers and
>
> b) when holding a scheduler runqueue->lock while klogd is running.
>

Oops, thinko. Thanks.

Lee

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