That is an artifact of sysctl_lock being used to implement
table_lock as best as I can tell. The case you point
out I could probably play with where I claim the lock
is acquired and make it work.
__sysctl_head_next on the read side is trickier.
We come in with table_lock held for read.
We grab sysctl_lock.
We release table_lock (aka the reference count is decremented)
We grab table_lock on the next table (aka the reference count is incremented)
We release sysctl_lock
If we generate lockdep annotations for that it would seem to transition
through the states:
table_lock
table_lock -> sysctl_lock
sysctl_lock
sysctl_lock -> table_lock
table_lock
Short of saying table_lock is an implementation detail. Used to
make certain operations atomic I do not see how to model this case.
Let me take a slightly simpler case and ask how that gets modeled.
Looking at rwsem. Ok all of the annotations are outside of the
spin_lock. So in some sense we are sloppy, and fib to lockdep
about when the we acquire/release a lock. In another sense
we are simply respecting the abstraction.
I guess I can take a look and see if I can model things a slightly
more lossy fashion so I don't need to do the __raw_spin_lock thing.
The only difference I can possibly see is read side versus write side.
Or in my case refcount side versus wait side.
Eric
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html