Re: SMP linux help

Sushil Agrawal (sushil@iitk.ac.in)
Sat, 4 Sep 1999 18:55:03 +0530 (IST)


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?

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

Bye,
Sushil.

On Sat, 4 Sep 1999, Matthew Wilcox wrote:

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

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