From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Date: Fri, 30 Aug 2013 21:54:04 +0100 Message-ID: <20130830205404.GF13318@ZenIV.linux.org.uk> References: <52200DAE.2020303@hp.com> <5220E56A.80603@hp.com> <5220F090.5050908@hp.com> <5220FD51.2010709@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Waiman Long , Ingo Molnar , Benjamin Herrenschmidt , Jeff Layton , Miklos Szeredi , Ingo Molnar , Thomas Gleixner , linux-fsdevel , Linux Kernel Mailing List , Peter Zijlstra , Steven Rostedt , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" To: Linus Torvalds Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Aug 30, 2013 at 01:43:11PM -0700, Linus Torvalds wrote: > On Fri, Aug 30, 2013 at 1:15 PM, Waiman Long wrote: > > > > The prepend_path() isn't all due to getcwd. The correct profile should be > > Ugh. I really think that prepend_path() should just be rewritten to > run entirely under RCU. > > Then we can remove *all* the stupid locking, and replace it with doing > a read-lock on the rename sequence count, and repeating if requited. > > That shouldn't even be hard to do, it just requires mindless massaging > and being careful. Not really. Sure, you'll retry it if you race with d_move(); that's not the real problem - access past the end of the object containing ->d_name.name would screw you and that's what ->d_lock is preventing there. Delayed freeing of what ->d_name is pointing into is fine, but it's not the only way to get hurt there...