Messages in this thread | | | Date | Fri, 30 Mar 2012 10:10:59 -0400 | From | Christoph Hellwig <> | Subject | Re: [PATCH 05/13] XFS: Fix lock ASSERT on UP |
| |
On Fri, Mar 30, 2012 at 04:04:57PM +0200, Andi Kleen wrote: > It's really interesting how much you guys argue for your buggy construct > which you clearly never tested on a UP build...
spin_is_locked always return 0 on UP builds, and given that XFS only has !spin_is_locked asserts things will work just fine on UP builds (not the !CONFIG_SMP and !CONFIG_XFS_DEBUG would be a common combination).
In fact if you check the archives the one use of assert_spin_locked was added exactly because some still tripped over the spin_is_locked behaviour on UP relatively soon.
> Not sure if that is a hot path, but on highly contended locks every cache line > fetch is quite expensive on larger systems.
It's not an overly contended lock.
> also I doubt the thing really catches bugs, and if it did you would be > probably better off with a sparse notation or so.
This one probably doesn't - the first occurance is just after a blocking allocation, and the second one just before taking the lock. So they probably could as well just be removed.
The point that still stands is that lockdep_assert_held isn't actually a useful replacement.
| |