From: Al Viro <viro@ZenIV.linux.org.uk>
To: NeilBrown <neilb@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] Improve fairness when locking the per-superblock s_anon list
Date: Thu, 9 Nov 2017 23:19:52 +0000 [thread overview]
Message-ID: <20171109231952.GF21978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <87zi7vdp7u.fsf@notabene.neil.brown.name>
On Fri, Nov 10, 2017 at 10:09:09AM +1100, NeilBrown wrote:
> So if an NFS server is getting lots of read/write request without opens
> or other pathname lookups, it could easily have lots of disconnected
> files being repeatedly accessed. Keeping the dentries on d_anon means
> we don't need to keep allocating new ones for every request.
>
> So I'm not keen on dropping an IS_ROOT() dentry at final dput(), but
> it might make sense to add the dentry to the per-fs list of IS_ROOT
> dentries at that time.
Watch out for dput() fast path (see fast_dput()) if you go that way.
> One possible approach would be to use d_child rather than d_hash to link
> together dentries that don't have a parent.
> We could assign a random number to d_name.hash so it could appear to be
> hashed without imposing on any one hash chain. We would still need a
> spinlock in the superblock to manage the d_anon list that links the
> d_child's together...
> I might try to see how the code looks.
Keep in mind that d_hash() includes bits of ->d_parent, aka. dentry itself.
So no need for fake ->d_name.hash; you'll get spread from that part.
->d_child is... delicate. There are very interesting games around d_walk
vs. dput already; I'd be very careful with that one.
next prev parent reply other threads:[~2017-11-09 23:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 3:22 [PATCH 0/3] Three VFS patch resends NeilBrown
2017-11-09 3:22 ` [PATCH 1/3] VFS: use synchronize_rcu_expedited() in namespace_unlock() NeilBrown
2017-11-09 3:22 ` [PATCH 2/3] Improve fairness when locking the per-superblock s_anon list NeilBrown
2017-11-09 19:52 ` Linus Torvalds
2017-11-09 20:50 ` Al Viro
2017-11-09 23:09 ` NeilBrown
2017-11-09 23:19 ` Al Viro [this message]
2017-11-10 0:02 ` Linus Torvalds
2017-11-10 8:50 ` Christoph Hellwig
2017-11-09 3:22 ` [PATCH 3/3] VFS: close race between getcwd() and d_move() NeilBrown
2017-11-09 11:41 ` Nikolay Borisov
2017-11-09 13:08 ` Matthew Wilcox
2017-11-09 16:02 ` Nikolay Borisov
2017-11-09 20:23 ` Linus Torvalds
2017-11-09 22:14 ` NeilBrown
2017-11-10 1:40 ` Linus Torvalds
2017-11-10 4:45 ` NeilBrown
2017-11-10 19:52 ` Linus Torvalds
2017-11-10 20:53 ` Al Viro
2017-11-21 23:50 ` Al Viro
2017-11-22 1:31 ` NeilBrown
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=20171109231952.GF21978@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.com \
--cc=torvalds@linux-foundation.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 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).