From: Frederic Weisbecker <frederic@kernel.org>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: rcu@vger.kernel.org, Lai Jiangshan <jiangshanlai@gmail.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH 2/2] srcu: Fix the comparision in srcu_invl_snp_seq()
Date: Wed, 16 Nov 2022 14:34:37 +0100 [thread overview]
Message-ID: <20221116133437.GA816333@lothringen> (raw)
In-Reply-To: <20221116015244.10539-2-kernelfans@gmail.com>
On Wed, Nov 16, 2022 at 09:52:44AM +0800, Pingfan Liu wrote:
> A seq contains two fields: counter and state.
>
> SRCU_SNP_INIT_SEQ is used as invalid initial value for srcu_node GP
> sequence numbers. Hence srcu_invl_snp_seq() should compare both fields
> of a seq.
>
> Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
> Cc: Lai Jiangshan <jiangshanlai@gmail.com>
> Cc: "Paul E. McKenney" <paulmck@kernel.org>
> Cc: Frederic Weisbecker <frederic@kernel.org>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> To: rcu@vger.kernel.org
> ---
> kernel/rcu/srcutree.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> index 1c304fec89c0..725c82bb0a6a 100644
> --- a/kernel/rcu/srcutree.c
> +++ b/kernel/rcu/srcutree.c
> @@ -154,7 +154,7 @@ static void init_srcu_struct_data(struct srcu_struct *ssp)
> */
> static inline bool srcu_invl_snp_seq(unsigned long s)
> {
> - return rcu_seq_state(s) == SRCU_SNP_INIT_SEQ;
> + return s == SRCU_SNP_INIT_SEQ;
Doesn't hurt and makes it less confusing as it doesn't suggest anymore
there _might_ be a gp number behind.
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
> }
>
> /*
> --
> 2.31.1
>
next prev parent reply other threads:[~2022-11-16 13:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 1:52 [PATCH 1/2] srcu: Fix a misspelling in note Pingfan Liu
2022-11-16 1:52 ` [PATCH 2/2] srcu: Fix the comparision in srcu_invl_snp_seq() Pingfan Liu
2022-11-16 13:34 ` Frederic Weisbecker [this message]
2022-11-16 17:26 ` Paul E. McKenney
2022-11-17 2:34 ` Pingfan Liu
2022-11-16 12:43 ` [PATCH 1/2] srcu: Fix a misspelling in note Mukesh Ojha
2022-11-16 13:36 ` Frederic Weisbecker
2022-11-16 16:48 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221116133437.GA816333@lothringen \
--to=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=kernelfans@gmail.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox