rid rcu_read_lock() and _unlock() of common-case memory barriers
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.
include/linux/sched.h | 1 kernel/rcupreempt.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 107 insertions(+), 8 deletions(-)
include/linux/sched.h +1 -0
@@ -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