rcu: Simplify the calculation of rcu_state.ncpus
authorWei Yang <richard.weiyang@gmail.com>
Sun, 19 Apr 2020 21:57:15 +0000 (21:57 +0000)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 29 Jun 2020 18:58:49 +0000 (11:58 -0700)
commitabfce0414814149f716e1d30da1fb3140d1b3473
tree865138345c93d7bcd96f9745ccdb83e560b21aaf
parent0a3b3c253a1eb2c7fe7f34086d46660c909abeb3
rcu: Simplify the calculation of rcu_state.ncpus

There is only 1 bit set in mask, which means that the only difference
between oldmask and the new one will be at the position where the bit is
set in mask.  This commit therefore updates rcu_state.ncpus by checking
whether the bit in mask is already set in rnp->expmaskinitnext.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c