Re: [RFC][PATCH 7/7] lockdep: spin_lock_nest_lock()

From: Steven Rostedt
Date: Wed Oct 08 2008 - 12:55:13 EST


Linus Torvalds wrote:

I know for a fact that some people thought unlocking in non-nested order was a bug. And I believe that belief is a dangerous one.

Ah, OK. You are fighting against nesting nazis, fair enough.

I have written a bit of code where nesting was not possible (similar to
your example, but I call those traversal locking not nesting). I just find that
the locks should be nested when the nesting is natural. Breaking the nesting
on natural nesting locks is a bug, IMHO. But as you know, there are several
programmers out there that can not determine the difference between natural
nesting locks and non nesting locks.

By adding such a rule, those that can not tell the difference will be making a
lot of needless noise, hence, it is best not to make any such rule.

Lesson learned. I'll now go back to debugging my code.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/