Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b31395e0 authored by Zqiang's avatar Zqiang Committed by Greg Kroah-Hartman
Browse files

locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal



[ Upstream commit 3a010c493271f04578b133de977e0e5dd2848cea ]

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: 040a0a37 ("mutex: Add support for wound/wait style locks")
Suggested-by: default avatarPeter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210517034005.30828-1-qiang.zhang@windriver.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6671cd54
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment