lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB7134D71E6190AD7E2C5C40F98955A@CY8PR11MB7134.namprd11.prod.outlook.com>
Date:   Tue, 13 Jun 2023 08:44:18 +0000
From:   "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To:     Frederic Weisbecker <frederic@...nel.org>,
        "Paul E . McKenney" <paulmck@...nel.org>
CC:     LKML <linux-kernel@...r.kernel.org>, rcu <rcu@...r.kernel.org>,
        "Uladzislau Rezki" <urezki@...il.com>,
        Neeraj Upadhyay <quic_neeraju@...cinc.com>,
        "Joel Fernandes" <joel@...lfernandes.org>,
        Giovanni Gherdovich <ggherdovich@...e.cz>
Subject: RE: [PATCH 2/9] rcu: Use rcu_segcblist_segempty() instead of open
 coding it

This patch LGTM. Thanks!

Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@...el.com>

> From: Frederic Weisbecker <frederic@...nel.org>
> Sent: Wednesday, May 31, 2023 6:17 PM
> To: Paul E . McKenney <paulmck@...nel.org>
> Cc: LKML <linux-kernel@...r.kernel.org>; Frederic Weisbecker
> <frederic@...nel.org>; rcu <rcu@...r.kernel.org>; Uladzislau Rezki
> <urezki@...il.com>; Neeraj Upadhyay <quic_neeraju@...cinc.com>; Joel
> Fernandes <joel@...lfernandes.org>; Giovanni Gherdovich
> <ggherdovich@...e.cz>
> Subject: [PATCH 2/9] rcu: Use rcu_segcblist_segempty() instead of open
> coding it
> 
> This makes the code more readable.
> 
> Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
> ---
>  kernel/rcu/rcu_segcblist.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c index
> f71fac422c8f..1693ea22ef1b 100644
> --- a/kernel/rcu/rcu_segcblist.c
> +++ b/kernel/rcu/rcu_segcblist.c
> @@ -368,7 +368,7 @@ bool rcu_segcblist_entrain(struct rcu_segcblist *rsclp,
>  	smp_mb(); /* Ensure counts are updated before callback is entrained.
> */
>  	rhp->next = NULL;
>  	for (i = RCU_NEXT_TAIL; i > RCU_DONE_TAIL; i--)
> -		if (rsclp->tails[i] != rsclp->tails[i - 1])
> +		if (!rcu_segcblist_segempty(rsclp, i))
>  			break;
>  	rcu_segcblist_inc_seglen(rsclp, i);
>  	WRITE_ONCE(*rsclp->tails[i], rhp);
> @@ -551,7 +551,7 @@ bool rcu_segcblist_accelerate(struct rcu_segcblist
> *rsclp, unsigned long seq)
>  	 * as their ->gp_seq[] grace-period completion sequence number.
>  	 */
>  	for (i = RCU_NEXT_READY_TAIL; i > RCU_DONE_TAIL; i--)
> -		if (rsclp->tails[i] != rsclp->tails[i - 1] &&
> +		if (!rcu_segcblist_segempty(rsclp, i) &&
>  		    ULONG_CMP_LT(rsclp->gp_seq[i], seq))
>  			break;
> 
> --
> 2.40.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ