lglock: Update lockdep annotations to report recursive local locks
lglock: Update lockdep annotations to report recursive local locks

Oleg Nesterov recently noticed that the lockdep annotations in lglock.c
are not sufficient to detect some obvious deadlocks, such as
lg_local_lock(LOCK) + lg_local_lock(LOCK) or spin_lock(X) +
lg_local_lock(Y) vs lg_local_lock(Y) + spin_lock(X).

Both issues are easily fixed by indicating to lockdep that lglock's local
locks are not recursive.  We shouldn't use the rwlock acquire/release
functions here, as lglock doesn't share the same semantics.  Instead we
can base our lockdep annotations on the lock_acquire_shared (for local
lglock) and lock_acquire_exclusive (for global lglock) helpers.

I am not proposing new lglock specific helpers as I don't see the point of
the existing second level of helpers :)

Noticed-by: Oleg Nesterov <20b70f0af00562e63758b9ee42012ecc96c58590@redhat.com>
Signed-off-by: Michel Lespinasse <6a4cf9207bb95b1a4cf1be22c2e93f8b38036f65@google.com>
Cc: Lai Jiangshan <4c9eb49378914b743bdd32292c04df29b820d73e@cn.fujitsu.com>
Cc: "Srivatsa S. Bhat" <5b23f8226e886b22344fc642373ea657dd596b63@linux.vnet.ibm.com>
Cc: Rusty Russell <df9728c9e5104131c08c7adb03af425394842596@rustcorp.com.au>
Cc: Andi Kleen <0474aee45985f5ae829f53849df476200e876990@linux.intel.com>
Cc: "Paul E. McKenney" <1e0ce936bb9b355d257bf5790d2513c3f28be22b@us.ibm.com>
Cc: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Link: 940ab9096163b446819d6e9bf54488586073b57e@corp2gmr1-1.hot.corp.google.com
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs