Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755989Ab3H3VLE (ORCPT ); Fri, 30 Aug 2013 17:11:04 -0400 Received: from g1t0026.austin.hp.com ([15.216.28.33]:15144 "EHLO g1t0026.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752857Ab3H3VLC (ORCPT ); Fri, 30 Aug 2013 17:11:02 -0400 Message-ID: <52210A55.8010308@hp.com> Date: Fri, 30 Aug 2013 17:10:45 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Al Viro CC: Linus Torvalds , 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" Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount References: <52200DAE.2020303@hp.com> <5220E56A.80603@hp.com> <5220F090.5050908@hp.com> <5220FD51.2010709@hp.com> <20130830205404.GF13318@ZenIV.linux.org.uk> In-Reply-To: <20130830205404.GF13318@ZenIV.linux.org.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1318 Lines: 28 On 08/30/2013 04:54 PM, Al Viro wrote: > 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... Actually, prepend_path() was called with rename_lock taken. So d_move() couldn't be run at the same time. Am I right? Regards, Longman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/