Subject: Re: kprintf locking problem.
To: None <thorpej@zembu.com>
From: Anders Magnusson <ragge@ludd.luth.se>
List: tech-smp
Date: 06/03/2001 17:47:19
> On Sun, Jun 03, 2001 at 04:55:04PM +0200, Anders Magnusson wrote:
> 
>  > The kernel printf routines are protected by a spinlock so that only
>  > one processor can be in the printf routnes at the same time. I assume
>  > that this locking is to protect the console hardware from being accessed
>  > from more than one CPU at a time. This causes problem on machines where
>  > only one CPU can access the system console and the rest must send their
>  > data over via IPI: if a slave CPU enters the printf routines, and then
>  > the master CPU also tries to do a printf, the master will spinlock at
>  > high ipl. Meanwhile the slave has reached putchar() and sends an IPI 
>  > which will never reach the master, hence the deadlock.
> 
> Well, it's also designed to prevent interleaved printf characters, i.e.
> you want to be able to see:
> 
[...]
> Does the VAX's scheme deal with that okay?
>
Not from the slave CPUs (because the chars are sent via IPI).

> Also, where do you want
> to put the new #define?  Probably should be in sys/types.h, or something,
> as __NO_KPRINTF_LOCK.
> 
It doesn't matter at all, I just want this to work for some degree of "work".
I am interested in all suggestions as long as this problem is solved.

-- Ragge