lkml.org 
[lkml]   [2023]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] rcu: remove unnecessary check cpu_no_qs.norm on rcu_report_qs_rdp
On Fri, Jul 21, 2023 at 01:15:33PM +0100, Levi Yun wrote:
> Wherever rcu_report_qs_rdp is called, cpu_no_qs.norm value is false.
> Therefore, Remove unnecessary check in rcu_report_qs_rdp.
>
> Signed-off-by: Levi Yun <ppbuk5246@gmail.com>

Why not start with something like this?

if (!WARN_ON_ONCE(!rdp->cpu_no_qs.b.norm) ||
rdp->gp_seq != rnp->gp_seq || rdp->gpwrap) {

Except that rcu_report_qs_rdp() is invoked with interrupts enabled,
which means that there is some possibility of state changes up to the
raw_spin_lock_irqsave_rcu_node(rnp, flags) statement.

So, did you check whether RCU's interrupt paths change this state?

Thanx, Paul

> ---
> kernel/rcu/tree.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 1449cb69a0e0..d840596e9903 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1962,8 +1962,7 @@ rcu_report_qs_rdp(struct rcu_data *rdp)
> WARN_ON_ONCE(rdp->cpu != smp_processor_id());
> rnp = rdp->mynode;
> raw_spin_lock_irqsave_rcu_node(rnp, flags);
> - if (rdp->cpu_no_qs.b.norm || rdp->gp_seq != rnp->gp_seq ||
> - rdp->gpwrap) {
> + if (rdp->gp_seq != rnp->gp_seq || rdp->gpwrap) {
>
> /*
> * The grace period in which this quiescent state was
> --
> 2.37.2

\
 
 \ /
  Last update: 2023-07-21 23:46    [W:1.391 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site