locking: Remove rcu_read_{,un}lock() for preempt_{dis,en}able()
authorYanfei Xu <yanfei.xu@windriver.com>
Wed, 13 Oct 2021 13:41:52 +0000 (21:41 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 19 Oct 2021 15:27:06 +0000 (17:27 +0200)
commit6c2787f2a20ceb49c98bd06f7dad1589eed1c951
tree087af925e2290780f932b1b960ae47beb1db663f
parent7cdacc5f52d68a9370f182c844b5b3e6cc975cc1
locking: Remove rcu_read_{,un}lock() for preempt_{dis,en}able()

preempt_disable/enable() is equal to RCU read-side crital section, and
the spinning codes in mutex and rwsem could ensure that the preemption
is disabled. So let's remove the unnecessary rcu_read_lock/unlock for
saving some cycles in hot codes.

Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://lore.kernel.org/r/20211013134154.1085649-2-yanfei.xu@windriver.com
kernel/locking/mutex.c
kernel/locking/rwsem.c