locking/rwsem: Simplify the is-owner-spinnable checks
authorOleg Nesterov <oleg@redhat.com>
Fri, 18 May 2018 16:55:35 +0000 (18:55 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 25 May 2018 06:11:47 +0000 (08:11 +0200)
commitaf9aa8229ad43bba3b2cd458bf21aec53e33970e
tree261b3bf3f6b89a19ab367b58105acbe1cd1e190d
parent0baadcb0689085a19af239f54f9fa4019353114e
locking/rwsem: Simplify the is-owner-spinnable checks

Add the trivial owner_on_cpu() helper for rwsem_can_spin_on_owner() and
rwsem_spin_on_owner(), it also allows to make rwsem_can_spin_on_owner()
a bit more clear.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <longman@redhat.com>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jan Kara <jack@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Theodore Y. Ts'o <tytso@mit.edu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180518165534.GA22348@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/locking/rwsem-xadd.c