OSDN Git Service

rcu: Move from ->need_future_gp[] to ->gp_seq_needed
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 1 May 2018 17:26:57 +0000 (10:26 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 12 Jul 2018 22:37:48 +0000 (15:37 -0700)
commit7a1d0f23ad70cd4813bf4b72735ea2c26a4f53fe
tree83c5e674a73d05ebc38687b9754d1509366e29b5
parentaebc82644b2c8eafa15e8c481fbafc1b41f4fbf9
rcu: Move from ->need_future_gp[] to ->gp_seq_needed

One problem with the ->need_future_gp[] array is that the grace-period
assignment of each element changes as the grace periods complete.
This means that it is necessary to hold a lock when checking this
array to learn if a given grace period has already been requested.
This increase lock contention, which is the opposite of helpful.
This commit therefore replaces the ->need_future_gp[] with a single
->gp_seq_needed value and keeps it updated in the rcu_data structure.

This will enable reliable lockless checking of whether or not a given
grace period has already been requested.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree.c
kernel/rcu/tree.h