linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "George Spelvin" <linux@horizon.com>
To: torvalds@linux-foundation.org, viro@ZenIV.linux.org.uk
Cc: aswin@hp.com, john@stoffel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux@horizon.com,
	scott.norton@hp.com, Waiman.Long@hp.com
Subject: Re: [PATCH v4 1/1] dcache: Translating dentry into pathname without taking rename_lock
Date: 9 Sep 2013 20:40:20 -0400	[thread overview]
Message-ID: <20130910004020.29299.qmail@science.horizon.com> (raw)
In-Reply-To: <20130909182111.GQ13318@ZenIV.linux.org.uk>

I'm really wondering about only trying once before taking the write lock.
Yes, using the lsbit is a cute hack, but are we using it for its cuteness
rather than its effectiveness?

Renames happen occasionally.  If that causes all the current pathname
translations to fall back to the write lock, that is fairly heavy.
Worse, all of those translations will (unnecessarily) bump the write
seqcount, triggering *other* translations to fail back to the write-lock
path.

One patch to fix this would be to have the fallback read algorithm take
sl->lock but *not* touch sl->seqcount, so it wouldn't break concurrent
readers.

But another is to simply retry at least once (two attempts) on the
non-exclusive path before falling back to the exclusive one,  This means
that the count lsbit is no longer enough space for a retry counter, but
oh, well.

(If you really want to use one word, perhaps a better heuristic
as to how to retry would be to examine the *number* of writes
to the seqlock during the read.  If there was only one, there's a fair
chance that another read will succeed.  If there was more than one
(i.e. the seqlock has incremented by 3 or more), then forcing the
writers to stop is probably necessary.)

  parent reply	other threads:[~2013-09-10  0:40 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
2013-09-10  0:40           ` George Spelvin [this message]
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=20130910004020.29299.qmail@science.horizon.com \
    --to=linux@horizon.com \
    --cc=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=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).