linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <waiman.long@hp.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	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 v3 1/1] dcache: Translating dentry into pathname without taking rename_lock
Date: Fri, 06 Sep 2013 22:24:01 -0400	[thread overview]
Message-ID: <522A8E41.3060607@hp.com> (raw)
In-Reply-To: <CA+55aFw8UuEmKsSdGZPUmcekZheNimEt4U81i7Bz0LipGzsFmg@mail.gmail.com>

On 09/06/2013 04:52 PM, Linus Torvalds wrote:
> On Fri, Sep 6, 2013 at 9:08 AM, Waiman Long<Waiman.Long@hp.com>  wrote:
>> This patch will replace the writer's write_seqlock/write_sequnlock
>> sequence of the rename_lock of the callers of the prepend_path() and
>> __dentry_path() functions with the reader's read_seqbegin/read_seqretry
>> sequence within these 2 functions.
> Ok, this actually looks really good.
>
> I do have one comment, from just reading the patch:
>
> I would really like the stuff inside the
>
>     restart:
>        bptr = *buffer;
>        blen = *buflen;
>        if (retry_cnt) {
>              seq = read_seqbegin(&rename_lock);
>              rcu_read_lock();
>        } else
>              write_seqlock(&rename_lock);
>
>        ... guts of path generation ...
>
>        if (retry_cnt) {
>              retry_cnt--;
>              rcu_read_unlock();
>              if (read_seqretry(&rename_lock, seq))
>                    goto restart;
>        } else
>              write_sequnlock(&rename_lock);
>
> could possible be done as a separate function?
>
> Alternatively (or perhaps additionally), maybe the locking could be
> done as an inline function too (taking the retry count as an argument)
> to make things a bit more easy to understand.

I would prefer putting the begin and end blocks into 2 helper inlined 
helper functions to make code easier to look at. I will work on this 
over the weekend.

-Longman


      parent reply	other threads:[~2013-09-07  2:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06 16:08 [PATCH v3 0/1] dcache: Translating dentry into pathname without taking rename_lock Waiman Long
2013-09-06 16:08 ` [PATCH v3 1/1] " Waiman Long
2013-09-06 20:52   ` Linus Torvalds
2013-09-06 21:05     ` Al Viro
2013-09-06 21:48       ` Linus Torvalds
2013-09-07  0:00         ` Al Viro
2013-09-07  0:19           ` Linus Torvalds
2013-09-07  0:58             ` Linus Torvalds
2013-09-07  3:01               ` Al Viro
2013-09-07 17:32                 ` Al Viro
2013-09-08  4:15                   ` Ian Kent
2013-09-08  4:58                     ` Al Viro
2013-09-08  8:51                       ` Ian Kent
2013-09-07 17:52                 ` Linus Torvalds
2013-09-07 18:07                   ` Al Viro
2013-09-07 18:53                     ` Al Viro
2013-09-09 14:31                     ` Waiman Long
2013-09-07  2:24     ` Waiman Long [this message]

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=522A8E41.3060607@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;
as well as URLs for NNTP newsgroup(s).