Subject: Re: new SMP problems
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: port-sparc
Date: 01/15/2003 23:34:44
>  > You have LOCKDEBUG on, which has a problem of its own (well, on sparc at least)
>  > If you want it, apply this patch:
> 
> Ew!  That's pretty special.  Is there no way to make IPIs come in at
> > spllock()?  The i386 port does this (which means it has some special
> interrupt/lock protocols in a few MD places).

I suppose spllock() could be lowered safely, but that's not the point.

The _simple_lock() function should not continue at spllock() while
actually spinning on the __cpu_simple_lock. It's perfectly valid to try
and grab a simple lock at, say, base priority as long as that lock is not
used in an interrupt context.

Unless of course, the rule is that only `spinlockmgr' locks are to be used
for such cases and simple locks should always be taken at spllock().
In that case however, it would make no sense for _simple_lock() to raise to
spllock(), but instead should check for being called at spllock() (or
higher) to aid in debugging.

>  > 
>  > Index: kern_lock.c
>  > ===================================================================
>  > RCS file: /cvsroot/src/sys/kern/kern_lock.c,v
>  > retrieving revision 1.67
>  > diff -r1.67 kern_lock.c
>  > 1052a1053
>  > >       splx(s);
>  > 1053a1055
>  > >       s = spllock();
> 
> -- 
>         -- Jason R. Thorpe <thorpej@wasabisystems.com>
>