diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-03-07 21:00:34 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@rostedt.homelinux.com> | 2013-04-23 11:35:08 -0400 |
commit | c28e8ca17040921cbeb6010faa9d3afa0bfa4d29 (patch) | |
tree | 4901d0a1d7a8124bdf5ee03768f659f4fc4a005c | |
parent | 8448ea6278f6a7db1a245f97b615931f7ac4c6d9 (diff) |
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
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | fs/autofs4/autofs_i.h | 1 | ||||
-rw-r--r-- | fs/autofs4/expire.c | 2 | ||||
-rw-r--r-- | fs/dcache.c | 7 |
3 files changed, 6 insertions, 4 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index 731f1de516c8..28df70ea4dee 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h @@ -34,6 +34,7 @@ #include <linux/sched.h> #include <linux/mount.h> #include <linux/namei.h> +#include <linux/delay.h> #include <asm/current.h> #include <asm/uaccess.h> diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index d8b6184f2e50..f4abda3720dd 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c @@ -170,7 +170,7 @@ again: parent = p->d_parent; if (!seq_spin_trylock(&parent->d_lock)) { seq_spin_unlock(&p->d_lock); - cpu_relax(); + cpu_chill(); goto relock; } seq_spin_unlock(&p->d_lock); diff --git a/fs/dcache.c b/fs/dcache.c index a1bae7cacdba..9d6461c6aeb4 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -36,6 +36,7 @@ #include <linux/bit_spinlock.h> #include <linux/rculist_bl.h> #include <linux/prefetch.h> +#include <linux/delay.h> #include "internal.h" /* @@ -360,7 +361,7 @@ static inline struct dentry *dentry_kill(struct dentry *dentry, int ref) if (inode && !spin_trylock(&inode->i_lock)) { relock: seq_spin_unlock(&dentry->d_lock); - cpu_relax(); + cpu_chill(); return dentry; /* try again with same dentry */ } if (IS_ROOT(dentry)) @@ -738,7 +739,7 @@ relock: if (!seq_spin_trylock(&dentry->d_lock)) { spin_unlock(&dcache_lru_lock); - cpu_relax(); + cpu_chill(); goto relock; } @@ -2057,7 +2058,7 @@ again: if (dentry->d_count == 1) { if (inode && !spin_trylock(&inode->i_lock)) { seq_spin_unlock(&dentry->d_lock); - cpu_relax(); + cpu_chill(); goto again; } dentry->d_flags &= ~DCACHE_CANT_MOUNT; |