* [PATCH RT 1/4] Revert "net: Properly annotate the try-lock for the seqlock"
2020-12-11 21:41 [PATCH RT 0/4] Linux 5.4.82-rt46-rc1 Steven Rostedt
@ 2020-12-11 21:41 ` Steven Rostedt
2020-12-11 21:41 ` [PATCH RT 2/4] Revert "hrtimer: Allow raw wakeups during boot" Steven Rostedt
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2020-12-11 21:41 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Daniel Wagner, Tom Zanussi, Srivatsa S. Bhat
5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
This reverts commit 3971227b5af04e6c34ef7b47b2ebe941727563a0.
Link: https://lore.kernel.org/r/20201116171958.2opbksmgbznrjxu2@linutronix.de
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
include/linux/seqlock.h | 9 +++++++++
include/net/sch_generic.h | 10 +---------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index f390293974ea..e5207897c33e 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -489,6 +489,15 @@ static inline void write_seqlock(seqlock_t *sl)
__raw_write_seqcount_begin(&sl->seqcount);
}
+static inline int try_write_seqlock(seqlock_t *sl)
+{
+ if (spin_trylock(&sl->lock)) {
+ __raw_write_seqcount_begin(&sl->seqcount);
+ return 1;
+ }
+ return 0;
+}
+
static inline void write_sequnlock(seqlock_t *sl)
{
__raw_write_seqcount_end(&sl->seqcount);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 112d2dca8b08..e6afb4b9cede 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -168,16 +168,8 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc)
return false;
}
#ifdef CONFIG_PREEMPT_RT
- if (spin_trylock(&qdisc->running.lock)) {
- seqcount_t *s = &qdisc->running.seqcount;
- /*
- * Variant of write_seqcount_t_begin() telling lockdep that a
- * trylock was attempted.
- */
- __raw_write_seqcount_begin(s);
- seqcount_acquire(&s->dep_map, 0, 1, _RET_IP_);
+ if (try_write_seqlock(&qdisc->running))
return true;
- }
return false;
#else
/* Variant of write_seqcount_begin() telling lockdep a trylock
--
2.29.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH RT 2/4] Revert "hrtimer: Allow raw wakeups during boot"
2020-12-11 21:41 [PATCH RT 0/4] Linux 5.4.82-rt46-rc1 Steven Rostedt
2020-12-11 21:41 ` [PATCH RT 1/4] Revert "net: Properly annotate the try-lock for the seqlock" Steven Rostedt
@ 2020-12-11 21:41 ` Steven Rostedt
2020-12-14 8:33 ` Sebastian Andrzej Siewior
2020-12-11 21:41 ` [PATCH RT 3/4] timers: Move clearing of base::timer_running under base::lock Steven Rostedt
2020-12-11 21:41 ` [PATCH RT 4/4] Linux 5.4.82-rt46-rc1 Steven Rostedt
3 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2020-12-11 21:41 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Daniel Wagner, Tom Zanussi, Srivatsa S. Bhat
5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
This change is no longer needed since commit
26c7295be0c5e ("kthread: Do not preempt current task if it is going to call schedule()")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/time/hrtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 41cc1c8530d8..42705a04c808 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1819,7 +1819,7 @@ static void __hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
* expiry.
*/
if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
- if ((task_is_realtime(current) && !(mode & HRTIMER_MODE_SOFT)) || system_state != SYSTEM_RUNNING)
+ if (task_is_realtime(current) && !(mode & HRTIMER_MODE_SOFT))
mode |= HRTIMER_MODE_HARD;
}
--
2.29.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH RT 2/4] Revert "hrtimer: Allow raw wakeups during boot"
2020-12-11 21:41 ` [PATCH RT 2/4] Revert "hrtimer: Allow raw wakeups during boot" Steven Rostedt
@ 2020-12-14 8:33 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2020-12-14 8:33 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, linux-rt-users, Thomas Gleixner, Carsten Emde,
John Kacur, Daniel Wagner, Tom Zanussi, Srivatsa S. Bhat
On 2020-12-11 16:41:05 [-0500], Steven Rostedt wrote:
> 5.4.82-rt46-rc1 stable review patch.
> If anyone has any objections, please let me know.
>
> ------------------
>
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> This change is no longer needed since commit
> 26c7295be0c5e ("kthread: Do not preempt current task if it is going to call schedule()")
This patch has been integrated in v5.7-rc1 and it made its way into
v5.4.61. Okay, why not.
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Sebastian
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH RT 3/4] timers: Move clearing of base::timer_running under base::lock
2020-12-11 21:41 [PATCH RT 0/4] Linux 5.4.82-rt46-rc1 Steven Rostedt
2020-12-11 21:41 ` [PATCH RT 1/4] Revert "net: Properly annotate the try-lock for the seqlock" Steven Rostedt
2020-12-11 21:41 ` [PATCH RT 2/4] Revert "hrtimer: Allow raw wakeups during boot" Steven Rostedt
@ 2020-12-11 21:41 ` Steven Rostedt
2020-12-11 21:41 ` [PATCH RT 4/4] Linux 5.4.82-rt46-rc1 Steven Rostedt
3 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2020-12-11 21:41 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Daniel Wagner, Tom Zanussi, Srivatsa S. Bhat,
syzbot+aa7c2385d46c5eba0b89, syzbot+abea4558531bae1ba9fe,
stable-rt
5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
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 lock. For an RT kernel moving the store under the lock
requires an extra unlock/lock pair in the case that there is a waiter for
the timer. But that's not the end of the world and definitely not worth the
trouble of adding boatloads of comments and annotations to the code. Famous
last words...
Reported-by: syzbot+aa7c2385d46c5eba0b89@syzkaller.appspotmail.com
Reported-by: syzbot+abea4558531bae1ba9fe@syzkaller.appspotmail.com
Link: https://lkml.kernel.org/r/87lfea7gw8.fsf@nanos.tec.linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/time/timer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 15b838401af8..86bb218d1df5 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1269,8 +1269,10 @@ static inline void timer_base_unlock_expiry(struct timer_base *base)
static void timer_sync_wait_running(struct timer_base *base)
{
if (atomic_read(&base->timer_waiters)) {
+ raw_spin_unlock_irq(&base->lock);
spin_unlock(&base->expiry_lock);
spin_lock(&base->expiry_lock);
+ raw_spin_lock_irq(&base->lock);
}
}
@@ -1461,14 +1463,14 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head)
if (timer->flags & TIMER_IRQSAFE) {
raw_spin_unlock(&base->lock);
call_timer_fn(timer, fn, baseclk);
- base->running_timer = NULL;
raw_spin_lock(&base->lock);
+ base->running_timer = NULL;
} else {
raw_spin_unlock_irq(&base->lock);
call_timer_fn(timer, fn, baseclk);
+ raw_spin_lock_irq(&base->lock);
base->running_timer = NULL;
timer_sync_wait_running(base);
- raw_spin_lock_irq(&base->lock);
}
}
}
--
2.29.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH RT 4/4] Linux 5.4.82-rt46-rc1
2020-12-11 21:41 [PATCH RT 0/4] Linux 5.4.82-rt46-rc1 Steven Rostedt
` (2 preceding siblings ...)
2020-12-11 21:41 ` [PATCH RT 3/4] timers: Move clearing of base::timer_running under base::lock Steven Rostedt
@ 2020-12-11 21:41 ` Steven Rostedt
3 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2020-12-11 21:41 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Daniel Wagner, Tom Zanussi, Srivatsa S. Bhat
5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
---
localversion-rt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/localversion-rt b/localversion-rt
index 38c40b21a885..2a08cf6d539b 100644
--- a/localversion-rt
+++ b/localversion-rt
@@ -1 +1 @@
--rt45
+-rt46-rc1
--
2.29.2
^ permalink raw reply related [flat|nested] 6+ messages in thread