rcu: Avoid resched_cpu() when rescheduling the current CPU
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 26 Jul 2018 20:44:00 +0000 (13:44 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 30 Aug 2018 23:03:45 +0000 (16:03 -0700)
commitfced9c8cfe6bc8a26dbbf785927aa673c83a7a35
tree04b80df17ce5b236c0aa4fef28a5d1ab6bf889b0
parentd3052109c0bc9e536d17d627ae628ed8ceb6928c
rcu: Avoid resched_cpu() when rescheduling the current CPU

The resched_cpu() interface is quite handy, but it does acquire the
specified CPU's runqueue lock, which does not come for free.  This
commit therefore substitutes the following when directing resched_cpu()
at the current CPU:

set_tsk_need_resched(current);
set_preempt_need_resched();

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
kernel/rcu/tree.c
kernel/rcu/tree_exp.h
kernel/rcu/tree_plugin.h