From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id knKhNo/OiGRuPgMAWB0awg (envelope-from ) for ; Tue, 13 Jun 2023 16:16:15 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=lists.lttng.org header.i=@lists.lttng.org header.a=rsa-sha256 header.s=default header.b=y/JK49wI; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D49D71E0BB; Tue, 13 Jun 2023 16:16:15 -0400 (EDT) Received: from lists.lttng.org (lists.lttng.org [167.114.26.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9C0761E00F for ; Tue, 13 Jun 2023 16:16:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1686687373; bh=TV7PmsnPqc4oSgfLC13pAiyHYd35uSgYYqnOdmFnNjs=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=y/JK49wIUc77e4jf/N0x8WwxIUz8usVqDmMfBBm801WHCHCGynf569E71/ghmLb2e F2IJwSRSC/2R8jzIC8aNnF2ov1wASLPrvnOy4+L/mU8NQ5wiPE2a7Ma0L2VSpLyOKx lKT5OCckJQfKrRqQRHVQzeTr23y1HMaOG73dlLqJ1Erb3qZTlOTlTTb/k4YX0ZEIDi rixg+kEsvU0K+OhgoXK2arhYwuTHPpkdRhU5fYbHaW245TnkuYGmBm/7wq7XdR4IHq kmMF3NIIuDgA8hW/h4al/fhI73WxY0WKc4VpG6aB12/YyNtopB9yyze6XkMId6wrKT TokZnoINW83TQ== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4Qgfvc72mbz1gDl; Tue, 13 Jun 2023 16:16:12 -0400 (EDT) Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lists.lttng.org (Postfix) with ESMTPS id 4QgfvY27PQz1g5V for ; Tue, 13 Jun 2023 16:16:09 -0400 (EDT) Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QgfvR5JNGz187B; Tue, 13 Jun 2023 16:16:03 -0400 (EDT) Message-ID: Date: Tue, 13 Jun 2023 16:16:19 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US To: Li-Kuan Ou , lttng-dev@lists.lttng.org References: <20230613154523.17184-1-k777k777tw@gmail.com> In-Reply-To: <20230613154523.17184-1-k777k777tw@gmail.com> Subject: Re: [lttng-dev] [PATCH] Fix: revise urcu_read_lock_update() comment X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mathieu Desnoyers via lttng-dev Reply-To: Mathieu Desnoyers Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" On 6/13/23 11:45, Li-Kuan Ou via lttng-dev wrote: > 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, > Signed-off-by: Li-Kuan Ou > --- > 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(-) > > diff --git a/include/urcu/static/urcu-bp.h b/include/urcu/static/urcu-bp.h > index 8ba3830..c90c9f1 100644 > --- a/include/urcu/static/urcu-bp.h > +++ b/include/urcu/static/urcu-bp.h > @@ -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 > * 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. > */ > diff --git a/include/urcu/static/urcu-mb.h b/include/urcu/static/urcu-mb.h > index b97e42a..218e2f3 100644 > --- a/include/urcu/static/urcu-mb.h > +++ b/include/urcu/static/urcu-mb.h > @@ -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. > */ > diff --git a/include/urcu/static/urcu-memb.h b/include/urcu/static/urcu-memb.h > index c8d102f..b923f73 100644 > --- a/include/urcu/static/urcu-memb.h > +++ b/include/urcu/static/urcu-memb.h > @@ -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. > */ > diff --git a/include/urcu/static/urcu-signal.h b/include/urcu/static/urcu-signal.h > index c7577d3..00588b8 100644 > --- a/include/urcu/static/urcu-signal.h > +++ b/include/urcu/static/urcu-signal.h > @@ -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. > */ -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev