linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Tree sweep for spin_is_locked misuses and start warning about it
@ 2012-03-16 19:00 Andi Kleen
  2012-03-16 19:00 ` [PATCH 01/11] block: use lockdep_assert_held for queue locking Andi Kleen
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: Andi Kleen @ 2012-03-16 19:00 UTC (permalink / raw)
  To: linux-kernel

I did a tree sweep for spin_is_locked() users and many of them were
wrong, got UP incorrect, were obviously racy and had other problems.
I replaced a lot of users with calls to the correct lock debugging functions,
like lockdep_assert_held()

Generally I think spin_is_locked() should be deprecated because it 
is rarely used correctly. There are a few legitimate users so we cannot
outright remove it unfortunately.

But most users can be removed or changed.

After this start warning in checkpatch.pl for spin_is_locked() because
it's rarely wrong. Also error out there for the broken
(WARN|BUG)_ON(!spin_is_locked()) which does not work on UP builds.

-Andi


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-03-21  0:44 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 19:00 Tree sweep for spin_is_locked misuses and start warning about it Andi Kleen
2012-03-16 19:00 ` [PATCH 01/11] block: use lockdep_assert_held for queue locking Andi Kleen
2012-03-16 19:00 ` [PATCH 02/11] sgi-xp: Use lockdep_assert_held Andi Kleen
2012-03-16 19:11   ` Robin Holt
2012-03-16 19:00 ` [PATCH 03/11] ada152x: Remove broken usage of spin_is_locked Andi Kleen
2012-03-16 19:00 ` [PATCH 04/11] staging/zmem: Use lockdep_assert_held instead " Andi Kleen
2012-03-16 19:00 ` [PATCH 05/11] XFS: Fix lock ASSERT on UP Andi Kleen
2012-03-19 22:47   ` Dave Chinner
2012-03-20  2:28     ` Andi Kleen
2012-03-21  0:44       ` Dave Chinner
2012-03-16 19:00 ` [PATCH 06/11] huge-memory: Use lockdep_assert_held Andi Kleen
2012-03-16 19:44   ` Andrea Arcangeli
2012-03-16 21:18     ` Hugh Dickins
2012-03-16 19:01 ` [PATCH 07/11] futex: Use lockdep_assert_held() for lock checking Andi Kleen
2012-03-16 19:01 ` [PATCH 08/11] irda: remove spin_is_locked Andi Kleen
2012-03-16 19:01 ` [PATCH 09/11] usb: gadget: f_fs: Remove lock is held before freeing checks Andi Kleen
2012-03-16 19:01 ` [PATCH 10/11] smsc911x: Use lockdep_assert_held instead of home grown buggy construct Andi Kleen
2012-03-16 19:01 ` [PATCH 11/11] checkpatch: Check for spin_is_locked Andi Kleen
2012-03-16 19:22   ` Joe Perches
2012-03-16 20:14     ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).