diff -Naur --exclude-from diff_exclude linux-2.6.11-final-V0.7.40-00/include/linux/rcupdate.h linux-2.6.11-final-V0.7.40-00-RCU/include/linux/rcupdate.h --- linux-2.6.11-final-V0.7.40-00/include/linux/rcupdate.h 2005-03-11 23:40:13.000000000 +0100 +++ linux-2.6.11-final-V0.7.40-00-RCU/include/linux/rcupdate.h 2005-03-19 12:47:09.000000000 +0100 @@ -85,6 +85,7 @@ * curlist - current batch for which quiescent cycle started if any */ struct rcu_data { + long active_readers; /* 1) quiescent state handling : */ long quiescbatch; /* Batch # for grace period */ int passed_quiesc; /* User-mode/idle loop etc. */ @@ -115,12 +116,14 @@ static inline void rcu_qsctr_inc(int cpu) { struct rcu_data *rdp = &per_cpu(rcu_data, cpu); - rdp->passed_quiesc = 1; + if(rdp->active_readers==0) + rdp->passed_quiesc = 1; } static inline void rcu_bh_qsctr_inc(int cpu) { struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu); - rdp->passed_quiesc = 1; + if(rdp->active_readers==0) + rdp->passed_quiesc = 1; } static inline int __rcu_pending(struct rcu_ctrlblk *rcp, @@ -183,29 +186,27 @@ * * It is illegal to block while in an RCU read-side critical section. */ -#define rcu_read_lock() preempt_disable() +static inline void rcu_read_lock(void) +{ + preempt_disable(); + __get_cpu_var(rcu_data).active_readers++; + preempt_enable(); +} /** * rcu_read_unlock - marks the end of an RCU read-side critical section. * * See rcu_read_lock() for more information. */ -#define rcu_read_unlock() preempt_enable() +static inline void rcu_read_unlock(void) +{ + preempt_disable(); + __get_cpu_var(rcu_data).active_readers--; + preempt_enable(); +} #define IGNORE_LOCK(op, lock) do { (void)(lock); op(); } while (0) -#ifdef CONFIG_PREEMPT_RT -# define rcu_read_lock_spin(lock) spin_lock(lock) -# define rcu_read_unlock_spin(lock) spin_unlock(lock) -# define rcu_read_lock_read(lock) read_lock(lock) -# define rcu_read_unlock_read(lock) read_unlock(lock) -# define rcu_read_lock_bh_read(lock) read_lock_bh(lock) -# define rcu_read_unlock_bh_read(lock) read_unlock_bh(lock) -# define rcu_read_lock_down_read(rwsem) down_read(rwsem) -# define rcu_read_unlock_up_read(rwsem) up_read(rwsem) -# define rcu_read_lock_nort() do { } while (0) -# define rcu_read_unlock_nort() do { } while (0) -#else # define rcu_read_lock_spin(lock) IGNORE_LOCK(rcu_read_lock, lock) # define rcu_read_unlock_spin(lock) IGNORE_LOCK(rcu_read_unlock, lock) # define rcu_read_lock_read(lock) IGNORE_LOCK(rcu_read_lock, lock) @@ -216,15 +217,10 @@ # define rcu_read_unlock_nort() rcu_read_unlock() # define rcu_read_lock_bh_read(lock) IGNORE_LOCK(rcu_read_lock_bh, lock) # define rcu_read_unlock_bh_read(lock) IGNORE_LOCK(rcu_read_unlock_bh, lock) -#endif -#ifdef CONFIG_PREEMPT_RT -# define rcu_read_lock_sem(lock) down(lock) -# define rcu_read_unlock_sem(lock) up(lock) -#else # define rcu_read_lock_sem(lock) IGNORE_LOCK(rcu_read_lock, lock) # define rcu_read_unlock_sem(lock) IGNORE_LOCK(rcu_read_unlock, lock) -#endif + /* * So where is rcu_write_lock()? It does not exist, as there is no * way for writers to lock out RCU readers. This is a feature, not diff -Naur --exclude-from diff_exclude linux-2.6.11-final-V0.7.40-00/Makefile linux-2.6.11-final-V0.7.40-00-RCU/Makefile --- linux-2.6.11-final-V0.7.40-00/Makefile 2005-03-11 23:40:13.000000000 +0100 +++ linux-2.6.11-final-V0.7.40-00-RCU/Makefile 2005-03-19 12:41:09.000000000 +0100 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 11 -EXTRAVERSION = -RT-V0.7.40-00 +EXTRAVERSION = -RT-V0.7.40-00-RCU NAME=Woozy Numbat # *DOCUMENTATION*