Subject: Re: SMP API things, lock debugging, etc.
To: None <>
From: Stefan Grefen <>
List: tech-smp
Date: 07/27/1999 19:31:26
"Eduardo E. Horvath" wrote:


> Are all locks spinlocks?  What about stealing the adaptive mutex concept
> from Solaris?

They can be build in a MI way using those MD spinlocks. All you need is
a spinlock
(that should block all interrupts on THIS cpu) and you can build those
On this level only a CPU can be owner of a lock. Anything that goes to
should never hold a spin lock while sleeping.


> >
> > #if defined(MULTIPROCESSOR)
> > #define       curproc         cpu_info[cpu_number()].ci_curproc
> > #else
> > extern struct proc    *curproc;
> > #endif
> >
> Why not just have a function that returns a pointer to the current
> cpu_info structure?  Array indexing may require rather expensive
> multiplication if the cpu_info structure is not a power of 2.

I think each CPU should have a private page mapped at the same VA,
the cpu_info struct or at least the pointer to it's curproc. 
Alternatively we could make the cpu_info an array of pointers.
I would prefer the private page, because this would be only one instead
2 pointer lookups.


> =========================================================================
> Eduardo Horvath               
>         "I need to find a pithy new quote." -- me

Stefan Grefen                                Tantau Software
International Inc. 
 --- Hacking's just another word for nothing left to kludge. ---