[PATCH RT 3/4] timers: Move clearing of base::timer_running under base::lock

2020-12-11 Thread Steven Rostedt
5.4.82-rt46-rc1 stable review patch. If anyone has any objections, please let me know. -- From: Thomas Gleixner syzbot reported KCSAN data races vs. timer_base::timer_running being set to NULL without holding base::lock in expire_timers(). This looks innocent and most reads

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-11 Thread Sebastian Andrzej Siewior
On 2020-12-11 15:36:27 [+0100], Thomas Gleixner wrote: > So the change at hand does not make things worse, right? Correct. This *ping*-*pong* was there before this patch because ->running_timer is always cleared after the callback finishes. I was just curious why out of a sudden there are *that*

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-11 Thread Thomas Gleixner
On Tue, Dec 08 2020 at 09:50, Sebastian Andrzej Siewior wrote: > On 2020-12-07 08:06:48 [-0800], Paul E. McKenney wrote: >> > Yes, but it triggers frequently. Like `rcuc' is somehow is aligned with >> > the timeout. >> >> Given that a lot of RCU processing is event-driven based on timers, >> and

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-08 Thread Paul E. McKenney
On Tue, Dec 08, 2020 at 09:50:49AM +0100, Sebastian Andrzej Siewior wrote: > On 2020-12-07 08:06:48 [-0800], Paul E. McKenney wrote: > > > Yes, but it triggers frequently. Like `rcuc' is somehow is aligned with > > > the timeout. > > > > Given that a lot of RCU processing is event-driven based on

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-08 Thread Sebastian Andrzej Siewior
On 2020-12-07 08:06:48 [-0800], Paul E. McKenney wrote: > > Yes, but it triggers frequently. Like `rcuc' is somehow is aligned with > > the timeout. > > Given that a lot of RCU processing is event-driven based on timers, > and given that the scheduling-clock interrupts are synchronized for >

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-07 Thread Paul E. McKenney
On Mon, Dec 07, 2020 at 04:25:33PM +0100, Sebastian Andrzej Siewior wrote: > On 2020-12-07 15:29:50 [+0100], Thomas Gleixner wrote: > > On Mon, Dec 07 2020 at 14:07, Sebastian Andrzej Siewior wrote: > > > One thing I noticed while testing it is that the "corner" case in > > >

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-07 Thread Sebastian Andrzej Siewior
On 2020-12-07 15:29:50 [+0100], Thomas Gleixner wrote: > On Mon, Dec 07 2020 at 14:07, Sebastian Andrzej Siewior wrote: > > One thing I noticed while testing it is that the "corner" case in > > timer_sync_wait_running() is quite reliably hit by rcu_preempt > > rcu_gp_fqs_loop() ->

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-07 Thread Thomas Gleixner
On Mon, Dec 07 2020 at 14:07, Sebastian Andrzej Siewior wrote: > On 2020-12-06 22:40:07 [+0100], Thomas Gleixner wrote: >> syzbot reported KCSAN data races vs. timer_base::timer_running being set to >> NULL without holding base::lock in expire_timers(). >> >> This looks innocent and most reads

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-07 Thread Sebastian Andrzej Siewior
On 2020-12-06 22:40:07 [+0100], Thomas Gleixner wrote: > syzbot reported KCSAN data races vs. timer_base::timer_running being set to > NULL without holding base::lock in expire_timers(). > > This looks innocent and most reads are clearly not problematic but for a > non-RT kernel it's completely

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-07 Thread Frederic Weisbecker
On Mon, Dec 07, 2020 at 01:25:13PM +0100, Peter Zijlstra wrote: > On Mon, Dec 07, 2020 at 02:10:13AM +0100, Frederic Weisbecker wrote: > > On Sun, Dec 06, 2020 at 10:40:07PM +0100, Thomas Gleixner wrote: > > > syzbot reported KCSAN data races vs. timer_base::timer_running being set > > > to > > >

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-07 Thread Peter Zijlstra
On Mon, Dec 07, 2020 at 02:10:13AM +0100, Frederic Weisbecker wrote: > On Sun, Dec 06, 2020 at 10:40:07PM +0100, Thomas Gleixner wrote: > > syzbot reported KCSAN data races vs. timer_base::timer_running being set to > > NULL without holding base::lock in expire_timers(). > > > > This looks

Re: timers: Move clearing of base::timer_running under base::lock

2020-12-06 Thread Frederic Weisbecker
On Sun, Dec 06, 2020 at 10:40:07PM +0100, Thomas Gleixner wrote: > syzbot reported KCSAN data races vs. timer_base::timer_running being set to > NULL without holding base::lock in expire_timers(). > > This looks innocent and most reads are clearly not problematic but for a > non-RT kernel it's

timers: Move clearing of base::timer_running under base::lock

2020-12-06 Thread Thomas Gleixner
syzbot reported KCSAN data races vs. timer_base::timer_running being set to NULL without holding base::lock in expire_timers(). This looks innocent and most reads are clearly not problematic but for a non-RT kernel it's completely irrelevant whether the store happens before or after taking the