Re: [PATCH 2/2] srcu: Fix the comparision in srcu_invl_snp_seq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> Cc: Lai Jiangshan <jiangshanlai@xxxxxxxxx>
> Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
> Cc: Frederic Weisbecker <frederic@xxxxxxxxxx>
> Cc: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> To: rcu@xxxxxxxxxxxxxxx
> ---
>  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@xxxxxxxxxx>


>  }
>  
>  /*
> -- 
> 2.31.1
> 



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux