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]
Date:   Sun, 23 Jul 2023 07:23:00 +0100
From:   Yun Levi <ppbuk5246@...il.com>
To:     paulmck@...nel.org
Cc:     frederic@...nel.org, quic_neeraju@...cinc.com,
        joel@...lfernandes.org, osh@...htriplett.org, boqun.feng@...il.com,
        rostedt@...dmis.org, mathieu.desnoyers@...icios.com,
        jiangshanlai@...il.com, qiang.zhang1211@...il.com,
        rcu@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rcu: remove unnecessary check cpu_no_qs.norm on rcu_report_qs_rdp

Thanks for replying to reply Paul :)

> And try testing with CONFIG_RCU_STRICT_GRACE_PERIOD=y and CONFIG_PREEMPT=n.
> Though there might be better Kconfig options to use.  Those two come
> immediately to mind.

I've tested with this option via rcu torture.
and it doesn't report any problems.
and after commit 6d60ea03ac2d3 ("rcu: Report QS for outermost
PREEMPT=n rcu_read_unlock() for strict GPs")
it always makes cpu_no_qs.b.norm false whenever it calls
rcu_report_qs_rdp in rcu_read_unlock.

> But one critical piece is that softirq handlers, including the RCU_SOFTIRQ
> handler rcu_core_si(), can be invoked upon return from interrupts.

I think in that case, no problem because if it reports qs already,
rcu_check_quiescent_state wouldn't call rcu_report_qs_rdp again.
And if RCU_SOFTIRQ is called as soon as RCU interrupt is finished,
it seems the fastest one to notify qs to related tree.

> Another critical piece is that if a CPU is idle during any part of a
> grace period, the grace-period kthread can report a quiescent state on
> its behalf.

I think
    1) If timer interrupt is still programed,
          - when rcu_sched_clock_irq first reports qs, no problem
          - If qs is reported via grace period thread first,
note_gp_chagned in rcu interrupt
            will recognize this situation by setting core_needs_qs as false,
            it doesn't call rcu_report_qs_rdp thou cpu_no_qs.b.norm is true.

     2) If the timer interrupt isn't programmed,
          - rcu_gp_kthreaad reports its qs, no problem.

So, I think there's no problem removing
      "rdp->cpu_no_qs.b.norm" check in rcu_report_qs_rdp.
or wrap this condition check as WARN_ON_ONCE.

> Does that help?
Many thanks always :)

--------
SIncerely,
Levi.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ