public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <waiman.long@hp.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Chandramouleeswaran, Aswin" <aswin@hp.com>,
	"Norton, Scott J" <scott.norton@hp.com>,
	George Spelvin <linux@horizon.com>,
	John Stoffel <john@stoffel.org>
Subject: Re: [PATCH v4 1/1] dcache: Translating dentry into pathname without taking rename_lock
Date: Mon, 09 Sep 2013 18:57:29 -0400	[thread overview]
Message-ID: <522E5259.7090000@hp.com> (raw)
In-Reply-To: <20130909192835.GU13318@ZenIV.linux.org.uk>

On 09/09/2013 03:28 PM, Al Viro wrote:
> On Mon, Sep 09, 2013 at 08:10:29PM +0100, Al Viro wrote:
>> On Mon, Sep 09, 2013 at 02:46:57PM -0400, Waiman Long wrote:
>>
>>> I am fine with your proposed change as long as it gets the job done.
>> I suspect that the real problem is the unlock part of read_seqretry_or_unlock();
>> for d_walk() we want to be able to check if we need retry and continue walking
>> if we do not.  Let's do it that way: I've applied your patch as is, with the
>> next step being
>> 	* split read_seqretry_or_unlock():
>> need_seqretry() (return (!(seq&  1)&&  read_seqretry(lock, seq))
>> done_seqretry() (if (seq&  1) write_sequnlock(lock, seq)),
>> your if (read_seqretry_or_unlock(&rename_lock,&seq))
>> 		goto restart;
>> becoming
>> 	if (need_seqretry(&rename_lock, seq)) {
>> 		seq = 1;
>> 		goto restart;
>> 	}
>> 	done_seqretry(&rename_lock, seq);
>>
>> Then d_walk() is trivially massaged to use of read_seqbegin_or_lock(),
>> need_seqretry() and done_seqretry().  Give me a few, I'll post it...
> OK, how about this?  It splits read_seqretry_or_unlock(), takes
> rcu_read_{lock,unlock} in the callers and converts d_walk() to those
> primitives.  I've pushed that and your commit into vfs.git#experimental
> (head at 48f5ec2, should propagate in a few); guys, please give it a look
> and comment.

The changes look good to me. I was planning to take rcu_read_lock() out 
and doing something similar, but your change is good. BTW, I think Linus 
want to add some comments on why RCU lock is needed without the 
rename_lock, but I can put that in with a follow-up patch once the 
current change is merged.

Thank for your help and inspiration on this patch.

-Longman

  reply	other threads:[~2013-09-09 22:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 16:18 [PATCH v4 0/1] dcache: Translating dentry into pathname without taking rename_lock Waiman Long
2013-09-09 16:18 ` [PATCH v4 1/1] " Waiman Long
2013-09-09 17:29   ` Al Viro
2013-09-09 17:45     ` Linus Torvalds
2013-09-09 17:56       ` Waiman Long
2013-09-09 18:06       ` Al Viro
2013-09-09 18:15         ` Linus Torvalds
2013-09-09 18:21         ` Al Viro
2013-09-09 18:36           ` Al Viro
2013-09-09 18:46             ` Al Viro
2013-09-09 18:46             ` Waiman Long
2013-09-09 19:10               ` Al Viro
2013-09-09 19:28                 ` Al Viro
2013-09-09 22:57                   ` Waiman Long [this message]
2013-09-10  0:40           ` George Spelvin
2013-09-10  0:57             ` Al Viro
2013-09-10  1:15               ` Ramkumar Ramachandra
2013-09-10  1:34                 ` Linus Torvalds
2013-09-10  2:25                   ` Al Viro
2013-09-10  2:33                     ` Linus Torvalds
2013-09-10  3:12                   ` Ramkumar Ramachandra
2013-09-10  8:24               ` George Spelvin
2013-09-10  3:57             ` Waiman Long
2013-09-09 17:55     ` Waiman Long
2013-09-09 18:07       ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522E5259.7090000@hp.com \
    --to=waiman.long@hp.com \
    --cc=aswin@hp.com \
    --cc=john@stoffel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=scott.norton@hp.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox