diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-03-07 20:00:34 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2015-02-13 22:20:54 (GMT) |
commit | fae775f49cbca6660d77086c4eed1d2c77afcdb0 (patch) | |
tree | 076cdd973f65d2e4c80f7a48b47de8cd6b39f914 /fs/dcache.c | |
parent | fb89e9743e513d51e2ea43deb0451461c328435c (diff) | |
download | linux-fsl-qoriq-fae775f49cbca6660d77086c4eed1d2c77afcdb0.tar.xz |
fs: dcache: Use cpu_chill() in trylock loops
Retry loops on RT might loop forever when the modifying side was
preempted. Use cpu_chill() instead of cpu_relax() to let the system
make progress.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index eb540b0..ed35215 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -19,6 +19,7 @@ #include <linux/mm.h> #include <linux/fs.h> #include <linux/fsnotify.h> +#include <linux/delay.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/hash.h> @@ -465,7 +466,7 @@ EXPORT_SYMBOL(d_drop); static void __dentry_kill(struct dentry *dentry) { - struct dentry *parent = NULL; +struct dentry *parent = NULL; bool can_free = true; if (!IS_ROOT(dentry)) parent = dentry->d_parent; @@ -545,7 +546,7 @@ static struct dentry *dentry_kill(struct dentry *dentry) failed: spin_unlock(&dentry->d_lock); - cpu_relax(); + cpu_chill(); return dentry; /* try again with same dentry */ } @@ -920,7 +921,7 @@ static void shrink_dentry_list(struct list_head *list) spin_unlock(&dentry->d_lock); if (parent) spin_unlock(&parent->d_lock); - cpu_relax(); + cpu_chill(); continue; } __dentry_kill(dentry); @@ -2289,7 +2290,7 @@ again: if (dentry->d_lockref.count == 1) { if (!spin_trylock(&inode->i_lock)) { spin_unlock(&dentry->d_lock); - cpu_relax(); + cpu_chill(); goto again; } dentry->d_flags &= ~DCACHE_CANT_MOUNT; |