Re: [PATCH] rcu: Use READ_ONCE() for rdp->gpwrap access in __note_gp_changes()

2024-11-07 Thread Zilin Guan
On Wed, Nov 06, 2024 at 12:18:25PM -0800, Paul E. McKenney wrote: > Good eyes!!! > > But did you find this with KCSAN, or by visual inspection? > > The reason that I ask is that the __note_gp_changes() should be > invoked with the leaf rnp->lock held, which should exclude writes to > the rdp->gpw

Re: [PATCH] rcu: Use READ_ONCE() for rdp->gpwrap access in __note_gp_changes()

2024-11-07 Thread Paul E. McKenney
On Thu, Nov 07, 2024 at 02:01:17PM +, Zilin Guan wrote: > On Wed, Nov 06, 2024 at 12:18:25PM -0800, Paul E. McKenney wrote: > > Good eyes!!! > > > > But did you find this with KCSAN, or by visual inspection? > > > > The reason that I ask is that the __note_gp_changes() should be > > invoked w

Re: [PATCH] rcu: Use READ_ONCE() for rdp->gpwrap access in __note_gp_changes()

2024-11-06 Thread Paul E. McKenney
On Mon, Nov 04, 2024 at 03:12:30PM +, Zilin Guan wrote: > In function __note_gp_changes(), rdp->gpwrap is read using READ_ONCE() > in line 1307: > > 1307if (IS_ENABLED(CONFIG_PROVE_RCU) && READ_ONCE(rdp->gpwrap)) > 1308WRITE_ONCE(rdp->last_sched_clock, jiffies); > > while read

[PATCH] rcu: Use READ_ONCE() for rdp->gpwrap access in __note_gp_changes()

2024-11-04 Thread Zilin Guan
In function __note_gp_changes(), rdp->gpwrap is read using READ_ONCE() in line 1307: 1307if (IS_ENABLED(CONFIG_PROVE_RCU) && READ_ONCE(rdp->gpwrap)) 1308WRITE_ONCE(rdp->last_sched_clock, jiffies); while read directly in line 1305: 1305if (ULONG_CMP_LT(rdp->gp_seq_needed, rnp-