locking/rwsem: Use OWNER_NONSPINNABLE directly instead of OWNER_SPINNABLE
authorJinliang Zheng <alexjlzheng@tencent.com>
Tue, 10 Jun 2025 13:01:58 +0000 (21:01 +0800)
committerBoqun Feng <boqun.feng@gmail.com>
Fri, 11 Jul 2025 22:11:54 +0000 (15:11 -0700)
commitf84a15b90d96f3da99f67fea2e116850d99fb7c4
tree0c12b88cfa1df02293945cc778cc9d0a83b06207
parent99214efedea521f1b79fa2a28ff142e933fc3eba
locking/rwsem: Use OWNER_NONSPINNABLE directly instead of OWNER_SPINNABLE

After commit 7d43f1ce9dd0 ("locking/rwsem: Enable time-based spinning on
reader-owned rwsem"), OWNER_SPINNABLE contains all possible values except
OWNER_NONSPINNABLE, namely OWNER_NULL | OWNER_WRITER | OWNER_READER.

Therefore, it is better to use OWNER_NONSPINNABLE directly to determine
whether to exit optimistic spin.

And, remove useless OWNER_SPINNABLE to simplify the code.

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20250610130158.4876-1-alexjlzheng@tencent.com
kernel/locking/rwsem.c