rcutorture: Correctly handle grace-period sequence wrap
The new ->gq_seq grace-period sequence numbers must be shifted down, which give artifacts when these numbers wrap. This commit therefore enables rcutorture and rcuperf to handle grace-period sequence numbers even if they do wrap. It does this by allowing a special subtraction function to be specified, and this function subtracts before shifting. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
@@ -142,6 +142,15 @@ static inline bool rcu_seq_new_gp(unsigned long old, unsigned long new)
|
||||
new);
|
||||
}
|
||||
|
||||
/*
|
||||
* Roughly how many full grace periods have elapsed between the collection
|
||||
* of the two specified grace periods?
|
||||
*/
|
||||
static inline unsigned long rcu_seq_diff(unsigned long new, unsigned long old)
|
||||
{
|
||||
return (new - old) >> RCU_SEQ_CTR_SHIFT;
|
||||
}
|
||||
|
||||
/*
|
||||
* debug_rcu_head_queue()/debug_rcu_head_unqueue() are used internally
|
||||
* by call_rcu() and rcu callback execution, and are therefore not part of the
|
||||
|
Reference in New Issue
Block a user