Commit 358eec18 authored by Linus Torvalds's avatar Linus Torvalds

vfs: decrapify dput(), fix cache behavior under normal load

We do not want to dirty the dentry->d_flags cacheline in dput() just to
set the DCACHE_REFERENCED flag when it is already set in the common case
anyway.  This way the first cacheline of the dentry (which contains the
RCU lookup information etc) can stay shared among multiple CPU's.

This finishes off some of the details of all the scalability patches
merged during the merge window.

Also don't mark dentry_kill() for inlining, since it's the uncommon path
and inlining it just makes the common path slower due to extra function
entry/exit overhead.
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0baab4fd
...@@ -542,7 +542,7 @@ EXPORT_SYMBOL(d_drop); ...@@ -542,7 +542,7 @@ EXPORT_SYMBOL(d_drop);
* If ref is non-zero, then decrement the refcount too. * If ref is non-zero, then decrement the refcount too.
* Returns dentry requiring refcount drop, or NULL if we're done. * Returns dentry requiring refcount drop, or NULL if we're done.
*/ */
static inline struct dentry * static struct dentry *
dentry_kill(struct dentry *dentry, int unlock_on_failure) dentry_kill(struct dentry *dentry, int unlock_on_failure)
__releases(dentry->d_lock) __releases(dentry->d_lock)
{ {
...@@ -630,6 +630,7 @@ void dput(struct dentry *dentry) ...@@ -630,6 +630,7 @@ void dput(struct dentry *dentry)
goto kill_it; goto kill_it;
} }
if (!(dentry->d_flags & DCACHE_REFERENCED))
dentry->d_flags |= DCACHE_REFERENCED; dentry->d_flags |= DCACHE_REFERENCED;
dentry_lru_add(dentry); dentry_lru_add(dentry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment