From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dave Chinner <david@fromorbit.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>,
LINUXFS-ML <linux-fsdevel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>,
James Bottomley <jbottomley@parallels.com>,
xemul@openvz.org
Subject: Re: [patch 0/3] A few patches for dcache
Date: Fri, 29 Jul 2011 08:24:41 +0100 [thread overview]
Message-ID: <20110729072441.GA2203@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20110729065951.GE5404@dastard>
On Fri, Jul 29, 2011 at 04:59:51PM +1000, Dave Chinner wrote:
> On Fri, Jul 29, 2011 at 09:59:18AM +0400, Cyrill Gorcunov wrote:
> > On Fri, Jul 29, 2011 at 01:25:03PM +1000, Dave Chinner wrote:
> > ...
> > >
> > > The VFS shrinker code is now already called on a per-sb basis. Each
> > > sb has it's own shrinker context that deals with dentries, inodes
> > > and anything a filesystem wants to have shrunk in the call. That
> > > solves the original issue I had with your "limit the dentry cache
> > > size" patch series in that it didn't shrink or limit the other VFS
> > > caches that were the ones that were really consuming all your
> > > memory...
> >
> > Thanks for comments, Dave! Still the read only lock without
> > increasing sequence number might be useful, no? (patch 1)
>
> I'll defer to Al on that one - the intricacies of the rename locking
> are way over my head.
I'm not sure that's safe. Note that one use of rename_lock is that
we allow hash lookup to race with d_move(). Which can move object
from one hash chain to another, so hash lookup may end up jumping
from one chain to another and getting a false negative. That's
why __d_lookup() is not safe without read_seqretry loop (or seq_writelock,
of course).
But look what happens if we do per-sb locks - d_move() derailing the
hash lookup might happen on *any* filesystem. They all share the
same hash table. So just checking that we hadn't done renames on
our filesystem is not enough to make sure we hadn't hit a false
negative.
Unless we go for making the hashtable itself per-superblock (and I really
doubt that it's a good idea), I don't see any obvious ways to avoid that
kind of race. IOW, how would you implement safe d_lookup()?
next prev parent reply other threads:[~2011-07-29 7:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 13:12 [patch 0/3] A few patches for dcache Cyrill Gorcunov
2011-07-28 13:12 ` [patch 1/3] vfs, dcache: Introduce lighten r/o rename_lock lockers Cyrill Gorcunov
2011-07-28 13:12 ` [patch 2/3] vfs, dcache: Factor out rename_lock locking Cyrill Gorcunov
2011-07-28 13:12 ` [patch 3/3] vfs: Make the rename_lock per-sb Cyrill Gorcunov
2011-07-29 3:25 ` [patch 0/3] A few patches for dcache Dave Chinner
2011-07-29 5:59 ` Cyrill Gorcunov
2011-07-29 6:59 ` Dave Chinner
2011-07-29 7:01 ` Cyrill Gorcunov
2011-07-29 7:24 ` Al Viro [this message]
2011-07-29 7:50 ` Cyrill Gorcunov
2011-08-15 7:42 ` Cyrill Gorcunov
2011-08-24 6:31 ` Pavel Emelyanov
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=20110729072441.GA2203@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.com \
--cc=gorcunov@gmail.com \
--cc=hch@infradead.org \
--cc=jbottomley@parallels.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xemul@openvz.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.