summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2017-09-05 11:21:20 +0200
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2017-09-05 11:21:20 +0200
commitd35d53ca33548fbb70fc5626e821454bd17a19db (patch)
tree8b627f895603dcebbd38fd3acf29ac68e53de1b2
parenta43794cd01154b6778fb82eec344ffdf776cea08 (diff)
download4.12-rt-patches-d35d53ca33548fbb70fc5626e821454bd17a19db.tar.gz
[ANNOUNCE] v4.11.12-rt12
Dear RT folks! I'm pleased to announce the v4.11.12-rt12 patch set. Changes since v4.11.12-rt11: - In the hrtimer/hotplug fix in the last release, there was one call path missed. Mike Galbraith reported it and sent a patch to handle it. Known issues - There was a report regarding a deadlock within the rtmutex code. The delta patch against v4.11.12-rt11 is appended below and can be found here: https://cdn.kernel.org/pub/linux/kernel/projects/rt/4.11/incr/patch-4.11.12-rt11-rt12.patch.xz You can get this release via the git tree at: git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git v4.11.12-rt12 The RT patch against v4.11.12 can be found here: https://cdn.kernel.org/pub/linux/kernel/projects/rt/4.11/older/patch-4.11.12-rt12.patch.xz The split quilt queue is available at: https://cdn.kernel.org/pub/linux/kernel/projects/rt/4.11/older/patches-4.11.12-rt12.tar.xz Sebastian diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1779,7 +1779,7 @@ int hrtimers_prepare_cpu(unsigned int cpu) #ifdef CONFIG_HOTPLUG_CPU -static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, +static int migrate_hrtimer_list(struct hrtimer_clock_base *old_base, struct hrtimer_clock_base *new_base) { struct hrtimer *timer; @@ -1809,15 +1809,19 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, } #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); + /* + * Tell the caller to raise HRTIMER_SOFTIRQ. We can't safely + * acquire ktimersoftd->pi_lock while the base lock is held. + */ + return !list_empty(&new_base->expired); #endif + return 0; } int hrtimers_dead_cpu(unsigned int scpu) { struct hrtimer_cpu_base *old_base, *new_base; - int i; + int i, raise = 0; BUG_ON(cpu_online(scpu)); tick_cancel_sched_timer(scpu); @@ -1833,13 +1837,16 @@ int hrtimers_dead_cpu(unsigned int scpu) raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING); for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { - migrate_hrtimer_list(&old_base->clock_base[i], - &new_base->clock_base[i]); + raise |= migrate_hrtimer_list(&old_base->clock_base[i], + &new_base->clock_base[i]); } raw_spin_unlock(&old_base->lock); raw_spin_unlock(&new_base->lock); + if (raise) + raise_softirq_irqoff(HRTIMER_SOFTIRQ); + /* Check, if we got expired work to do */ __hrtimer_peek_ahead_timers(); local_irq_enable(); diff --git a/localversion-rt b/localversion-rt --- a/localversion-rt +++ b/localversion-rt @@ -1 +1 @@ --rt11 +-rt12 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-rw-r--r--patches/kernel-hrtimer-hotplug-don-t-wake-ktimersoftd-while-.patch69
-rw-r--r--patches/localversion.patch2
-rw-r--r--patches/series1
3 files changed, 71 insertions, 1 deletions
diff --git a/patches/kernel-hrtimer-hotplug-don-t-wake-ktimersoftd-while-.patch b/patches/kernel-hrtimer-hotplug-don-t-wake-ktimersoftd-while-.patch
new file mode 100644
index 00000000000000..925c2af1942ebf
--- /dev/null
+++ b/patches/kernel-hrtimer-hotplug-don-t-wake-ktimersoftd-while-.patch
@@ -0,0 +1,69 @@
+From 4ca8658769126558b04a1d78b7d6bee389bfa24b Mon Sep 17 00:00:00 2001
+From: Mike Galbraith <efault@gmx.de>
+Date: Sun, 3 Sep 2017 04:48:10 +0200
+Subject: [PATCH] kernel/hrtimer/hotplug: don't wake ktimersoftd while holding
+ the hrtimer base lock
+
+kernel/hrtimer: don't wakeup a process while holding the hrtimer base lock
+missed a path, namely hrtimers_dead_cpu() -> migrate_hrtimer_list(). Defer
+raising softirq until after base lock has been released there as well.
+
+Signed-off-by: Mike Galbraith <efault@gmx.de>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/time/hrtimer.c | 19 +++++++++++++------
+ 1 file changed, 13 insertions(+), 6 deletions(-)
+
+--- a/kernel/time/hrtimer.c
++++ b/kernel/time/hrtimer.c
+@@ -1725,7 +1725,7 @@ int hrtimers_prepare_cpu(unsigned int cp
+
+ #ifdef CONFIG_HOTPLUG_CPU
+
+-static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
++static int migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
+ struct hrtimer_clock_base *new_base)
+ {
+ struct hrtimer *timer;
+@@ -1755,15 +1755,19 @@ static void migrate_hrtimer_list(struct
+ }
+ #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);
++ /*
++ * Tell the caller to raise HRTIMER_SOFTIRQ. We can't safely
++ * acquire ktimersoftd->pi_lock while the base lock is held.
++ */
++ return !list_empty(&new_base->expired);
+ #endif
++ return 0;
+ }
+
+ int hrtimers_dead_cpu(unsigned int scpu)
+ {
+ struct hrtimer_cpu_base *old_base, *new_base;
+- int i;
++ int i, raise = 0;
+
+ BUG_ON(cpu_online(scpu));
+ tick_cancel_sched_timer(scpu);
+@@ -1779,13 +1783,16 @@ int hrtimers_dead_cpu(unsigned int scpu)
+ raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
+
+ for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
+- migrate_hrtimer_list(&old_base->clock_base[i],
+- &new_base->clock_base[i]);
++ raise |= migrate_hrtimer_list(&old_base->clock_base[i],
++ &new_base->clock_base[i]);
+ }
+
+ raw_spin_unlock(&old_base->lock);
+ raw_spin_unlock(&new_base->lock);
+
++ if (raise)
++ raise_softirq_irqoff(HRTIMER_SOFTIRQ);
++
+ /* Check, if we got expired work to do */
+ __hrtimer_peek_ahead_timers();
+ local_irq_enable();
diff --git a/patches/localversion.patch b/patches/localversion.patch
index 58842b503a2712..12bd473a33f5b0 100644
--- a/patches/localversion.patch
+++ b/patches/localversion.patch
@@ -10,4 +10,4 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
--- /dev/null
+++ b/localversion-rt
@@ -0,0 +1 @@
-+-rt11
++-rt12
diff --git a/patches/series b/patches/series
index 8dac6fa0f250ee..0985cc1292d05d 100644
--- a/patches/series
+++ b/patches/series
@@ -397,6 +397,7 @@ tick-broadcast--Make-hrtimer-irqsafe.patch
timer-hrtimer-check-properly-for-a-running-timer.patch
kernel-hrtimer-migrate-deferred-timer-on-CPU-down.patch
kernel-hrtimer-don-t-wakeup-a-process-while-holding-.patch
+kernel-hrtimer-hotplug-don-t-wake-ktimersoftd-while-.patch
# POSIX-CPU-TIMERS
posix-timers-thread-posix-cpu-timers-on-rt.patch