diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-30 15:35:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-30 15:35:15 -0400 |
commit | fa7eadab4b4aec0139d2429e6f8d13375ff8a658 (patch) | |
tree | 91b4ef421d415b782ff54cc89296268903fc9552 /kernel | |
parent | bc7d352c5e76c74c628a39b99777a1bdddde5e81 (diff) | |
parent | fd6be105b883244127a734ac9f14ae94a022dcc0 (diff) |
Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
mutex: Fix optimistic spinning vs. BKL
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/mutex.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/mutex.c b/kernel/mutex.c index 632f04c57d82..4c0b7b3e6d2e 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c | |||
@@ -172,6 +172,13 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, | |||
172 | struct thread_info *owner; | 172 | struct thread_info *owner; |
173 | 173 | ||
174 | /* | 174 | /* |
175 | * If we own the BKL, then don't spin. The owner of | ||
176 | * the mutex might be waiting on us to release the BKL. | ||
177 | */ | ||
178 | if (unlikely(current->lock_depth >= 0)) | ||
179 | break; | ||
180 | |||
181 | /* | ||
175 | * If there's an owner, wait for it to either | 182 | * If there's an owner, wait for it to either |
176 | * release the lock or go to sleep. | 183 | * release the lock or go to sleep. |
177 | */ | 184 | */ |