Skip to contentSkip to conversation

Linux 5.4.82-rt46-rc1

PATCH In review Steven Rostedt 2 participants 6 messages Dec 11, 2020 – Dec 14, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Linux 5.4.82-rt46-rc1

Dear RT Folks,

This is the RT stable review cycle of patch 5.4.82-rt46-rc1.

Please scream at me if I messed something up. Please test the patches too.

The -rc release will be uploaded to kernel.org and will be deleted when the final release is out. This is just a review release (or release candidate).

The pre-releases will not be pushed to the git repository, only the final release is.

If all goes well, this patch will be converted to the next main release on 12/15/2020.

Enjoy,

-- Steve

To build 5.4.82-rt46-rc1 directly, the following patches should be applied:

http://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.tar.xz

http://www.kernel.org/pub/linux/kernel/v5.x/patch-5.4.82.xz

http://www.kernel.org/pub/linux/kernel/projects/rt/5.4/patch-5.4.82-rt46-rc1.patch.xz

You can also build from 5.4.82-rt45 by applying the incremental patch:

http://www.kernel.org/pub/linux/kernel/projects/rt/5.4/incr/patch-5.4.82-rt45-rt46-rc1.patch.xz

Changes from 5.4.82-rt45:

---

Sebastian Andrzej Siewior (1):
Revert "hrtimer: Allow raw wakeups during boot"

Steven Rostedt (VMware) (2):
Revert "net: Properly annotate the try-lock for the seqlock" Linux 5.4.82-rt46-rc1

Thomas Gleixner (1):
timers: Move clearing of base::timer_running under base::lock

----

 include/linux/seqlock.h   |  9 +++++++++
 include/net/sch_generic.h | 10 +---------
 kernel/time/hrtimer.c     |  2 +-
 kernel/time/timer.c       |  6 ++++--
 localversion-rt           |  2 +-
 5 files changed, 16 insertions(+), 13 deletions(-)
#1 lore raw

PATCH 1/4 Revert "net: Properly annotate the try-lock for the seqlock"

5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (VMware)" <[email protected]>

This reverts commit 3971227b5af04e6c34ef7b47b2ebe941727563a0.

---
 include/linux/seqlock.h   |  9 +++++++++
 include/net/sch_generic.h | 10 +---------
 2 files changed, 10 insertions(+), 9 deletions(-)
include/linux/seqlock.h +9 -0
index f390293974ea..e5207897c33e 100644
@@ -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);
include/net/sch_generic.h +1 -9
index 112d2dca8b08..e6afb4b9cede 100644
@@ -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
Signature · 1 line
2.29.2
#2 lore raw

PATCH 2/4 Revert "hrtimer: Allow raw wakeups during boot"

In reply to Steven Rostedt

5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <[email protected]>

This change is no longer needed since commit
26c7295be0c5e ("kthread: Do not preempt current task if it is going to call schedule()")

---
 kernel/time/hrtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/hrtimer.c +1 -1
index 41cc1c8530d8..42705a04c808 100644
@@ -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;
 	}
 
Signature · 1 line
2.29.2
#3 lore raw

Re: [PATCH RT 2/4] Revert "hrtimer: Allow raw wakeups during boot"

Quoted 9 lines · Steven Rostedt

5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <[email protected]>

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.

Quoted 2 lines

Sebastian

#4 lore raw

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

In reply to Steven Rostedt

5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Thomas Gleixner <[email protected]>

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...

---
 kernel/time/timer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/time/timer.c +4 -2
index 15b838401af8..86bb218d1df5 100644
@@ -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);
 		}
 	}
 }
Signature · 1 line
2.29.2
#5 lore raw

PATCH 4/4 Linux 5.4.82-rt46-rc1

In reply to Steven Rostedt

5.4.82-rt46-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (VMware)" <[email protected]>

---
 localversion-rt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
localversion-rt +1 -1
index 38c40b21a885..2a08cf6d539b 100644
@@ -1 +1 @@
--rt45
+-rt46-rc1
Signature · 1 line
2.29.2