Re: SMP linux help

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


The lock_kernel locks the entire kernel; this is sometimes referred
to as the big kernel lock. Originally, this was the only lock, and
was acquired whenever the kernel was entered. The big lock is being
replaced in certain places by finer-grained locking and mutexes, but
this task is not yet complete.

On Sat, Sep 04, 1999 at 05:55:38PM +0530, sushil@iitk.ac.in wrote:
> Hi,
> I am running linux 2.9.9 kernel.
> I am trying the understand the locking mechanism used in linux to make
> the kernel SMP safe. In do_fork() (also in many other syscall interface
> functions) there is call to lock_kernel() function. What does
> lock_kernel() do? If it is used to synchronize the access to kernel data
> structures from other processes on other processors, then why, after
> having called this function, we again try to do some locking like calling
> spin_lock(&lastpid_lock) in get_pid()?
>
> I have seen the definition of lock_kernel. It increments the
> current->lock_depth and if it nonzero then tries to lock the kernel_flag
> variable.
>
> Kindly reply.
> I am on this mailing list.
>
> Thanks,
> Sushil.
>
>
>
>
>
> -
> 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/

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