xfs-masters
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 05/13] XFS: Fix lock ASSERT on UP
From: Andi Kleen <andi@xxxxxxxxxxxxxx>
Date: Fri, 30 Mar 2012 16:04:57 +0200
Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, akpm@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Andi Kleen <ak@xxxxxxxxxxxxxxx>, xfs-masters@xxxxxxxxxxx
In-reply-to: <20120330041348.GF18323@dastard>
References: <1332895637-32572-1-git-send-email-andi@xxxxxxxxxxxxxx> <1332895637-32572-6-git-send-email-andi@xxxxxxxxxxxxxx> <20120329232114.GA26342@xxxxxxxxxxxxx> <20120329235201.GF17822@xxxxxxxxxxxxxxxxxx> <20120330041348.GF18323@dastard>
User-agent: Mutt/1.4.2.2i
On Fri, Mar 30, 2012 at 03:13:48PM +1100, Dave Chinner wrote:
> On Fri, Mar 30, 2012 at 01:52:01AM +0200, Andi Kleen wrote:
> > On Thu, Mar 29, 2012 at 07:21:14PM -0400, Christoph Hellwig wrote:
> > > On Tue, Mar 27, 2012 at 05:47:09PM -0700, Andi Kleen wrote:
> > > > From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> > > > 
> > > > ASSERT(!spin_is_locked()) doesn't work on UP builds. Replace with a 
> > > > standard
> > > > lockdep_assert_held()
> > > 
> > > The "standard" is assert_spin_locked() - which not only is much cheaper
> > > but also has the advantage of working in non-lockdep builds.
> > 
> > But then you have it unconditional, not just on debug builds.
> 
> And the problem with that is what? There is so little overhead to the
> check it doesn't matter that it is enabled in production kernels...

It's really interesting how much you guys argue for your buggy construct
which you clearly never tested on a UP build...

Not sure if that is a hot path, but on highly contended locks every cache line
fetch is quite expensive on larger systems.

also I doubt the thing really catches bugs, and if it did you would be 
probably better off with a sparse notation or so.

Anyways I will turn it into the normal assert.

-Andi
-- 
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.

<Prev in Thread] Current Thread [Next in Thread>