diff options
author | Zqiang <qiang.zhang@windriver.com> | 2021-05-17 11:40:05 +0800 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-05-18 12:53:51 +0200 |
commit | 3a010c493271f04578b133de977e0e5dd2848cea (patch) | |
tree | 58eb2fd9fc9f8f9bb56034835688d189403a028c /kernel/locking/mutex-debug.h | |
parent | 89e70d5c583c55088faa2201d397ee30a15704aa (diff) |
locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal
When a interruptible mutex locker is interrupted by a signal
without acquiring this lock and removed from the wait queue.
if the mutex isn't contended enough to have a waiter
put into the wait queue again, the setting of the WAITER
bit will force mutex locker to go into the slowpath to
acquire the lock every time, so if the wait queue is empty,
the WAITER bit need to be clear.
Fixes: 040a0a371005 ("mutex: Add support for wound/wait style locks")
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Zqiang <qiang.zhang@windriver.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210517034005.30828-1-qiang.zhang@windriver.com
Diffstat (limited to 'kernel/locking/mutex-debug.h')
-rw-r--r-- | kernel/locking/mutex-debug.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/locking/mutex-debug.h b/kernel/locking/mutex-debug.h index 1edd3f45a4ec..53e631e1d76d 100644 --- a/kernel/locking/mutex-debug.h +++ b/kernel/locking/mutex-debug.h @@ -22,7 +22,7 @@ extern void debug_mutex_free_waiter(struct mutex_waiter *waiter); extern void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, struct task_struct *task); -extern void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter, +extern void debug_mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter, struct task_struct *task); extern void debug_mutex_unlock(struct mutex *lock); extern void debug_mutex_init(struct mutex *lock, const char *name, |