Skip to contentSkip to conversation

Introduce check for callback list/count mismatch

PATCH In review Paul E. McKenney 2 participants 2 messages Jul 5, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Introduce check for callback list/count mismatch

The recent bug that introduced the RCU callback list/count mismatch showed the need for a diagnostic to check for this, which this patch adds.

kernel/rcutree.c +1 -0
index 95c7b61..4154c95 100644
@@ -1612,6 +1612,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
 		rdp->n_force_qs_snap = rsp->n_force_qs;
 	} else if (rdp->qlen < rdp->qlen_last_fqs_check - qhimark)
 		rdp->qlen_last_fqs_check = rdp->qlen;
+	WARN_ON_ONCE((rdp->nxtlist == NULL) != (rdp->qlen == 0));
 
 	local_irq_restore(flags);
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Paul E. McKenney

The recent bug that introduced the RCU callback list/count mismatch showed the need for a diagnostic to check for this, which this patch adds.

Quoted 13 lines
kernel/rcutree.c +1 -0
index 95c7b61..4154c95 100644
@@ -1612,6 +1612,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
 		rdp->n_force_qs_snap = rsp->n_force_qs;
 	} else if (rdp->qlen < rdp->qlen_last_fqs_check - qhimark)
 		rdp->qlen_last_fqs_check = rdp->qlen;
+	WARN_ON_ONCE((rdp->nxtlist == NULL) != (rdp->qlen == 0));
 
 	local_irq_restore(flags);