Fix: revise urcu_read_lock_update() comment
PATCH 1/1 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
--- include/urcu/static/urcu-bp.h | 4 ++-- include/urcu/static/urcu-mb.h | 4 ++-- include/urcu/static/urcu-memb.h | 4 ++-- include/urcu/static/urcu-signal.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
include/urcu/static/urcu-bp.h +2 -2
@@ -137,8 +137,8 @@ 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 +* 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 bit that contains either zero * or URCU_BP_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in * _urcu_bp_read_lock() happen before the subsequent read-side critical section. */
include/urcu/static/urcu-mb.h +2 -2
@@ -63,8 +63,8 @@ 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 +* 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 bit that contains either zero * or URCU_GP_CTR_PHASE. The cmm_smp_mb() ensures that the accesses in * _urcu_mb_read_lock() happen before the subsequent read-side critical section. */
include/urcu/static/urcu-memb.h +2 -2
@@ -86,8 +86,8 @@ 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 +* the per-thread rcu_reader.ctr) has the lower-order bits containing a count of +* _rcu_read_lock() nesting, and a single high-order bit that contains either zero * or URCU_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in * _rcu_read_lock() happen before the subsequent read-side critical section. */
include/urcu/static/urcu-signal.h +2 -2
@@ -64,8 +64,8 @@ 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 +* the per-thread rcu_reader.ctr) has the lower-order bits containing a count of +* _rcu_read_lock() nesting, and a single high-order bit that contains either zero * or URCU_GP_CTR_PHASE. The cmm_barrier() ensures that the accesses in * _rcu_read_lock() happen before the subsequent read-side critical section. */
Signature · 6 lines
2.34.1 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Quoted 3 lines · Li-Kuan Ou via lttng-dev
Read-side critical section nesting is tracked in lower-order bits and grace-period phase number use a single high-order bit
Thanks for the fix. Here is a comment below,
Quoted 13 lines
Signed-off-by Li-Kuan Ou <[email protected]>--- include/urcu/static/urcu-bp.h | 4 ++-- include/urcu/static/urcu-mb.h | 4 ++-- include/urcu/static/urcu-memb.h | 4 ++-- include/urcu/static/urcu-signal.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)include/urcu/static/urcu-bp.h +0
-0
include/urcu/static/urcu-bp.h static inline enum urcu_bp_state urcu_bp_reader_state(unsigned long *ctr) · line 141
Quoted 7 lines
include/urcu/static/urcu-bp.h +2
-2@@ -137,8 +137,8 @@ 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 +* 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 bit that contains either zero
I think it would be clearer to state:
Helper for _urcu_bp_read_lock(). The format of urcu_bp_gp.ctr (as well as 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.
(likewise for similar comments in other files).
Can you submit an updated patch please ?
Thanks,
Mathieu
Quoted 48 lines
include/urcu/static/urcu-bp.h +0
-0* or URCU_BP_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in * _urcu_bp_read_lock() happen before the subsequent read-side critical section. */ include/urcu/static/urcu-mb.h +2
-2@@ -63,8 +63,8 @@ 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 +* 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 bit that contains either zero * or URCU_GP_CTR_PHASE. The cmm_smp_mb() ensures that the accesses in * _urcu_mb_read_lock() happen before the subsequent read-side critical section. */ include/urcu/static/urcu-memb.h +2
-2@@ -86,8 +86,8 @@ 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 +* the per-thread rcu_reader.ctr) has the lower-order bits containing a count of +* _rcu_read_lock() nesting, and a single high-order bit that contains either zero * or URCU_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in * _rcu_read_lock() happen before the subsequent read-side critical section. */ include/urcu/static/urcu-signal.h +2
-2@@ -64,8 +64,8 @@ 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 +* the per-thread rcu_reader.ctr) has the lower-order bits containing a count of +* _rcu_read_lock() nesting, and a single high-order bit that contains either zero * or URCU_GP_CTR_PHASE. The cmm_barrier() ensures that the accesses in * _rcu_read_lock() happen before the subsequent read-side critical section. */
Signature · 8 lines
Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
PATCH 1/1 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
--- include/urcu/static/urcu-bp.h | 6 +++--- include/urcu/static/urcu-mb.h | 6 +++--- include/urcu/static/urcu-memb.h | 6 +++--- include/urcu/static/urcu-signal.h | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-)
include/urcu/static/urcu-bp.h +3 -3
@@ -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)
include/urcu/static/urcu-mb.h +3 -3
@@ -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)
include/urcu/static/urcu-memb.h +3 -3
@@ -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)
include/urcu/static/urcu-signal.h +3 -3
@@ -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)
Signature · 6 lines
2.34.1 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Mathieu Desnoyers via lttng-dev
AppliedQuoted 3 lines · Li-Kuan Ou
Read-side critical section nesting is tracked in lower-order bits and grace-period phase number use a single high-order bit
Merged, thanks!
Mathieu
Quoted 76 lines
Signed-off-by Li-Kuan Ou <[email protected]>--- include/urcu/static/urcu-bp.h | 6 +++--- include/urcu/static/urcu-mb.h | 6 +++--- include/urcu/static/urcu-memb.h | 6 +++--- include/urcu/static/urcu-signal.h | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-)include/urcu/static/urcu-bp.h +3
-3@@ -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)include/urcu/static/urcu-mb.h +3
-3@@ -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)include/urcu/static/urcu-memb.h +3
-3@@ -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)include/urcu/static/urcu-signal.h +3
-3@@ -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)
Signature · 8 lines
Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev