Re: recursive locks in kernel?

Paul Rusty Russell (Paul.Russell@rustcorp.com.au)
Sun, 26 Sep 1999 12:50:52 +0930


In message <Pine.LNX.4.10.9909240520080.37934025-100000@csemt83.cse.iitk.ac.in>
you write:
> and some of them not. Now the problem arises if this lower level function
> also wants to lock the same data because it does not know whether the data is
> already locked by some higher level function or not. If it just locks it
> blindly then this could lead to a deadlock.

It can be a problem: there are cases where a `raw' version of a
function is required (usually __xxx) which doesn't grab the lock.

However, if your calls are so convoluted that you don't realize that a
public lock will be grabbed, you've got more subtle deadlock problems
with grabbing locks out of order, which can't be hacked around by
making locks recursive.

My 2c,
Rusty.

--
Hacking time.

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