summaryrefslogtreecommitdiff
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-03-07 20:00:34 (GMT)
committerScott Wood <scottwood@freescale.com>2014-05-14 18:38:37 (GMT)
commit587c55f3b7e91d6b5059b6276b3c9c6789e514be (patch)
tree333f48e8692f0fd37b3eae27b8335b416e656518 /fs/dcache.c
parenta473767a5b67bc7b0196a61e9e26aec5298c1928 (diff)
downloadlinux-fsl-qoriq-587c55f3b7e91d6b5059b6276b3c9c6789e514be.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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 8ef74f3..2f9d6f3 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>
@@ -554,7 +555,7 @@ dentry_kill(struct dentry *dentry, int unlock_on_failure)
relock:
if (unlock_on_failure) {
spin_unlock(&dentry->d_lock);
- cpu_relax();
+ cpu_chill();
}
return dentry; /* try again with same dentry */
}
@@ -2391,7 +2392,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;