Index: kernel/generic/include/synch/rcu.h
===================================================================
--- kernel/generic/include/synch/rcu.h	(revision 8e3ed060352d7c72e3c40551fdd7ee221f4b3c49)
+++ kernel/generic/include/synch/rcu.h	(revision 5b03a724f5c58712ae1e5a720a4c07c141603021)
@@ -181,8 +181,8 @@
 
 	/* Record a QS if not in a reader critical section. */
-	if (0 == *CPU->rcu.pnesting_cnt)
+	if (0 == CPU->rcu.nesting_cnt)
 		_rcu_record_qs();
 
-	++(*CPU->rcu.pnesting_cnt);
+	++CPU->rcu.nesting_cnt;
 
 	preemption_enable();
@@ -195,5 +195,5 @@
 	preemption_disable();
 	
-	if (0 == --(*CPU->rcu.pnesting_cnt)) {
+	if (0 == --CPU->rcu.nesting_cnt) {
 		_rcu_record_qs();
 		
Index: kernel/generic/include/synch/rcu_types.h
===================================================================
--- kernel/generic/include/synch/rcu_types.h	(revision 8e3ed060352d7c72e3c40551fdd7ee221f4b3c49)
+++ kernel/generic/include/synch/rcu_types.h	(revision 5b03a724f5c58712ae1e5a720a4c07c141603021)
@@ -61,8 +61,11 @@
 	rcu_gp_t last_seen_gp;
 	
-	/** Pointer to the currently used nesting count (THREAD's or CPU's). */
-	size_t *pnesting_cnt;
-	/** Temporary nesting count if THREAD is NULL, eg in scheduler(). */
-	size_t tmp_nesting_cnt;
+	/** The number of times an RCU reader section is nested on this cpu. 
+	 * 
+	 * If positive, it is definitely executing reader code. If zero, 
+	 * the thread might already be executing reader code thanks to
+	 * cpu instruction reordering.
+	 */
+	size_t nesting_cnt;
 
 	/** Callbacks to invoke once the current grace period ends, ie cur_cbs_gp.
@@ -128,9 +131,7 @@
 /** RCU related per-thread data. */
 typedef struct rcu_thread_data {
-	/** The number of times an RCU reader section is nested. 
-	 * 
-	 * If positive, it is definitely executing reader code. If zero, 
-	 * the thread might already be executing reader code thanks to
-	 * cpu instruction reordering.
+	/** 
+	 * Nesting count of the thread's RCU read sections when the thread 
+	 * is not running.
 	 */
 	size_t nesting_cnt;
Index: kernel/generic/src/synch/rcu.c
===================================================================
--- kernel/generic/src/synch/rcu.c	(revision 8e3ed060352d7c72e3c40551fdd7ee221f4b3c49)
+++ kernel/generic/src/synch/rcu.c	(revision 5b03a724f5c58712ae1e5a720a4c07c141603021)
@@ -225,6 +225,5 @@
 	CPU->rcu.last_seen_gp = 0;
 	
-	CPU->rcu.pnesting_cnt = &CPU->rcu.tmp_nesting_cnt;
-	CPU->rcu.tmp_nesting_cnt = 0;
+	CPU->rcu.nesting_cnt = 0;
 	
 	CPU->rcu.cur_cbs = 0;
@@ -286,8 +285,7 @@
 	 * reader section nesting count while we examine/process it.
 	 */
-	ASSERT(&CPU->rcu.tmp_nesting_cnt == CPU->rcu.pnesting_cnt);
-	
-	/* 
-	 * The thread forgot to exit its reader critical secion. 
+	
+	/* 
+	 * The thread forgot to exit its reader critical section. 
 	 * It is a bug, but rather than letting the entire system lock up
 	 * forcefully leave the reader section. The thread is not holding 
@@ -373,5 +371,5 @@
 {
 	preemption_disable();
-	bool locked = 0 < *CPU->rcu.pnesting_cnt;
+	bool locked = 0 < CPU->rcu.nesting_cnt;
 	preemption_enable();
 	
@@ -483,5 +481,5 @@
 {
 	/* Calling from a reader section will deadlock. */
-	ASSERT(THREAD == 0 || 0 == THREAD->rcu.nesting_cnt);
+	ASSERT(0 == CPU->rcu.nesting_cnt);
 	
 	synch_item_t completion; 
@@ -1199,5 +1197,5 @@
 	if (CPU->rcu.last_seen_gp != _rcu_cur_gp) {
 		/* Interrupted a reader in a reader critical section. */
-		if (0 < (*CPU->rcu.pnesting_cnt)) {
+		if (0 < CPU->rcu.nesting_cnt) {
 			ASSERT(!CPU->idle);
 			/* Note to notify the detector from rcu_read_unlock(). */
@@ -1276,5 +1274,9 @@
 {
 	ASSERT(interrupts_disabled());
-	ASSERT(CPU->rcu.pnesting_cnt == &THREAD->rcu.nesting_cnt);
+	
+	/* Save the thread's nesting count when its not running. */
+	THREAD->rcu.nesting_cnt = CPU->rcu.nesting_cnt;
+	/* Interrupt handlers might use RCU while idle in scheduler(). */
+	CPU->rcu.nesting_cnt = 0;
 	
 	/* Preempted a reader critical section for the first time. */
@@ -1317,11 +1319,4 @@
 	
 	/* 
-	 * After this point THREAD is 0 and stays 0 until the scheduler()
-	 * switches to a new thread. Use a temporary nesting counter for readers
-	 * in handlers of interrupts that are raised while idle in the scheduler.
-	 */
-	CPU->rcu.pnesting_cnt = &CPU->rcu.tmp_nesting_cnt;
-
-	/* 
 	 * Forcefully associate the detector with the highest priority
 	 * even if preempted due to its time slice running out.
@@ -1355,7 +1350,8 @@
 {
 	ASSERT(PREEMPTION_DISABLED || interrupts_disabled());
-	ASSERT(&CPU->rcu.tmp_nesting_cnt == CPU->rcu.pnesting_cnt);
-	
-	CPU->rcu.pnesting_cnt = &THREAD->rcu.nesting_cnt;
+	ASSERT(0 == CPU->rcu.nesting_cnt);
+	
+	/* Load the thread's saved nesting count from before it was preempted. */
+	CPU->rcu.nesting_cnt = THREAD->rcu.nesting_cnt;
 }
 
