Skip to contentSkip to conversation

rid rcu_read_lock() and _unlock() of common-case memory barriers

RFC PATCH New Paul E. McKenney 1 participant 1 message Mar 27, 2006 Scheduler

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 rid rcu_read_lock() and _unlock() of common-case memory barriers

Hello!

Another step towards lighter-weight rcu_read_lock() and rcu_read_unlock() for PREEMPT_RCU. Removes both atomic operations and memory barriers in the common case. Further work in progress to remove them in -all- cases, so probably not worth applying this one.

This patch relies on the fact that only the first and last RCU read-side critical sections really need the memory barriers. This means that the memory barriers can be associated with grace-period detection rather than with RCU read-side critical sections, which is a win in the usual case where there are far more RCU read-side critical sections than there are grace periods.

Signed-off-by <[email protected]>
 include/linux/sched.h |    1 
 kernel/rcupreempt.c   |  114 ++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 107 insertions(+), 8 deletions(-)
include/linux/sched.h +1 -0
diff -urpNa -X dontdiff linux-2.6.15-rt16-splitPREEMPT_RCU/include/linux/sched.h linux-2.6.15-rt16-sPR-optmb/include/linux/sched.h
@@ -893,6 +893,7 @@ struct task_struct {
 	int rcu_read_lock_nesting;
 	atomic_t *rcu_flipctr1;
 	atomic_t *rcu_flipctr2;
+	int rcu_read_lock_cpu;
 #endif
 #ifdef CONFIG_SCHEDSTATS
 	struct sched_info sched_info;
kernel/rcupreempt.c +106 -8

187 lines not on this page · raw message