rcu/kvfree: Add debug to check grace periods
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 3 Apr 2023 23:49:14 +0000 (16:49 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 10 May 2023 00:26:21 +0000 (17:26 -0700)
commitcdfa0f6fa6b7183c062046043b649b9a91e3ac52
treef41f5abdf97e0fa3060ac924c0b62be0b5def5a6
parent7e3f926bf4538cb4988b3e3f8bc1cb4a603b2ef6
rcu/kvfree: Add debug to check grace periods

This commit adds debugging checks to verify that the required RCU
grace period has elapsed for each kvfree_rcu_bulk_data structure that
arrives at the kvfree_rcu_bulk() function.  These checks make use
of that structure's ->gp_snap field, which has been upgraded from an
unsigned long to an rcu_gp_oldstate structure.  This upgrade reduces
the chances of false positives to nearly zero, even on 32-bit systems,
for which this structure carries 64 bits of state.

Cc: Ziwei Dai <ziwei.dai@unisoc.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c