Skip to contentSkip to conversation

rcu: make dead code really dead

PATCH In review Lai Jiangshan 2 participants 2 messages Mar 28, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: make dead code really dead

cleanup: make dead code really dead

---

kernel/rcutree.c +2 -2
index e6014e1..1947c4e 100644
@@ -1236,11 +1236,11 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
 		break; /* grace period idle or initializing, ignore. */
 
 	case RCU_SAVE_DYNTICK:
-
-		raw_spin_unlock(&rnp->lock);  /* irqs remain disabled */
 		if (RCU_SIGNAL_INIT != RCU_SAVE_DYNTICK)
 			break; /* So gcc recognizes the dead code. */
 
+		raw_spin_unlock(&rnp->lock);  /* irqs remain disabled */
+
 		/* Record dyntick-idle state. */
 		force_qs_rnp(rsp, dyntick_save_progress_counter);
 		raw_spin_lock(&rnp->lock);  /* irqs already disabled */
#1 lore raw
Quoted 2 lines · Lai Jiangshan

cleanup: make dead code really dead

Good catch! I have queued this one up for RCU for 2.6.35.

Thanx, Paul

Quoted 21 lines

---

kernel/rcutree.c +2 -2
index e6014e1..1947c4e 100644
@@ -1236,11 +1236,11 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
 		break; /* grace period idle or initializing, ignore. */
 
 	case RCU_SAVE_DYNTICK:
-
-		raw_spin_unlock(&rnp->lock);  /* irqs remain disabled */
 		if (RCU_SIGNAL_INIT != RCU_SAVE_DYNTICK)
 			break; /* So gcc recognizes the dead code. */
 
+		raw_spin_unlock(&rnp->lock);  /* irqs remain disabled */
+
 		/* Record dyntick-idle state. */
 		force_qs_rnp(rsp, dyntick_save_progress_counter);
 		raw_spin_lock(&rnp->lock);  /* irqs already disabled */