Re: [PATCH 2/2] sysctl: lockdep support for sysctl reference counting.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric W. Biederman
Date: Tuesday, March 31, 2009 - 3:44 pm

Peter Zijlstra <peterz@infradead.org> writes:


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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] sysctl: lockdep support., Eric W. Biederman, (Sat Mar 21, 12:39 am)
[PATCH 1/2] sysctl: Don't take the use count of multiple h ..., Eric W. Biederman, (Sat Mar 21, 12:40 am)
[PATCH 2/2] sysctl: lockdep support for sysctl reference ..., Eric W. Biederman, (Sat Mar 21, 12:42 am)
Re: [PATCH 2/2] sysctl: lockdep support for sysctl refere ..., Eric W. Biederman, (Mon Mar 30, 3:53 pm)
Re: [PATCH 2/2] sysctl: lockdep support for sysctl refere ..., Eric W. Biederman, (Mon Mar 30, 4:50 pm)
Re: [PATCH 2/2] sysctl: lockdep support for sysctl refere ..., Eric W. Biederman, (Tue Mar 31, 1:47 am)
Re: [PATCH 2/2] sysctl: lockdep support for sysctl refere ..., Eric W. Biederman, (Tue Mar 31, 6:40 am)
Re: [PATCH 2/2] sysctl: lockdep support for sysctl refere ..., Eric W. Biederman, (Tue Mar 31, 3:44 pm)