aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/locking/mutex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 4f408be39a07..e6d646b18d6c 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -166,6 +166,9 @@ static inline int mutex_can_spin_on_owner(struct mutex *lock)
166 struct task_struct *owner; 166 struct task_struct *owner;
167 int retval = 1; 167 int retval = 1;
168 168
169 if (need_resched())
170 return 0;
171
169 rcu_read_lock(); 172 rcu_read_lock();
170 owner = ACCESS_ONCE(lock->owner); 173 owner = ACCESS_ONCE(lock->owner);
171 if (owner) 174 if (owner)