Re: [PATCH 05/13] XFS: Fix lock ASSERT on UP

From: Christoph Hellwig
Date: Fri Mar 30 2012 - 10:11:08 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/