Messages in this thread | | | Date | Sun, 5 Sep 1999 00:31:32 +0200 | From | Matthew Wilcox <> | Subject | Re: SMP linux help |
| |
On Sat, Sep 04, 1999 at 02:54:33PM -0700, Nate Eldredge wrote: > I have been wondering about the locking stuff for a while too. These > are probably dumb questions but my OS terminology is not what it could > be. (Is there a good reference somewhere?) > > * Does "lock the kernel" mean "prevent anyone else from executing any > kernel code"? > > * If so, what happens if some other CPU is already inside the kernel? > Is there some mechanism to stop the other CPU??
If another CPU holds the kernel lock, we spin until it has released it, just as any other spinlock (<asm-i386/smplock.h>). lock_kernel prevents any other processor from simultaneously executing any other code that is also protected by the big kernel lock.
spinning means constantly polling a lock until it's available.
-- Matthew Wilcox <willy@bofh.ai> "Windows and MacOS are products, contrived by engineers in the service of specific companies. Unix, by contrast, is not so much a product as it is a painstakingly compiled oral history of the hacker subculture." - N Stephenson
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |