From: Li-Kuan Ou Date: Wed, 14 Jun 2023 01:51:48 +0000 (+0800) Subject: Fix: revise urcu_read_lock_update() comment X-Git-Tag: v0.13.4~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=26dc986ad3b7f6506eec8544e2f9bf1f80731212;p=userspace-rcu.git Fix: revise urcu_read_lock_update() comment Read-side critical section nesting is tracked in lower-order bits and grace-period phase number use a single high-order bit. Signed-off-by: Li-Kuan Ou Signed-off-by: Mathieu Desnoyers Change-Id: I4fc185aa12a367e997fa20bf37793cfb2023c96f --- diff --git a/include/urcu/static/urcu-bp.h b/include/urcu/static/urcu-bp.h index 8614d68..662a234 100644 --- a/include/urcu/static/urcu-bp.h +++ b/include/urcu/static/urcu-bp.h @@ -137,9 +137,9 @@ static inline enum urcu_bp_state urcu_bp_reader_state(unsigned long *ctr) /* * Helper for _urcu_bp_read_lock(). The format of urcu_bp_gp.ctr (as well as - * the per-thread rcu_reader.ctr) has the upper bits containing a count of - * _urcu_bp_read_lock() nesting, and a lower-order bit that contains either zero - * or URCU_BP_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in + * the per-thread rcu_reader.ctr) has the lower-order bits containing a count of + * _urcu_bp_read_lock() nesting, and a single high-order URCU_BP_GP_CTR_PHASE bit + * that contains either zero or one. The smp_mb_slave() ensures that the accesses in * _urcu_bp_read_lock() happen before the subsequent read-side critical section. */ static inline void _urcu_bp_read_lock_update(unsigned long tmp) diff --git a/include/urcu/static/urcu-mb.h b/include/urcu/static/urcu-mb.h index 0dd7d42..edcd99e 100644 --- a/include/urcu/static/urcu-mb.h +++ b/include/urcu/static/urcu-mb.h @@ -63,9 +63,9 @@ extern DECLARE_URCU_TLS(struct urcu_reader, urcu_mb_reader); /* * Helper for _urcu_mb_read_lock(). The format of urcu_mb_gp.ctr (as well as - * the per-thread rcu_reader.ctr) has the upper bits containing a count of - * _urcu_mb_read_lock() nesting, and a lower-order bit that contains either zero - * or URCU_GP_CTR_PHASE. The cmm_smp_mb() ensures that the accesses in + * the per-thread rcu_reader.ctr) has the lower-order bits containing a count of + * _urcu_mb_read_lock() nesting, and a single high-order URCU_BP_GP_CTR_PHASE bit + * that contains either zero or one. The cmm_smp_mb() ensures that the accesses in * _urcu_mb_read_lock() happen before the subsequent read-side critical section. */ static inline void _urcu_mb_read_lock_update(unsigned long tmp) diff --git a/include/urcu/static/urcu-memb.h b/include/urcu/static/urcu-memb.h index a64efee..ccf3e7c 100644 --- a/include/urcu/static/urcu-memb.h +++ b/include/urcu/static/urcu-memb.h @@ -86,9 +86,9 @@ extern DECLARE_URCU_TLS(struct urcu_reader, urcu_memb_reader); /* * Helper for _rcu_read_lock(). The format of urcu_memb_gp.ctr (as well as - * the per-thread rcu_reader.ctr) has the upper bits containing a count of - * _rcu_read_lock() nesting, and a lower-order bit that contains either zero - * or URCU_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in + * the per-thread rcu_reader.ctr) has the lower-order bits containing a count of + * _rcu_read_lock() nesting, and a single high-order URCU_BP_GP_CTR_PHASE bit + * that contains either zero or one. The smp_mb_slave() ensures that the accesses in * _rcu_read_lock() happen before the subsequent read-side critical section. */ static inline void _urcu_memb_read_lock_update(unsigned long tmp) diff --git a/include/urcu/static/urcu-signal.h b/include/urcu/static/urcu-signal.h index f0faf3a..85cd8b0 100644 --- a/include/urcu/static/urcu-signal.h +++ b/include/urcu/static/urcu-signal.h @@ -64,9 +64,9 @@ extern DECLARE_URCU_TLS(struct urcu_reader, urcu_signal_reader); /* * Helper for _rcu_read_lock(). The format of urcu_signal_gp.ctr (as well as - * the per-thread rcu_reader.ctr) has the upper bits containing a count of - * _rcu_read_lock() nesting, and a lower-order bit that contains either zero - * or URCU_GP_CTR_PHASE. The cmm_barrier() ensures that the accesses in + * the per-thread rcu_reader.ctr) has the lower-order bits containing a count of + * _rcu_read_lock() nesting, and a single high-order URCU_BP_GP_CTR_PHASE bit + * that contains either zero or one. The cmm_barrier() ensures that the accesses in * _rcu_read_lock() happen before the subsequent read-side critical section. */ static inline void _urcu_signal_read_lock_update(unsigned long tmp)