Re: SMP linux help

Matthew Wilcox (Matthew.Wilcox@genedata.com)
Sat, 4 Sep 1999 15:48:13 +0200


On Sat, Sep 04, 1999 at 06:55:03PM +0530, Sushil Agrawal wrote:
> Hi,
> Thanks Matthew for the help.
> Does that mean that as of now (in linux 2.2.9) the
> spin_lock(&lastpid_lock) and read_lock(&tasklist_lock) in the get_pid()
> function in fork.c are redundant?

Not at all. The spinlocks are used in this place so the kernel lock can
be dropped.

> Also, why is current->lock_depth used in lock_kernel() macro? We could
> have just used kernel_flag as a lock variable?

Because it's legal to call lock_kernel recursively, as long as you
pair it with the correct number of unlock_kernel calls.

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