diff options
author | Zqiang <qiang.zhang@windriver.com> | 2021-05-17 06:40:05 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-05-18 13:53:51 +0300 |
commit | 3a010c493271f04578b133de977e0e5dd2848cea (patch) | |
tree | 58eb2fd9fc9f8f9bb56034835688d189403a028c /kernel/locking/mutex.h | |
parent | 89e70d5c583c55088faa2201d397ee30a15704aa (diff) | |
download | linux-3a010c493271f04578b133de977e0e5dd2848cea.tar.xz |
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.h')
-rw-r--r-- | kernel/locking/mutex.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/locking/mutex.h b/kernel/locking/mutex.h index 1c2287d3fa71..f0c710b1d192 100644 --- a/kernel/locking/mutex.h +++ b/kernel/locking/mutex.h @@ -10,12 +10,10 @@ * !CONFIG_DEBUG_MUTEXES case. Most of them are NOPs: */ -#define mutex_remove_waiter(lock, waiter, task) \ - __list_del((waiter)->list.prev, (waiter)->list.next) - #define debug_mutex_wake_waiter(lock, waiter) do { } while (0) #define debug_mutex_free_waiter(waiter) do { } while (0) #define debug_mutex_add_waiter(lock, waiter, ti) do { } while (0) +#define debug_mutex_remove_waiter(lock, waiter, ti) do { } while (0) #define debug_mutex_unlock(lock) do { } while (0) #define debug_mutex_init(lock, name, key) do { } while (0) |