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

Steven Rostedt
2008-10-08T16:55:10Z

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