Skip to contentSkip to conversation

Linux 4.1.46-rt52-rc1

PATCH New Julia Cartwright 1 participant 5 messages Nov 10, 2017

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

cover Linux 4.1.46-rt52-rc1

Dear RT Folks,

This is the RT stable review cycle of patch 4.1.46-rt52-rc1. Please review the included patches, and test!

You might ask: "Where was 4.1.46-rt51?". The answer is: it was released silently, and only as a means to facilitate release-level bisection. Version 4.1.46-rt51 has known issues to be resolved by the pending release of -rt52.

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 11/15/2017.

Julia

----------------------------------------------------------------
To build 4.1.46-rt52-rc1 directly, the following patches should be applied:

http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.1.tar.xz

http://www.kernel.org/pub/linux/kernel/v4.x/patch-4.1.46.xz

http://www.kernel.org/pub/linux/kernel/projects/rt/4.1/patch-4.1.46-rt52-rc1.patch.xz

You can also build from 4.1.46-rt51 release by applying the incremental patch:

http://www.kernel.org/pub/linux/kernel/projects/rt/4.1/incr/patch-4.1.46-rt51-rt52-rc1.patch.xz

Julia Cartwright (2):
workqueue: fixup rcu check for RT
Linux 4.1.46-rt52-rc1

Sebastian Andrzej Siewior (2):
PM / CPU: replace raw_notifier with atomic_notifier (fixup) kernel/hrtimer: migrate deferred timer on CPU down

 kernel/cpu_pm.c       | 7 +++++++
 kernel/time/hrtimer.c | 5 +++++
 kernel/workqueue.c    | 2 +-
 localversion-rt       | 2 +-
 4 files changed, 14 insertions(+), 2 deletions(-)
Signature · 1 line
2.14.2
#1 lore raw

PATCH 1/4 PM / CPU: replace raw_notifier with atomic_notifier

4.1.46-rt52-rc1 stable review patch.
If you have any objection to the inclusion of this patch, let me know.

--- 8< --- 8< --- 8< ---
From: Sebastian Andrzej Siewior <[email protected]>

The original patch changed betwen its posting and what finally went into Rafael's tree so here is the delta.

(cherry picked from commit f648e23dac72deef07f25e05fc09dbbc209dbd33)
---
 kernel/cpu_pm.c | 7 +++++++
 1 file changed, 7 insertions(+)
kernel/cpu_pm.c +7 -0
index 9da42f83ee03..d1d1c3961553 100644
@@ -28,8 +28,15 @@ static int cpu_pm_notify(enum cpu_pm_event event, int nr_to_call, int *nr_calls)
 {
 	int ret;
 
+	/*
+	 * __atomic_notifier_call_chain has a RCU read critical section, which
+	 * could be disfunctional in cpu idle. Copy RCU_NONIDLE code to let
+	 * RCU know this.
+	 */
+	rcu_irq_enter_irqson();
 	ret = __atomic_notifier_call_chain(&cpu_pm_notifier_chain, event, NULL,
 		nr_to_call, nr_calls);
+	rcu_irq_exit_irqson();
 
 	return notifier_to_errno(ret);
 }
Signature · 1 line
2.14.2
#2 lore raw

PATCH 2/4 workqueue: fixup rcu check for RT

In reply to Julia Cartwright

4.1.46-rt52-rc1 stable review patch.
If you have any objection to the inclusion of this patch, let me know.

--- 8< --- 8< --- 8< ---
Upstream commit 5b95e1af8d17d ("workqueue: wq_pool_mutex protects the attrs-installation") introduced an additional assertion (assert_rcu_or_wq_mutex_or_pool_mutex) which contains a check ensuring that the caller is in a RCU-sched read-side critical section.

However, on RT, the locking rules are lessened to only require require _normal_ RCU. Fix up this check.

The upstream commit was cherry-picked back into stable v4.1.19 as d3c4dd8843be.

This fixes up the bogus splat triggered on boot:

    ===============================
    [ INFO: suspicious RCU usage. ]
    4.1.42-rt50
    -------------------------------
    kernel/workqueue.c:609 sched RCU, wq->mutex or wq_pool_mutex should be held!

    other info that might help us debug this:

    rcu_scheduler_active = 1, debug_locks = 0
    2 locks held by swapper/0/1:
     #0:  ((pendingb_lock).lock){+.+...}, at: queue_work_on+0x64/0x1c0
     #1:  (rcu_read_lock){......}, at:  __queue_work+0x2a/0x880

    stack backtrace:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.42-rt50 #4
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-20170228_101828-anatol 04/01/2014
    Call Trace:
     dump_stack+0x70/0x9a
     lockdep_rcu_suspicious+0xe7/0x120
     unbound_pwq_by_node+0x92/0x100
     __queue_work+0x28c/0x880
     ? __queue_work+0x2a/0x880
     queue_work_on+0xc9/0x1c0
     call_usermodehelper_exec+0x1a7/0x200
     kobject_uevent_env+0x4be/0x520
     ? initcall_blacklist+0xa2/0xa2
     kobject_uevent+0xb/0x10
     kset_register+0x34/0x50
     bus_register+0x100/0x2d0
     ? ftrace_define_fields_workqueue_work+0x29/0x29
     subsys_virtual_register+0x26/0x50
     wq_sysfs_init+0x12/0x14
     do_one_initcall+0x88/0x1b0
     ? parse_args+0x190/0x410
     kernel_init_freeable+0x204/0x299
     ? rest_init+0x140/0x140
     kernel_init+0x9/0xf0
     ret_from_fork+0x42/0x70
     ? rest_init+0x140/0x140
---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
index 6bdcab98501c..90e261c8811e 100644
@@ -363,7 +363,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
 			   "RCU or wq->mutex should be held")
 
 #define assert_rcu_or_wq_mutex_or_pool_mutex(wq)			\
-	rcu_lockdep_assert(rcu_read_lock_sched_held() ||		\
+	rcu_lockdep_assert(rcu_read_lock_held() ||			\
 			   lockdep_is_held(&wq->mutex) ||		\
 			   lockdep_is_held(&wq_pool_mutex),		\
 			   "sched RCU, wq->mutex or wq_pool_mutex should be held")
Signature · 1 line
2.14.2
#3 lore raw

PATCH 3/4 kernel/hrtimer: migrate deferred timer on CPU down

In reply to Julia Cartwright

4.1.46-rt52-rc1 stable review patch.
If you have any objection to the inclusion of this patch, let me know.

--- 8< --- 8< --- 8< ---
From: Sebastian Andrzej Siewior <[email protected]>

hrtimers, which were deferred to the softirq context, and expire between softirq shutdown and hrtimer migration are dangling around. If the CPU goes back up the list head will be initialized and this corrupts the timer's list. It will remain unnoticed until a hrtimer_cancel(). This moves those timers so they will expire.

(cherry picked from commit b3c08bffdcdd23f1b3ca8d9c01e3b8a715e03d46)
---
 kernel/time/hrtimer.c | 5 +++++
 1 file changed, 5 insertions(+)
kernel/time/hrtimer.c +5 -0
index 2c6be169bdc7..75c990b00525 100644
@@ -1951,6 +1951,11 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
 		/* Clear the migration state bit */
 		timer->state &= ~HRTIMER_STATE_MIGRATE;
 	}
+#ifdef CONFIG_PREEMPT_RT_BASE
+	list_splice_tail(&old_base->expired, &new_base->expired);
+	if (!list_empty(&new_base->expired))
+		raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+#endif
 }
 
 static void migrate_hrtimers(int scpu)
Signature · 1 line
2.14.2
#4 lore raw

PATCH 4/4 Linux 4.1.46-rt52-rc1

In reply to Julia Cartwright

4.1.46-rt52-rc1 stable review patch.
If you have any objection to the inclusion of this patch, let me know.

--- 8< --- 8< --- 8< ---

---
 localversion-rt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
localversion-rt +1 -1
index 75493460c41f..d42746076d9b 100644
@@ -1 +1 @@
--rt51
+-rt52-rc1
Signature · 1 line
2.14.2