[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081230144836.GA31439@lst.de>
Date: Tue, 30 Dec 2008 15:48:37 +0100
From: Christoph Hellwig <hch@....de>
To: Andi Kleen <andi@...stfloor.org>
Cc: Christoph Hellwig <hch@....de>, Jonathan Corbet <corbet@....net>,
Al@....sgi.com, Oleg Nesterov <oleg@...hat.com>,
LKML <linux-kernel@...r.kernel.org>, bfields@...ldses.org,
xfs-masters@....sgi.com, Viro <viro@...IV.linux.org.uk>,
Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [xfs-masters] RFC: Fix f_flags races without the BKL
On Tue, Dec 30, 2008 at 02:37:37PM +0100, Andi Kleen wrote:
> That's not clear. Mutexes can be much slower than a spinlock
> like BKL in some situations, mostly because they schedule more and
> have generally more overhead.
>
> As long as you don't have another BKL user contending the BKL
> is likely faster than the mutex.
Note that I did not say faster, but better. The subtle races the
BKL semantics introduce are nasty.
That beeing said I took another look at the patch and it seems like
most places are indeed just very quick flags setting / clearing
with the only sleeping possible inside ->fasync. So having a
file_flags_lock spinlock, and another sleeping mutex protecting
->fasync might be another options.
Jon, do you remember what we actually need to protect in -fasync?
any reason not to take the locking inside the method? Together with
->lock and the old ->ioctl it's pretty special in fops as none of
the others have any locking at all.
>
> -Andi
>
> --
> ak@...ux.intel.com
>
> _______________________________________________
> xfs-masters mailing list
> xfs-masters@....sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs-masters
---end quoted text---
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists