diff options
author | Peter Zijlstra <peterz@infradead.org> | 2021-06-30 17:35:18 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-15 09:47:25 +0200 |
commit | a5e42516a61ead33e5b98c6508547e1cbef0f8ac (patch) | |
tree | 35da719171b66bf465ee034687f6cf4309b609ca /crypto/crypto_engine.c | |
parent | a0f68fb55ebc85e5ed3c6582ffc70379340c4a72 (diff) |
locking/mutex: Fix HANDOFF condition
[ Upstream commit 048661a1f963e9517630f080687d48af79ed784c ]
Yanfei reported that setting HANDOFF should not depend on recomputing
@first, only on @first state. Which would then give:
if (ww_ctx || !first)
first = __mutex_waiter_is_first(lock, &waiter);
if (first)
__mutex_set_flag(lock, MUTEX_FLAG_HANDOFF);
But because 'ww_ctx || !first' is basically 'always' and the test for
first is relatively cheap, omit that first branch entirely.
Reported-by: Yanfei Xu <yanfei.xu@windriver.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Waiman Long <longman@redhat.com>
Reviewed-by: Yanfei Xu <yanfei.xu@windriver.com>
Link: https://lore.kernel.org/r/20210630154114.896786297@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'crypto/crypto_engine.c')
0 files changed, 0 insertions, 0 deletions