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-04-10 00:19:45 (GMT)
commitb4e35a44d3c268150f3803121e1d9ca1e5e9f998 (patch)
tree64c735fe12b99fb7eb25b6cad10314d89c84ec6f /fs/dcache.c
parente960551addbad2c36f32ed55d84566250fe46b6e (diff)
downloadlinux-fsl-qoriq-b4e35a44d3c268150f3803121e1d9ca1e5e9f998.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 4021e01..ae2a83e 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;