diff --git a/debian/changelog b/debian/changelog index ccef56c93..847e59a01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2153,6 +2153,33 @@ linux (4.19.67-1) UNRELEASED; urgency=medium * rtc-s35390a: backport fix to make hwclock able to read the time (Closes: #932845) + [ Ben Hutchings ] + * [rt] Update to 4.19.59-rt24: + - Fix build failure after "genirq: Prevent use-after-free and work + list corruption": + + Update "genirq: Do not invoke the affinity callback via a workqueue on + RT" + + kthread: add a global worker thread. + + genirq: Do not invoke the affinity callback via a workqueue on RT + + genirq: Handle missing work_struct in irq_set_affinity_notifier() + - Update "irqwork: push most work into softirq context" to resolve + conflict with "irq_work: Do not raise an IPI when queueing work on the + local CPU" + - Drop "random: avoid preempt_disable()ed section" + - arm: imx6: cpuidle: Use raw_spinlock_t + - rcu: Don't allow to change rcu_normal_after_boot on RT + - sched/core: Drop a preempt_disable_rt() statement + - timers: Redo the notification of canceling timers on -RT + - Fix futex regression in 4.19.21: + + Revert "futex: Ensure lock/unlock symetry versus pi_lock and hash + bucket lock" + + Revert "futex: Fix bug on when a requeued RT task times out" + + Revert "rtmutex: Handle the various new futex race conditions" + + Revert "futex: workaround migrate_disable/enable in different context" + + futex: Make the futex_hash_bucket lock raw + + futex: Delay deallocation of pi_state + - mm/zswap: Do not disable preemption in zswap_frontswap_store() + -- Salvatore Bonaccorso Sun, 23 Jun 2019 16:15:17 +0200 linux (4.19.37-5+deb10u2) buster-security; urgency=high diff --git a/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch b/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch index 1b49ad153..703dc9701 100644 --- a/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch +++ b/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch @@ -1,8 +1,8 @@ -From bc4d8f04b5bd123853531af90f1ec548d8ab61e4 Mon Sep 17 00:00:00 2001 +From 200fca9a9f123bcca859fadc996b1e40c0384269 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:18 +0200 -Subject: [PATCH 001/269] ARM: at91: add TCB registers definitions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 001/283] ARM: at91: add TCB registers definitions +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Add registers and bits definitions for the timer counter blocks found on Atmel ARM SoCs. diff --git a/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch b/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch index 187117d5f..f332bac5d 100644 --- a/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch +++ b/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch @@ -1,9 +1,9 @@ -From 1eef86c9b8aa09d8e57f4ee5684c7bfd28f6900f Mon Sep 17 00:00:00 2001 +From 13e8b97c81d4029a2c41ce13ffc84507af252845 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:19 +0200 -Subject: [PATCH 002/269] clocksource/drivers: Add a new driver for the Atmel +Subject: [PATCH 002/283] clocksource/drivers: Add a new driver for the Atmel ARM TC blocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Add a driver for the Atmel Timer Counter Blocks. This driver provides a clocksource and two clockevent devices. @@ -32,10 +32,10 @@ Signed-off-by: Sebastian Andrzej Siewior create mode 100644 drivers/clocksource/timer-atmel-tcb.c diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig -index c1ddafa4c299..c5a5ad4e22e7 100644 +index 4d37f018d846..0ab22e7037f4 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig -@@ -414,6 +414,14 @@ config ATMEL_ST +@@ -415,6 +415,14 @@ config ATMEL_ST help Support for the Atmel ST timer. diff --git a/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch b/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch index 75f96195b..5c4c47476 100644 --- a/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch +++ b/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch @@ -1,9 +1,9 @@ -From f6803050ab0965a1255a3b407ca429a04c5cb230 Mon Sep 17 00:00:00 2001 +From 108301f18eaae6fde1bf8b864d52052bdc2a7043 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:20 +0200 -Subject: [PATCH 003/269] clocksource/drivers: timer-atmel-tcb: add clockevent +Subject: [PATCH 003/283] clocksource/drivers: timer-atmel-tcb: add clockevent device on separate channel -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Add an other clockevent device that uses a separate TCB channel when available. diff --git a/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch b/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch index e4297e5c3..7dcc22f7a 100644 --- a/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch +++ b/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch @@ -1,8 +1,8 @@ -From 873075a203c574d322429e4a8cd0686541293903 Mon Sep 17 00:00:00 2001 +From e60c9d976e3462237d2f3644c18091ac1e7746c6 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:21 +0200 -Subject: [PATCH 004/269] clocksource/drivers: atmel-pit: make option silent -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 004/283] clocksource/drivers: atmel-pit: make option silent +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz To conform with the other option, make the ATMEL_PIT option silent so it can be selected from the platform @@ -15,10 +15,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig -index c5a5ad4e22e7..076aa8184961 100644 +index 0ab22e7037f4..34b07047b91f 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig -@@ -403,8 +403,11 @@ config ARMV7M_SYSTICK +@@ -404,8 +404,11 @@ config ARMV7M_SYSTICK This options enables support for the ARMv7M system timer unit config ATMEL_PIT diff --git a/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch b/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch index 19bea6da3..45f3957e0 100644 --- a/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch +++ b/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch @@ -1,8 +1,8 @@ -From e0dc436f11c998b38ee3dc4cd269d5075ea12b7e Mon Sep 17 00:00:00 2001 +From 8cd066d01a3bc84384ba64a7521fdc80598a3418 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:22 +0200 -Subject: [PATCH 005/269] ARM: at91: Implement clocksource selection -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 005/283] ARM: at91: Implement clocksource selection +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Allow selecting and unselecting the PIT clocksource driver so it doesn't have to be compile when unused. diff --git a/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch b/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch index 08dd5eadb..46012642f 100644 --- a/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch +++ b/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch @@ -1,8 +1,8 @@ -From ca4a1c8ce5f7224d99ef6c2a6754468cb72ea4c3 Mon Sep 17 00:00:00 2001 +From db6f702c9d0558505d757c28c61f4f6a567a898a Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:23 +0200 -Subject: [PATCH 006/269] ARM: configs: at91: use new TCB timer driver -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 006/283] ARM: configs: at91: use new TCB timer driver +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Unselecting ATMEL_TCLIB switches the TCB timer driver from tcb_clksrc to timer-atmel-tcb. diff --git a/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch b/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch index c49d1996c..8315fc6b1 100644 --- a/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch +++ b/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch @@ -1,8 +1,8 @@ -From 2c83222f4057f755febccd002f3720bbf73a6473 Mon Sep 17 00:00:00 2001 +From 95cda24e3882fa19a569c029275d14089e8418e9 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:24 +0200 -Subject: [PATCH 007/269] ARM: configs: at91: unselect PIT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 007/283] ARM: configs: at91: unselect PIT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The PIT is not required anymore to successfully boot and may actually harm in case preempt-rt is used because the PIT interrupt is shared. diff --git a/debian/patches-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch b/debian/patches-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch index 4aa2abd9d..497781963 100644 --- a/debian/patches-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch +++ b/debian/patches-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch @@ -1,9 +1,9 @@ -From bb357496d72d05e2841899655c8e709d7c369ab0 Mon Sep 17 00:00:00 2001 +From 44f074c1b1621cbfa2d9f8f44aa69231154399d9 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Fri, 27 Jul 2018 13:38:54 +0100 -Subject: [PATCH 008/269] irqchip/gic-v3-its: Move pending table allocation to +Subject: [PATCH 008/283] irqchip/gic-v3-its: Move pending table allocation to init time -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Signed-off-by: Marc Zyngier Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch b/debian/patches-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch index 29139f173..309720b66 100644 --- a/debian/patches-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch +++ b/debian/patches-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch @@ -1,8 +1,8 @@ -From 9d8b1db47a7e355eb0c34a8af57f3613db6cb18c Mon Sep 17 00:00:00 2001 +From cd9320a1954642117f572891a8b45b177e6b0ebf Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 -Subject: [PATCH 009/269] kthread: convert worker lock to raw spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 009/283] kthread: convert worker lock to raw spinlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In order to enable the queuing of kthread work items from hardirq context even when PREEMPT_RT_FULL is enabled, convert the worker diff --git a/debian/patches-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch b/debian/patches-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch index 4f9fbcd18..74bc3bf12 100644 --- a/debian/patches-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch +++ b/debian/patches-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch @@ -1,11 +1,11 @@ -From b37ee7bd4ac42c97c3fce905634cf808345a25ac Mon Sep 17 00:00:00 2001 +From d4cc8969937e548b95b4d6f40804a4b706c9b441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horia=20Geant=C4=83?= Date: Mon, 8 Oct 2018 14:09:37 +0300 -Subject: [PATCH 010/269] crypto: caam/qi - simplify CGR allocation, freeing +Subject: [PATCH 010/283] crypto: caam/qi - simplify CGR allocation, freeing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz [Upstream commit 29e83c757006fd751966bdc53392bb22d74179c6] diff --git a/debian/patches-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch b/debian/patches-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch index d16136ac8..04dfc765f 100644 --- a/debian/patches-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch +++ b/debian/patches-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch @@ -1,8 +1,8 @@ -From 78f68e44994c830d70aa92bb86a47b204ff605c6 Mon Sep 17 00:00:00 2001 +From 256f2e459fd2eea3e04b6b9934f06c46e19185bb Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 7 Jan 2019 13:52:31 +0100 -Subject: [PATCH 011/269] sched/fair: Robustify CFS-bandwidth timer locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 011/283] sched/fair: Robustify CFS-bandwidth timer locking +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Traditionally hrtimer callbacks were run with IRQs disabled, but with the introduction of HRTIMER_MODE_SOFT it is possible they run from @@ -30,10 +30,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 4aa8e7d90c25..53acadf72cd9 100644 +index 4a433608ba74..289c966f907a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4553,7 +4553,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, +@@ -4557,7 +4557,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, struct rq *rq = rq_of(cfs_rq); struct rq_flags rf; @@ -42,7 +42,7 @@ index 4aa8e7d90c25..53acadf72cd9 100644 if (!cfs_rq_throttled(cfs_rq)) goto next; -@@ -4570,7 +4570,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, +@@ -4574,7 +4574,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, unthrottle_cfs_rq(cfs_rq); next: @@ -51,7 +51,7 @@ index 4aa8e7d90c25..53acadf72cd9 100644 if (!remaining) break; -@@ -4586,7 +4586,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, +@@ -4590,7 +4590,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, * period the timer is deactivated until scheduling resumes; cfs_b->idle is * used to track this state. */ @@ -60,7 +60,7 @@ index 4aa8e7d90c25..53acadf72cd9 100644 { u64 runtime, runtime_expires; int throttled; -@@ -4628,11 +4628,11 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun) +@@ -4632,11 +4632,11 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun) while (throttled && cfs_b->runtime > 0 && !cfs_b->distribute_running) { runtime = cfs_b->runtime; cfs_b->distribute_running = 1; @@ -74,7 +74,7 @@ index 4aa8e7d90c25..53acadf72cd9 100644 cfs_b->distribute_running = 0; throttled = !list_empty(&cfs_b->throttled_cfs_rq); -@@ -4741,17 +4741,18 @@ static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq) +@@ -4745,17 +4745,18 @@ static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq) static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) { u64 runtime = 0, slice = sched_cfs_bandwidth_slice(); @@ -96,7 +96,7 @@ index 4aa8e7d90c25..53acadf72cd9 100644 return; } -@@ -4762,18 +4763,18 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) +@@ -4766,18 +4767,18 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) if (runtime) cfs_b->distribute_running = 1; @@ -118,7 +118,7 @@ index 4aa8e7d90c25..53acadf72cd9 100644 } /* -@@ -4853,11 +4854,12 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) +@@ -4857,11 +4858,12 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) { struct cfs_bandwidth *cfs_b = container_of(timer, struct cfs_bandwidth, period_timer); @@ -132,7 +132,7 @@ index 4aa8e7d90c25..53acadf72cd9 100644 for (;;) { overrun = hrtimer_forward_now(timer, cfs_b->period); if (!overrun) -@@ -4885,11 +4887,11 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) +@@ -4889,11 +4891,11 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) count = 0; } diff --git a/debian/patches-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch b/debian/patches-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch index 8aa2bb96e..012d5c20f 100644 --- a/debian/patches-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch +++ b/debian/patches-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch @@ -1,8 +1,8 @@ -From fa6e4c3d085352808073b23fdff79729db01930a Mon Sep 17 00:00:00 2001 +From 3c866fa6b40a3acfe50a091680cd9f51a54cd45b Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Mon, 19 Sep 2011 14:51:14 -0700 -Subject: [PATCH 012/269] arm: Convert arm boot_lock to raw -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 012/283] arm: Convert arm boot_lock to raw +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The arm boot_lock is used by the secondary processor startup code. The locking task is the idle thread, which has idle->sched_class == &idle_sched_class. diff --git a/debian/patches-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch b/debian/patches-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch index ab0404403..8015a9079 100644 --- a/debian/patches-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch +++ b/debian/patches-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch @@ -1,9 +1,9 @@ -From 4debab2aa3d29fcdb5b9cd132416094c54e9361b Mon Sep 17 00:00:00 2001 +From abbec8803a7e474a1e1a1b1ee105de8ffd0c8cbc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 17 Jul 2018 18:25:31 +0200 -Subject: [PATCH 013/269] x86/ioapic: Don't let setaffinity unmask threaded EOI +Subject: [PATCH 013/283] x86/ioapic: Don't let setaffinity unmask threaded EOI interrupt too early -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz There is an issue with threaded interrupts which are marked ONESHOT and using the fasteoi handler. diff --git a/debian/patches-rt/0014-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch b/debian/patches-rt/0014-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch index 610a824f9..e80df87ee 100644 --- a/debian/patches-rt/0014-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +++ b/debian/patches-rt/0014-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch @@ -1,8 +1,8 @@ -From 1117688ac7606703683b1ac8cacdbf02d47b4adb Mon Sep 17 00:00:00 2001 +From 39150ca165ea6d7d6b5ffe76efb6170893ffdb06 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 18:19:48 +0200 -Subject: [PATCH 014/269] cgroup: use irqsave in cgroup_rstat_flush_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 014/283] cgroup: use irqsave in cgroup_rstat_flush_locked() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock either with spin_lock_irq() or spin_lock_irqsave(). diff --git a/debian/patches-rt/0015-fscache-initialize-cookie-hash-table-raw-spinlocks.patch b/debian/patches-rt/0015-fscache-initialize-cookie-hash-table-raw-spinlocks.patch index 6633da294..6b3ee79c5 100644 --- a/debian/patches-rt/0015-fscache-initialize-cookie-hash-table-raw-spinlocks.patch +++ b/debian/patches-rt/0015-fscache-initialize-cookie-hash-table-raw-spinlocks.patch @@ -1,8 +1,8 @@ -From 8cf7a5b4f03a2829c823971a12c1a206bcba069d Mon Sep 17 00:00:00 2001 +From 6c83cc3183d8efc6378788160d78a3a917a5ae96 Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Tue, 3 Jul 2018 13:34:30 -0500 -Subject: [PATCH 015/269] fscache: initialize cookie hash table raw spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 015/283] fscache: initialize cookie hash table raw spinlocks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The fscache cookie mechanism uses a hash table of hlist_bl_head structures. The PREEMPT_RT patcheset adds a raw spinlock to this structure and so on PREEMPT_RT diff --git a/debian/patches-rt/0016-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch b/debian/patches-rt/0016-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch index 9a355ac51..4847088d4 100644 --- a/debian/patches-rt/0016-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch +++ b/debian/patches-rt/0016-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch @@ -1,11 +1,11 @@ -From 841d8b9e20d17d7907421dc223346198287e81a1 Mon Sep 17 00:00:00 2001 +From fdfc7c94f7e160bd80c27ac31c6823fbb20330f7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 29 Aug 2018 21:59:04 +0200 -Subject: [PATCH 016/269] Drivers: hv: vmbus: include header for get_irq_regs() +Subject: [PATCH 016/283] Drivers: hv: vmbus: include header for get_irq_regs() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On !RT the header file get_irq_regs() gets pulled in via other header files. On RT it does not and the build fails: diff --git a/debian/patches-rt/0017-percpu-include-irqflags.h-for-raw_local_irq_save.patch b/debian/patches-rt/0017-percpu-include-irqflags.h-for-raw_local_irq_save.patch index abcbbe902..f560f06a9 100644 --- a/debian/patches-rt/0017-percpu-include-irqflags.h-for-raw_local_irq_save.patch +++ b/debian/patches-rt/0017-percpu-include-irqflags.h-for-raw_local_irq_save.patch @@ -1,8 +1,8 @@ -From d77a9b0754acbc89c7884b3505afdbb49677b36a Mon Sep 17 00:00:00 2001 +From 31f7158d8389cec550de5964422b1123fc94079b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 11 Oct 2018 16:39:59 +0200 -Subject: [PATCH 017/269] percpu: include irqflags.h for raw_local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 017/283] percpu: include irqflags.h for raw_local_irq_save() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The header percpu.h header file is using raw_local_irq_save() but does not include irqflags.h for its definition. It compiles because the diff --git a/debian/patches-rt/0018-efi-Allow-efi-runtime.patch b/debian/patches-rt/0018-efi-Allow-efi-runtime.patch index 5cf488436..b44169d09 100644 --- a/debian/patches-rt/0018-efi-Allow-efi-runtime.patch +++ b/debian/patches-rt/0018-efi-Allow-efi-runtime.patch @@ -1,8 +1,8 @@ -From 10c47a6dadf91edee1d414002f91cc73bbe59c90 Mon Sep 17 00:00:00 2001 +From fcb3ebea1da6aede14a10c28a06902043072f250 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:06:10 +0200 -Subject: [PATCH 018/269] efi: Allow efi=runtime -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 018/283] efi: Allow efi=runtime +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In case the option "efi=noruntime" is default at built-time, the user could overwrite its sate by `efi=runtime' and allow it again. diff --git a/debian/patches-rt/0019-x86-efi-drop-task_lock-from-efi_switch_mm.patch b/debian/patches-rt/0019-x86-efi-drop-task_lock-from-efi_switch_mm.patch index ea62e1549..b9736f4f8 100644 --- a/debian/patches-rt/0019-x86-efi-drop-task_lock-from-efi_switch_mm.patch +++ b/debian/patches-rt/0019-x86-efi-drop-task_lock-from-efi_switch_mm.patch @@ -1,8 +1,8 @@ -From d1af306cedb5a02314565763b49992b10ce5d802 Mon Sep 17 00:00:00 2001 +From 9dda6e746277e68f244d5660b5a3f3f85b0d9be0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 24 Jul 2018 14:48:55 +0200 -Subject: [PATCH 019/269] x86/efi: drop task_lock() from efi_switch_mm() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 019/283] x86/efi: drop task_lock() from efi_switch_mm() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz efi_switch_mm() is a wrapper around switch_mm() which saves current's ->active_mm, sets the requests mm as ->active_mm and invokes diff --git a/debian/patches-rt/0020-arm64-KVM-compute_layout-before-altenates-are-applie.patch b/debian/patches-rt/0020-arm64-KVM-compute_layout-before-altenates-are-applie.patch index 80844a73a..e1bfa7a87 100644 --- a/debian/patches-rt/0020-arm64-KVM-compute_layout-before-altenates-are-applie.patch +++ b/debian/patches-rt/0020-arm64-KVM-compute_layout-before-altenates-are-applie.patch @@ -1,9 +1,9 @@ -From 6d4ae829b2e8c46b1d730790bf2644e5a053cf14 Mon Sep 17 00:00:00 2001 +From b66a9f85a9e8ee817d0e2de1637bf95b7710127f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 09:13:42 +0200 -Subject: [PATCH 020/269] arm64: KVM: compute_layout before altenates are +Subject: [PATCH 020/283] arm64: KVM: compute_layout before altenates are applied -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz compute_layout() is invoked as part of an alternative fixup under stop_machine() and needs a sleeping lock as part of get_random_long(). diff --git a/debian/patches-rt/0021-of-allocate-free-phandle-cache-outside-of-the-devtre.patch b/debian/patches-rt/0021-of-allocate-free-phandle-cache-outside-of-the-devtre.patch index 877c18874..f41ae7c07 100644 --- a/debian/patches-rt/0021-of-allocate-free-phandle-cache-outside-of-the-devtre.patch +++ b/debian/patches-rt/0021-of-allocate-free-phandle-cache-outside-of-the-devtre.patch @@ -1,9 +1,9 @@ -From 1ab1616de2aaaa7392ebb706a457af2fdcd2b82a Mon Sep 17 00:00:00 2001 +From 6d0f5b28de481062ee69b0d62ae5ef2fc5101f9c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 31 Aug 2018 14:16:30 +0200 -Subject: [PATCH 021/269] of: allocate / free phandle cache outside of the +Subject: [PATCH 021/283] of: allocate / free phandle cache outside of the devtree_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The phandle cache code allocates memory while holding devtree_lock which is a raw_spinlock_t. Memory allocation (and free()) is not possible on diff --git a/debian/patches-rt/0022-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch b/debian/patches-rt/0022-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch index 9b24635a7..55168f205 100644 --- a/debian/patches-rt/0022-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch +++ b/debian/patches-rt/0022-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch @@ -1,8 +1,8 @@ -From a61c877f81f1f0b850090df19e08d51cf9465955 Mon Sep 17 00:00:00 2001 +From 3ec52d2ee13b6e83429a4f7a048a0005305b8033 Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Tue, 18 Sep 2018 10:29:31 -0500 -Subject: [PATCH 022/269] mm/kasan: make quarantine_lock a raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 022/283] mm/kasan: make quarantine_lock a raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The static lock quarantine_lock is used in quarantine.c to protect the quarantine queue datastructures. It is taken inside quarantine queue diff --git a/debian/patches-rt/0023-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch b/debian/patches-rt/0023-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch index ecad607ac..908660a08 100644 --- a/debian/patches-rt/0023-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch +++ b/debian/patches-rt/0023-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch @@ -1,9 +1,9 @@ -From b710c9561c0a7ddf1c7fef8d3bd3bc6d9e140a4e Mon Sep 17 00:00:00 2001 +From 22ddccee8b48a817b261c98dda99967345475755 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Mon, 29 Oct 2018 11:53:01 +0100 -Subject: [PATCH 023/269] EXP rcu: Revert expedited GP parallelization +Subject: [PATCH 023/283] EXP rcu: Revert expedited GP parallelization cleverness -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz (Commit 258ba8e089db23f760139266c232f01bad73f85c from linux-rcu) diff --git a/debian/patches-rt/0024-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch b/debian/patches-rt/0024-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch index b6b60369c..8719fbb70 100644 --- a/debian/patches-rt/0024-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch +++ b/debian/patches-rt/0024-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch @@ -1,11 +1,11 @@ -From b32df881582f39cab5e57b894f554f8573170cf7 Mon Sep 17 00:00:00 2001 +From ced9290a5d8460c8a46615a475cd094bc3b0c344 Mon Sep 17 00:00:00 2001 From: He Zhe Date: Wed, 19 Dec 2018 16:30:57 +0100 -Subject: [PATCH 024/269] kmemleak: Turn kmemleak_lock to raw spinlock on RT +Subject: [PATCH 024/283] kmemleak: Turn kmemleak_lock to raw spinlock on RT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz kmemleak_lock, as a rwlock on RT, can possibly be held in atomic context and causes the follow BUG. @@ -79,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c -index 17dd883198ae..b68a3d0d075f 100644 +index 72e3fb3bb037..0ed549045074 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -26,7 +26,7 @@ diff --git a/debian/patches-rt/0025-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches-rt/0025-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index c460c60e5..6fb235434 100644 --- a/debian/patches-rt/0025-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/debian/patches-rt/0025-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -1,8 +1,8 @@ -From 82889085f9639d9aed51313cf8fd8e8ca32b8e8b Mon Sep 17 00:00:00 2001 +From e1b321401ca437984b8973749826aea3a245e15b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 28 Oct 2016 23:05:11 +0200 -Subject: [PATCH 025/269] NFSv4: replace seqcount_t with a seqlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 025/283] NFSv4: replace seqcount_t with a seqlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The raw_write_seqcount_begin() in nfs4_reclaim_open_state() bugs me because it maps to preempt_disable() in -RT which I can't have at this @@ -58,10 +58,10 @@ index 63287d911c08..2ae55eaa4a1e 100644 }; diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c -index 580e37bc3fe2..9d010731f901 100644 +index 1de855e0ae61..78c3f4359e76 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c -@@ -2863,7 +2863,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, +@@ -2865,7 +2865,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, unsigned int seq; int ret; @@ -70,7 +70,7 @@ index 580e37bc3fe2..9d010731f901 100644 ret = _nfs4_proc_open(opendata, ctx); if (ret != 0) -@@ -2904,7 +2904,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, +@@ -2906,7 +2906,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, if (d_inode(dentry) == state->inode) { nfs_inode_attach_open_context(ctx); @@ -80,10 +80,10 @@ index 580e37bc3fe2..9d010731f901 100644 } diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c -index d2f645d34eb1..1698dd2ca20b 100644 +index 3ba2087469ac..f10952680bd9 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c -@@ -511,7 +511,7 @@ nfs4_alloc_state_owner(struct nfs_server *server, +@@ -515,7 +515,7 @@ nfs4_alloc_state_owner(struct nfs_server *server, nfs4_init_seqid_counter(&sp->so_seqid); atomic_set(&sp->so_count, 1); INIT_LIST_HEAD(&sp->so_lru); @@ -92,7 +92,7 @@ index d2f645d34eb1..1698dd2ca20b 100644 mutex_init(&sp->so_delegreturn_mutex); return sp; } -@@ -1564,8 +1564,12 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs +@@ -1568,8 +1568,12 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs * recovering after a network partition or a reboot from a * server that doesn't support a grace period. */ @@ -106,7 +106,7 @@ index d2f645d34eb1..1698dd2ca20b 100644 restart: list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) -@@ -1652,14 +1656,20 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs +@@ -1656,14 +1660,20 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs spin_lock(&sp->so_lock); goto restart; } diff --git a/debian/patches-rt/0026-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/debian/patches-rt/0026-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index b03cd883a..3d793eb82 100644 --- a/debian/patches-rt/0026-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/debian/patches-rt/0026-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -1,12 +1,12 @@ -From 3ace22e122817ae9b6da2d0c49209a834f96375c Mon Sep 17 00:00:00 2001 +From 02954bb06eedf19db3637fea6699d0dc1761b270 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 4 Apr 2017 12:50:16 +0200 -Subject: [PATCH 026/269] kernel: sched: Provide a pointer to the valid CPU +Subject: [PATCH 026/283] kernel: sched: Provide a pointer to the valid CPU mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In commit 4b53a3412d66 ("sched/core: Remove the tsk_nr_cpus_allowed() wrapper") the tsk_nr_cpus_allowed() wrapper was removed. There was not @@ -166,7 +166,7 @@ index c9ef3c532169..cb10249b1125 100644 /* Save the current cpu id for spu interrupt routing. */ ctx->last_ran = raw_smp_processor_id(); diff --git a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c -index f8c260d522ca..befeec6414b0 100644 +index 912d53939f4f..6b8dc68b5ccc 100644 --- a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c +++ b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c @@ -1435,7 +1435,7 @@ static int pseudo_lock_dev_mmap(struct file *filp, struct vm_area_struct *vma) @@ -255,7 +255,7 @@ index 98e1ce14fa2a..5d3828625017 100644 if (weight == 1 && !test_bit(cpu, qib_cpulist)) if (!find_hca(cpu, &unit) && unit >= 0) diff --git a/fs/proc/array.c b/fs/proc/array.c -index 0ceb3b6b37e7..ccfef702c771 100644 +index 9eb99a43f849..e4d0cfebaac5 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -381,9 +381,9 @@ static inline void task_context_switch_counts(struct seq_file *m, @@ -308,7 +308,7 @@ index 5aebe3be4d7c..0b49b9cf5571 100644 .mm = NULL, .active_mm = &init_mm, diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c -index 266f10cb7222..ef085d84a940 100644 +index ff956ccbb6df..7bb129c5b412 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -2090,7 +2090,7 @@ static void cpuset_fork(struct task_struct *task) @@ -321,7 +321,7 @@ index 266f10cb7222..ef085d84a940 100644 } diff --git a/kernel/fork.c b/kernel/fork.c -index 64ef113e387e..bfe9c5c3eb88 100644 +index 69874db3fba8..98c971cb1d36 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -845,6 +845,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) @@ -334,7 +334,7 @@ index 64ef113e387e..bfe9c5c3eb88 100644 /* * One for us, one for whoever does the "release_task()" (usually diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index d7f409866cdf..80badc70c258 100644 +index 6859ea1d5c04..d6f690064cce 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -878,7 +878,7 @@ static inline bool is_per_cpu_kthread(struct task_struct *p) @@ -542,10 +542,10 @@ index daaadf939ccb..f7d2c10b4c92 100644 /* * We have to ensure that we have at least one bit diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c -index 91e4202b0634..f927b1f45474 100644 +index 72c07059ef37..fb6e64417470 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -539,7 +539,7 @@ static struct rq *dl_task_offline_migration(struct rq *rq, struct task_struct *p +@@ -538,7 +538,7 @@ static struct rq *dl_task_offline_migration(struct rq *rq, struct task_struct *p * If we cannot preempt any rq, fall back to pick any * online CPU: */ @@ -554,7 +554,7 @@ index 91e4202b0634..f927b1f45474 100644 if (cpu >= nr_cpu_ids) { /* * Failed to find any suitable CPU. -@@ -1824,7 +1824,7 @@ static void set_curr_task_dl(struct rq *rq) +@@ -1823,7 +1823,7 @@ static void set_curr_task_dl(struct rq *rq) static int pick_dl_task(struct rq *rq, struct task_struct *p, int cpu) { if (!task_running(rq, p) && @@ -563,7 +563,7 @@ index 91e4202b0634..f927b1f45474 100644 return 1; return 0; } -@@ -1974,7 +1974,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq) +@@ -1973,7 +1973,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq) /* Retry if something changed. */ if (double_lock_balance(rq, later_rq)) { if (unlikely(task_rq(task) != rq || @@ -573,7 +573,7 @@ index 91e4202b0634..f927b1f45474 100644 !dl_task(task) || !task_on_rq_queued(task))) { diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 53acadf72cd9..c17d63b06026 100644 +index 289c966f907a..0048a32a3b4d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1630,7 +1630,7 @@ static void task_numa_compare(struct task_numa_env *env, @@ -594,7 +594,7 @@ index 53acadf72cd9..c17d63b06026 100644 continue; env->dst_cpu = cpu; -@@ -5737,7 +5737,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, +@@ -5741,7 +5741,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, /* Skip over this group if it has no CPUs allowed */ if (!cpumask_intersects(sched_group_span(group), @@ -603,7 +603,7 @@ index 53acadf72cd9..c17d63b06026 100644 continue; local_group = cpumask_test_cpu(this_cpu, -@@ -5869,7 +5869,7 @@ find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, int this +@@ -5873,7 +5873,7 @@ find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, int this return cpumask_first(sched_group_span(group)); /* Traverse only the allowed CPUs */ @@ -612,7 +612,7 @@ index 53acadf72cd9..c17d63b06026 100644 if (available_idle_cpu(i)) { struct rq *rq = cpu_rq(i); struct cpuidle_state *idle = idle_get_state(rq); -@@ -5909,7 +5909,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p +@@ -5913,7 +5913,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p { int new_cpu = cpu; @@ -621,7 +621,7 @@ index 53acadf72cd9..c17d63b06026 100644 return prev_cpu; /* -@@ -6026,7 +6026,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int +@@ -6030,7 +6030,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int if (!test_idle_cores(target, false)) return -1; @@ -630,7 +630,7 @@ index 53acadf72cd9..c17d63b06026 100644 for_each_cpu_wrap(core, cpus, target) { bool idle = true; -@@ -6060,7 +6060,7 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t +@@ -6064,7 +6064,7 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t return -1; for_each_cpu(cpu, cpu_smt_mask(target)) { @@ -639,7 +639,7 @@ index 53acadf72cd9..c17d63b06026 100644 continue; if (available_idle_cpu(cpu)) return cpu; -@@ -6123,7 +6123,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t +@@ -6127,7 +6127,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t for_each_cpu_wrap(cpu, sched_domain_span(sd), target) { if (!--nr) return -1; @@ -648,7 +648,7 @@ index 53acadf72cd9..c17d63b06026 100644 continue; if (available_idle_cpu(cpu)) break; -@@ -6160,7 +6160,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) +@@ -6164,7 +6164,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) recent_used_cpu != target && cpus_share_cache(recent_used_cpu, target) && available_idle_cpu(recent_used_cpu) && @@ -657,7 +657,7 @@ index 53acadf72cd9..c17d63b06026 100644 /* * Replace recent_used_cpu with prev as it is a potential * candidate for the next wake: -@@ -6378,7 +6378,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f +@@ -6382,7 +6382,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f if (sd_flag & SD_BALANCE_WAKE) { record_wakee(p); want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu) @@ -666,7 +666,7 @@ index 53acadf72cd9..c17d63b06026 100644 } rcu_read_lock(); -@@ -7117,14 +7117,14 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) +@@ -7121,14 +7121,14 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) /* * We do not migrate tasks that are: * 1) throttled_lb_pair, or @@ -683,7 +683,7 @@ index 53acadf72cd9..c17d63b06026 100644 int cpu; schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -7144,7 +7144,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) +@@ -7148,7 +7148,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) /* Prevent to re-select dst_cpu via env's CPUs: */ for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) { @@ -692,7 +692,7 @@ index 53acadf72cd9..c17d63b06026 100644 env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; break; -@@ -7741,7 +7741,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) +@@ -7745,7 +7745,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -701,7 +701,7 @@ index 53acadf72cd9..c17d63b06026 100644 * * Imagine a situation of two groups of 4 CPUs each and 4 tasks each with a * cpumask covering 1 CPU of the first group and 3 CPUs of the second group. -@@ -8356,7 +8356,7 @@ static struct sched_group *find_busiest_group(struct lb_env *env) +@@ -8360,7 +8360,7 @@ static struct sched_group *find_busiest_group(struct lb_env *env) /* * If the busiest group is imbalanced the below checks don't * work because they assume all things are equal, which typically @@ -710,7 +710,7 @@ index 53acadf72cd9..c17d63b06026 100644 */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -8752,7 +8752,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, +@@ -8756,7 +8756,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, * if the curr task on busiest CPU can't be * moved to this_cpu: */ @@ -720,7 +720,7 @@ index 53acadf72cd9..c17d63b06026 100644 flags); env.flags |= LBF_ALL_PINNED; diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c -index 2e2955a8cf8f..4857ca145119 100644 +index b980cc96604f..b6ca4a630050 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1611,7 +1611,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p) diff --git a/debian/patches-rt/0027-kernel-sched-core-add-migrate_disable.patch b/debian/patches-rt/0027-kernel-sched-core-add-migrate_disable.patch index c897de2bb..1f6634ce1 100644 --- a/debian/patches-rt/0027-kernel-sched-core-add-migrate_disable.patch +++ b/debian/patches-rt/0027-kernel-sched-core-add-migrate_disable.patch @@ -1,8 +1,8 @@ -From 2fc8b5c9ca4ff2df7913d6e6d75a98bdece9b264 Mon Sep 17 00:00:00 2001 +From bda814671dc9f9f74cabd99a65cad3101b68ee83 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: [PATCH 027/269] kernel/sched/core: add migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 027/283] kernel/sched/core: add migrate_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz --- include/linux/preempt.h | 23 +++++++ @@ -86,7 +86,7 @@ index 9fb239e12b82..5801e516ba63 100644 * Callback to arch code if there's nosmp or maxcpus=0 on the * boot command line: diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 80badc70c258..3df110e8c6f9 100644 +index d6f690064cce..b658f0147c3b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1008,7 +1008,15 @@ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_ma @@ -145,7 +145,7 @@ index 80badc70c258..3df110e8c6f9 100644 dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask); if (task_running(rq, p) || p->state == TASK_WAKING) { struct migration_arg arg = { p, dest_cpu }; -@@ -7060,3 +7089,100 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7067,3 +7096,100 @@ const u32 sched_prio_to_wmult[40] = { }; #undef CREATE_TRACE_POINTS @@ -247,7 +247,7 @@ index 80badc70c258..3df110e8c6f9 100644 +EXPORT_SYMBOL(migrate_enable); +#endif diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c -index 141ea9ff210e..34c27afae009 100644 +index 78fadf0438ea..5027158d3908 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -982,6 +982,10 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, diff --git a/debian/patches-rt/0028-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch b/debian/patches-rt/0028-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch index 335487de7..c22787b20 100644 --- a/debian/patches-rt/0028-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch +++ b/debian/patches-rt/0028-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch @@ -1,9 +1,9 @@ -From 0af010b771c642c17c33fbc991e183c04427af59 Mon Sep 17 00:00:00 2001 +From 6fb56185df42e49e0e2d8fe12d315356a57f4bce Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 9 Oct 2018 17:34:50 +0200 -Subject: [PATCH 028/269] sched/migrate_disable: Add export_symbol_gpl for +Subject: [PATCH 028/283] sched/migrate_disable: Add export_symbol_gpl for __migrate_disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Jonathan reported that lttng/modules can't use __migrate_disabled(). This function is only used by sched/core itself and the tracing @@ -22,7 +22,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 3df110e8c6f9..9c4a9f0a627b 100644 +index b658f0147c3b..7a39d56f6a6b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1013,6 +1013,7 @@ int __migrate_disabled(struct task_struct *p) diff --git a/debian/patches-rt/0029-arm-at91-do-not-disable-enable-clocks-in-a-row.patch b/debian/patches-rt/0029-arm-at91-do-not-disable-enable-clocks-in-a-row.patch index 124107dfb..207df7e47 100644 --- a/debian/patches-rt/0029-arm-at91-do-not-disable-enable-clocks-in-a-row.patch +++ b/debian/patches-rt/0029-arm-at91-do-not-disable-enable-clocks-in-a-row.patch @@ -1,8 +1,8 @@ -From 245bd7bd92ce193e01ef35fbdaae505d5eefd28b Mon Sep 17 00:00:00 2001 +From 35e0294d43f7c53bdb7ecba19df0710037d888ec Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 9 Mar 2016 10:51:06 +0100 -Subject: [PATCH 029/269] arm: at91: do not disable/enable clocks in a row -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 029/283] arm: at91: do not disable/enable clocks in a row +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Currently the driver will disable the clock and enable it one line later if it is switching from periodic mode into one shot. diff --git a/debian/patches-rt/0030-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch b/debian/patches-rt/0030-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch index b72ec6ae7..da41f6fa5 100644 --- a/debian/patches-rt/0030-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch +++ b/debian/patches-rt/0030-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch @@ -1,12 +1,12 @@ -From 7b123775c97399cd5ca5394392bf72c5d73f2808 Mon Sep 17 00:00:00 2001 +From 4d4322de76f7b52df1529acfc6e5fc46e25761f1 Mon Sep 17 00:00:00 2001 From: Benedikt Spranger Date: Mon, 8 Mar 2010 18:57:04 +0100 -Subject: [PATCH 030/269] clocksource: TCLIB: Allow higher clock rates for +Subject: [PATCH 030/283] clocksource: TCLIB: Allow higher clock rates for clock events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz As default the TCLIB uses the 32KiHz base clock rate for clock events. Add a compile time selection to allow higher clock resulution. diff --git a/debian/patches-rt/0031-timekeeping-Split-jiffies-seqlock.patch b/debian/patches-rt/0031-timekeeping-Split-jiffies-seqlock.patch index a29977fbb..639c5b019 100644 --- a/debian/patches-rt/0031-timekeeping-Split-jiffies-seqlock.patch +++ b/debian/patches-rt/0031-timekeeping-Split-jiffies-seqlock.patch @@ -1,8 +1,8 @@ -From 5a0bfb35b3b826135a39a8e8744e9926b5be7607 Mon Sep 17 00:00:00 2001 +From 64f770d93319861d308ce265a4389e4ca0a6ed5f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 14 Feb 2013 22:36:59 +0100 -Subject: [PATCH 031/269] timekeeping: Split jiffies seqlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 031/283] timekeeping: Split jiffies seqlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Replace jiffies_lock seqlock with a simple seqcounter and a rawlock so it can be taken in atomic context on RT. @@ -136,10 +136,10 @@ index 5b33e2f5c0ed..54fd344ef973 100644 ts->timer_expires_base = basemono; diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c -index 7846ce24ecc0..68cf97548cba 100644 +index 443edcddac8a..0517bc42c6b6 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c -@@ -2417,8 +2417,10 @@ EXPORT_SYMBOL(hardpps); +@@ -2418,8 +2418,10 @@ EXPORT_SYMBOL(hardpps); */ void xtime_update(unsigned long ticks) { diff --git a/debian/patches-rt/0032-signal-Revert-ptrace-preempt-magic.patch b/debian/patches-rt/0032-signal-Revert-ptrace-preempt-magic.patch index 7d3cc9c19..3bd2227dc 100644 --- a/debian/patches-rt/0032-signal-Revert-ptrace-preempt-magic.patch +++ b/debian/patches-rt/0032-signal-Revert-ptrace-preempt-magic.patch @@ -1,8 +1,8 @@ -From a9a18a8c88bd90bdac5f33690be17244dc22bd22 Mon Sep 17 00:00:00 2001 +From 8cf90f7e58f51438a7ec0e4e704918afaa450ff1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 21 Sep 2011 19:57:12 +0200 -Subject: [PATCH 032/269] signal: Revert ptrace preempt magic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 032/283] signal: Revert ptrace preempt magic +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 8 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c -index 9102d60fc5c6..f29def2be652 100644 +index 0e6bc3049427..d5a9646b3538 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2094,15 +2094,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info) diff --git a/debian/patches-rt/0033-net-sched-Use-msleep-instead-of-yield.patch b/debian/patches-rt/0033-net-sched-Use-msleep-instead-of-yield.patch index 8bb86a62a..331af4531 100644 --- a/debian/patches-rt/0033-net-sched-Use-msleep-instead-of-yield.patch +++ b/debian/patches-rt/0033-net-sched-Use-msleep-instead-of-yield.patch @@ -1,8 +1,8 @@ -From b1e277ed2b65bf647c2a6dc2d103ffe5aa2e4fa7 Mon Sep 17 00:00:00 2001 +From 882c4f88db8d6179773dc733e794fa504aef75e3 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Wed, 5 Mar 2014 00:49:47 +0100 -Subject: [PATCH 033/269] net: sched: Use msleep() instead of yield() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 033/283] net: sched: Use msleep() instead of yield() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On PREEMPT_RT enabled systems the interrupt handler run as threads at prio 50 (by default). If a high priority userspace process tries to shut down a busy diff --git a/debian/patches-rt/0034-dm-rq-remove-BUG_ON-irqs_disabled-check.patch b/debian/patches-rt/0034-dm-rq-remove-BUG_ON-irqs_disabled-check.patch index 5f07592be..baef728eb 100644 --- a/debian/patches-rt/0034-dm-rq-remove-BUG_ON-irqs_disabled-check.patch +++ b/debian/patches-rt/0034-dm-rq-remove-BUG_ON-irqs_disabled-check.patch @@ -1,8 +1,8 @@ -From 812137beb49a5dea2e269ea9739d0ed291e27375 Mon Sep 17 00:00:00 2001 +From ea6d238547b58b5fe9ce953cd818ef8bf6cb8915 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 27 Mar 2018 16:24:15 +0200 -Subject: [PATCH 034/269] dm rq: remove BUG_ON(!irqs_disabled) check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 034/283] dm rq: remove BUG_ON(!irqs_disabled) check +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In commit 052189a2ec95 ("dm: remove superfluous irq disablement in dm_request_fn") the spin_lock_irq() was replaced with spin_lock() + a diff --git a/debian/patches-rt/0035-usb-do-no-disable-interrupts-in-giveback.patch b/debian/patches-rt/0035-usb-do-no-disable-interrupts-in-giveback.patch index a4d68f75a..132ff1c3f 100644 --- a/debian/patches-rt/0035-usb-do-no-disable-interrupts-in-giveback.patch +++ b/debian/patches-rt/0035-usb-do-no-disable-interrupts-in-giveback.patch @@ -1,8 +1,8 @@ -From e958966734633c26363abc8920eca9c38e5cd7ce Mon Sep 17 00:00:00 2001 +From b91ae27f3efa2e15087397591db35dd1d11f5120 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 8 Nov 2013 17:34:54 +0100 -Subject: [PATCH 035/269] usb: do no disable interrupts in giveback -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 035/283] usb: do no disable interrupts in giveback +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Since commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet context") the USB code disables interrupts before invoking the complete @@ -20,7 +20,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 3 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c -index 1c21955fe7c0..7863dec34f0b 100644 +index b82a7d787add..2f3015356124 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1738,7 +1738,6 @@ static void __usb_hcd_giveback_urb(struct urb *urb) diff --git a/debian/patches-rt/0036-rt-Provide-PREEMPT_RT_BASE-config-switch.patch b/debian/patches-rt/0036-rt-Provide-PREEMPT_RT_BASE-config-switch.patch index f710028f4..83ae9c0ba 100644 --- a/debian/patches-rt/0036-rt-Provide-PREEMPT_RT_BASE-config-switch.patch +++ b/debian/patches-rt/0036-rt-Provide-PREEMPT_RT_BASE-config-switch.patch @@ -1,8 +1,8 @@ -From 588e8fb01ec7915ef280606b80bd605f49c56915 Mon Sep 17 00:00:00 2001 +From 79f8ad95ffc5f1cd2ac721ab3d01291d4ad055df Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 17 Jun 2011 12:39:57 +0200 -Subject: [PATCH 036/269] rt: Provide PREEMPT_RT_BASE config switch -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 036/283] rt: Provide PREEMPT_RT_BASE config switch +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Introduce PREEMPT_RT_BASE which enables parts of PREEMPT_RT_FULL. Forces interrupt threading and enables some of the RT diff --git a/debian/patches-rt/0037-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch b/debian/patches-rt/0037-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch index 686312488..8c991d239 100644 --- a/debian/patches-rt/0037-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch +++ b/debian/patches-rt/0037-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch @@ -1,8 +1,8 @@ -From 9480b8b41cb649337466e43807eff3816a9530bc Mon Sep 17 00:00:00 2001 +From 75df679c581581978487f6f6de91bf86a9f72e7c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 14 Dec 2011 01:03:49 +0100 -Subject: [PATCH 037/269] cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 037/283] cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz There are "valid" GFP_ATOMIC allocations such as diff --git a/debian/patches-rt/0038-jump-label-disable-if-stop_machine-is-used.patch b/debian/patches-rt/0038-jump-label-disable-if-stop_machine-is-used.patch index deef2add3..b5a3fd2bf 100644 --- a/debian/patches-rt/0038-jump-label-disable-if-stop_machine-is-used.patch +++ b/debian/patches-rt/0038-jump-label-disable-if-stop_machine-is-used.patch @@ -1,8 +1,8 @@ -From d23a435dc809c84e3185683681ef735f2097fe57 Mon Sep 17 00:00:00 2001 +From b5d77d6b4b4bcead77cd720e8a93f4ae78420034 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 8 Jul 2015 17:14:48 +0200 -Subject: [PATCH 038/269] jump-label: disable if stop_machine() is used -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 038/283] jump-label: disable if stop_machine() is used +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. @@ -25,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index cd4c74daf71e..27a5f0b9ddc7 100644 +index 51794c7fa6d5..7d11242a37d2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -51,7 +51,7 @@ config ARM diff --git a/debian/patches-rt/0039-kconfig-Disable-config-options-which-are-not-RT-comp.patch b/debian/patches-rt/0039-kconfig-Disable-config-options-which-are-not-RT-comp.patch index 82f46df4f..8822287db 100644 --- a/debian/patches-rt/0039-kconfig-Disable-config-options-which-are-not-RT-comp.patch +++ b/debian/patches-rt/0039-kconfig-Disable-config-options-which-are-not-RT-comp.patch @@ -1,9 +1,9 @@ -From 6c83d4802fcd91010b16a5a69456c7370cd10f9f Mon Sep 17 00:00:00 2001 +From 94fd428643474b867a8cac432d7d911a5250c367 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 24 Jul 2011 12:11:43 +0200 -Subject: [PATCH 039/269] kconfig: Disable config options which are not RT +Subject: [PATCH 039/283] kconfig: Disable config options which are not RT compatible -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Disable stuff which is known to have issues on RT @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig -index 6801123932a5..42b9062b9dbf 100644 +index a336548487e6..3f537b264852 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -28,6 +28,7 @@ config OPROFILE @@ -26,7 +26,7 @@ index 6801123932a5..42b9062b9dbf 100644 select RING_BUFFER_ALLOW_SWAP help diff --git a/mm/Kconfig b/mm/Kconfig -index de64ea658716..438460486a5b 100644 +index b457e94ae618..0dddbb2a3282 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -377,7 +377,7 @@ config NOMMU_INITIAL_TRIM_EXCESS diff --git a/debian/patches-rt/0040-lockdep-disable-self-test.patch b/debian/patches-rt/0040-lockdep-disable-self-test.patch index b1fedcb99..1b065a53b 100644 --- a/debian/patches-rt/0040-lockdep-disable-self-test.patch +++ b/debian/patches-rt/0040-lockdep-disable-self-test.patch @@ -1,11 +1,11 @@ -From 968d103b4727308889b77f3fa556e149bba6d56c Mon Sep 17 00:00:00 2001 +From 1a9e9b418236c18717a91955eeafe5bd72a00598 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 17 Oct 2017 16:36:18 +0200 -Subject: [PATCH 040/269] lockdep: disable self-test +Subject: [PATCH 040/283] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The self-test wasn't always 100% accurate for RT. We disabled a few tests which failed because they had a different semantic for RT. Some @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug -index 4966c4fbe7f7..92e7d88946f7 100644 +index 3dea52f7be9c..1504e6aa8418 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1207,7 +1207,7 @@ config DEBUG_ATOMIC_SLEEP diff --git a/debian/patches-rt/0041-mm-Allow-only-slub-on-RT.patch b/debian/patches-rt/0041-mm-Allow-only-slub-on-RT.patch index 2123347d7..cd5af84c0 100644 --- a/debian/patches-rt/0041-mm-Allow-only-slub-on-RT.patch +++ b/debian/patches-rt/0041-mm-Allow-only-slub-on-RT.patch @@ -1,8 +1,8 @@ -From 16680836f36c75ccaff96ab3155869144b0dd028 Mon Sep 17 00:00:00 2001 +From 75102ff5e253e5ababc30c7512e0c07f2b7dc297 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:44:03 -0500 -Subject: [PATCH 041/269] mm: Allow only slub on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 041/283] mm: Allow only slub on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. @@ -13,10 +13,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 2 insertions(+) diff --git a/init/Kconfig b/init/Kconfig -index 864af10bb1b9..f3f073942c30 100644 +index 47035b5a46f6..ae9a0113a699 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1634,6 +1634,7 @@ choice +@@ -1637,6 +1637,7 @@ choice config SLAB bool "SLAB" @@ -24,7 +24,7 @@ index 864af10bb1b9..f3f073942c30 100644 select HAVE_HARDENED_USERCOPY_ALLOCATOR help The regular slab allocator that is established and known to work -@@ -1654,6 +1655,7 @@ config SLUB +@@ -1657,6 +1658,7 @@ config SLUB config SLOB depends on EXPERT bool "SLOB (Simple Allocator)" diff --git a/debian/patches-rt/0042-locking-Disable-spin-on-owner-for-RT.patch b/debian/patches-rt/0042-locking-Disable-spin-on-owner-for-RT.patch index 2a335f0f2..c43feeebd 100644 --- a/debian/patches-rt/0042-locking-Disable-spin-on-owner-for-RT.patch +++ b/debian/patches-rt/0042-locking-Disable-spin-on-owner-for-RT.patch @@ -1,11 +1,11 @@ -From a506cf490ae3e346c6082877f109fcf34568f22d Mon Sep 17 00:00:00 2001 +From 32697a0be9afdc5c631cc3d232a298b5880ed65c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:51:45 +0200 -Subject: [PATCH 042/269] locking: Disable spin on owner for RT +Subject: [PATCH 042/283] locking: Disable spin on owner for RT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Drop spin on owner for mutex / rwsem. We are most likely not using it but… diff --git a/debian/patches-rt/0043-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch b/debian/patches-rt/0043-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch index 5e8e88d36..99eda5975 100644 --- a/debian/patches-rt/0043-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch +++ b/debian/patches-rt/0043-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch @@ -1,8 +1,8 @@ -From 30987f403875e211eee90cac11127e04b1a27c73 Mon Sep 17 00:00:00 2001 +From 708879e986c1b552ee69d6444b808a196bba0f5f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 28 Oct 2012 13:26:09 +0000 -Subject: [PATCH 043/269] rcu: Disable RCU_FAST_NO_HZ on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 043/283] rcu: Disable RCU_FAST_NO_HZ on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz This uses a timer_list timer from the irq disabled guts of the idle code. Disable it for now to prevent wreckage. diff --git a/debian/patches-rt/0044-rcu-make-RCU_BOOST-default-on-RT.patch b/debian/patches-rt/0044-rcu-make-RCU_BOOST-default-on-RT.patch index 37170b6fc..e87db8676 100644 --- a/debian/patches-rt/0044-rcu-make-RCU_BOOST-default-on-RT.patch +++ b/debian/patches-rt/0044-rcu-make-RCU_BOOST-default-on-RT.patch @@ -1,8 +1,8 @@ -From 709173f4678f7f2f0b834e508d8044821d1c2354 Mon Sep 17 00:00:00 2001 +From a14822b6d5fcc441064faf3edc2f91b5d461e703 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 21 Mar 2014 20:19:05 +0100 -Subject: [PATCH 044/269] rcu: make RCU_BOOST default on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 044/283] rcu: make RCU_BOOST default on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Since it is no longer invoked from the softirq people run into OOM more often if the priority of the RCU thread is too low. Making boosting diff --git a/debian/patches-rt/0045-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch b/debian/patches-rt/0045-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch index 5c171fc26..eaad52703 100644 --- a/debian/patches-rt/0045-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch +++ b/debian/patches-rt/0045-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch @@ -1,8 +1,8 @@ -From 56d2f884391ba7e98721f6639f87698e46429c7f Mon Sep 17 00:00:00 2001 +From 36c33c65b461082612dffa7be01862b7bd55270e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:03:52 +0200 -Subject: [PATCH 045/269] sched: Disable CONFIG_RT_GROUP_SCHED on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 045/283] sched: Disable CONFIG_RT_GROUP_SCHED on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Carsten reported problems when running: @@ -19,10 +19,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 1 insertion(+) diff --git a/init/Kconfig b/init/Kconfig -index f3f073942c30..707ca4d49944 100644 +index ae9a0113a699..61e8b531649b 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -781,6 +781,7 @@ config CFS_BANDWIDTH +@@ -784,6 +784,7 @@ config CFS_BANDWIDTH config RT_GROUP_SCHED bool "Group scheduling for SCHED_RR/FIFO" depends on CGROUP_SCHED diff --git a/debian/patches-rt/0046-net-core-disable-NET_RX_BUSY_POLL.patch b/debian/patches-rt/0046-net-core-disable-NET_RX_BUSY_POLL.patch index 71297ebcd..8f7d350fb 100644 --- a/debian/patches-rt/0046-net-core-disable-NET_RX_BUSY_POLL.patch +++ b/debian/patches-rt/0046-net-core-disable-NET_RX_BUSY_POLL.patch @@ -1,11 +1,11 @@ -From a5a9737c0c6edf17eecb16a923a936432f11019e Mon Sep 17 00:00:00 2001 +From f2b7e396c43d3607ee0a0090c7470da50f833e93 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: [PATCH 046/269] net/core: disable NET_RX_BUSY_POLL +Subject: [PATCH 046/283] net/core: disable NET_RX_BUSY_POLL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz sk_busy_loop() does preempt_disable() followed by a few operations which can take sleeping locks and may get long. diff --git a/debian/patches-rt/0047-arm-disable-NEON-in-kernel-mode.patch b/debian/patches-rt/0047-arm-disable-NEON-in-kernel-mode.patch index eee3ee4c0..208ca8945 100644 --- a/debian/patches-rt/0047-arm-disable-NEON-in-kernel-mode.patch +++ b/debian/patches-rt/0047-arm-disable-NEON-in-kernel-mode.patch @@ -1,8 +1,8 @@ -From 0db6c523b2591dbf527c759ef1b3718f96bc3c29 Mon Sep 17 00:00:00 2001 +From 477660c22f2036e69299438b1292307ee1dba46b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 1 Dec 2017 10:42:03 +0100 -Subject: [PATCH 047/269] arm*: disable NEON in kernel mode -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 047/283] arm*: disable NEON in kernel mode +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz NEON in kernel mode is used by the crypto algorithms and raid6 code. While the raid6 code looks okay, the crypto algorithms do not: NEON @@ -21,10 +21,10 @@ Signed-off-by: Sebastian Andrzej Siewior 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 27a5f0b9ddc7..91f4f80a6f24 100644 +index 7d11242a37d2..e122dd212ab3 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -2161,7 +2161,7 @@ config NEON +@@ -2162,7 +2162,7 @@ config NEON config KERNEL_MODE_NEON bool "Support for NEON in kernel mode" diff --git a/debian/patches-rt/0048-powerpc-Use-generic-rwsem-on-RT.patch b/debian/patches-rt/0048-powerpc-Use-generic-rwsem-on-RT.patch index 4b1181067..50d900ee3 100644 --- a/debian/patches-rt/0048-powerpc-Use-generic-rwsem-on-RT.patch +++ b/debian/patches-rt/0048-powerpc-Use-generic-rwsem-on-RT.patch @@ -1,8 +1,8 @@ -From 24bc2177006a16588c79a438ba84122ec215135a Mon Sep 17 00:00:00 2001 +From 297ef639cbc4bc3aac2e5a8835090136753796fc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 048/269] powerpc: Use generic rwsem on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 048/283] powerpc: Use generic rwsem on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Use generic code which uses rtmutex diff --git a/debian/patches-rt/0049-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches-rt/0049-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index 01542ef5b..470c2ac02 100644 --- a/debian/patches-rt/0049-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/debian/patches-rt/0049-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,9 +1,9 @@ -From 86dd7e931e1f812e0fc9b44545ed1f9ffc80dcae Mon Sep 17 00:00:00 2001 +From 3bead4e3fc7560659c1982ace99de374aa9df79c Mon Sep 17 00:00:00 2001 From: Bogdan Purcareata Date: Fri, 24 Apr 2015 15:53:13 +0000 -Subject: [PATCH 049/269] powerpc/kvm: Disable in-kernel MPIC emulation for +Subject: [PATCH 049/283] powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT_FULL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz While converting the openpic emulation code to use a raw_spinlock_t enables guests to run on RT, there's still a performance issue. For interrupts sent in diff --git a/debian/patches-rt/0050-powerpc-Disable-highmem-on-RT.patch b/debian/patches-rt/0050-powerpc-Disable-highmem-on-RT.patch index 911ac0994..14bb749cc 100644 --- a/debian/patches-rt/0050-powerpc-Disable-highmem-on-RT.patch +++ b/debian/patches-rt/0050-powerpc-Disable-highmem-on-RT.patch @@ -1,8 +1,8 @@ -From f5b4401c967f9ead16662b347d2082f8f2743205 Mon Sep 17 00:00:00 2001 +From ae9000e3c66794249fbca61b8a71bcdf690910e0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:08:34 +0200 -Subject: [PATCH 050/269] powerpc: Disable highmem on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 050/283] powerpc: Disable highmem on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches-rt/0051-mips-Disable-highmem-on-RT.patch b/debian/patches-rt/0051-mips-Disable-highmem-on-RT.patch index cd8dd902e..7887c11ef 100644 --- a/debian/patches-rt/0051-mips-Disable-highmem-on-RT.patch +++ b/debian/patches-rt/0051-mips-Disable-highmem-on-RT.patch @@ -1,8 +1,8 @@ -From 29b46bfd781d871ae857c940e6ef76454bf356c2 Mon Sep 17 00:00:00 2001 +From 454e636edd0bb26495afb3850a37aa5e5214a4ed Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:10:12 +0200 -Subject: [PATCH 051/269] mips: Disable highmem on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 051/283] mips: Disable highmem on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches-rt/0052-x86-Use-generic-rwsem_spinlocks-on-rt.patch b/debian/patches-rt/0052-x86-Use-generic-rwsem_spinlocks-on-rt.patch index 46f7543bb..e4e486d99 100644 --- a/debian/patches-rt/0052-x86-Use-generic-rwsem_spinlocks-on-rt.patch +++ b/debian/patches-rt/0052-x86-Use-generic-rwsem_spinlocks-on-rt.patch @@ -1,8 +1,8 @@ -From 789344b11534d2799fbc807496846f21869124b5 Mon Sep 17 00:00:00 2001 +From 5c86aec91ae10f140d18bd33cd62783cdde0922d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 26 Jul 2009 02:21:32 +0200 -Subject: [PATCH 052/269] x86: Use generic rwsem_spinlocks on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 052/283] x86: Use generic rwsem_spinlocks on -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt. diff --git a/debian/patches-rt/0053-leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches-rt/0053-leds-trigger-disable-CPU-trigger-on-RT.patch index e7d041a4f..778693165 100644 --- a/debian/patches-rt/0053-leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/debian/patches-rt/0053-leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,8 +1,8 @@ -From 7554227ac04319dadc334245535dd1d21d258de0 Mon Sep 17 00:00:00 2001 +From 9cd1a715d85ace3e9b1d3ae703eb16744dd3ebb6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 23 Jan 2014 14:45:59 +0100 -Subject: [PATCH 053/269] leds: trigger: disable CPU trigger on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 053/283] leds: trigger: disable CPU trigger on -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 diff --git a/debian/patches-rt/0054-cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/debian/patches-rt/0054-cpufreq-drop-K8-s-driver-from-beeing-selected.patch index 2fca9d00c..f05d9e16b 100644 --- a/debian/patches-rt/0054-cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/debian/patches-rt/0054-cpufreq-drop-K8-s-driver-from-beeing-selected.patch @@ -1,8 +1,8 @@ -From 57c3607ed990ada1d1636542d00bd3ed95e243da Mon Sep 17 00:00:00 2001 +From f19ffb87fe48ba1e8904df670b13d52f8b9c08f1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 9 Apr 2015 15:23:01 +0200 -Subject: [PATCH 054/269] cpufreq: drop K8's driver from beeing selected -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 054/283] cpufreq: drop K8's driver from beeing selected +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Ralf posted a picture of a backtrace from diff --git a/debian/patches-rt/0055-md-disable-bcache.patch b/debian/patches-rt/0055-md-disable-bcache.patch index 7081e7a7c..0a4f4f588 100644 --- a/debian/patches-rt/0055-md-disable-bcache.patch +++ b/debian/patches-rt/0055-md-disable-bcache.patch @@ -1,11 +1,11 @@ -From 53eb768ccfb675d61d67bd236402aa90434a6923 Mon Sep 17 00:00:00 2001 +From 3b1c3bc41b87cd7a714ebfa5e88651d4f3326f2e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 11:48:57 +0200 -Subject: [PATCH 055/269] md: disable bcache +Subject: [PATCH 055/283] md: disable bcache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz It uses anon semaphores |drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’: diff --git a/debian/patches-rt/0056-efi-Disable-runtime-services-on-RT.patch b/debian/patches-rt/0056-efi-Disable-runtime-services-on-RT.patch index 023ab75af..1e0d1f1d5 100644 --- a/debian/patches-rt/0056-efi-Disable-runtime-services-on-RT.patch +++ b/debian/patches-rt/0056-efi-Disable-runtime-services-on-RT.patch @@ -1,8 +1,8 @@ -From 62309a1da779bde384a7645a7d3e2713520a76da Mon Sep 17 00:00:00 2001 +From f0e7a6e0f76d2ab27a0c5ef0f7872d971ec1dd23 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:03:16 +0200 -Subject: [PATCH 056/269] efi: Disable runtime services on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 056/283] efi: Disable runtime services on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Based on meassurements the EFI functions get_variable / get_next_variable take up to 2us which looks okay. diff --git a/debian/patches-rt/0057-printk-Add-a-printk-kill-switch.patch b/debian/patches-rt/0057-printk-Add-a-printk-kill-switch.patch index cfb575490..8d1630bbf 100644 --- a/debian/patches-rt/0057-printk-Add-a-printk-kill-switch.patch +++ b/debian/patches-rt/0057-printk-Add-a-printk-kill-switch.patch @@ -1,8 +1,8 @@ -From 09acfc4d67168f054485eb40955069fa2390a5ec Mon Sep 17 00:00:00 2001 +From d1e9e20fe16f16a1665eabaa44a0f1c2a4cebfec Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 22 Jul 2011 17:58:40 +0200 -Subject: [PATCH 057/269] printk: Add a printk kill switch -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 057/283] printk: Add a printk kill switch +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Add a prinkt-kill-switch. This is used from (NMI) watchdog to ensure that it does not dead-lock with the early printk code. diff --git a/debian/patches-rt/0058-printk-Add-force_early_printk-boot-param-to-help-wit.patch b/debian/patches-rt/0058-printk-Add-force_early_printk-boot-param-to-help-wit.patch index 17d1cfa1c..0b0acd787 100644 --- a/debian/patches-rt/0058-printk-Add-force_early_printk-boot-param-to-help-wit.patch +++ b/debian/patches-rt/0058-printk-Add-force_early_printk-boot-param-to-help-wit.patch @@ -1,9 +1,9 @@ -From 3dd75cbf0c1ddd8dc0a7c0492e86f7293a730145 Mon Sep 17 00:00:00 2001 +From 3d881bc012788bea38e0bf55b03d9996eb40b1b9 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Fri, 2 Sep 2011 14:41:29 +0200 -Subject: [PATCH 058/269] printk: Add "force_early_printk" boot param to help +Subject: [PATCH 058/283] printk: Add "force_early_printk" boot param to help with debugging -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Gives me an option to screw printk and actually see what the machine says. diff --git a/debian/patches-rt/0059-preempt-Provide-preempt_-_-no-rt-variants.patch b/debian/patches-rt/0059-preempt-Provide-preempt_-_-no-rt-variants.patch index 8704e90cc..03806b6e9 100644 --- a/debian/patches-rt/0059-preempt-Provide-preempt_-_-no-rt-variants.patch +++ b/debian/patches-rt/0059-preempt-Provide-preempt_-_-no-rt-variants.patch @@ -1,8 +1,8 @@ -From 31772df387205be3a95e3d0bc21b7b81a244f6df Mon Sep 17 00:00:00 2001 +From 6a3ec551d9ea7e49f20d8f9d3d45fb8d9ca1b720 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 24 Jul 2009 12:38:56 +0200 -Subject: [PATCH 059/269] preempt: Provide preempt_*_(no)rt variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 059/283] preempt: Provide preempt_*_(no)rt variants +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz RT needs a few preempt_disable/enable points which are not necessary otherwise. Implement variants to avoid #ifdeffery. diff --git a/debian/patches-rt/0060-futex-workaround-migrate_disable-enable-in-different.patch b/debian/patches-rt/0060-futex-workaround-migrate_disable-enable-in-different.patch index 5dba51267..f8c4482e1 100644 --- a/debian/patches-rt/0060-futex-workaround-migrate_disable-enable-in-different.patch +++ b/debian/patches-rt/0060-futex-workaround-migrate_disable-enable-in-different.patch @@ -1,9 +1,9 @@ -From c78bd62f56b86aa7717ac7a79e288fa8b3978573 Mon Sep 17 00:00:00 2001 +From 02487d0393920e03426a2378e40bc7547193c3aa Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 8 Mar 2017 14:23:35 +0100 -Subject: [PATCH 060/269] futex: workaround migrate_disable/enable in different +Subject: [PATCH 060/283] futex: workaround migrate_disable/enable in different context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz migrate_disable()/migrate_enable() takes a different path in atomic() vs !atomic() context. These little hacks ensure that we don't underflow / overflow @@ -17,10 +17,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 19 insertions(+) diff --git a/kernel/futex.c b/kernel/futex.c -index 5a26d843a015..1bd0950bea4e 100644 +index afdc5eadce6e..304f07d08c95 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2859,6 +2859,14 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2876,6 +2876,14 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, * before __rt_mutex_start_proxy_lock() is done. */ raw_spin_lock_irq(&q.pi_state->pi_mutex.wait_lock); @@ -35,7 +35,7 @@ index 5a26d843a015..1bd0950bea4e 100644 spin_unlock(q.lock_ptr); /* * __rt_mutex_start_proxy_lock() unconditionally enqueues the @rt_waiter -@@ -2867,6 +2875,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2884,6 +2892,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, */ ret = __rt_mutex_start_proxy_lock(&q.pi_state->pi_mutex, &rt_waiter, current); raw_spin_unlock_irq(&q.pi_state->pi_mutex.wait_lock); @@ -43,7 +43,7 @@ index 5a26d843a015..1bd0950bea4e 100644 if (ret) { if (ret == 1) -@@ -3015,11 +3024,21 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) +@@ -3032,11 +3041,21 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) * rt_waiter. Also see the WARN in wake_futex_pi(). */ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); diff --git a/debian/patches-rt/0061-rt-Add-local-irq-locks.patch b/debian/patches-rt/0061-rt-Add-local-irq-locks.patch index 7dc2325ae..1c74837c6 100644 --- a/debian/patches-rt/0061-rt-Add-local-irq-locks.patch +++ b/debian/patches-rt/0061-rt-Add-local-irq-locks.patch @@ -1,8 +1,8 @@ -From 5b811e266fa9c293395c73c7a21e7e5c5a51deb1 Mon Sep 17 00:00:00 2001 +From 1e4195bafdb198d778c98aece678c7b16cd035c8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 20 Jun 2011 09:03:47 +0200 -Subject: [PATCH 061/269] rt: Add local irq locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 061/283] rt: Add local irq locks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Introduce locallock. For !RT this maps to preempt_disable()/ local_irq_disable() so there is not much that changes. For RT this will diff --git a/debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch b/debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch index b3f9eba50..cc0c03405 100644 --- a/debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch +++ b/debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch @@ -1,8 +1,8 @@ -From 251ca7087d744d8b174f8488d2f7ea42cedaccf3 Mon Sep 17 00:00:00 2001 +From 58ee9341c0c3521cdb41239c83807a98cef97bd0 Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Mon, 7 May 2018 08:58:56 -0500 -Subject: [PATCH 062/269] locallock: provide {get,put}_locked_ptr() variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 062/283] locallock: provide {get,put}_locked_ptr() variants +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Provide a set of locallocked accessors for pointers to per-CPU data; this is useful for dynamically-allocated per-CPU regions, for example. diff --git a/debian/patches-rt/0063-mm-scatterlist-Do-not-disable-irqs-on-RT.patch b/debian/patches-rt/0063-mm-scatterlist-Do-not-disable-irqs-on-RT.patch index 9b4295d7a..2ae2bc186 100644 --- a/debian/patches-rt/0063-mm-scatterlist-Do-not-disable-irqs-on-RT.patch +++ b/debian/patches-rt/0063-mm-scatterlist-Do-not-disable-irqs-on-RT.patch @@ -1,8 +1,8 @@ -From bdf1c5db6f1c5d8fe706592f9373849948d65813 Mon Sep 17 00:00:00 2001 +From a6c38f0b349a8921a1bfe4dcef5972cf1e2224a0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:34 -0500 -Subject: [PATCH 063/269] mm/scatterlist: Do not disable irqs on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 063/283] mm/scatterlist: Do not disable irqs on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). diff --git a/debian/patches-rt/0064-signal-x86-Delay-calling-signals-in-atomic.patch b/debian/patches-rt/0064-signal-x86-Delay-calling-signals-in-atomic.patch index 6ca079b6a..e62f228b4 100644 --- a/debian/patches-rt/0064-signal-x86-Delay-calling-signals-in-atomic.patch +++ b/debian/patches-rt/0064-signal-x86-Delay-calling-signals-in-atomic.patch @@ -1,8 +1,8 @@ -From d892f2116baf1643d4d3c792231c687fa49b71ce Mon Sep 17 00:00:00 2001 +From f994c5279fb1173131e67419c540713cd25a59e3 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 064/269] signal/x86: Delay calling signals in atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 064/283] signal/x86: Delay calling signals in atomic +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On x86_64 we must disable preemption before we enable interrupts for stack faults, int3 and debugging, because the current task is using @@ -38,10 +38,10 @@ Signed-off-by: Thomas Gleixner 4 files changed, 59 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c -index 3b2490b81918..ec46ee700791 100644 +index 8353348ddeaf..91676b0d2d4c 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -151,6 +151,13 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) +@@ -152,6 +152,13 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) if (cached_flags & _TIF_NEED_RESCHED) schedule(); @@ -95,7 +95,7 @@ index df39ad5916e7..535e57775208 100644 size_t sas_ss_size; unsigned int sas_ss_flags; diff --git a/kernel/signal.c b/kernel/signal.c -index f29def2be652..57c48b3d1491 100644 +index d5a9646b3538..56edb0580a3a 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1268,8 +1268,8 @@ int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p, diff --git a/debian/patches-rt/0065-x86-signal-delay-calling-signals-on-32bit.patch b/debian/patches-rt/0065-x86-signal-delay-calling-signals-on-32bit.patch index 7e2222765..a7f9725a2 100644 --- a/debian/patches-rt/0065-x86-signal-delay-calling-signals-on-32bit.patch +++ b/debian/patches-rt/0065-x86-signal-delay-calling-signals-on-32bit.patch @@ -1,8 +1,8 @@ -From 6828880f532efdf1ded1248f5e0ea555e9520eda Mon Sep 17 00:00:00 2001 +From 77f58646e4722365c6b6b91802d5feddd57dff34 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Thu, 10 Dec 2015 10:58:51 -0800 -Subject: [PATCH 065/269] x86/signal: delay calling signals on 32bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 065/283] x86/signal: delay calling signals on 32bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz When running some ptrace single step tests on x86-32 machine, the below problem is triggered: diff --git a/debian/patches-rt/0066-buffer_head-Replace-bh_uptodate_lock-for-rt.patch b/debian/patches-rt/0066-buffer_head-Replace-bh_uptodate_lock-for-rt.patch index 056049b04..fb68aa55b 100644 --- a/debian/patches-rt/0066-buffer_head-Replace-bh_uptodate_lock-for-rt.patch +++ b/debian/patches-rt/0066-buffer_head-Replace-bh_uptodate_lock-for-rt.patch @@ -1,8 +1,8 @@ -From 651a49976e8e481190cc465a5590940a6f6bbcf9 Mon Sep 17 00:00:00 2001 +From 86a1cbd4eddbe083ad0331f0eeec002f6fa7b322 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 18 Mar 2011 09:18:52 +0100 -Subject: [PATCH 066/269] buffer_head: Replace bh_uptodate_lock for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 066/283] buffer_head: Replace bh_uptodate_lock for -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Wrap the bit_spin_lock calls into a separate inline and add the RT replacements with a real spinlock. diff --git a/debian/patches-rt/0067-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch b/debian/patches-rt/0067-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch index b75c78a86..d9f13ac25 100644 --- a/debian/patches-rt/0067-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch +++ b/debian/patches-rt/0067-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch @@ -1,9 +1,9 @@ -From 6107effb93a85ff7db4857dca4a0acc2ec4a7d5c Mon Sep 17 00:00:00 2001 +From a0ac5bf9b179bff5745bd4c15d14cb2ec5c81c16 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 18 Mar 2011 10:11:25 +0100 -Subject: [PATCH 067/269] fs: jbd/jbd2: Make state lock and journal head lock +Subject: [PATCH 067/283] fs: jbd/jbd2: Make state lock and journal head lock rt safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz bit_spin_locks break under RT. @@ -45,7 +45,7 @@ index 8a1bcfb145d7..5869330d1f38 100644 } diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h -index b708e5169d1d..018665350951 100644 +index 583b82b5a1e9..57f4ad8d45a5 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -347,32 +347,56 @@ static inline struct journal_head *bh2jh(struct buffer_head *bh) diff --git a/debian/patches-rt/0068-list_bl-Make-list-head-locking-RT-safe.patch b/debian/patches-rt/0068-list_bl-Make-list-head-locking-RT-safe.patch index a0ae303ed..84d1cefdd 100644 --- a/debian/patches-rt/0068-list_bl-Make-list-head-locking-RT-safe.patch +++ b/debian/patches-rt/0068-list_bl-Make-list-head-locking-RT-safe.patch @@ -1,8 +1,8 @@ -From 44a67462ebab9e354cfa669144248912fa92ca24 Mon Sep 17 00:00:00 2001 +From 575440eb3e514693de4892b3589bd02b584834ef Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Fri, 21 Jun 2013 15:07:25 -0400 -Subject: [PATCH 068/269] list_bl: Make list head locking RT safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 068/283] list_bl: Make list head locking RT safe +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz As per changes in include/linux/jbd_common.h for avoiding the bit_spin_locks on RT ("fs: jbd/jbd2: Make state lock and journal diff --git a/debian/patches-rt/0069-list_bl-fixup-bogus-lockdep-warning.patch b/debian/patches-rt/0069-list_bl-fixup-bogus-lockdep-warning.patch index 6a11855d0..41894773f 100644 --- a/debian/patches-rt/0069-list_bl-fixup-bogus-lockdep-warning.patch +++ b/debian/patches-rt/0069-list_bl-fixup-bogus-lockdep-warning.patch @@ -1,8 +1,8 @@ -From 20f64514264a9d0ea1533f4743f542a1fb056a16 Mon Sep 17 00:00:00 2001 +From 386260fdddeed151902355b8c816f9b166c1c2b8 Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 31 Mar 2016 00:04:25 -0500 -Subject: [PATCH 069/269] list_bl: fixup bogus lockdep warning -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 069/283] list_bl: fixup bogus lockdep warning +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). diff --git a/debian/patches-rt/0070-genirq-Disable-irqpoll-on-rt.patch b/debian/patches-rt/0070-genirq-Disable-irqpoll-on-rt.patch index e23223906..39aa3701e 100644 --- a/debian/patches-rt/0070-genirq-Disable-irqpoll-on-rt.patch +++ b/debian/patches-rt/0070-genirq-Disable-irqpoll-on-rt.patch @@ -1,8 +1,8 @@ -From 7520cd851f5733f5e69fe73008893f4be48506f9 Mon Sep 17 00:00:00 2001 +From d884d2bff2d643468c5e37727aa29e8f5c88b3be Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:57 -0500 -Subject: [PATCH 070/269] genirq: Disable irqpoll on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 070/283] genirq: Disable irqpoll on -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Creates long latencies for no value diff --git a/debian/patches-rt/0071-genirq-Force-interrupt-thread-on-RT.patch b/debian/patches-rt/0071-genirq-Force-interrupt-thread-on-RT.patch index fa5bc7eb9..1d763cc84 100644 --- a/debian/patches-rt/0071-genirq-Force-interrupt-thread-on-RT.patch +++ b/debian/patches-rt/0071-genirq-Force-interrupt-thread-on-RT.patch @@ -1,8 +1,8 @@ -From 22860bd2c33dc3abc1b0aa695f8f455595762a93 Mon Sep 17 00:00:00 2001 +From 91f768aed73cc93826112811b4e622dce0c1915f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 3 Apr 2011 11:57:29 +0200 -Subject: [PATCH 071/269] genirq: Force interrupt thread on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 071/283] genirq: Force interrupt thread on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. @@ -13,11 +13,9 @@ Signed-off-by: Thomas Gleixner kernel/irq/manage.c | 2 ++ 2 files changed, 6 insertions(+) -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index eeceac3376fc..315f852b4981 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -427,7 +427,11 @@ extern int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, +@@ -427,7 +427,11 @@ extern int irq_set_irqchip_state(unsigne bool state); #ifdef CONFIG_IRQ_FORCED_THREADING @@ -29,11 +27,9 @@ index eeceac3376fc..315f852b4981 100644 #else #define force_irqthreads (0) #endif -diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index 5c0ba5ca5930..94a18cf54293 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -23,6 +23,7 @@ +@@ -24,6 +24,7 @@ #include "internals.h" #ifdef CONFIG_IRQ_FORCED_THREADING @@ -41,14 +37,11 @@ index 5c0ba5ca5930..94a18cf54293 100644 __read_mostly bool force_irqthreads; EXPORT_SYMBOL_GPL(force_irqthreads); -@@ -32,6 +33,7 @@ static int __init setup_forced_irqthreads(char *arg) +@@ -33,6 +34,7 @@ static int __init setup_forced_irqthread return 0; } early_param("threadirqs", setup_forced_irqthreads); +# endif #endif - static void __synchronize_hardirq(struct irq_desc *desc) --- -2.20.1 - + static void __synchronize_hardirq(struct irq_desc *desc, bool sync_chip) diff --git a/debian/patches-rt/0072-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0072-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 7e5dbf919..ce1379ae3 100644 --- a/debian/patches-rt/0072-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0072-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -1,9 +1,9 @@ -From 3c22477fe8ef4919a3fb0314834751ad2e2134d8 Mon Sep 17 00:00:00 2001 +From 6ec0e8d1526370de73bd18c096f7f96827594308 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:20 +0200 -Subject: [PATCH 072/269] Split IRQ-off and zone->lock while freeing pages from +Subject: [PATCH 072/283] Split IRQ-off and zone->lock while freeing pages from PCP list #1 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 8e6932a140b8..8c10f34364c0 100644 +index 2d04bd2e1ced..332b48f38d1e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1095,7 +1095,7 @@ static inline void prefetch_buddy(struct page *page) diff --git a/debian/patches-rt/0073-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0073-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 06cc2016e..c560a2ac3 100644 --- a/debian/patches-rt/0073-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0073-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -1,9 +1,9 @@ -From e4639c8f6abcfb4b8b26aa296089349739103578 Mon Sep 17 00:00:00 2001 +From f9efb76f365f15eaca8f29ee7f2648de90925a76 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:21 +0200 -Subject: [PATCH 073/269] Split IRQ-off and zone->lock while freeing pages from +Subject: [PATCH 073/283] Split IRQ-off and zone->lock while freeing pages from PCP list #2 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 8c10f34364c0..4d630aebd84f 100644 +index 332b48f38d1e..55cee9a17a36 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1105,8 +1105,8 @@ static inline void prefetch_buddy(struct page *page) diff --git a/debian/patches-rt/0074-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0074-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch index 8b78f9d2b..30fe582de 100644 --- a/debian/patches-rt/0074-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0074-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch @@ -1,8 +1,8 @@ -From 21da9341b8a6c5d9308bf0c2fa3fe4647749f125 Mon Sep 17 00:00:00 2001 +From 302fcfd8e9527e8f7b6ec9d733a5a3a760af64ef Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 28 May 2018 15:24:22 +0200 -Subject: [PATCH 074/269] mm/SLxB: change list_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 074/283] mm/SLxB: change list_lock to raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The list_lock is used with used with IRQs off on RT. Make it a raw_spinlock_t otherwise the interrupts won't be disabled on -RT. The locking rules remain @@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/mm/slab.c b/mm/slab.c -index b8e0ec74330f..21fe15fb9624 100644 +index 46f21e73db2f..38f6609343b3 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -233,7 +233,7 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent) @@ -369,7 +369,7 @@ index b8e0ec74330f..21fe15fb9624 100644 } num_objs = total_slabs * cachep->num; active_slabs = total_slabs - free_slabs; -@@ -4333,13 +4333,13 @@ static int leaks_show(struct seq_file *m, void *p) +@@ -4338,13 +4338,13 @@ static int leaks_show(struct seq_file *m, void *p) for_each_kmem_cache_node(cachep, node, n) { check_irq_on(); diff --git a/debian/patches-rt/0075-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch b/debian/patches-rt/0075-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch index 2305c2811..c6312d034 100644 --- a/debian/patches-rt/0075-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch +++ b/debian/patches-rt/0075-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch @@ -1,9 +1,9 @@ -From 7950585d96adfc3a0b99a639041dbaed50e2a496 Mon Sep 17 00:00:00 2001 +From 9da82885e5b9187857b5fdc2eaa482752e814fbc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 21 Jun 2018 17:29:19 +0200 -Subject: [PATCH 075/269] mm/SLUB: delay giving back empty slubs to IRQ enabled +Subject: [PATCH 075/283] mm/SLUB: delay giving back empty slubs to IRQ enabled regions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz __free_slab() is invoked with disabled interrupts which increases the irq-off time while __free_pages() is doing the work. diff --git a/debian/patches-rt/0076-mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches-rt/0076-mm-page_alloc-rt-friendly-per-cpu-pages.patch index 300e07f24..f09e17263 100644 --- a/debian/patches-rt/0076-mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches-rt/0076-mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,8 +1,8 @@ -From 31695882006c45fad86890ceff90dd7d65ea5dd3 Mon Sep 17 00:00:00 2001 +From 4cd1dede47de27525631161fdc6cdfc9d8608c31 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:37 -0500 -Subject: [PATCH 076/269] mm: page_alloc: rt-friendly per-cpu pages -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 076/283] mm: page_alloc: rt-friendly per-cpu pages +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. @@ -18,7 +18,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 4d630aebd84f..4d11ec179aa7 100644 +index 55cee9a17a36..99b3861b1ef6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -60,6 +60,7 @@ @@ -216,7 +216,7 @@ index 4d630aebd84f..4d11ec179aa7 100644 return NULL; } -@@ -8094,7 +8117,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -8096,7 +8119,7 @@ void zone_pcp_reset(struct zone *zone) struct per_cpu_pageset *pset; /* avoid races with drain_pages() */ @@ -225,7 +225,7 @@ index 4d630aebd84f..4d11ec179aa7 100644 if (zone->pageset != &boot_pageset) { for_each_online_cpu(cpu) { pset = per_cpu_ptr(zone->pageset, cpu); -@@ -8103,7 +8126,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -8105,7 +8128,7 @@ void zone_pcp_reset(struct zone *zone) free_percpu(zone->pageset); zone->pageset = &boot_pageset; } diff --git a/debian/patches-rt/0077-mm-swap-Convert-to-percpu-locked.patch b/debian/patches-rt/0077-mm-swap-Convert-to-percpu-locked.patch index 22b5ce824..937b154b7 100644 --- a/debian/patches-rt/0077-mm-swap-Convert-to-percpu-locked.patch +++ b/debian/patches-rt/0077-mm-swap-Convert-to-percpu-locked.patch @@ -1,8 +1,8 @@ -From 25ce0ae0ad1ef1ed724757c0137241db28a8208d Mon Sep 17 00:00:00 2001 +From 98c01e9756e741d807b1198eb885a26e0998fcde Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:51 -0500 -Subject: [PATCH 077/269] mm/swap: Convert to percpu locked -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 077/283] mm/swap: Convert to percpu locked +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". @@ -56,10 +56,10 @@ index faca45ebe62d..f8ccb9d9daa3 100644 cc->last_migrated_pfn = 0; } diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 4d11ec179aa7..a01c15fdb723 100644 +index 99b3861b1ef6..1679f5883307 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7205,8 +7205,9 @@ void __init free_area_init(unsigned long *zones_size) +@@ -7207,8 +7207,9 @@ void __init free_area_init(unsigned long *zones_size) static int page_alloc_cpu_dead(unsigned int cpu) { diff --git a/debian/patches-rt/0078-mm-perform-lru_add_drain_all-remotely.patch b/debian/patches-rt/0078-mm-perform-lru_add_drain_all-remotely.patch index bd99cce88..18e923e2b 100644 --- a/debian/patches-rt/0078-mm-perform-lru_add_drain_all-remotely.patch +++ b/debian/patches-rt/0078-mm-perform-lru_add_drain_all-remotely.patch @@ -1,8 +1,8 @@ -From c6e0c51ac7fe1d0892449e41e6792babe4d7c3fa Mon Sep 17 00:00:00 2001 +From f4f53c9fdf55676d783a4fbad5049f39401a0542 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 27 May 2016 15:03:28 +0200 -Subject: [PATCH 078/269] mm: perform lru_add_drain_all() remotely -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 078/283] mm: perform lru_add_drain_all() remotely +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz lru_add_drain_all() works by scheduling lru_add_drain_cpu() to run on all CPUs that have non-empty LRU pagevecs and then waiting for diff --git a/debian/patches-rt/0079-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch b/debian/patches-rt/0079-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch index b24328615..4e558cd2b 100644 --- a/debian/patches-rt/0079-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch +++ b/debian/patches-rt/0079-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch @@ -1,9 +1,9 @@ -From b0971a2847fd9cd9f59eb19e6761f6800a33150d Mon Sep 17 00:00:00 2001 +From 3e1b4a0068b41c1782264376379985fb992bd41e Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:13 -0500 -Subject: [PATCH 079/269] mm/vmstat: Protect per cpu variables with preempt +Subject: [PATCH 079/283] mm/vmstat: Protect per cpu variables with preempt disable on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Disable preemption on -RT for the vmstat code. On vanila the code runs in IRQ-off regions while on -RT it is not. "preempt_disable" ensures that the diff --git a/debian/patches-rt/0080-ARM-Initialize-split-page-table-locks-for-vector-pag.patch b/debian/patches-rt/0080-ARM-Initialize-split-page-table-locks-for-vector-pag.patch index 71e3f4f31..8ac3f617b 100644 --- a/debian/patches-rt/0080-ARM-Initialize-split-page-table-locks-for-vector-pag.patch +++ b/debian/patches-rt/0080-ARM-Initialize-split-page-table-locks-for-vector-pag.patch @@ -1,9 +1,9 @@ -From 1062ea19aa6e1c3dacb44d07747c89b4f66dadc2 Mon Sep 17 00:00:00 2001 +From fb089e89b26bc5653a90d9983021813e15fa04d9 Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Sat, 1 Oct 2011 18:58:13 -0700 -Subject: [PATCH 080/269] ARM: Initialize split page table locks for vector +Subject: [PATCH 080/283] ARM: Initialize split page table locks for vector page -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Without this patch, ARM can not use SPLIT_PTLOCK_CPUS if PREEMPT_RT_FULL=y because vectors_user_mapping() creates a diff --git a/debian/patches-rt/0081-mm-Enable-SLUB-for-RT.patch b/debian/patches-rt/0081-mm-Enable-SLUB-for-RT.patch index 268062785..3354b0ff9 100644 --- a/debian/patches-rt/0081-mm-Enable-SLUB-for-RT.patch +++ b/debian/patches-rt/0081-mm-Enable-SLUB-for-RT.patch @@ -1,8 +1,8 @@ -From 7bd789a93c5b97d553b15fd8e446228d23456aff Mon Sep 17 00:00:00 2001 +From b01d03c695bcba2149713f4425c806b5b5e3410d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 25 Oct 2012 10:32:35 +0100 -Subject: [PATCH 081/269] mm: Enable SLUB for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 081/283] mm: Enable SLUB for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Avoid the memory allocation in IRQ section diff --git a/debian/patches-rt/0082-slub-Enable-irqs-for-__GFP_WAIT.patch b/debian/patches-rt/0082-slub-Enable-irqs-for-__GFP_WAIT.patch index dac00ea6d..c21175faa 100644 --- a/debian/patches-rt/0082-slub-Enable-irqs-for-__GFP_WAIT.patch +++ b/debian/patches-rt/0082-slub-Enable-irqs-for-__GFP_WAIT.patch @@ -1,8 +1,8 @@ -From 11224977de88f7f3ddc92b29390c44fdf9a85820 Mon Sep 17 00:00:00 2001 +From 14471a3281f661b8b8bccdb64820879a699fb2ad Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 9 Jan 2013 12:08:15 +0100 -Subject: [PATCH 082/269] slub: Enable irqs for __GFP_WAIT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 082/283] slub: Enable irqs for __GFP_WAIT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz SYSTEM_RUNNING might be too late for enabling interrupts. Allocations with GFP_WAIT can happen before that. So use this as an indicator. diff --git a/debian/patches-rt/0083-slub-Disable-SLUB_CPU_PARTIAL.patch b/debian/patches-rt/0083-slub-Disable-SLUB_CPU_PARTIAL.patch index e60cbbdff..fe5f645f7 100644 --- a/debian/patches-rt/0083-slub-Disable-SLUB_CPU_PARTIAL.patch +++ b/debian/patches-rt/0083-slub-Disable-SLUB_CPU_PARTIAL.patch @@ -1,8 +1,8 @@ -From b8b912f1bb257eb44228b3bdb7652c4d6dcda56b Mon Sep 17 00:00:00 2001 +From fb6bfe69057a4177f5f5b273cace7ea5cbb5f649 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 15 Apr 2015 19:00:47 +0200 -Subject: [PATCH 083/269] slub: Disable SLUB_CPU_PARTIAL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 083/283] slub: Disable SLUB_CPU_PARTIAL +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 87, name: rcuop/7 @@ -37,10 +37,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/Kconfig b/init/Kconfig -index 707ca4d49944..68b4e39e421b 100644 +index 61e8b531649b..b4e88fb19c26 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1698,7 +1698,7 @@ config SLAB_FREELIST_HARDENED +@@ -1701,7 +1701,7 @@ config SLAB_FREELIST_HARDENED config SLUB_CPU_PARTIAL default y diff --git a/debian/patches-rt/0084-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches-rt/0084-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index 2742d1eea..859b0f723 100644 --- a/debian/patches-rt/0084-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/debian/patches-rt/0084-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,9 +1,9 @@ -From 107eee1a14857d0aecad3c1f56f8b4cabbadcf89 Mon Sep 17 00:00:00 2001 +From b64de8d2bb376abf6af01c84a94e1a201aecc6ec Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Wed, 30 Oct 2013 11:48:33 -0700 -Subject: [PATCH 084/269] mm/memcontrol: Don't call schedule_work_on in +Subject: [PATCH 084/283] mm/memcontrol: Don't call schedule_work_on in preemption disabled context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The following trace is triggered when running ltp oom test cases: diff --git a/debian/patches-rt/0085-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch b/debian/patches-rt/0085-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch index 83b806156..789ae3431 100644 --- a/debian/patches-rt/0085-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch +++ b/debian/patches-rt/0085-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch @@ -1,9 +1,9 @@ -From b1fa5897c72583b68655f7eeca2e598dbfa8a0b5 Mon Sep 17 00:00:00 2001 +From 3cb7dde3b41a847eefeac79763e46ce167c8521f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 28 Jan 2015 17:14:16 +0100 -Subject: [PATCH 085/269] mm/memcontrol: Replace local_irq_disable with local +Subject: [PATCH 085/283] mm/memcontrol: Replace local_irq_disable with local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. diff --git a/debian/patches-rt/0086-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch b/debian/patches-rt/0086-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch index 28e818625..d0976ea4c 100644 --- a/debian/patches-rt/0086-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch +++ b/debian/patches-rt/0086-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch @@ -1,8 +1,8 @@ -From 83e42c20f52f70e65d03b214fd9c8579b0128f47 Mon Sep 17 00:00:00 2001 +From 50eae40f0475c039a273e2f5441f4ecda84d104e Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Tue, 22 Mar 2016 11:16:09 +0100 -Subject: [PATCH 086/269] mm/zsmalloc: copy with get_cpu_var() and locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 086/283] mm/zsmalloc: copy with get_cpu_var() and locking +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz get_cpu_var() disables preemption and triggers a might_sleep() splat later. This is replaced with get_locked_var(). diff --git a/debian/patches-rt/0087-x86-mm-pat-disable-preemption-__split_large_page-aft.patch b/debian/patches-rt/0087-x86-mm-pat-disable-preemption-__split_large_page-aft.patch index 026fcb3a2..253b1fd5f 100644 --- a/debian/patches-rt/0087-x86-mm-pat-disable-preemption-__split_large_page-aft.patch +++ b/debian/patches-rt/0087-x86-mm-pat-disable-preemption-__split_large_page-aft.patch @@ -1,9 +1,9 @@ -From 2543c80b6aadc59c70c6b6e912ed1e6a9965b3c0 Mon Sep 17 00:00:00 2001 +From 3d625e1fb1f5adff8191330efe6d47017b0806bd Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 11 Dec 2018 21:53:43 +0100 -Subject: [PATCH 087/269] x86/mm/pat: disable preemption __split_large_page() +Subject: [PATCH 087/283] x86/mm/pat: disable preemption __split_large_page() after spin_lock() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Commit "x86/mm/pat: Disable preemption around __flush_tlb_all()" added a warning if __flush_tlb_all() is invoked in preemptible context. On !RT diff --git a/debian/patches-rt/0088-radix-tree-use-local-locks.patch b/debian/patches-rt/0088-radix-tree-use-local-locks.patch index 3d3e49f89..5d2d5bc70 100644 --- a/debian/patches-rt/0088-radix-tree-use-local-locks.patch +++ b/debian/patches-rt/0088-radix-tree-use-local-locks.patch @@ -1,8 +1,8 @@ -From 11c1fef6d646f26007271dd7486fe14176d6e6f6 Mon Sep 17 00:00:00 2001 +From 0a7a65a5055b7a5a94c57ee2dc8404116cff804b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 25 Jan 2017 16:34:27 +0100 -Subject: [PATCH 088/269] radix-tree: use local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 088/283] radix-tree: use local locks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The preload functionality uses per-CPU variables and preempt-disable to ensure that it does not switch CPUs during its usage. This patch adds diff --git a/debian/patches-rt/0089-timers-Prepare-for-full-preemption.patch b/debian/patches-rt/0089-timers-Prepare-for-full-preemption.patch index 4e7a53939..6d5ecb02b 100644 --- a/debian/patches-rt/0089-timers-Prepare-for-full-preemption.patch +++ b/debian/patches-rt/0089-timers-Prepare-for-full-preemption.patch @@ -1,8 +1,8 @@ -From 558451a44923dab908e500200b3f6f02fd6e4fae Mon Sep 17 00:00:00 2001 +From 5bbf9de052f34cd8d685120f60da34937f2b0772 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 -Subject: [PATCH 089/269] timers: Prepare for full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 089/283] timers: Prepare for full preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz When softirqs can be preempted we need to make sure that cancelling the timer from the active thread can not deadlock vs. a running timer @@ -30,7 +30,7 @@ index 7b066fd38248..54627d046b3a 100644 #else # define del_timer_sync(t) del_timer(t) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 9c4a9f0a627b..ddf6282d9780 100644 +index 7a39d56f6a6b..5de80f29ef57 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -498,11 +498,14 @@ void resched_cpu(int cpu) diff --git a/debian/patches-rt/0090-x86-kvm-Require-const-tsc-for-RT.patch b/debian/patches-rt/0090-x86-kvm-Require-const-tsc-for-RT.patch index 61aff062b..2c3363e31 100644 --- a/debian/patches-rt/0090-x86-kvm-Require-const-tsc-for-RT.patch +++ b/debian/patches-rt/0090-x86-kvm-Require-const-tsc-for-RT.patch @@ -1,8 +1,8 @@ -From ea0ad5586875098798cbf5d53bb21f2a5b82e537 Mon Sep 17 00:00:00 2001 +From 49f95baf1667e4853406b63d30062b94afff4a25 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 6 Nov 2011 12:26:18 +0100 -Subject: [PATCH 090/269] x86: kvm Require const tsc for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 090/283] x86: kvm Require const tsc for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds @@ -15,10 +15,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 7 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 4a61e1609c97..0b4fd313b626 100644 +index cea6568667c4..c90545667fd6 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -6725,6 +6725,13 @@ int kvm_arch_init(void *opaque) +@@ -6756,6 +6756,13 @@ int kvm_arch_init(void *opaque) goto out; } diff --git a/debian/patches-rt/0091-pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/debian/patches-rt/0091-pci-switchtec-Don-t-use-completion-s-wait-queue.patch index ecfcb1a33..ad379fa42 100644 --- a/debian/patches-rt/0091-pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/debian/patches-rt/0091-pci-switchtec-Don-t-use-completion-s-wait-queue.patch @@ -1,8 +1,8 @@ -From 8d76a7f3ba4284defc688a9131aa96e66eb1310a Mon Sep 17 00:00:00 2001 +From 99fc3867798d14c5cff8c71c3872af84605d572d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 10:24:23 +0200 -Subject: [PATCH 091/269] pci/switchtec: Don't use completion's wait queue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 091/283] pci/switchtec: Don't use completion's wait queue +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The poll callback is using completion's wait_queue_head_t member and puts it in poll_wait() so the poll() caller gets a wakeup after command @@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c -index 37d0c15c9eeb..c396f3ef1852 100644 +index 72db2e0ebced..77d4fb86d05b 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -43,10 +43,11 @@ struct switchtec_user { diff --git a/debian/patches-rt/0092-wait.h-include-atomic.h.patch b/debian/patches-rt/0092-wait.h-include-atomic.h.patch index 5f030c0ae..250b359a0 100644 --- a/debian/patches-rt/0092-wait.h-include-atomic.h.patch +++ b/debian/patches-rt/0092-wait.h-include-atomic.h.patch @@ -1,11 +1,11 @@ -From f8a4f74be5bbce9f9664ebf005bb35f26875858f Mon Sep 17 00:00:00 2001 +From 88037fc07062d469557427c97507d3f95d7ca3a6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 28 Oct 2013 12:19:57 +0100 -Subject: [PATCH 092/269] wait.h: include atomic.h +Subject: [PATCH 092/283] wait.h: include atomic.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz | CC init/main.o |In file included from include/linux/mmzone.h:9:0, diff --git a/debian/patches-rt/0093-work-simple-Simple-work-queue-implemenation.patch b/debian/patches-rt/0093-work-simple-Simple-work-queue-implemenation.patch index a06efb200..3fcf292e6 100644 --- a/debian/patches-rt/0093-work-simple-Simple-work-queue-implemenation.patch +++ b/debian/patches-rt/0093-work-simple-Simple-work-queue-implemenation.patch @@ -1,8 +1,8 @@ -From 7cf55f71248f4f3c603383a84c73c5e44bfb9229 Mon Sep 17 00:00:00 2001 +From 67478d9c6704de32600fd4363f3853bcdffcf391 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 11 Jul 2014 15:26:11 +0200 -Subject: [PATCH 093/269] work-simple: Simple work queue implemenation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 093/283] work-simple: Simple work queue implemenation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Provides a framework for enqueuing callbacks from irq context PREEMPT_RT_FULL safe. The callbacks are executed in kthread context. diff --git a/debian/patches-rt/0094-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch b/debian/patches-rt/0094-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch index 39d7ad01c..70ab96e0e 100644 --- a/debian/patches-rt/0094-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch +++ b/debian/patches-rt/0094-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch @@ -1,9 +1,9 @@ -From ba25a567c5891e2b1acd586212b0fd92ce755e71 Mon Sep 17 00:00:00 2001 +From 147a7822bfe8f027b88fa0ca82ae0d210e57bf34 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 10 Sep 2018 18:00:31 +0200 -Subject: [PATCH 094/269] work-simple: drop a shit statement in +Subject: [PATCH 094/283] work-simple: drop a shit statement in SWORK_EVENT_PENDING -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Dan Carpenter reported | smatch warnings: diff --git a/debian/patches-rt/0095-completion-Use-simple-wait-queues.patch b/debian/patches-rt/0095-completion-Use-simple-wait-queues.patch index f7194e4d0..e50733a81 100644 --- a/debian/patches-rt/0095-completion-Use-simple-wait-queues.patch +++ b/debian/patches-rt/0095-completion-Use-simple-wait-queues.patch @@ -1,8 +1,8 @@ -From d24dfe04ec75d5329d870c0d20f56f2cba4563ec Mon Sep 17 00:00:00 2001 +From 334dc78522991ee04c4704a53d24f0009be71172 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 11 Jan 2013 11:23:51 +0100 -Subject: [PATCH 095/269] completion: Use simple wait queues -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 095/283] completion: Use simple wait queues +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the @@ -161,10 +161,10 @@ index 73e06e9986d4..f426a0661aa0 100644 extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state); diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c -index abef759de7c8..69e418787f21 100644 +index f5ce9f7ec132..0f00ba01376f 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c -@@ -681,6 +681,10 @@ static int load_image_and_restore(void) +@@ -690,6 +690,10 @@ static int load_image_and_restore(void) return error; } @@ -175,7 +175,7 @@ index abef759de7c8..69e418787f21 100644 /** * hibernate - Carry out system hibernation, including saving the image. */ -@@ -694,6 +698,8 @@ int hibernate(void) +@@ -703,6 +707,8 @@ int hibernate(void) return -EPERM; } @@ -184,7 +184,7 @@ index abef759de7c8..69e418787f21 100644 lock_system_sleep(); /* The snapshot device should not be opened while we're running */ if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { -@@ -772,6 +778,7 @@ int hibernate(void) +@@ -781,6 +787,7 @@ int hibernate(void) atomic_inc(&snapshot_device_available); Unlock: unlock_system_sleep(); @@ -320,10 +320,10 @@ index a1ad5b7d5521..755a58084978 100644 } EXPORT_SYMBOL(completion_done); diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index ddf6282d9780..8272d920b749 100644 +index 5de80f29ef57..337cc72e6a6a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7109,7 +7109,10 @@ void migrate_disable(void) +@@ -7116,7 +7116,10 @@ void migrate_disable(void) return; } #ifdef CONFIG_SCHED_DEBUG @@ -335,7 +335,7 @@ index ddf6282d9780..8272d920b749 100644 #endif if (p->migrate_disable) { -@@ -7139,7 +7142,10 @@ void migrate_enable(void) +@@ -7146,7 +7149,10 @@ void migrate_enable(void) } #ifdef CONFIG_SCHED_DEBUG diff --git a/debian/patches-rt/0096-fs-aio-simple-simple-work.patch b/debian/patches-rt/0096-fs-aio-simple-simple-work.patch index e5cb98ce4..c7f86e40b 100644 --- a/debian/patches-rt/0096-fs-aio-simple-simple-work.patch +++ b/debian/patches-rt/0096-fs-aio-simple-simple-work.patch @@ -1,8 +1,8 @@ -From 39010d30f3244de6b51646a0325b6292d8c84282 Mon Sep 17 00:00:00 2001 +From b576efb7cedb58ffa58242d7b0df24d14063ba0e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 16 Feb 2015 18:49:10 +0100 -Subject: [PATCH 096/269] fs/aio: simple simple work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 096/283] fs/aio: simple simple work +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:768 |in_atomic(): 1, irqs_disabled(): 0, pid: 26, name: rcuos/2 @@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/fs/aio.c b/fs/aio.c -index 45d5ef8dd0a8..7db10b87c9bc 100644 +index 911e23087dfb..16dcf8521c2c 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -42,6 +42,7 @@ @@ -49,7 +49,7 @@ index 45d5ef8dd0a8..7db10b87c9bc 100644 /* * signals when all in-flight requests are done -@@ -255,6 +257,7 @@ static int __init aio_setup(void) +@@ -265,6 +267,7 @@ static int __init aio_setup(void) .mount = aio_mount, .kill_sb = kill_anon_super, }; @@ -57,7 +57,7 @@ index 45d5ef8dd0a8..7db10b87c9bc 100644 aio_mnt = kern_mount(&aio_fs); if (IS_ERR(aio_mnt)) panic("Failed to create aio fs mount."); -@@ -596,9 +599,9 @@ static void free_ioctx_reqs(struct percpu_ref *ref) +@@ -606,9 +609,9 @@ static void free_ioctx_reqs(struct percpu_ref *ref) * and ctx->users has dropped to 0, so we know no more kiocbs can be submitted - * now it's safe to cancel any that need to be. */ @@ -69,7 +69,7 @@ index 45d5ef8dd0a8..7db10b87c9bc 100644 struct aio_kiocb *req; spin_lock_irq(&ctx->ctx_lock); -@@ -616,6 +619,14 @@ static void free_ioctx_users(struct percpu_ref *ref) +@@ -626,6 +629,14 @@ static void free_ioctx_users(struct percpu_ref *ref) percpu_ref_put(&ctx->reqs); } diff --git a/debian/patches-rt/0097-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch b/debian/patches-rt/0097-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch index 02de3b17f..4b9aa6abd 100644 --- a/debian/patches-rt/0097-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/debian/patches-rt/0097-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,9 +1,9 @@ -From 2010005b28eea662f9390937d92563ea1c466e24 Mon Sep 17 00:00:00 2001 +From bac483c38a96edeadc43fa8dcf03c3e57c41cc62 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 21 Aug 2013 17:48:46 +0200 -Subject: [PATCH 097/269] genirq: Do not invoke the affinity callback via a +Subject: [PATCH 097/283] genirq: Do not invoke the affinity callback via a workqueue on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Joe Korty reported, that __irq_set_affinity_locked() schedules a workqueue while holding a rawlock which results in a might_sleep() @@ -12,9 +12,9 @@ This patch uses swork_queue() instead. Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/interrupt.h | 6 ++++++ - kernel/irq/manage.c | 43 ++++++++++++++++++++++++++++++++++++--- - 2 files changed, 46 insertions(+), 3 deletions(-) + include/linux/interrupt.h | 6 +++++ + kernel/irq/manage.c | 46 ++++++++++++++++++++++++++++++++++++--- + 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 315f852b4981..a943c07b54ba 100644 @@ -49,7 +49,7 @@ index 315f852b4981..a943c07b54ba 100644 void (*release)(struct kref *ref); }; diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index 94a18cf54293..d2270f61d335 100644 +index c3b9f6dacd8f..af2a8757abfb 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -259,7 +259,12 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, @@ -126,6 +126,17 @@ index 94a18cf54293..d2270f61d335 100644 } raw_spin_lock_irqsave(&desc->lock, flags); +@@ -359,7 +396,10 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) + raw_spin_unlock_irqrestore(&desc->lock, flags); + + if (old_notify) { ++#ifndef CONFIG_PREEMPT_RT_BASE ++ /* Need to address this for PREEMPT_RT */ + cancel_work_sync(&old_notify->work); ++#endif + kref_put(&old_notify->kref, old_notify->release); + } + -- 2.20.1 diff --git a/debian/patches-rt/0098-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch b/debian/patches-rt/0098-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch index 96f562ec0..b5396c63c 100644 --- a/debian/patches-rt/0098-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +++ b/debian/patches-rt/0098-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch @@ -1,9 +1,9 @@ -From 49622b7282a6c10c5a70f3987df4ccfe3a32c92b Mon Sep 17 00:00:00 2001 +From 7ada38687fe4d4f0ff8b7390d1588f7fed28a28d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 15 Nov 2017 17:29:51 +0100 -Subject: [PATCH 098/269] time/hrtimer: avoid schedule_work() with interrupts +Subject: [PATCH 098/283] time/hrtimer: avoid schedule_work() with interrupts disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The NOHZ code tries to schedule a workqueue with interrupts disabled. Since this does not work -RT I am switching it to swork instead. diff --git a/debian/patches-rt/0099-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/debian/patches-rt/0099-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index 884a86c56..a3501d406 100644 --- a/debian/patches-rt/0099-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/debian/patches-rt/0099-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -1,9 +1,9 @@ -From 7223736bbeccbb731d509b603b15adcbf36bdade Mon Sep 17 00:00:00 2001 +From 2decd81945344204be663182b0eac46997f297b2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 11:25:41 +0200 -Subject: [PATCH 099/269] hrtimer: consolidate hrtimer_init() + +Subject: [PATCH 099/283] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() calls -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of @@ -28,10 +28,10 @@ Signed-off-by: Anna-Maria Gleixner 7 files changed, 67 insertions(+), 34 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c -index 7d53f2314d7c..b0d0b74cf5a6 100644 +index 70d839b9c3b0..e3e7a88e03a6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -3124,10 +3124,9 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, +@@ -3128,10 +3128,9 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, kt = nsecs; mode = HRTIMER_MODE_REL; @@ -126,10 +126,10 @@ index 2b5ef8e94d19..94bd2e841de6 100644 hrtimer_start_range_ns(&__t.timer, timeout, \ current->timer_slack_ns, \ diff --git a/kernel/futex.c b/kernel/futex.c -index 1bd0950bea4e..fadd9bff6e3c 100644 +index 304f07d08c95..ccf933ac2997 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2684,10 +2684,9 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, +@@ -2701,10 +2701,9 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, if (abs_time) { to = &timeout; @@ -143,7 +143,7 @@ index 1bd0950bea4e..fadd9bff6e3c 100644 hrtimer_set_expires_range_ns(&to->timer, *abs_time, current->timer_slack_ns); } -@@ -2786,9 +2785,8 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2803,9 +2802,8 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, if (time) { to = &timeout; @@ -155,7 +155,7 @@ index 1bd0950bea4e..fadd9bff6e3c 100644 hrtimer_set_expires(&to->timer, *time); } -@@ -3212,10 +3210,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3242,10 +3240,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, if (abs_time) { to = &timeout; @@ -264,7 +264,7 @@ index e1a549c9e399..4f43ece42f3b 100644 if (likely(t.task)) diff --git a/net/core/pktgen.c b/net/core/pktgen.c -index 7f6938405fa1..b71d9eef334e 100644 +index 092fa3d75b32..9d472d626aaa 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2160,7 +2160,8 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until) diff --git a/debian/patches-rt/0100-hrtimers-Prepare-full-preemption.patch b/debian/patches-rt/0100-hrtimers-Prepare-full-preemption.patch index 59dfac113..452ab3844 100644 --- a/debian/patches-rt/0100-hrtimers-Prepare-full-preemption.patch +++ b/debian/patches-rt/0100-hrtimers-Prepare-full-preemption.patch @@ -1,8 +1,8 @@ -From 87f5cf4447982ad964655f0831ea4deff2c59819 Mon Sep 17 00:00:00 2001 +From 15ee476637495474369f2b444a8ae5c041e59ed4 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 -Subject: [PATCH 100/269] hrtimers: Prepare full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 100/283] hrtimers: Prepare full preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Make cancellation of a running callback in softirq context safe against preemption. diff --git a/debian/patches-rt/0101-hrtimer-by-timers-by-default-into-the-softirq-contex.patch b/debian/patches-rt/0101-hrtimer-by-timers-by-default-into-the-softirq-contex.patch index 6cc3fee6b..5632d0d40 100644 --- a/debian/patches-rt/0101-hrtimer-by-timers-by-default-into-the-softirq-contex.patch +++ b/debian/patches-rt/0101-hrtimer-by-timers-by-default-into-the-softirq-contex.patch @@ -1,9 +1,9 @@ -From 7bbc9e32ebfc904f317e3e3808164cdcba6f7f6d Mon Sep 17 00:00:00 2001 +From da6822e02b92c82126e1e2ef3846912c9874b024 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 3 Jul 2009 08:44:31 -0500 -Subject: [PATCH 101/269] hrtimer: by timers by default into the softirq +Subject: [PATCH 101/283] hrtimer: by timers by default into the softirq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz We can't have hrtimers callbacks running in hardirq context on RT. Therefore the timers are deferred to the softirq context by default. @@ -29,10 +29,10 @@ Signed-off-by: Sebastian Andrzej Siewior 11 files changed, 37 insertions(+), 14 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c -index 3692de84c420..e3c95654b0d1 100644 +index 031bd7f91f98..4b2a399f1df5 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c -@@ -2250,7 +2250,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) +@@ -2252,7 +2252,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) apic->vcpu = vcpu; hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC, @@ -66,7 +66,7 @@ index 73ad7309436a..2bdb047c7656 100644 /* diff --git a/kernel/events/core.c b/kernel/events/core.c -index 87bd96399d1c..36661d7a8581 100644 +index 171b83ebed4a..a7807c609c22 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1102,7 +1102,7 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_context *cpuctx, int cpu) @@ -78,7 +78,7 @@ index 87bd96399d1c..36661d7a8581 100644 timer->function = perf_mux_hrtimer_handler; } -@@ -9183,7 +9183,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event) +@@ -9216,7 +9216,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event) if (!is_sampling_event(event)) return; @@ -88,7 +88,7 @@ index 87bd96399d1c..36661d7a8581 100644 /* diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 8272d920b749..4ed3b29cb0c8 100644 +index 337cc72e6a6a..1f997ceec454 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -315,7 +315,7 @@ static void hrtick_rq_init(struct rq *rq) @@ -101,10 +101,10 @@ index 8272d920b749..4ed3b29cb0c8 100644 } #else /* CONFIG_SCHED_HRTICK */ diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c -index f927b1f45474..ad2a793a912b 100644 +index fb6e64417470..1794e152d888 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -1054,7 +1054,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se) +@@ -1053,7 +1053,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se) { struct hrtimer *timer = &dl_se->dl_timer; @@ -114,10 +114,10 @@ index f927b1f45474..ad2a793a912b 100644 } diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index c17d63b06026..4193041b3cab 100644 +index 0048a32a3b4d..4022ad749d85 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4904,9 +4904,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) +@@ -4908,9 +4908,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) cfs_b->period = ns_to_ktime(default_cfs_period()); INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); @@ -130,7 +130,7 @@ index c17d63b06026..4193041b3cab 100644 cfs_b->distribute_running = 0; } diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c -index 4857ca145119..32c9a9f54495 100644 +index b6ca4a630050..aeb99395c03b 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -45,8 +45,8 @@ void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime) diff --git a/debian/patches-rt/0102-sched-fair-Make-the-hrtimers-non-hard-again.patch b/debian/patches-rt/0102-sched-fair-Make-the-hrtimers-non-hard-again.patch index edd43a551..fb794ac54 100644 --- a/debian/patches-rt/0102-sched-fair-Make-the-hrtimers-non-hard-again.patch +++ b/debian/patches-rt/0102-sched-fair-Make-the-hrtimers-non-hard-again.patch @@ -1,8 +1,8 @@ -From f498fc065cd56d96f2583801142a348eb801e631 Mon Sep 17 00:00:00 2001 +From bccc05d43b6e3443288909080b555413b80fe36a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 8 Jan 2019 12:31:06 +0100 -Subject: [PATCH 102/269] sched/fair: Make the hrtimers non-hard again -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 102/283] sched/fair: Make the hrtimers non-hard again +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Since commit "sched/fair: Robustify CFS-bandwidth timer locking" both hrtimer can run in softirq context because now interrupts are disabled @@ -14,10 +14,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 4193041b3cab..c17d63b06026 100644 +index 4022ad749d85..0048a32a3b4d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4904,9 +4904,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) +@@ -4908,9 +4908,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) cfs_b->period = ns_to_ktime(default_cfs_period()); INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); diff --git a/debian/patches-rt/0103-hrtimer-Move-schedule_work-call-to-helper-thread.patch b/debian/patches-rt/0103-hrtimer-Move-schedule_work-call-to-helper-thread.patch index 219cbbdda..ecc3eb95c 100644 --- a/debian/patches-rt/0103-hrtimer-Move-schedule_work-call-to-helper-thread.patch +++ b/debian/patches-rt/0103-hrtimer-Move-schedule_work-call-to-helper-thread.patch @@ -1,8 +1,8 @@ -From ca493505f2f12750ca207582fc7b6ca69cbf504e Mon Sep 17 00:00:00 2001 +From 73842c09ad741a2814a0df56dccd630cbd503cf9 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Mon, 16 Sep 2013 14:09:19 -0700 -Subject: [PATCH 103/269] hrtimer: Move schedule_work call to helper thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 103/283] hrtimer: Move schedule_work call to helper thread +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz When run ltp leapsec_timer test, the following call trace is caught: diff --git a/debian/patches-rt/0104-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch b/debian/patches-rt/0104-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch index f017782cd..145d4846d 100644 --- a/debian/patches-rt/0104-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch +++ b/debian/patches-rt/0104-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch @@ -1,9 +1,9 @@ -From 78fffa8243d75e61f9508289b2f68d2f66cf34f6 Mon Sep 17 00:00:00 2001 +From f9cb7c14dad693481c5b5dfea9223e1904a63a09 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 10:15:13 +0100 -Subject: [PATCH 104/269] hrtimer: move state change before hrtimer_cancel in +Subject: [PATCH 104/283] hrtimer: move state change before hrtimer_cancel in do_nanosleep() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz There is a small window between setting t->task to NULL and waking the task up (which would set TASK_RUNNING). So the timer would fire, run and diff --git a/debian/patches-rt/0105-posix-timers-Thread-posix-cpu-timers-on-rt.patch b/debian/patches-rt/0105-posix-timers-Thread-posix-cpu-timers-on-rt.patch index 5cb32b450..587af328b 100644 --- a/debian/patches-rt/0105-posix-timers-Thread-posix-cpu-timers-on-rt.patch +++ b/debian/patches-rt/0105-posix-timers-Thread-posix-cpu-timers-on-rt.patch @@ -1,8 +1,8 @@ -From 34b024b3a992c144a3df653c0ad623a8a69dc735 Mon Sep 17 00:00:00 2001 +From f7d44ae1ff53ff9277b2207c7987b8ffa0a65738 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Fri, 3 Jul 2009 08:29:58 -0500 -Subject: [PATCH 105/269] posix-timers: Thread posix-cpu-timers on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 105/283] posix-timers: Thread posix-cpu-timers on -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz posix-cpu-timer code takes non -rt safe locks in hard irq context. Move it to a thread. @@ -58,10 +58,10 @@ index 0b49b9cf5571..9e3362748214 100644 .thread_group = LIST_HEAD_INIT(init_task.thread_group), .thread_node = LIST_HEAD_INIT(init_signals.thread_head), diff --git a/kernel/fork.c b/kernel/fork.c -index bfe9c5c3eb88..1b8ac523aa99 100644 +index 98c971cb1d36..492bc898b09a 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1575,6 +1575,9 @@ static void rt_mutex_init_task(struct task_struct *p) +@@ -1585,6 +1585,9 @@ static void rt_mutex_init_task(struct task_struct *p) */ static void posix_cpu_timers_init(struct task_struct *tsk) { diff --git a/debian/patches-rt/0106-sched-Move-task_struct-cleanup-to-RCU.patch b/debian/patches-rt/0106-sched-Move-task_struct-cleanup-to-RCU.patch index 4a7346649..e062c4ad4 100644 --- a/debian/patches-rt/0106-sched-Move-task_struct-cleanup-to-RCU.patch +++ b/debian/patches-rt/0106-sched-Move-task_struct-cleanup-to-RCU.patch @@ -1,8 +1,8 @@ -From 3c13de2cc91a9379fe1de22e474cad11805812f9 Mon Sep 17 00:00:00 2001 +From bc6dc2730e93dec5ead183a44781b5c8bf47b3d7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 31 May 2011 16:59:16 +0200 -Subject: [PATCH 106/269] sched: Move task_struct cleanup to RCU -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 106/283] sched: Move task_struct cleanup to RCU +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz __put_task_struct() does quite some expensive work. We don't want to burden random tasks with that. @@ -58,7 +58,7 @@ index 108ede99e533..bb98c5b43f81 100644 #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT diff --git a/kernel/fork.c b/kernel/fork.c -index 1b8ac523aa99..b7e0aac93ee5 100644 +index 492bc898b09a..cba3cade3d5b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -671,7 +671,9 @@ static inline void put_signal_struct(struct signal_struct *sig) diff --git a/debian/patches-rt/0107-sched-Limit-the-number-of-task-migrations-per-batch.patch b/debian/patches-rt/0107-sched-Limit-the-number-of-task-migrations-per-batch.patch index 3e8ca0625..9303ad899 100644 --- a/debian/patches-rt/0107-sched-Limit-the-number-of-task-migrations-per-batch.patch +++ b/debian/patches-rt/0107-sched-Limit-the-number-of-task-migrations-per-batch.patch @@ -1,8 +1,8 @@ -From 043af6e53425a94e13a6648ac0206a006f2d7792 Mon Sep 17 00:00:00 2001 +From 5e09842f9bc61a1babc80804a7c2e003b56989c3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 6 Jun 2011 12:12:51 +0200 -Subject: [PATCH 107/269] sched: Limit the number of task migrations per batch -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 107/283] sched: Limit the number of task migrations per batch +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Put an upper limit on the number of tasks which are migrated per batch to avoid large latencies. @@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 4 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 4ed3b29cb0c8..f6504beff565 100644 +index 1f997ceec454..88a886c751ca 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -44,7 +44,11 @@ const_debug unsigned int sysctl_sched_features = diff --git a/debian/patches-rt/0108-sched-Move-mmdrop-to-RCU-on-RT.patch b/debian/patches-rt/0108-sched-Move-mmdrop-to-RCU-on-RT.patch index 45235952d..915e7c10a 100644 --- a/debian/patches-rt/0108-sched-Move-mmdrop-to-RCU-on-RT.patch +++ b/debian/patches-rt/0108-sched-Move-mmdrop-to-RCU-on-RT.patch @@ -1,8 +1,8 @@ -From 2870b4f8c6cadeb84fb963b2d58ffc546a4c3371 Mon Sep 17 00:00:00 2001 +From a07363220fb1b9eb6ed3a28d5eef11e4b95f6170 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 6 Jun 2011 12:20:33 +0200 -Subject: [PATCH 108/269] sched: Move mmdrop to RCU on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 108/283] sched: Move mmdrop to RCU on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. @@ -38,7 +38,7 @@ index 5ed8f6292a53..f430cf0a377e 100644 atomic_long_t hugetlb_usage; #endif diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h -index cebb79fe2c72..6e578905e4ec 100644 +index 0d10b7ce0da7..b6758c6fffbf 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -49,6 +49,17 @@ static inline void mmdrop(struct mm_struct *mm) @@ -60,7 +60,7 @@ index cebb79fe2c72..6e578905e4ec 100644 * This has to be called after a get_task_mm()/mmget_not_zero() * followed by taking the mmap_sem for writing before modifying the diff --git a/kernel/fork.c b/kernel/fork.c -index b7e0aac93ee5..857ce1a7269f 100644 +index cba3cade3d5b..098130002cda 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -637,6 +637,19 @@ void __mmdrop(struct mm_struct *mm) @@ -84,7 +84,7 @@ index b7e0aac93ee5..857ce1a7269f 100644 { struct mm_struct *mm; diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index f6504beff565..551ce1adea4a 100644 +index 88a886c751ca..0c916e7010a2 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2729,9 +2729,13 @@ static struct rq *finish_task_switch(struct task_struct *prev) diff --git a/debian/patches-rt/0109-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches-rt/0109-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index 867759931..315c1a856 100644 --- a/debian/patches-rt/0109-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches-rt/0109-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -1,9 +1,9 @@ -From 5237487b97c59d69fbd880f60b8cc9ca5414a52a Mon Sep 17 00:00:00 2001 +From fcd92c128f39749e17ad0c95cf7154f14f3b575a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 21 Nov 2016 19:31:08 +0100 -Subject: [PATCH 109/269] kernel/sched: move stack + kprobe clean up to +Subject: [PATCH 109/283] kernel/sched: move stack + kprobe clean up to __put_task_struct() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz There is no need to free the stack before the task struct (except for reasons mentioned in commit 68f24b08ee89 ("sched/core: Free the stack early if @@ -17,8 +17,6 @@ Signed-off-by: Sebastian Andrzej Siewior kernel/sched/core.c | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) -diff --git a/kernel/fork.c b/kernel/fork.c -index 857ce1a7269f..8a9241afefb0 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -40,6 +40,7 @@ @@ -29,7 +27,7 @@ index 857ce1a7269f..8a9241afefb0 100644 #include #include #include -@@ -693,6 +694,15 @@ void __put_task_struct(struct task_struct *tsk) +@@ -698,6 +699,15 @@ void __put_task_struct(struct task_struc WARN_ON(atomic_read(&tsk->usage)); WARN_ON(tsk == current); @@ -43,13 +41,11 @@ index 857ce1a7269f..8a9241afefb0 100644 + put_task_stack(tsk); + cgroup_free(tsk); - task_numa_free(tsk); + task_numa_free(tsk, true); security_task_free(tsk); -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 551ce1adea4a..788947117ed2 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2741,15 +2741,6 @@ static struct rq *finish_task_switch(struct task_struct *prev) +@@ -2741,15 +2741,6 @@ static struct rq *finish_task_switch(str if (prev->sched_class->task_dead) prev->sched_class->task_dead(prev); @@ -65,6 +61,3 @@ index 551ce1adea4a..788947117ed2 100644 put_task_struct(prev); } --- -2.20.1 - diff --git a/debian/patches-rt/0110-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch b/debian/patches-rt/0110-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch index cf1f2a1aa..f329c8016 100644 --- a/debian/patches-rt/0110-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch +++ b/debian/patches-rt/0110-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch @@ -1,9 +1,9 @@ -From 63a798ec299b7daacf684067fbe7917856193133 Mon Sep 17 00:00:00 2001 +From 1b7fcb7ee765eafbf39fa9f1427f38370c00eff3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 25 Jun 2011 09:21:04 +0200 -Subject: [PATCH 110/269] sched: Add saved_state for tasks blocked on sleeping +Subject: [PATCH 110/283] sched: Add saved_state for tasks blocked on sleeping locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Spinlocks are state preserving in !RT. RT changes the state when a task gets blocked on a lock. So we need to remember the state before @@ -40,7 +40,7 @@ index a6f2f76b1162..ad44849fba2e 100644 #ifdef CONFIG_SMP diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 788947117ed2..e7dccbb9973a 100644 +index 31d8e5828ece..5734699b0812 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1999,8 +1999,27 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) @@ -92,7 +92,7 @@ index 788947117ed2..e7dccbb9973a 100644 { return try_to_wake_up(p, state, 0); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index 4c7a837d7c14..dd6ae39957ce 100644 +index 9a7c3d08b39f..49ae30da28ee 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1443,6 +1443,7 @@ static inline int task_on_rq_migrating(struct task_struct *p) diff --git a/debian/patches-rt/0111-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch b/debian/patches-rt/0111-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch index d89326bd6..f56f6249b 100644 --- a/debian/patches-rt/0111-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch +++ b/debian/patches-rt/0111-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch @@ -1,9 +1,9 @@ -From 01cbb896854fa0cccd07b728402d50b349946011 Mon Sep 17 00:00:00 2001 +From 833fc1aa92cf522d59c1a02d410198e8ba4d1832 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 7 Jun 2011 09:19:06 +0200 -Subject: [PATCH 111/269] sched: Do not account rcu_preempt_depth on RT in +Subject: [PATCH 111/283] sched: Do not account rcu_preempt_depth on RT in might_sleep() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h -index 75e5b393cf44..0539f55bf7b3 100644 +index e102c5bccbb9..87eafcb3312f 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -73,6 +73,11 @@ void synchronize_rcu(void); @@ -30,7 +30,7 @@ index 75e5b393cf44..0539f55bf7b3 100644 #else /* #ifdef CONFIG_PREEMPT_RCU */ -@@ -98,6 +103,8 @@ static inline int rcu_preempt_depth(void) +@@ -96,6 +101,8 @@ static inline int rcu_preempt_depth(void) return 0; } @@ -40,7 +40,7 @@ index 75e5b393cf44..0539f55bf7b3 100644 /* Internal to kernel */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index e7dccbb9973a..8033a8f4efdd 100644 +index 5734699b0812..0be1cc1120db 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6156,7 +6156,7 @@ void __init sched_init(void) diff --git a/debian/patches-rt/0112-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch b/debian/patches-rt/0112-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch index fd3df9353..0b1338fbb 100644 --- a/debian/patches-rt/0112-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch +++ b/debian/patches-rt/0112-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch @@ -1,8 +1,8 @@ -From 575557e0c67be96034f9528399a7b7361dae5dd2 Mon Sep 17 00:00:00 2001 +From be9eeaeabb9966cc740ca075b3bbffe54b2506a4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 22:51:33 +0200 -Subject: [PATCH 112/269] sched: Use the proper LOCK_OFFSET for cond_resched() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 112/283] sched: Use the proper LOCK_OFFSET for cond_resched() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz RT does not increment preempt count when a 'sleeping' spinlock is locked. Update PREEMPT_LOCK_OFFSET for that case. diff --git a/debian/patches-rt/0113-sched-Disable-TTWU_QUEUE-on-RT.patch b/debian/patches-rt/0113-sched-Disable-TTWU_QUEUE-on-RT.patch index ddfc9d47b..2744a2aef 100644 --- a/debian/patches-rt/0113-sched-Disable-TTWU_QUEUE-on-RT.patch +++ b/debian/patches-rt/0113-sched-Disable-TTWU_QUEUE-on-RT.patch @@ -1,8 +1,8 @@ -From 5e05ad5c470039b646a457459138f582bc139f3f Mon Sep 17 00:00:00 2001 +From a6ae12a40e837ece98c723e624820e41421b70a0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 13 Sep 2011 16:42:35 +0200 -Subject: [PATCH 113/269] sched: Disable TTWU_QUEUE on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 113/283] sched: Disable TTWU_QUEUE on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The queued remote wakeup mechanism can introduce rather large latencies if the number of migrated tasks is high. Disable it for RT. diff --git a/debian/patches-rt/0114-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/debian/patches-rt/0114-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch index c205ddf88..3175b2a1d 100644 --- a/debian/patches-rt/0114-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +++ b/debian/patches-rt/0114-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch @@ -1,9 +1,9 @@ -From 1241476225268360ae571ec5de750f504cac3604 Mon Sep 17 00:00:00 2001 +From 4ad0a976dcfe34e35355f20f464dd7eb08dd38e5 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Mon, 18 Mar 2013 15:12:49 -0400 -Subject: [PATCH 114/269] sched/workqueue: Only wake up idle workers if not +Subject: [PATCH 114/283] sched/workqueue: Only wake up idle workers if not blocked on sleeping spin lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In -rt, most spin_locks() turn into mutexes. One of these spin_lock conversions is performed on the workqueue gcwq->lock. When the idle @@ -25,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 8033a8f4efdd..acca3e94ee27 100644 +index 0be1cc1120db..5ca8f53ba4fd 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3498,8 +3498,10 @@ static void __sched notrace __schedule(bool preempt) diff --git a/debian/patches-rt/0115-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/debian/patches-rt/0115-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index cf99cdbc8..59f82e9da 100644 --- a/debian/patches-rt/0115-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/debian/patches-rt/0115-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch @@ -1,9 +1,9 @@ -From 5fe7427b8a7b38b8b395ce68c2c6cb06b2f95a58 Mon Sep 17 00:00:00 2001 +From 807cb05d929f39b81b980b673d69ea33c6473b96 Mon Sep 17 00:00:00 2001 From: Daniel Bristot de Oliveira Date: Mon, 26 Jun 2017 17:07:15 +0200 -Subject: [PATCH 115/269] rt: Increase/decrease the nr of migratory tasks when +Subject: [PATCH 115/283] rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz There is a problem in the migrate_disable()/enable() implementation regarding the number of migratory tasks in the rt/dl RQs. The problem @@ -82,10 +82,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index acca3e94ee27..eb752804e8cf 100644 +index 5ca8f53ba4fd..434fd8946629 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7140,6 +7140,47 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7147,6 +7147,47 @@ const u32 sched_prio_to_wmult[40] = { #if defined(CONFIG_PREEMPT_COUNT) && defined(CONFIG_SMP) @@ -133,7 +133,7 @@ index acca3e94ee27..eb752804e8cf 100644 void migrate_disable(void) { struct task_struct *p = current; -@@ -7163,10 +7204,9 @@ void migrate_disable(void) +@@ -7170,10 +7211,9 @@ void migrate_disable(void) } preempt_disable(); @@ -146,7 +146,7 @@ index acca3e94ee27..eb752804e8cf 100644 preempt_enable(); } -@@ -7198,9 +7238,8 @@ void migrate_enable(void) +@@ -7205,9 +7245,8 @@ void migrate_enable(void) preempt_disable(); diff --git a/debian/patches-rt/0116-hotplug-Lightweight-get-online-cpus.patch b/debian/patches-rt/0116-hotplug-Lightweight-get-online-cpus.patch index bfff24d5d..e96427823 100644 --- a/debian/patches-rt/0116-hotplug-Lightweight-get-online-cpus.patch +++ b/debian/patches-rt/0116-hotplug-Lightweight-get-online-cpus.patch @@ -1,8 +1,8 @@ -From 1e1a0808ffc8df10c6bc1e46f40a4948395f72a6 Mon Sep 17 00:00:00 2001 +From 6c5886f66d8a616f3294c2fd8ca26b4c638e430b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 15 Jun 2011 12:36:06 +0200 -Subject: [PATCH 116/269] hotplug: Lightweight get online cpus -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 116/283] hotplug: Lightweight get online cpus +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only @@ -20,10 +20,10 @@ Signed-off-by: Thomas Gleixner 3 files changed, 24 insertions(+) diff --git a/include/linux/cpu.h b/include/linux/cpu.h -index 5041357d0297..3403eab853b7 100644 +index 006f69f9277b..d45ea5c98cdd 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h -@@ -111,6 +111,8 @@ extern void cpu_hotplug_disable(void); +@@ -113,6 +113,8 @@ extern void cpu_hotplug_disable(void); extern void cpu_hotplug_enable(void); void clear_tasks_mm_cpumask(int cpu); int cpu_down(unsigned int cpu); @@ -32,7 +32,7 @@ index 5041357d0297..3403eab853b7 100644 #else /* CONFIG_HOTPLUG_CPU */ -@@ -122,6 +124,9 @@ static inline int cpus_read_trylock(void) { return true; } +@@ -124,6 +126,9 @@ static inline int cpus_read_trylock(void) { return true; } static inline void lockdep_assert_cpus_held(void) { } static inline void cpu_hotplug_disable(void) { } static inline void cpu_hotplug_enable(void) { } @@ -43,7 +43,7 @@ index 5041357d0297..3403eab853b7 100644 /* Wrappers which go away once all code is converted */ diff --git a/kernel/cpu.c b/kernel/cpu.c -index dc250ec2c096..f684f41492d3 100644 +index 46aefe5c0e35..9001e1779325 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -281,6 +281,21 @@ static int cpu_hotplug_disabled; @@ -69,10 +69,10 @@ index dc250ec2c096..f684f41492d3 100644 void cpus_read_lock(void) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index eb752804e8cf..516f05702550 100644 +index 434fd8946629..a8e9283f018c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7204,6 +7204,7 @@ void migrate_disable(void) +@@ -7211,6 +7211,7 @@ void migrate_disable(void) } preempt_disable(); @@ -80,7 +80,7 @@ index eb752804e8cf..516f05702550 100644 migrate_disable_update_cpus_allowed(p); p->migrate_disable = 1; -@@ -7269,12 +7270,15 @@ void migrate_enable(void) +@@ -7276,12 +7277,15 @@ void migrate_enable(void) arg.task = p; arg.dest_cpu = dest_cpu; diff --git a/debian/patches-rt/0117-trace-Add-migrate-disabled-counter-to-tracing-output.patch b/debian/patches-rt/0117-trace-Add-migrate-disabled-counter-to-tracing-output.patch index e3b1502d8..8fe3a5b4d 100644 --- a/debian/patches-rt/0117-trace-Add-migrate-disabled-counter-to-tracing-output.patch +++ b/debian/patches-rt/0117-trace-Add-migrate-disabled-counter-to-tracing-output.patch @@ -1,8 +1,8 @@ -From e93174d8da86d81922b37dd559f026f1eb4cafb8 Mon Sep 17 00:00:00 2001 +From cea179e4bc61a9548573e2f5ece3e78b976c35eb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:56:42 +0200 -Subject: [PATCH 117/269] trace: Add migrate-disabled counter to tracing output -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 117/283] trace: Add migrate-disabled counter to tracing output +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Signed-off-by: Thomas Gleixner --- @@ -26,10 +26,10 @@ index 78a010e19ed4..0403d9696944 100644 #define TRACE_EVENT_TYPE_MAX \ diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index c65cea71d1ee..0af14953d52d 100644 +index 3b0de19b9ed7..496c5d358010 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2146,6 +2146,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, +@@ -2149,6 +2149,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, ((pc & SOFTIRQ_OFFSET) ? TRACE_FLAG_SOFTIRQ : 0) | (tif_need_resched() ? TRACE_FLAG_NEED_RESCHED : 0) | (test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0); @@ -38,7 +38,7 @@ index c65cea71d1ee..0af14953d52d 100644 } EXPORT_SYMBOL_GPL(tracing_generic_entry_update); -@@ -3349,9 +3351,10 @@ static void print_lat_help_header(struct seq_file *m) +@@ -3352,9 +3354,10 @@ static void print_lat_help_header(struct seq_file *m) "# | / _----=> need-resched \n" "# || / _---=> hardirq/softirq \n" "# ||| / _--=> preempt-depth \n" @@ -53,7 +53,7 @@ index c65cea71d1ee..0af14953d52d 100644 static void print_event_info(struct trace_buffer *buf, struct seq_file *m) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c -index f94be0c2827b..acdb2c2067c6 100644 +index 7345f5f8f3fe..6455e2ca7987 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -188,6 +188,8 @@ static int trace_define_common_fields(void) diff --git a/debian/patches-rt/0118-lockdep-Make-it-RT-aware.patch b/debian/patches-rt/0118-lockdep-Make-it-RT-aware.patch index 5377b21e8..b4f11ee47 100644 --- a/debian/patches-rt/0118-lockdep-Make-it-RT-aware.patch +++ b/debian/patches-rt/0118-lockdep-Make-it-RT-aware.patch @@ -1,8 +1,8 @@ -From 1a31bace22b513efaa0864bd1d32d7d4c698a618 Mon Sep 17 00:00:00 2001 +From d2810fd8e650b96863a15b748cf385698ecde121 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 18:51:23 +0200 -Subject: [PATCH 118/269] lockdep: Make it RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 118/283] lockdep: Make it RT aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz teach lockdep that we don't really do softirqs on -RT. diff --git a/debian/patches-rt/0119-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch b/debian/patches-rt/0119-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch index 693d055a2..33a3f725b 100644 --- a/debian/patches-rt/0119-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch +++ b/debian/patches-rt/0119-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch @@ -1,9 +1,9 @@ -From f0dbaae62eb8d03e46818d0babb5889b3a5ce6eb Mon Sep 17 00:00:00 2001 +From bb78f12d34959257b4413ff817644ce7477a93cd Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Tue, 29 Nov 2011 20:18:22 -0500 -Subject: [PATCH 119/269] tasklet: Prevent tasklets from going into infinite +Subject: [PATCH 119/283] tasklet: Prevent tasklets from going into infinite spin in RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with diff --git a/debian/patches-rt/0120-softirq-Check-preemption-after-reenabling-interrupts.patch b/debian/patches-rt/0120-softirq-Check-preemption-after-reenabling-interrupts.patch index 7276a816c..dd2ac2daa 100644 --- a/debian/patches-rt/0120-softirq-Check-preemption-after-reenabling-interrupts.patch +++ b/debian/patches-rt/0120-softirq-Check-preemption-after-reenabling-interrupts.patch @@ -1,8 +1,8 @@ -From dcfab76d9eab264a1e79cc42713a004d2ef7658b Mon Sep 17 00:00:00 2001 +From 573f3d4984a2aa2239e4e28c0df1dc28517397d2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 13 Nov 2011 17:17:09 +0100 -Subject: [PATCH 120/269] softirq: Check preemption after reenabling interrupts -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 120/283] softirq: Check preemption after reenabling interrupts +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, @@ -117,7 +117,7 @@ index 86a709954f5a..9c069ef83d6d 100644 return 0; } diff --git a/net/core/dev.c b/net/core/dev.c -index 3bcec116a5f2..3362d8897058 100644 +index 138951d28643..48c4dc728d1b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2726,6 +2726,7 @@ static void __netif_reschedule(struct Qdisc *q) diff --git a/debian/patches-rt/0121-softirq-Disable-softirq-stacks-for-RT.patch b/debian/patches-rt/0121-softirq-Disable-softirq-stacks-for-RT.patch index 042b36d4a..de34e0405 100644 --- a/debian/patches-rt/0121-softirq-Disable-softirq-stacks-for-RT.patch +++ b/debian/patches-rt/0121-softirq-Disable-softirq-stacks-for-RT.patch @@ -1,8 +1,8 @@ -From 7a6ae7f96331bdaeeac96006086d01805ca48612 Mon Sep 17 00:00:00 2001 +From ac1ed27a8471e837c8ea8811ca8322f47f47add2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 13:59:17 +0200 -Subject: [PATCH 121/269] softirq: Disable softirq stacks for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 121/283] softirq: Disable softirq stacks for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. @@ -120,10 +120,10 @@ index 713670e6d13d..5dfc715343f9 100644 #ifdef CONFIG_HOTPLUG_CPU void fixup_irqs(void) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S -index 617df50a11d9..ce2a6587ed11 100644 +index c90e00db5c13..7b29f2c10d01 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -1043,6 +1043,7 @@ bad_gs: +@@ -1059,6 +1059,7 @@ bad_gs: jmp 2b .previous @@ -131,7 +131,7 @@ index 617df50a11d9..ce2a6587ed11 100644 /* Call softirq on interrupt stack. Interrupts are off. */ ENTRY(do_softirq_own_stack) pushq %rbp -@@ -1053,6 +1054,7 @@ ENTRY(do_softirq_own_stack) +@@ -1069,6 +1070,7 @@ ENTRY(do_softirq_own_stack) leaveq ret ENDPROC(do_softirq_own_stack) diff --git a/debian/patches-rt/0122-softirq-Split-softirq-locks.patch b/debian/patches-rt/0122-softirq-Split-softirq-locks.patch index 32f916ee3..958219614 100644 --- a/debian/patches-rt/0122-softirq-Split-softirq-locks.patch +++ b/debian/patches-rt/0122-softirq-Split-softirq-locks.patch @@ -1,8 +1,8 @@ -From 35e1d70c2ede4d34ff411570acf377f7ffe77e70 Mon Sep 17 00:00:00 2001 +From 92ea7fb3bb1aa31dbfaa1aa02e6a83b3d5e2e476 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 4 Oct 2012 14:20:47 +0100 -Subject: [PATCH 122/269] softirq: Split softirq locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 122/283] softirq: Split softirq locks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The 3.x RT series removed the split softirq implementation in favour of pushing softirq processing into the context of the thread which @@ -199,7 +199,7 @@ index ad44849fba2e..7ecccccbd358 100644 #define PF_EXITING 0x00000004 /* Getting shut down */ #define PF_EXITPIDONE 0x00000008 /* PI exit done on shut down */ diff --git a/init/main.c b/init/main.c -index e083fac08aed..1647cb052be5 100644 +index 020972fed117..4a7471606e53 100644 --- a/init/main.c +++ b/init/main.c @@ -561,6 +561,7 @@ asmlinkage __visible void __init start_kernel(void) diff --git a/debian/patches-rt/0123-net-core-use-local_bh_disable-in-netif_rx_ni.patch b/debian/patches-rt/0123-net-core-use-local_bh_disable-in-netif_rx_ni.patch index e6d362ce3..0ba701a49 100644 --- a/debian/patches-rt/0123-net-core-use-local_bh_disable-in-netif_rx_ni.patch +++ b/debian/patches-rt/0123-net-core-use-local_bh_disable-in-netif_rx_ni.patch @@ -1,8 +1,8 @@ -From e4b4f2fba2b81120beca06cd1c49f37ceb8bd9c2 Mon Sep 17 00:00:00 2001 +From 05b2969dc9be8c70c6bac548cf956a1d14d905f5 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 16 Jun 2017 19:03:16 +0200 -Subject: [PATCH 123/269] net/core: use local_bh_disable() in netif_rx_ni() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 123/283] net/core: use local_bh_disable() in netif_rx_ni() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In 2004 netif_rx_ni() gained a preempt_disable() section around netif_rx() and its do_softirq() + testing for it. The do_softirq() part @@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c -index 3362d8897058..b8208b940b5d 100644 +index 48c4dc728d1b..abaf8a73403b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4526,11 +4526,9 @@ int netif_rx_ni(struct sk_buff *skb) diff --git a/debian/patches-rt/0124-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch b/debian/patches-rt/0124-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch index 90d3ccc48..262b0c22e 100644 --- a/debian/patches-rt/0124-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch +++ b/debian/patches-rt/0124-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch @@ -1,9 +1,9 @@ -From 68c9fb7ded900fff5f4e0a41978b36eb36292c66 Mon Sep 17 00:00:00 2001 +From c1e610ee580a46e958b904e4b2ec3c0d701e08d1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 31 Jan 2012 13:01:27 +0100 -Subject: [PATCH 124/269] genirq: Allow disabling of softirq processing in irq +Subject: [PATCH 124/283] genirq: Allow disabling of softirq processing in irq thread context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The processing of softirqs in irq thread context is a performance gain for the non-rt workloads of a system, but it's counterproductive for @@ -69,10 +69,10 @@ index c9bffda04a45..73d3146db74d 100644 #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index d2270f61d335..ba5bba5f1ffd 100644 +index af2a8757abfb..69b4bfd4654c 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -973,7 +973,15 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) +@@ -978,7 +978,15 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) atomic_inc(&desc->threads_handled); irq_finalize_oneshot(desc, action); @@ -89,7 +89,7 @@ index d2270f61d335..ba5bba5f1ffd 100644 return ret; } -@@ -1483,6 +1491,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) +@@ -1488,6 +1496,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) irqd_set(&desc->irq_data, IRQD_NO_BALANCING); } diff --git a/debian/patches-rt/0125-softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/debian/patches-rt/0125-softirq-split-timer-softirqs-out-of-ksoftirqd.patch index 75c14654e..c2b0b2aa6 100644 --- a/debian/patches-rt/0125-softirq-split-timer-softirqs-out-of-ksoftirqd.patch +++ b/debian/patches-rt/0125-softirq-split-timer-softirqs-out-of-ksoftirqd.patch @@ -1,8 +1,8 @@ -From 5b5c9a38190fcf09aad69449f6552598a2502bf8 Mon Sep 17 00:00:00 2001 +From 9d4b8d35c23cd7cece2662fa17dea28d39f73e82 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 16:34:17 +0100 -Subject: [PATCH 125/269] softirq: split timer softirqs out of ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 125/283] softirq: split timer softirqs out of ksoftirqd +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The softirqd runs in -RT with SCHED_FIFO (prio 1) and deals mostly with timer wakeup which can not happen in hardirq context. The prio has been diff --git a/debian/patches-rt/0126-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch b/debian/patches-rt/0126-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch index 37469d4fe..5ccc63ea6 100644 --- a/debian/patches-rt/0126-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch +++ b/debian/patches-rt/0126-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch @@ -1,9 +1,9 @@ -From f76ac7c02f06f8b40b041c7b9ff9bc13c55bb353 Mon Sep 17 00:00:00 2001 +From 75bef693f46a9a3fd05cda70554c004df275c92b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 18 Feb 2019 13:19:59 +0100 -Subject: [PATCH 126/269] softirq: Avoid "local_softirq_pending" messages if +Subject: [PATCH 126/283] softirq: Avoid "local_softirq_pending" messages if ksoftirqd is blocked -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz If the ksoftirqd thread has a softirq pending and is blocked on the `local_softirq_locks' lock then softirq_check_pending_idle() won't diff --git a/debian/patches-rt/0127-softirq-Avoid-local_softirq_pending-messages-if-task.patch b/debian/patches-rt/0127-softirq-Avoid-local_softirq_pending-messages-if-task.patch index 9910e3465..5158e8a43 100644 --- a/debian/patches-rt/0127-softirq-Avoid-local_softirq_pending-messages-if-task.patch +++ b/debian/patches-rt/0127-softirq-Avoid-local_softirq_pending-messages-if-task.patch @@ -1,9 +1,9 @@ -From 35b95587b8a912221d7eb0bdbb7aefb126c7db5d Mon Sep 17 00:00:00 2001 +From fffcebd7dd6c2220fd06db35bffa957b6d4f3de1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 19 Feb 2019 16:49:29 +0100 -Subject: [PATCH 127/269] softirq: Avoid "local_softirq_pending" messages if +Subject: [PATCH 127/283] softirq: Avoid "local_softirq_pending" messages if task is in cpu_chill() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz If the softirq thread enters cpu_chill() then ->state is UNINTERRUPTIBLE and has no ->pi_blocked_on set and so its mask is not taken into account. diff --git a/debian/patches-rt/0128-rtmutex-trylock-is-okay-on-RT.patch b/debian/patches-rt/0128-rtmutex-trylock-is-okay-on-RT.patch index 341dcdf79..eb4c01b2e 100644 --- a/debian/patches-rt/0128-rtmutex-trylock-is-okay-on-RT.patch +++ b/debian/patches-rt/0128-rtmutex-trylock-is-okay-on-RT.patch @@ -1,8 +1,8 @@ -From 86d0b19c922c5c25ec598f869e859be148c058e2 Mon Sep 17 00:00:00 2001 +From e35f309a9eb6078f3d09d042b9ebcff7612d9398 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 2 Dec 2015 11:34:07 +0100 -Subject: [PATCH 128/269] rtmutex: trylock is okay on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 128/283] rtmutex: trylock is okay on -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz non-RT kernel could deadlock on rt_mutex_trylock() in softirq context. On -RT we don't run softirqs in IRQ context but in thread context so it is diff --git a/debian/patches-rt/0129-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/debian/patches-rt/0129-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index 6e6c066c2..c75eb6174 100644 --- a/debian/patches-rt/0129-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/debian/patches-rt/0129-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,8 +1,8 @@ -From 8e56a215d6f5df86b3cfcf2386facd511db3d0ed Mon Sep 17 00:00:00 2001 +From 2755280eb692ac3db15304cb7874d039103cf43f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 15 Sep 2016 10:51:27 +0200 -Subject: [PATCH 129/269] fs/nfs: turn rmdir_sem into a semaphore -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 129/283] fs/nfs: turn rmdir_sem into a semaphore +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The RW semaphore had a reader side which used the _non_owner version because it most likely took the reader lock in one thread and released it diff --git a/debian/patches-rt/0130-rtmutex-Handle-the-various-new-futex-race-conditions.patch b/debian/patches-rt/0130-rtmutex-Handle-the-various-new-futex-race-conditions.patch index 9213d7d3e..a4c54e174 100644 --- a/debian/patches-rt/0130-rtmutex-Handle-the-various-new-futex-race-conditions.patch +++ b/debian/patches-rt/0130-rtmutex-Handle-the-various-new-futex-race-conditions.patch @@ -1,8 +1,8 @@ -From 915b60215e529acc7c55ded1a85af2ad92a5c9c3 Mon Sep 17 00:00:00 2001 +From 7130157f0703b4fe45ca427befd9ef0a7f88612f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 10 Jun 2011 11:04:15 +0200 -Subject: [PATCH 130/269] rtmutex: Handle the various new futex race conditions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 130/283] rtmutex: Handle the various new futex race conditions +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz RT opens a few new interesting race conditions in the rtmutex/futex combo due to futex hash bucket lock being a 'sleeping' spinlock and @@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner 3 files changed, 94 insertions(+), 21 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c -index fadd9bff6e3c..be06626b29d2 100644 +index ccf933ac2997..b2a90c66d8f4 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -2146,6 +2146,16 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, @@ -36,7 +36,7 @@ index fadd9bff6e3c..be06626b29d2 100644 } else if (ret) { /* * rt_mutex_start_proxy_lock() detected a -@@ -3194,7 +3204,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3224,7 +3234,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, struct hrtimer_sleeper timeout, *to = NULL; struct futex_pi_state *pi_state = NULL; struct rt_mutex_waiter rt_waiter; @@ -45,7 +45,7 @@ index fadd9bff6e3c..be06626b29d2 100644 union futex_key key2 = FUTEX_KEY_INIT; struct futex_q q = futex_q_init; int res, ret; -@@ -3252,20 +3262,55 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3282,20 +3292,55 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, /* Queue the futex_q, drop the hb lock, wait for wakeup. */ futex_wait_queue_me(hb, &q, to); @@ -112,7 +112,7 @@ index fadd9bff6e3c..be06626b29d2 100644 /* Check if the requeue code acquired the second futex for us. */ if (!q.rt_waiter) { -@@ -3274,7 +3319,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3304,7 +3349,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, * did a lock-steal - fix up the PI-state in that case. */ if (q.pi_state && (q.pi_state->owner != current)) { @@ -122,7 +122,7 @@ index fadd9bff6e3c..be06626b29d2 100644 ret = fixup_pi_state_owner(uaddr2, &q, current); if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { pi_state = q.pi_state; -@@ -3285,7 +3331,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3315,7 +3361,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, * the requeue_pi() code acquired for us. */ put_pi_state(q.pi_state); @@ -131,7 +131,7 @@ index fadd9bff6e3c..be06626b29d2 100644 } } else { struct rt_mutex *pi_mutex; -@@ -3299,7 +3345,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3329,7 +3375,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, pi_mutex = &q.pi_state->pi_mutex; ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); diff --git a/debian/patches-rt/0131-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch b/debian/patches-rt/0131-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch index f69b29857..7e5dd04d3 100644 --- a/debian/patches-rt/0131-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch +++ b/debian/patches-rt/0131-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch @@ -1,8 +1,8 @@ -From c1664acee8627620a0406cc55b13d81c710f2bac Mon Sep 17 00:00:00 2001 +From 7e148d447a1c2abcfba79f0d7cefeeb24350ca70 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 131/269] futex: Fix bug on when a requeued RT task times out -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 131/283] futex: Fix bug on when a requeued RT task times out +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Requeue with timeout causes a bug with PREEMPT_RT_FULL. diff --git a/debian/patches-rt/0132-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches-rt/0132-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index dcdead6f8..634b9e044 100644 --- a/debian/patches-rt/0132-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/debian/patches-rt/0132-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch @@ -1,9 +1,9 @@ -From 03de38c7dbb4653aa5f13353b834b6be244a727d Mon Sep 17 00:00:00 2001 +From aee00b9108ae7ac1108f577b3bbdfd0b34709904 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 1 Mar 2013 11:17:42 +0100 -Subject: [PATCH 132/269] futex: Ensure lock/unlock symetry versus pi_lock and +Subject: [PATCH 132/283] futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In exit_pi_state_list() we have the following locking construct: @@ -32,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 2 insertions(+) diff --git a/kernel/futex.c b/kernel/futex.c -index be06626b29d2..eeb3e16fb9ec 100644 +index b2a90c66d8f4..4d6501d689b5 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -918,7 +918,9 @@ void exit_pi_state_list(struct task_struct *curr) diff --git a/debian/patches-rt/0133-pid.h-include-atomic.h.patch b/debian/patches-rt/0133-pid.h-include-atomic.h.patch index 534c72dda..7a8b04cf3 100644 --- a/debian/patches-rt/0133-pid.h-include-atomic.h.patch +++ b/debian/patches-rt/0133-pid.h-include-atomic.h.patch @@ -1,8 +1,8 @@ -From fab65ac89d2148c60793f1043b3391b8431674d1 Mon Sep 17 00:00:00 2001 +From 6a4de7464f4d9165d37b0649a2b3e15f4cb64385 Mon Sep 17 00:00:00 2001 From: Grygorii Strashko Date: Tue, 21 Jul 2015 19:43:56 +0300 -Subject: [PATCH 133/269] pid.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 133/283] pid.h: include atomic.h +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz This patch fixes build error: CC kernel/pid_namespace.o diff --git a/debian/patches-rt/0134-arm-include-definition-for-cpumask_t.patch b/debian/patches-rt/0134-arm-include-definition-for-cpumask_t.patch index e284a5a9b..1b034b8ca 100644 --- a/debian/patches-rt/0134-arm-include-definition-for-cpumask_t.patch +++ b/debian/patches-rt/0134-arm-include-definition-for-cpumask_t.patch @@ -1,8 +1,8 @@ -From 3286a3abb2234e5ecf7605154781fbd762b3d726 Mon Sep 17 00:00:00 2001 +From 7a6eaa6b88680cbb1309983cc198a08c1bccacfa Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Dec 2016 17:28:33 +0100 -Subject: [PATCH 134/269] arm: include definition for cpumask_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 134/283] arm: include definition for cpumask_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz This definition gets pulled in by other files. With the (later) split of RCU and spinlock.h it won't compile anymore. diff --git a/debian/patches-rt/0135-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/debian/patches-rt/0135-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index 3bb462a97..7cfcb3560 100644 --- a/debian/patches-rt/0135-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/debian/patches-rt/0135-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch @@ -1,9 +1,9 @@ -From 55274d88157f847bb93b54d4b3c0d569995b8443 Mon Sep 17 00:00:00 2001 +From 9043ba063f09071ec009efc5a340864f46b5d660 Mon Sep 17 00:00:00 2001 From: "Wolfgang M. Reimer" Date: Tue, 21 Jul 2015 16:20:07 +0200 -Subject: [PATCH 135/269] locking: locktorture: Do NOT include rwlock.h +Subject: [PATCH 135/283] locking: locktorture: Do NOT include rwlock.h directly -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Including rwlock.h directly will cause kernel builds to fail if CONFIG_PREEMPT_RT_FULL is defined. The correct header file diff --git a/debian/patches-rt/0136-rtmutex-Add-rtmutex_lock_killable.patch b/debian/patches-rt/0136-rtmutex-Add-rtmutex_lock_killable.patch index a4e09b0c5..00ae29b57 100644 --- a/debian/patches-rt/0136-rtmutex-Add-rtmutex_lock_killable.patch +++ b/debian/patches-rt/0136-rtmutex-Add-rtmutex_lock_killable.patch @@ -1,8 +1,8 @@ -From 84d0c68fcaa44acc03d15941d982f4a0157903d0 Mon Sep 17 00:00:00 2001 +From 471f3ddc1d39e94a3bb7b3de877630a7ba33e9ed Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 9 Jun 2011 11:43:52 +0200 -Subject: [PATCH 136/269] rtmutex: Add rtmutex_lock_killable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 136/283] rtmutex: Add rtmutex_lock_killable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Add "killable" type to rtmutex. We need this since rtmutex are used as "normal" mutexes which do use this type. diff --git a/debian/patches-rt/0137-rtmutex-Make-lock_killable-work.patch b/debian/patches-rt/0137-rtmutex-Make-lock_killable-work.patch index decc8bf81..c3a8a643c 100644 --- a/debian/patches-rt/0137-rtmutex-Make-lock_killable-work.patch +++ b/debian/patches-rt/0137-rtmutex-Make-lock_killable-work.patch @@ -1,8 +1,8 @@ -From 05fb36753dd6a8fb6b5af57e77d7f195083d3348 Mon Sep 17 00:00:00 2001 +From f8590dc009d4339ab04d322fbc87a267824eb97f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 1 Apr 2017 12:50:59 +0200 -Subject: [PATCH 137/269] rtmutex: Make lock_killable work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 137/283] rtmutex: Make lock_killable work +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. diff --git a/debian/patches-rt/0138-spinlock-Split-the-lock-types-header.patch b/debian/patches-rt/0138-spinlock-Split-the-lock-types-header.patch index 8b5847373..60860d0e0 100644 --- a/debian/patches-rt/0138-spinlock-Split-the-lock-types-header.patch +++ b/debian/patches-rt/0138-spinlock-Split-the-lock-types-header.patch @@ -1,8 +1,8 @@ -From 8eee663cf2becdb10a170336c2cf3fba5fe3be80 Mon Sep 17 00:00:00 2001 +From 2211e897694e1560a1b5b5e552c2321e131dacc3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 19:34:01 +0200 -Subject: [PATCH 138/269] spinlock: Split the lock types header -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 138/283] spinlock: Split the lock types header +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Split raw_spinlock into its own file and the remaining spinlock_t into its own non-RT header. The non-RT header will be replaced later by sleeping diff --git a/debian/patches-rt/0139-rtmutex-Avoid-include-hell.patch b/debian/patches-rt/0139-rtmutex-Avoid-include-hell.patch index 30b194ad2..784721eea 100644 --- a/debian/patches-rt/0139-rtmutex-Avoid-include-hell.patch +++ b/debian/patches-rt/0139-rtmutex-Avoid-include-hell.patch @@ -1,8 +1,8 @@ -From a006197b4fa5fcec0fd8bee40072cf420689c354 Mon Sep 17 00:00:00 2001 +From eac9084f86148510c6c67ed209d33fcb15fb8b94 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 20:06:39 +0200 -Subject: [PATCH 139/269] rtmutex: Avoid include hell -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 139/283] rtmutex: Avoid include hell +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Include only the required raw types. This avoids pulling in the complete spinlock header which in turn requires rtmutex.h at some point. diff --git a/debian/patches-rt/0140-rbtree-don-t-include-the-rcu-header.patch b/debian/patches-rt/0140-rbtree-don-t-include-the-rcu-header.patch index d756d2d09..5fd2e6254 100644 --- a/debian/patches-rt/0140-rbtree-don-t-include-the-rcu-header.patch +++ b/debian/patches-rt/0140-rbtree-don-t-include-the-rcu-header.patch @@ -1,11 +1,11 @@ -From 3465bbb3bbbf562cd3d67f1c2f387eaa48a1af70 Mon Sep 17 00:00:00 2001 +From ac40e3b4806fe59befb8c9387e7bb317a560cd9a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 26 Feb 2019 16:56:02 +0100 -Subject: [PATCH 140/269] rbtree: don't include the rcu header +Subject: [PATCH 140/283] rbtree: don't include the rcu header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The RCU header pulls in spinlock.h and fails due not yet defined types: @@ -104,7 +104,7 @@ index 000000000000..7066962a4379 + +#endif diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h -index 0539f55bf7b3..63cd0a1a99a0 100644 +index 87eafcb3312f..b73715c3c3c2 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -42,6 +42,7 @@ @@ -115,7 +115,7 @@ index 0539f55bf7b3..63cd0a1a99a0 100644 #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) -@@ -371,54 +372,6 @@ static inline void rcu_preempt_sleep_check(void) { } +@@ -369,54 +370,6 @@ static inline void rcu_preempt_sleep_check(void) { } ((typeof(*p) __force __kernel *)(________p1)); \ }) diff --git a/debian/patches-rt/0141-rtmutex-Provide-rt_mutex_slowlock_locked.patch b/debian/patches-rt/0141-rtmutex-Provide-rt_mutex_slowlock_locked.patch index e4224d0b8..1745d19cb 100644 --- a/debian/patches-rt/0141-rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/debian/patches-rt/0141-rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,8 +1,8 @@ -From 28e2025df13c6a1c66fae452e91d26f8d2755460 Mon Sep 17 00:00:00 2001 +From 701e93b4c6964c05cec92d9611c50dc83a6b6b9b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:14:22 +0200 -Subject: [PATCH 141/269] rtmutex: Provide rt_mutex_slowlock_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 141/283] rtmutex: Provide rt_mutex_slowlock_locked() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. diff --git a/debian/patches-rt/0142-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/debian/patches-rt/0142-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index 56e5144a2..840bf9938 100644 --- a/debian/patches-rt/0142-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/debian/patches-rt/0142-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch @@ -1,9 +1,9 @@ -From cc9444912602fb283e5e75dc9ca36ee98cf8d0e9 Mon Sep 17 00:00:00 2001 +From 8bd2090cb448193446dee9a6a7fb661e89263f46 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:36:39 +0200 -Subject: [PATCH 142/269] rtmutex: export lockdep-less version of rt_mutex's +Subject: [PATCH 142/283] rtmutex: export lockdep-less version of rt_mutex's lock, trylock and unlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Required for lock implementation ontop of rtmutex. diff --git a/debian/patches-rt/0143-rtmutex-add-sleeping-lock-implementation.patch b/debian/patches-rt/0143-rtmutex-add-sleeping-lock-implementation.patch index 863cef503..6cf19578b 100644 --- a/debian/patches-rt/0143-rtmutex-add-sleeping-lock-implementation.patch +++ b/debian/patches-rt/0143-rtmutex-add-sleeping-lock-implementation.patch @@ -1,8 +1,8 @@ -From 162034b085d74f4c4131bf4dc0c229a4c971cfae Mon Sep 17 00:00:00 2001 +From 966d9bcd54442c2ae5dd15f89a908539d6ad7137 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:11:19 +0200 -Subject: [PATCH 143/269] rtmutex: add sleeping lock implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 143/283] rtmutex: add sleeping lock implementation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior @@ -23,7 +23,7 @@ Signed-off-by: Sebastian Andrzej Siewior create mode 100644 include/linux/spinlock_types_rt.h diff --git a/include/linux/kernel.h b/include/linux/kernel.h -index d6aac75b51ba..e3f1a7c3b953 100644 +index 3d83ebb302cf..d81a153df451 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -259,6 +259,9 @@ extern int _cond_resched(void); @@ -396,7 +396,7 @@ index 000000000000..3e3d8c5f7a9a + +#endif diff --git a/kernel/fork.c b/kernel/fork.c -index 8a9241afefb0..f62ae61064c7 100644 +index 247b08eb66c8..96297e71019c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -895,6 +895,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) @@ -408,10 +408,10 @@ index 8a9241afefb0..f62ae61064c7 100644 account_kernel_stack(tsk, 1); diff --git a/kernel/futex.c b/kernel/futex.c -index eeb3e16fb9ec..2c5a5e180223 100644 +index 4d6501d689b5..fe90164aa6ec 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -1474,6 +1474,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ +@@ -1476,6 +1476,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ struct task_struct *new_owner; bool postunlock = false; DEFINE_WAKE_Q(wake_q); @@ -436,7 +436,7 @@ index eeb3e16fb9ec..2c5a5e180223 100644 return ret; } -@@ -2853,7 +2854,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2870,7 +2871,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, goto no_block; } @@ -445,7 +445,7 @@ index eeb3e16fb9ec..2c5a5e180223 100644 /* * On PREEMPT_RT_FULL, when hb->lock becomes an rt_mutex, we must not -@@ -3233,7 +3234,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3263,7 +3264,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, * The waiter is allocated on our stack, manipulated by the requeue * code while we sleep on uaddr. */ @@ -1144,7 +1144,7 @@ index 5955ad2aa2a8..6fcf0a3e180d 100644 #ifdef CONFIG_DEBUG_RT_MUTEXES # include "rtmutex-debug.h" diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 516f05702550..e699500aea26 100644 +index a8e9283f018c..868d3395c3cf 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -401,9 +401,15 @@ static bool set_nr_if_polling(struct task_struct *p) diff --git a/debian/patches-rt/0144-rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/debian/patches-rt/0144-rtmutex-add-mutex-implementation-based-on-rtmutex.patch index 83b5dbc6f..8f95d58bb 100644 --- a/debian/patches-rt/0144-rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/0144-rtmutex-add-mutex-implementation-based-on-rtmutex.patch @@ -1,8 +1,8 @@ -From b2eccb42878894e44f005029aa9b2fc9962d9093 Mon Sep 17 00:00:00 2001 +From b589ab9fd5ba3e54255590659660a6c0beecdc4b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:17:03 +0200 -Subject: [PATCH 144/269] rtmutex: add mutex implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 144/283] rtmutex: add mutex implementation based on rtmutex +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/0145-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/debian/patches-rt/0145-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index a4c88a3da..b99050a48 100644 --- a/debian/patches-rt/0145-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/0145-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch @@ -1,8 +1,8 @@ -From d8e44c235bb3238fc1848c72b906014f1d9a5fb1 Mon Sep 17 00:00:00 2001 +From 5b491c8328f76502a2285229fd224ec7116dfed7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:28:34 +0200 -Subject: [PATCH 145/269] rtmutex: add rwsem implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 145/283] rtmutex: add rwsem implementation based on rtmutex +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The RT specific R/W semaphore implementation restricts the number of readers to one because a writer cannot block on multiple readers and inherit its diff --git a/debian/patches-rt/0146-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/debian/patches-rt/0146-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index 5fd646591..6414f8c98 100644 --- a/debian/patches-rt/0146-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/0146-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch @@ -1,8 +1,8 @@ -From d49ee1d88e89db7c1a404171e67553b7695c349c Mon Sep 17 00:00:00 2001 +From 0ac4d3a8d1b2e6effaea2997c80bb3583d3f6a12 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:18:06 +0200 -Subject: [PATCH 146/269] rtmutex: add rwlock implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 146/283] rtmutex: add rwlock implementation based on rtmutex +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The implementation is bias-based, similar to the rwsem implementation. diff --git a/debian/patches-rt/0147-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch b/debian/patches-rt/0147-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch index 6d3a4feab..212ce900d 100644 --- a/debian/patches-rt/0147-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch +++ b/debian/patches-rt/0147-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch @@ -1,8 +1,8 @@ -From f4e21a9f84eb9919949bfe5763eb96637b90bb1e Mon Sep 17 00:00:00 2001 +From fa17e8511d2f284ca4d1bebe5744ec1e41ce1803 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 11 Jan 2019 21:16:31 +0100 -Subject: [PATCH 147/269] rtmutex/rwlock: preserve state like a sleeping lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 147/283] rtmutex/rwlock: preserve state like a sleeping lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The rwlock is spinning while acquiring a lock. Therefore it must become a sleeping lock on RT and preserve its task state while sleeping and diff --git a/debian/patches-rt/0148-rtmutex-wire-up-RT-s-locking.patch b/debian/patches-rt/0148-rtmutex-wire-up-RT-s-locking.patch index d6dee379a..92329cb0e 100644 --- a/debian/patches-rt/0148-rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches-rt/0148-rtmutex-wire-up-RT-s-locking.patch @@ -1,8 +1,8 @@ -From 145de90802b872003bf17064f49d5b1ea94f1a5f Mon Sep 17 00:00:00 2001 +From c3de22b64c9e40a638fd521cbfb87285e475d2ee Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:31:14 +0200 -Subject: [PATCH 148/269] rtmutex: wire up RT's locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 148/283] rtmutex: wire up RT's locking +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/0149-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/debian/patches-rt/0149-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index 650412eae..d0b52e0a8 100644 --- a/debian/patches-rt/0149-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/debian/patches-rt/0149-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,8 +1,8 @@ -From cb5d05fc6f3f2a23c0dc2d3cdf925e62d8e9e13f Mon Sep 17 00:00:00 2001 +From a0132c114d821b81d4e4104b797f76f0dd8fbcba Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 17:34:38 +0200 -Subject: [PATCH 149/269] rtmutex: add ww_mutex addon for mutex-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 149/283] rtmutex: add ww_mutex addon for mutex-rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches-rt/0150-kconfig-Add-PREEMPT_RT_FULL.patch b/debian/patches-rt/0150-kconfig-Add-PREEMPT_RT_FULL.patch index dcf19605c..6a0d52fce 100644 --- a/debian/patches-rt/0150-kconfig-Add-PREEMPT_RT_FULL.patch +++ b/debian/patches-rt/0150-kconfig-Add-PREEMPT_RT_FULL.patch @@ -1,8 +1,8 @@ -From 77032b07bcce84656ba960fea1a786fda5dcd81a Mon Sep 17 00:00:00 2001 +From b0a0152ae5fe9de88c2b10c9e213ab1d10459876 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 14:58:57 +0200 -Subject: [PATCH 150/269] kconfig: Add PREEMPT_RT_FULL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 150/283] kconfig: Add PREEMPT_RT_FULL +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Introduce the final symbol for PREEMPT_RT_FULL. diff --git a/debian/patches-rt/0151-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/debian/patches-rt/0151-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index 05e4269ee..1d1503f65 100644 --- a/debian/patches-rt/0151-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/debian/patches-rt/0151-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch @@ -1,9 +1,9 @@ -From 810f1d5d210b1101d5b93300358d6362861ea392 Mon Sep 17 00:00:00 2001 +From bb6f7fcdf67a3a410b786714d43f24dde243ff4e Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Mon, 13 Nov 2017 12:56:53 -0500 -Subject: [PATCH 151/269] locking/rt-mutex: fix deadlock in device mapper / +Subject: [PATCH 151/283] locking/rt-mutex: fix deadlock in device mapper / block-IO -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz When some block device driver creates a bio and submits it to another block device driver, the bio is added to current->bio_list (in order to diff --git a/debian/patches-rt/0152-locking-rt-mutex-Flush-block-plug-on-__down_read.patch b/debian/patches-rt/0152-locking-rt-mutex-Flush-block-plug-on-__down_read.patch index be7304f83..056cac181 100644 --- a/debian/patches-rt/0152-locking-rt-mutex-Flush-block-plug-on-__down_read.patch +++ b/debian/patches-rt/0152-locking-rt-mutex-Flush-block-plug-on-__down_read.patch @@ -1,8 +1,8 @@ -From 9c3afee65f743bf1492e76f16139111e10d8f205 Mon Sep 17 00:00:00 2001 +From 8b1428c9761e45fabdb70309947582526e3bbfbc Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Fri, 4 Jan 2019 15:33:21 -0500 -Subject: [PATCH 152/269] locking/rt-mutex: Flush block plug on __down_read() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 152/283] locking/rt-mutex: Flush block plug on __down_read() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz __down_read() bypasses the rtmutex frontend to call rt_mutex_slowlock_locked() directly, and thus it needs to call diff --git a/debian/patches-rt/0153-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/debian/patches-rt/0153-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index e3fc2a2e1..7ba88ce85 100644 --- a/debian/patches-rt/0153-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/debian/patches-rt/0153-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch @@ -1,9 +1,9 @@ -From 4a9a885ab4f7e220568aa7c19704f1f6b020f545 Mon Sep 17 00:00:00 2001 +From 232cc4794d35bf36a49924022ebd18edb13c8a5d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 16 Nov 2017 16:48:48 +0100 -Subject: [PATCH 153/269] locking/rtmutex: re-init the wait_lock in +Subject: [PATCH 153/283] locking/rtmutex: re-init the wait_lock in rt_mutex_init_proxy_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz We could provide a key-class for the lockdep (and fixup all callers) or move the init to all callers (like it was) in order to avoid lockdep diff --git a/debian/patches-rt/0154-ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches-rt/0154-ptrace-fix-ptrace-vs-tasklist_lock-race.patch index 17ad3990d..44f772d75 100644 --- a/debian/patches-rt/0154-ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/debian/patches-rt/0154-ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,8 +1,8 @@ -From de7eff6fda53e683a83289d9c0c0a2d774fbfe92 Mon Sep 17 00:00:00 2001 +From b031672801c6d24d255cc3d458e9a546899c919b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 18:21:04 +0200 -Subject: [PATCH 154/269] ptrace: fix ptrace vs tasklist_lock race -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 154/283] ptrace: fix ptrace vs tasklist_lock race +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz As explained by Alexander Fyodorov : @@ -100,10 +100,10 @@ index 1797fd3c8cbb..25e9a40f9576 100644 * cond_resched() and cond_resched_lock(): latency reduction via * explicit rescheduling in places that are safe. The return diff --git a/kernel/ptrace.c b/kernel/ptrace.c -index 21fec73d45d4..9c8d6f9f3a3a 100644 +index fed682a01a75..ace2839323de 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c -@@ -175,7 +175,14 @@ static bool ptrace_freeze_traced(struct task_struct *task) +@@ -174,7 +174,14 @@ static bool ptrace_freeze_traced(struct task_struct *task) spin_lock_irq(&task->sighand->siglock); if (task_is_traced(task) && !__fatal_signal_pending(task)) { @@ -120,7 +120,7 @@ index 21fec73d45d4..9c8d6f9f3a3a 100644 } spin_unlock_irq(&task->sighand->siglock); diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index e699500aea26..14eb51dae23d 100644 +index 868d3395c3cf..b2149a7ed3cd 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1349,6 +1349,18 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, diff --git a/debian/patches-rt/0155-rtmutex-annotate-sleeping-lock-context.patch b/debian/patches-rt/0155-rtmutex-annotate-sleeping-lock-context.patch index c0a4b9b8c..415bb9e6d 100644 --- a/debian/patches-rt/0155-rtmutex-annotate-sleeping-lock-context.patch +++ b/debian/patches-rt/0155-rtmutex-annotate-sleeping-lock-context.patch @@ -1,8 +1,8 @@ -From 2a9b009589ed8b11c6c94e2af70c3d6fc4c957b8 Mon Sep 17 00:00:00 2001 +From f9ae4924361c91598ce03771aaa5f99c4bfa8100 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:25:13 +0200 -Subject: [PATCH 155/269] rtmutex: annotate sleeping lock context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 155/283] rtmutex: annotate sleeping lock context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The RCU code complains on schedule() within a rcu_readlock() section. The valid scenario on -RT is if a sleeping is held. In order to suppress @@ -250,10 +250,10 @@ index a97c20ea9bce..564e3927e7b0 100644 !t->rcu_read_unlock_special.b.blocked) { diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 14eb51dae23d..a5226728e407 100644 +index b2149a7ed3cd..ce1cb23cb78f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7309,4 +7309,49 @@ void migrate_enable(void) +@@ -7316,4 +7316,49 @@ void migrate_enable(void) preempt_enable(); } EXPORT_SYMBOL(migrate_enable); diff --git a/debian/patches-rt/0156-sched-migrate_disable-fallback-to-preempt_disable-in.patch b/debian/patches-rt/0156-sched-migrate_disable-fallback-to-preempt_disable-in.patch index 88f193678..23739a68a 100644 --- a/debian/patches-rt/0156-sched-migrate_disable-fallback-to-preempt_disable-in.patch +++ b/debian/patches-rt/0156-sched-migrate_disable-fallback-to-preempt_disable-in.patch @@ -1,9 +1,9 @@ -From 09cc5496ae17c924c25e80d5a300901957c44b54 Mon Sep 17 00:00:00 2001 +From 55652e517f87d321623cda451d7bfbcdc55528d9 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 5 Jul 2018 14:44:51 +0200 -Subject: [PATCH 156/269] sched/migrate_disable: fallback to preempt_disable() +Subject: [PATCH 156/283] sched/migrate_disable: fallback to preempt_disable() instead barrier() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On SMP + !RT migrate_disable() is still around. It is not part of spin_lock() anymore so it has almost no users. However the futex code has a workaround for @@ -94,7 +94,7 @@ index 8f0bb5f6d39e..a023e1ba5d8f 100644 # endif #endif diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index a5226728e407..fb205b1ec799 100644 +index ce1cb23cb78f..36f791ff52bc 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1031,7 +1031,7 @@ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_ma @@ -124,7 +124,7 @@ index a5226728e407..fb205b1ec799 100644 if (__migrate_disabled(p)) { p->migrate_disable_update = 1; goto out; -@@ -7165,7 +7165,7 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7172,7 +7172,7 @@ const u32 sched_prio_to_wmult[40] = { #undef CREATE_TRACE_POINTS @@ -133,7 +133,7 @@ index a5226728e407..fb205b1ec799 100644 static inline void update_nr_migratory(struct task_struct *p, long delta) -@@ -7313,45 +7313,44 @@ EXPORT_SYMBOL(migrate_enable); +@@ -7320,45 +7320,44 @@ EXPORT_SYMBOL(migrate_enable); #elif !defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) void migrate_disable(void) { @@ -187,7 +187,7 @@ index a5226728e407..fb205b1ec799 100644 EXPORT_SYMBOL(migrate_enable); #endif diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c -index 34c27afae009..cb6ad6fd2320 100644 +index 5027158d3908..dd6c364d6f01 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -982,7 +982,7 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, diff --git a/debian/patches-rt/0157-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/debian/patches-rt/0157-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index c945198eb..a52981500 100644 --- a/debian/patches-rt/0157-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/debian/patches-rt/0157-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -1,9 +1,9 @@ -From e283cad9ed8ce6e508399dc21fde2645ff2a9259 Mon Sep 17 00:00:00 2001 +From 86ad5f1aff0d9992886c176a2f136ef494754c55 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 17:40:42 +0200 -Subject: [PATCH 157/269] locking: don't check for __LINUX_SPINLOCK_TYPES_H on +Subject: [PATCH 157/283] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT archs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Upstream uses arch_spinlock_t within spinlock_t and requests that spinlock_types.h header file is included first. diff --git a/debian/patches-rt/0158-rcu-Frob-softirq-test.patch b/debian/patches-rt/0158-rcu-Frob-softirq-test.patch index a78e3b1a5..d984dfbbc 100644 --- a/debian/patches-rt/0158-rcu-Frob-softirq-test.patch +++ b/debian/patches-rt/0158-rcu-Frob-softirq-test.patch @@ -1,8 +1,8 @@ -From 0a4604cc3cc194643ed11ab6909612b9bed4b4ad Mon Sep 17 00:00:00 2001 +From 3b403e90bb2186f5908b365157b777ed870de348 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Sat, 13 Aug 2011 00:23:17 +0200 -Subject: [PATCH 158/269] rcu: Frob softirq test -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 158/283] rcu: Frob softirq test +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz With RT_FULL we get the below wreckage: diff --git a/debian/patches-rt/0159-rcu-Merge-RCU-bh-into-RCU-preempt.patch b/debian/patches-rt/0159-rcu-Merge-RCU-bh-into-RCU-preempt.patch index 235f1fff8..753b98bb4 100644 --- a/debian/patches-rt/0159-rcu-Merge-RCU-bh-into-RCU-preempt.patch +++ b/debian/patches-rt/0159-rcu-Merge-RCU-bh-into-RCU-preempt.patch @@ -1,8 +1,8 @@ -From dd8eae9da2e22bd7b41cea43792b107b3deb3fd7 Mon Sep 17 00:00:00 2001 +From 324e697209ed33e734f64df4cf0ddf60658de5ff Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 5 Oct 2011 11:59:38 -0700 -Subject: [PATCH 159/269] rcu: Merge RCU-bh into RCU-preempt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 159/283] rcu: Merge RCU-bh into RCU-preempt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The Linux kernel has long RCU-bh read-side critical sections that intolerably increase scheduling latency under mainline's RCU-bh rules, @@ -35,7 +35,7 @@ Signed-off-by: Thomas Gleixner 7 files changed, 73 insertions(+), 2 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h -index 63cd0a1a99a0..60a9b5feefe2 100644 +index b73715c3c3c2..241a4a9577a0 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -56,7 +56,11 @@ void call_rcu(struct rcu_head *head, rcu_callback_t func); @@ -50,7 +50,7 @@ index 63cd0a1a99a0..60a9b5feefe2 100644 void call_rcu_sched(struct rcu_head *head, rcu_callback_t func); void synchronize_sched(void); void rcu_barrier_tasks(void); -@@ -263,7 +267,14 @@ extern struct lockdep_map rcu_sched_lock_map; +@@ -261,7 +265,14 @@ extern struct lockdep_map rcu_sched_lock_map; extern struct lockdep_map rcu_callback_map; int debug_lockdep_rcu_enabled(void); int rcu_read_lock_held(void); @@ -65,7 +65,7 @@ index 63cd0a1a99a0..60a9b5feefe2 100644 int rcu_read_lock_sched_held(void); #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ -@@ -663,10 +674,14 @@ static inline void rcu_read_unlock(void) +@@ -661,10 +672,14 @@ static inline void rcu_read_unlock(void) static inline void rcu_read_lock_bh(void) { local_bh_disable(); @@ -80,7 +80,7 @@ index 63cd0a1a99a0..60a9b5feefe2 100644 } /* -@@ -676,10 +691,14 @@ static inline void rcu_read_lock_bh(void) +@@ -674,10 +689,14 @@ static inline void rcu_read_lock_bh(void) */ static inline void rcu_read_unlock_bh(void) { @@ -156,7 +156,7 @@ index 4d04683c31b2..808cce9a5d43 100644 #ifdef CONFIG_RCU_NOCB_CPU diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c -index c596c6f1e457..7d2a615601e7 100644 +index 0b7af7e2bcbb..e95d121efc80 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -434,6 +434,7 @@ static struct rcu_torture_ops rcu_ops = { diff --git a/debian/patches-rt/0160-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch b/debian/patches-rt/0160-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch index 4e01d91f8..5eaa323c3 100644 --- a/debian/patches-rt/0160-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch +++ b/debian/patches-rt/0160-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch @@ -1,8 +1,8 @@ -From 435eba4b4298b15db7304d4b60e313d95f9b004f Mon Sep 17 00:00:00 2001 +From 00cbdab312799cf3648a917434e3178644f44f07 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Wed, 5 Oct 2011 11:45:18 -0700 -Subject: [PATCH 160/269] rcu: Make ksoftirqd do RCU quiescent states -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 160/283] rcu: Make ksoftirqd do RCU quiescent states +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Implementing RCU-bh in terms of RCU-preempt makes the system vulnerable to network-based denial-of-service attacks. This patch therefore diff --git a/debian/patches-rt/0161-rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches-rt/0161-rcu-Eliminate-softirq-processing-from-rcutree.patch index dc667b2bd..2a739d26c 100644 --- a/debian/patches-rt/0161-rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/debian/patches-rt/0161-rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,8 +1,8 @@ -From ca691ed27290645375a66795b1d87fb910501211 Mon Sep 17 00:00:00 2001 +From e270d045cc4c717e9781c7e4f0d351b63e61858a Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Mon, 4 Nov 2013 13:21:10 -0800 -Subject: [PATCH 161/269] rcu: Eliminate softirq processing from rcutree -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 161/283] rcu: Eliminate softirq processing from rcutree +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Running RCU out of softirq is a problem for some workloads that would like to manage RCU core processing independently of other softirq work, diff --git a/debian/patches-rt/0162-srcu-use-cpu_online-instead-custom-check.patch b/debian/patches-rt/0162-srcu-use-cpu_online-instead-custom-check.patch index c18091cbf..b5fe9a7c0 100644 --- a/debian/patches-rt/0162-srcu-use-cpu_online-instead-custom-check.patch +++ b/debian/patches-rt/0162-srcu-use-cpu_online-instead-custom-check.patch @@ -1,8 +1,8 @@ -From cf507028c7a29d61fc47c6209aeca2d9d7cd0876 Mon Sep 17 00:00:00 2001 +From ceae4b480cbafa469d9bfb43e2916b8cd4092ec6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 14:43:41 +0200 -Subject: [PATCH 162/269] srcu: use cpu_online() instead custom check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 162/283] srcu: use cpu_online() instead custom check +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The current check via srcu_online is slightly racy because after looking at srcu_online there could be an interrupt that interrupted us long diff --git a/debian/patches-rt/0163-srcu-replace-local_irqsave-with-a-locallock.patch b/debian/patches-rt/0163-srcu-replace-local_irqsave-with-a-locallock.patch index 15def95d4..9b2c6c7a3 100644 --- a/debian/patches-rt/0163-srcu-replace-local_irqsave-with-a-locallock.patch +++ b/debian/patches-rt/0163-srcu-replace-local_irqsave-with-a-locallock.patch @@ -1,8 +1,8 @@ -From 162767bbf4dfe16744f93ead7a5c938defc00489 Mon Sep 17 00:00:00 2001 +From c5179e3d05fb9c649a24846aec42fd142baaba46 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 18:37:12 +0200 -Subject: [PATCH 163/269] srcu: replace local_irqsave() with a locallock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 163/283] srcu: replace local_irqsave() with a locallock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz There are two instances which disable interrupts in order to become a stable this_cpu_ptr() pointer. The restore part is coupled with diff --git a/debian/patches-rt/0164-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/debian/patches-rt/0164-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index 1668d47ea..328708bd7 100644 --- a/debian/patches-rt/0164-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/debian/patches-rt/0164-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,8 +1,8 @@ -From f723e17e9826ed2e03a4b4c40c575ea2e2bf2c56 Mon Sep 17 00:00:00 2001 +From 279a404efccb555b0b9cb897445eb06bab8efe14 Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Wed, 12 Oct 2016 11:21:14 -0500 -Subject: [PATCH 164/269] rcu: enable rcu_normal_after_boot by default for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 164/283] rcu: enable rcu_normal_after_boot by default for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The forcing of an expedited grace period is an expensive and very RT-application unfriendly operation, as it forcibly preempts all running diff --git a/debian/patches-rt/0165-tty-serial-omap-Make-the-locking-RT-aware.patch b/debian/patches-rt/0165-tty-serial-omap-Make-the-locking-RT-aware.patch index 0afd1ce99..d627b6dd6 100644 --- a/debian/patches-rt/0165-tty-serial-omap-Make-the-locking-RT-aware.patch +++ b/debian/patches-rt/0165-tty-serial-omap-Make-the-locking-RT-aware.patch @@ -1,8 +1,8 @@ -From ccd76e8feed9271e97bc207e13fce803567e1017 Mon Sep 17 00:00:00 2001 +From e88697f5f31d546848145184386ec739cc7aabfd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 28 Jul 2011 13:32:57 +0200 -Subject: [PATCH 165/269] tty/serial/omap: Make the locking RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 165/283] tty/serial/omap: Make the locking RT aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and diff --git a/debian/patches-rt/0166-tty-serial-pl011-Make-the-locking-work-on-RT.patch b/debian/patches-rt/0166-tty-serial-pl011-Make-the-locking-work-on-RT.patch index 0dadef0cc..8ac8135a2 100644 --- a/debian/patches-rt/0166-tty-serial-pl011-Make-the-locking-work-on-RT.patch +++ b/debian/patches-rt/0166-tty-serial-pl011-Make-the-locking-work-on-RT.patch @@ -1,8 +1,8 @@ -From 9ad06fff0efb4629430d5ced37c81e4f3ef040bf Mon Sep 17 00:00:00 2001 +From 5d5a72172d1b6447861b7359fb2fa8e4ea1e707c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 8 Jan 2013 21:36:51 +0100 -Subject: [PATCH 166/269] tty/serial/pl011: Make the locking work on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 166/283] tty/serial/pl011: Make the locking work on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and non-RT. diff --git a/debian/patches-rt/0167-tty-serial-pl011-explicitly-initialize-the-flags-var.patch b/debian/patches-rt/0167-tty-serial-pl011-explicitly-initialize-the-flags-var.patch index 12ced87ef..909cc7309 100644 --- a/debian/patches-rt/0167-tty-serial-pl011-explicitly-initialize-the-flags-var.patch +++ b/debian/patches-rt/0167-tty-serial-pl011-explicitly-initialize-the-flags-var.patch @@ -1,12 +1,12 @@ -From e30b0dc820111e11ecc71383d20682d2eee77061 Mon Sep 17 00:00:00 2001 +From 1d9fb6ef0391f5e2ee11e6ae76fbdad192da7f6a Mon Sep 17 00:00:00 2001 From: Kurt Kanzenbach Date: Mon, 24 Sep 2018 10:29:01 +0200 -Subject: [PATCH 167/269] tty: serial: pl011: explicitly initialize the flags +Subject: [PATCH 167/283] tty: serial: pl011: explicitly initialize the flags variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Silence the following gcc warning: diff --git a/debian/patches-rt/0168-rt-Improve-the-serial-console-PASS_LIMIT.patch b/debian/patches-rt/0168-rt-Improve-the-serial-console-PASS_LIMIT.patch index e55b0c291..6a0d274d5 100644 --- a/debian/patches-rt/0168-rt-Improve-the-serial-console-PASS_LIMIT.patch +++ b/debian/patches-rt/0168-rt-Improve-the-serial-console-PASS_LIMIT.patch @@ -1,11 +1,11 @@ -From 0a6ea176915e05db911401e89a925ee948f4434f Mon Sep 17 00:00:00 2001 +From 1e7abe5e3aee5c132a0d65d39713c6f4cb67be9c Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 14 Dec 2011 13:05:54 +0100 -Subject: [PATCH 168/269] rt: Improve the serial console PASS_LIMIT +Subject: [PATCH 168/283] rt: Improve the serial console PASS_LIMIT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Beyond the warning: diff --git a/debian/patches-rt/0169-tty-serial-8250-don-t-take-the-trylock-during-oops.patch b/debian/patches-rt/0169-tty-serial-8250-don-t-take-the-trylock-during-oops.patch index 4a597d90e..2b22a2184 100644 --- a/debian/patches-rt/0169-tty-serial-8250-don-t-take-the-trylock-during-oops.patch +++ b/debian/patches-rt/0169-tty-serial-8250-don-t-take-the-trylock-during-oops.patch @@ -1,8 +1,8 @@ -From 511eaf0e0ecbd9898b7f680f08ab0636062f3c7e Mon Sep 17 00:00:00 2001 +From 872de798df0e839bfdfdaebdde0eae1b50de4614 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Apr 2016 16:55:02 +0200 -Subject: [PATCH 169/269] tty: serial: 8250: don't take the trylock during oops -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 169/283] tty: serial: 8250: don't take the trylock during oops +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz An oops with irqs off (panic() from irqsafe hrtimer like the watchdog timer) will lead to a lockdep warning on each invocation and as such @@ -15,10 +15,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 3f779d25ec0c..851d7f6046a4 100644 +index e26d87b6ffc5..8d85448975d3 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -3239,10 +3239,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, +@@ -3238,10 +3238,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, serial8250_rpm_get(up); diff --git a/debian/patches-rt/0170-locking-percpu-rwsem-Remove-preempt_disable-variants.patch b/debian/patches-rt/0170-locking-percpu-rwsem-Remove-preempt_disable-variants.patch index 937f69be8..1a94ff29c 100644 --- a/debian/patches-rt/0170-locking-percpu-rwsem-Remove-preempt_disable-variants.patch +++ b/debian/patches-rt/0170-locking-percpu-rwsem-Remove-preempt_disable-variants.patch @@ -1,8 +1,8 @@ -From 7b2e3123b8a2c8f1df0aa040b4c58d2f443fa8a5 Mon Sep 17 00:00:00 2001 +From e1d3a8c231f929b0069ddc2dc3059bab193e9d00 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Wed, 23 Nov 2016 16:29:32 +0100 -Subject: [PATCH 170/269] locking/percpu-rwsem: Remove preempt_disable variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 170/283] locking/percpu-rwsem: Remove preempt_disable variants +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Effective revert commit: diff --git a/debian/patches-rt/0171-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch b/debian/patches-rt/0171-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch index 2de7fe2b9..52fb63eaa 100644 --- a/debian/patches-rt/0171-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch +++ b/debian/patches-rt/0171-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch @@ -1,9 +1,9 @@ -From 28f91f849d8485292f7b25ce6a2ceae9fe18fb4d Mon Sep 17 00:00:00 2001 +From 3fe311d6ea2109a5390bffc6870dafee03cab931 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Tue, 15 May 2012 13:53:56 +0800 -Subject: [PATCH 171/269] mm: Protect activate_mm() by +Subject: [PATCH 171/283] mm: Protect activate_mm() by preempt_[disable&enable]_rt() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz User preempt_*_rt instead of local_irq_*_rt or otherwise there will be warning on ARM like below: diff --git a/debian/patches-rt/0172-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch b/debian/patches-rt/0172-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch index 80038e109..ef4f2178f 100644 --- a/debian/patches-rt/0172-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch +++ b/debian/patches-rt/0172-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch @@ -1,9 +1,9 @@ -From bbbfae78f8bad17199822dcfb994d1c927de5c32 Mon Sep 17 00:00:00 2001 +From a82c4acdfe13556ab98571ef02f3a3eb9d29dd6e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 12:32:34 +0200 -Subject: [PATCH 172/269] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD +Subject: [PATCH 172/283] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD init -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed INIT_HLIST_BL_HEAD and uses the ZERO flag instead for the init. However @@ -16,10 +16,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 11 insertions(+) diff --git a/fs/dcache.c b/fs/dcache.c -index cb515f183482..7e15f1bff5ea 100644 +index 6e0022326afe..10225a9135fb 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -3058,6 +3058,8 @@ __setup("dhash_entries=", set_dhash_entries); +@@ -3060,6 +3060,8 @@ __setup("dhash_entries=", set_dhash_entries); static void __init dcache_init_early(void) { @@ -28,7 +28,7 @@ index cb515f183482..7e15f1bff5ea 100644 /* If hashes are distributed across NUMA nodes, defer * hash allocation until vmalloc space is available. */ -@@ -3074,11 +3076,16 @@ static void __init dcache_init_early(void) +@@ -3076,11 +3078,16 @@ static void __init dcache_init_early(void) NULL, 0, 0); @@ -45,7 +45,7 @@ index cb515f183482..7e15f1bff5ea 100644 /* * A constructor could be added for stable state like the lists, * but it is probably not worth it because of the cache nature -@@ -3102,6 +3109,10 @@ static void __init dcache_init(void) +@@ -3104,6 +3111,10 @@ static void __init dcache_init(void) NULL, 0, 0); diff --git a/debian/patches-rt/0173-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/debian/patches-rt/0173-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index 2b12ecacb..7e414a08c 100644 --- a/debian/patches-rt/0173-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/debian/patches-rt/0173-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,9 +1,9 @@ -From 2f25e633c3f100305735735e8f7728a335395f94 Mon Sep 17 00:00:00 2001 +From 09acbcc860c548ba124fb4402beed59790f49218 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 20 Oct 2017 11:29:53 +0200 -Subject: [PATCH 173/269] fs/dcache: disable preemption on i_dir_seq's write +Subject: [PATCH 173/283] fs/dcache: disable preemption on i_dir_seq's write side -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz i_dir_seq is an opencoded seqcounter. Based on the code it looks like we could have two writers in parallel despite the fact that the d_lock is @@ -25,10 +25,10 @@ Signed-off-by: Sebastian Andrzej Siewior 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c -index 7e15f1bff5ea..173b53b536f0 100644 +index 10225a9135fb..dcde8ffe384c 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -2400,9 +2400,10 @@ EXPORT_SYMBOL(d_rehash); +@@ -2404,9 +2404,10 @@ EXPORT_SYMBOL(d_rehash); static inline unsigned start_dir_add(struct inode *dir) { @@ -41,7 +41,7 @@ index 7e15f1bff5ea..173b53b536f0 100644 return n; cpu_relax(); } -@@ -2410,7 +2411,8 @@ static inline unsigned start_dir_add(struct inode *dir) +@@ -2414,7 +2415,8 @@ static inline unsigned start_dir_add(struct inode *dir) static inline void end_dir_add(struct inode *dir, unsigned n) { @@ -51,7 +51,7 @@ index 7e15f1bff5ea..173b53b536f0 100644 } static void d_wait_lookup(struct dentry *dentry) -@@ -2443,7 +2445,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, +@@ -2447,7 +2449,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, retry: rcu_read_lock(); @@ -60,7 +60,7 @@ index 7e15f1bff5ea..173b53b536f0 100644 r_seq = read_seqbegin(&rename_lock); dentry = __d_lookup_rcu(parent, name, &d_seq); if (unlikely(dentry)) { -@@ -2471,7 +2473,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, +@@ -2475,7 +2477,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, } hlist_bl_lock(b); @@ -70,7 +70,7 @@ index 7e15f1bff5ea..173b53b536f0 100644 rcu_read_unlock(); goto retry; diff --git a/fs/inode.c b/fs/inode.c -index 42f6d25f32a5..97f11df6ca6a 100644 +index 5c63693326bb..c3e17dcbb558 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -155,7 +155,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) @@ -115,10 +115,10 @@ index 0fb590d79f30..cd95874a1952 100644 } diff --git a/include/linux/fs.h b/include/linux/fs.h -index 7b6084854bfe..6782a83a8d4f 100644 +index d4e1b43a53c3..72749feed0e3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h -@@ -669,7 +669,7 @@ struct inode { +@@ -678,7 +678,7 @@ struct inode { struct block_device *i_bdev; struct cdev *i_cdev; char *i_link; diff --git a/debian/patches-rt/0174-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch b/debian/patches-rt/0174-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch index 762e929d0..3c1673364 100644 --- a/debian/patches-rt/0174-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch +++ b/debian/patches-rt/0174-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch @@ -1,9 +1,9 @@ -From cef566ebb92c429f8d12735d50bf7d6772daa4dc Mon Sep 17 00:00:00 2001 +From d1843e5a615442fd804b363f5593ddbf58bc6688 Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Mon, 7 May 2018 08:58:57 -0500 -Subject: [PATCH 174/269] squashfs: make use of local lock in multi_cpu +Subject: [PATCH 174/283] squashfs: make use of local lock in multi_cpu decompressor -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Currently, the squashfs multi_cpu decompressor makes use of get_cpu_ptr()/put_cpu_ptr(), which unconditionally disable preemption diff --git a/debian/patches-rt/0175-thermal-Defer-thermal-wakups-to-threads.patch b/debian/patches-rt/0175-thermal-Defer-thermal-wakups-to-threads.patch index a87f7ce7a..afc218fb8 100644 --- a/debian/patches-rt/0175-thermal-Defer-thermal-wakups-to-threads.patch +++ b/debian/patches-rt/0175-thermal-Defer-thermal-wakups-to-threads.patch @@ -1,8 +1,8 @@ -From 63284d578bc862d28f5f85f74fdc9fdadc90bea3 Mon Sep 17 00:00:00 2001 +From 4f73daf6f6c5ecfca2198293c10701d2d777a451 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 17 Feb 2015 09:37:44 +0100 -Subject: [PATCH 175/269] thermal: Defer thermal wakups to threads -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 175/283] thermal: Defer thermal wakups to threads +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On RT the spin lock in pkg_temp_thermal_platfrom_thermal_notify will call schedule while we run in irq context. diff --git a/debian/patches-rt/0176-x86-fpu-Disable-preemption-around-local_bh_disable.patch b/debian/patches-rt/0176-x86-fpu-Disable-preemption-around-local_bh_disable.patch index 501f7da6c..a5f584cec 100644 --- a/debian/patches-rt/0176-x86-fpu-Disable-preemption-around-local_bh_disable.patch +++ b/debian/patches-rt/0176-x86-fpu-Disable-preemption-around-local_bh_disable.patch @@ -1,8 +1,8 @@ -From ac8e13bf3ba7c4ef2587d4b8932ca56d30ca4841 Mon Sep 17 00:00:00 2001 +From c3a958f7c3d63e98096d5c662e8346b5fc0fafec Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 11 Dec 2018 15:10:33 +0100 -Subject: [PATCH 176/269] x86/fpu: Disable preemption around local_bh_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 176/283] x86/fpu: Disable preemption around local_bh_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz __fpu__restore_sig() restores the content of the FPU state in the CPUs and in order to avoid concurency it disbles BH. On !RT it also disables diff --git a/debian/patches-rt/0177-fs-epoll-Do-not-disable-preemption-on-RT.patch b/debian/patches-rt/0177-fs-epoll-Do-not-disable-preemption-on-RT.patch index d2e01662b..5e4fb4487 100644 --- a/debian/patches-rt/0177-fs-epoll-Do-not-disable-preemption-on-RT.patch +++ b/debian/patches-rt/0177-fs-epoll-Do-not-disable-preemption-on-RT.patch @@ -1,8 +1,8 @@ -From 364aac82cf51da276aaf325fbcc1d837b41ebd6d Mon Sep 17 00:00:00 2001 +From 2bc1814482c92194daf20b98841321870709e4dd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 8 Jul 2011 16:35:35 +0200 -Subject: [PATCH 177/269] fs/epoll: Do not disable preemption on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 177/283] fs/epoll: Do not disable preemption on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz ep_call_nested() takes a sleeping lock so we can't disable preemption. The light version is enough since ep_call_nested() doesn't mind beeing diff --git a/debian/patches-rt/0178-mm-vmalloc-Another-preempt-disable-region-which-suck.patch b/debian/patches-rt/0178-mm-vmalloc-Another-preempt-disable-region-which-suck.patch index a71b14f00..bfd85a176 100644 --- a/debian/patches-rt/0178-mm-vmalloc-Another-preempt-disable-region-which-suck.patch +++ b/debian/patches-rt/0178-mm-vmalloc-Another-preempt-disable-region-which-suck.patch @@ -1,9 +1,9 @@ -From 27414c4ed0a59bb7044e708938c07d3141da2f38 Mon Sep 17 00:00:00 2001 +From 974d73cf26c5d957984cd6078582894a25a0600a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 12 Jul 2011 11:39:36 +0200 -Subject: [PATCH 178/269] mm/vmalloc: Another preempt disable region which +Subject: [PATCH 178/283] mm/vmalloc: Another preempt disable region which sucks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. diff --git a/debian/patches-rt/0179-block-mq-use-cpu_light.patch b/debian/patches-rt/0179-block-mq-use-cpu_light.patch index bc41e3828..e6b440faa 100644 --- a/debian/patches-rt/0179-block-mq-use-cpu_light.patch +++ b/debian/patches-rt/0179-block-mq-use-cpu_light.patch @@ -1,8 +1,8 @@ -From 42ff48e7b8242871b11a0c7c5e8753c702c8aee5 Mon Sep 17 00:00:00 2001 +From a8a7839dcded1152098641824de0792247d0af82 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 10:37:23 +0200 -Subject: [PATCH 179/269] block: mq: use cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 179/283] block: mq: use cpu_light() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz there is a might sleep splat because get_cpu() disables preemption and later we grab a lock. As a workaround for this we use get_cpu_light(). diff --git a/debian/patches-rt/0180-block-mq-do-not-invoke-preempt_disable.patch b/debian/patches-rt/0180-block-mq-do-not-invoke-preempt_disable.patch index 375ecb4fb..957822be2 100644 --- a/debian/patches-rt/0180-block-mq-do-not-invoke-preempt_disable.patch +++ b/debian/patches-rt/0180-block-mq-do-not-invoke-preempt_disable.patch @@ -1,8 +1,8 @@ -From 1574b433606302c16705ba46441b23c6f286e3a0 Mon Sep 17 00:00:00 2001 +From f981eb8d8253e9496a5551600aa89d6ac82f153d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 180/269] block/mq: do not invoke preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 180/283] block/mq: do not invoke preempt_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz preempt_disable() and get_cpu() don't play well together with the sleeping locks it tries to allocate later. @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c -index b0d0b74cf5a6..430037cda971 100644 +index e3e7a88e03a6..b07332cab8ff 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -570,7 +570,7 @@ static void __blk_mq_complete_request(struct request *rq) diff --git a/debian/patches-rt/0181-block-mq-don-t-complete-requests-via-IPI.patch b/debian/patches-rt/0181-block-mq-don-t-complete-requests-via-IPI.patch index fecd184d3..07a8ba94e 100644 --- a/debian/patches-rt/0181-block-mq-don-t-complete-requests-via-IPI.patch +++ b/debian/patches-rt/0181-block-mq-don-t-complete-requests-via-IPI.patch @@ -1,8 +1,8 @@ -From 9ec5d3b932b407e0b6780392ddb1f7f2fe1251e4 Mon Sep 17 00:00:00 2001 +From 806f56991b1c799b77919980a4331ebd857eca6e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 15:10:08 +0100 -Subject: [PATCH 181/269] block/mq: don't complete requests via IPI -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 181/283] block/mq: don't complete requests via IPI +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The IPI runs in hardirq context and there are sleeping locks. This patch moves the completion into a workqueue. @@ -16,7 +16,7 @@ Signed-off-by: Sebastian Andrzej Siewior 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c -index eb8b52241453..581bf704154a 100644 +index 682bc561b77b..b6010a1c3aad 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -189,6 +189,9 @@ void blk_rq_init(struct request_queue *q, struct request *rq) @@ -30,7 +30,7 @@ index eb8b52241453..581bf704154a 100644 rq->q = q; rq->__sector = (sector_t) -1; diff --git a/block/blk-mq.c b/block/blk-mq.c -index 430037cda971..9560ebae322d 100644 +index b07332cab8ff..a01b6aba61fa 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -320,6 +320,9 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, diff --git a/debian/patches-rt/0182-md-raid5-Make-raid5_percpu-handling-RT-aware.patch b/debian/patches-rt/0182-md-raid5-Make-raid5_percpu-handling-RT-aware.patch index 2d1f319c2..bab51162f 100644 --- a/debian/patches-rt/0182-md-raid5-Make-raid5_percpu-handling-RT-aware.patch +++ b/debian/patches-rt/0182-md-raid5-Make-raid5_percpu-handling-RT-aware.patch @@ -1,8 +1,8 @@ -From 6c971609e903127436e633a14252b0f3cf42c919 Mon Sep 17 00:00:00 2001 +From 149113bd6da78fc421b65edab96f402b3fdfc0f8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 6 Apr 2010 16:51:31 +0200 -Subject: [PATCH 182/269] md: raid5: Make raid5_percpu handling RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 182/283] md: raid5: Make raid5_percpu handling RT aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic @@ -20,7 +20,7 @@ Tested-by: Udo van den Heuvel 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c -index ae38895c44b2..abc559dc516f 100644 +index f237d6f30752..adec2947c3e1 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -2069,8 +2069,9 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) @@ -44,7 +44,7 @@ index ae38895c44b2..abc559dc516f 100644 } static void free_stripe(struct kmem_cache *sc, struct stripe_head *sh) -@@ -6803,6 +6805,7 @@ static int raid456_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) +@@ -6811,6 +6813,7 @@ static int raid456_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) __func__, cpu); return -ENOMEM; } @@ -52,7 +52,7 @@ index ae38895c44b2..abc559dc516f 100644 return 0; } -@@ -6813,7 +6816,6 @@ static int raid5_alloc_percpu(struct r5conf *conf) +@@ -6821,7 +6824,6 @@ static int raid5_alloc_percpu(struct r5conf *conf) conf->percpu = alloc_percpu(struct raid5_percpu); if (!conf->percpu) return -ENOMEM; diff --git a/debian/patches-rt/0183-rt-Introduce-cpu_chill.patch b/debian/patches-rt/0183-rt-Introduce-cpu_chill.patch index b0b3d6e67..f9cf763e1 100644 --- a/debian/patches-rt/0183-rt-Introduce-cpu_chill.patch +++ b/debian/patches-rt/0183-rt-Introduce-cpu_chill.patch @@ -1,8 +1,8 @@ -From 70f8f6e166aff0215e6e440d9365f8ce0ade2336 Mon Sep 17 00:00:00 2001 +From e4e5f1cc93c38f1bc914494fc1a4a0c4388e42e1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 7 Mar 2012 20:51:03 +0100 -Subject: [PATCH 183/269] rt: Introduce cpu_chill() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 183/283] rt: Introduce cpu_chill() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() diff --git a/debian/patches-rt/0184-hrtimer-Don-t-lose-state-in-cpu_chill.patch b/debian/patches-rt/0184-hrtimer-Don-t-lose-state-in-cpu_chill.patch index 34faffb96..f2623ae2c 100644 --- a/debian/patches-rt/0184-hrtimer-Don-t-lose-state-in-cpu_chill.patch +++ b/debian/patches-rt/0184-hrtimer-Don-t-lose-state-in-cpu_chill.patch @@ -1,8 +1,8 @@ -From 420f45d08b300f698438e0a208f03e0f89aa8009 Mon Sep 17 00:00:00 2001 +From 33f5a28483e30eb660e9ebc75308de9618a279ff Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 19 Feb 2019 16:59:15 +0100 -Subject: [PATCH 184/269] hrtimer: Don't lose state in cpu_chill() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 184/283] hrtimer: Don't lose state in cpu_chill() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In cpu_chill() the state is set to TASK_UNINTERRUPTIBLE and a timer is programmed. On return the state is always TASK_RUNNING which means we diff --git a/debian/patches-rt/0185-hrtimer-cpu_chill-save-task-state-in-saved_state.patch b/debian/patches-rt/0185-hrtimer-cpu_chill-save-task-state-in-saved_state.patch index 4a92ccac2..956475285 100644 --- a/debian/patches-rt/0185-hrtimer-cpu_chill-save-task-state-in-saved_state.patch +++ b/debian/patches-rt/0185-hrtimer-cpu_chill-save-task-state-in-saved_state.patch @@ -1,9 +1,9 @@ -From 39c4c7819a0377ee59a1197664454bc54012907b Mon Sep 17 00:00:00 2001 +From 65b275b3fee3444107af46dd38c427834861ea37 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 26 Feb 2019 12:31:10 +0100 -Subject: [PATCH 185/269] hrtimer: cpu_chill(): save task state in +Subject: [PATCH 185/283] hrtimer: cpu_chill(): save task state in ->saved_state() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In the previous change I saved the current task state on stack. This was bad because while the task is scheduled-out it might receive a wake-up. diff --git a/debian/patches-rt/0186-block-blk-mq-move-blk_queue_usage_counter_release-in.patch b/debian/patches-rt/0186-block-blk-mq-move-blk_queue_usage_counter_release-in.patch index 985877ebe..b12f53318 100644 --- a/debian/patches-rt/0186-block-blk-mq-move-blk_queue_usage_counter_release-in.patch +++ b/debian/patches-rt/0186-block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -1,9 +1,9 @@ -From 3933bc43d3be58eb86a118b1bd147cd4a2c9b33d Mon Sep 17 00:00:00 2001 +From a0f3744dd80367c9d401ebb5764b426fa7634006 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 13 Mar 2018 13:49:16 +0100 -Subject: [PATCH 186/269] block: blk-mq: move blk_queue_usage_counter_release() +Subject: [PATCH 186/283] block: blk-mq: move blk_queue_usage_counter_release() into process context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 | in_atomic(): 1, irqs_disabled(): 0, pid: 255, name: kworker/u257:6 @@ -52,10 +52,10 @@ Signed-off-by: Sebastian Andrzej Siewior 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c -index 581bf704154a..0a651b442cec 100644 +index b6010a1c3aad..38b1bd493165 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -968,12 +968,21 @@ void blk_queue_exit(struct request_queue *q) +@@ -967,12 +967,21 @@ void blk_queue_exit(struct request_queue *q) percpu_ref_put(&q->q_usage_counter); } @@ -78,7 +78,7 @@ index 581bf704154a..0a651b442cec 100644 } static void blk_rq_timed_out_timer(struct timer_list *t) -@@ -1066,6 +1075,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id, +@@ -1069,6 +1078,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id, queue_flag_set_unlocked(QUEUE_FLAG_BYPASS, q); init_waitqueue_head(&q->mq_freeze_wq); @@ -86,7 +86,7 @@ index 581bf704154a..0a651b442cec 100644 /* * Init percpu_ref in atomic mode so that it's faster to shutdown. -@@ -3956,6 +3966,8 @@ int __init blk_dev_init(void) +@@ -3958,6 +3968,8 @@ int __init blk_dev_init(void) if (!kblockd_workqueue) panic("Failed to create kblockd\n"); diff --git a/debian/patches-rt/0187-block-Use-cpu_chill-for-retry-loops.patch b/debian/patches-rt/0187-block-Use-cpu_chill-for-retry-loops.patch index e01bb97c6..10488914a 100644 --- a/debian/patches-rt/0187-block-Use-cpu_chill-for-retry-loops.patch +++ b/debian/patches-rt/0187-block-Use-cpu_chill-for-retry-loops.patch @@ -1,8 +1,8 @@ -From 608d51b75238d882851b21f980b37aa54d26620e Mon Sep 17 00:00:00 2001 +From 21b09ece0276ba2e189265b580648e8505039067 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 20 Dec 2012 18:28:26 +0100 -Subject: [PATCH 187/269] block: Use cpu_chill() for retry loops -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 187/283] block: Use cpu_chill() for retry loops +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Steven also observed a live lock when there was a diff --git a/debian/patches-rt/0188-fs-dcache-Use-cpu_chill-in-trylock-loops.patch b/debian/patches-rt/0188-fs-dcache-Use-cpu_chill-in-trylock-loops.patch index 28ebe2bb0..5bc96a53c 100644 --- a/debian/patches-rt/0188-fs-dcache-Use-cpu_chill-in-trylock-loops.patch +++ b/debian/patches-rt/0188-fs-dcache-Use-cpu_chill-in-trylock-loops.patch @@ -1,8 +1,8 @@ -From 4e8f4b38754fe437338d35cde5fafd8bfa53aaa3 Mon Sep 17 00:00:00 2001 +From 0a339e66574cbd8cf1cb2b146d2b960db46a2803 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 7 Mar 2012 21:00:34 +0100 -Subject: [PATCH 188/269] fs: dcache: Use cpu_chill() in trylock loops -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 188/283] fs: dcache: Use cpu_chill() in trylock loops +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system diff --git a/debian/patches-rt/0189-net-Use-cpu_chill-instead-of-cpu_relax.patch b/debian/patches-rt/0189-net-Use-cpu_chill-instead-of-cpu_relax.patch index c34ee472d..c00ba794e 100644 --- a/debian/patches-rt/0189-net-Use-cpu_chill-instead-of-cpu_relax.patch +++ b/debian/patches-rt/0189-net-Use-cpu_chill-instead-of-cpu_relax.patch @@ -1,8 +1,8 @@ -From 128245989afa7b20f2b7e7fc43727086cce5bf13 Mon Sep 17 00:00:00 2001 +From 3e88f3c941795af8750994fd1a26f7031b691be6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 7 Mar 2012 21:10:04 +0100 -Subject: [PATCH 189/269] net: Use cpu_chill() instead of cpu_relax() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 189/283] net: Use cpu_chill() instead of cpu_relax() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c -index a0d295478e69..ce1bfcbbda45 100644 +index 93b5a4200585..47009dddb740 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -63,6 +63,7 @@ @@ -45,7 +45,7 @@ index a0d295478e69..ce1bfcbbda45 100644 } prb_close_block(pkc, pbd, po, status); diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c -index 63c8d107adcf..671f8ad38864 100644 +index 0b347f46b2f4..f395f06031bc 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -34,6 +34,7 @@ diff --git a/debian/patches-rt/0190-fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches-rt/0190-fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 0a5988168..899c29af3 100644 --- a/debian/patches-rt/0190-fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/debian/patches-rt/0190-fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,8 +1,8 @@ -From 0e5745ddcc9a0454ba787dfcb0da5e9753b787dc Mon Sep 17 00:00:00 2001 +From 4625df6903b8b9c8ebbcddea1660e7df3e4f9efa Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 14:35:49 +0200 -Subject: [PATCH 190/269] fs/dcache: use swait_queue instead of waitqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 190/283] fs/dcache: use swait_queue instead of waitqueue +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz __d_lookup_done() invokes wake_up_all() while holding a hlist_bl_lock() which disables preemption. As a workaround convert it to swait. @@ -36,10 +36,10 @@ index 3925a7bfc74d..33f7723fb83e 100644 cifs_dbg(FYI, "%s: for %s\n", __func__, name->name); diff --git a/fs/dcache.c b/fs/dcache.c -index 173b53b536f0..7cb44c7218a4 100644 +index dcde8ffe384c..b2a00f3ff7df 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -2417,21 +2417,24 @@ static inline void end_dir_add(struct inode *dir, unsigned n) +@@ -2421,21 +2421,24 @@ static inline void end_dir_add(struct inode *dir, unsigned n) static void d_wait_lookup(struct dentry *dentry) { @@ -75,7 +75,7 @@ index 173b53b536f0..7cb44c7218a4 100644 { unsigned int hash = name->hash; struct hlist_bl_head *b = in_lookup_hash(parent, hash); -@@ -2546,7 +2549,7 @@ void __d_lookup_done(struct dentry *dentry) +@@ -2550,7 +2553,7 @@ void __d_lookup_done(struct dentry *dentry) hlist_bl_lock(b); dentry->d_flags &= ~DCACHE_PAR_LOOKUP; __hlist_bl_del(&dentry->d_u.d_in_lookup_hash); @@ -164,7 +164,7 @@ index ce9100b5604d..839bfa76f41e 100644 status = -EBUSY; spin_lock(&dentry->d_lock); diff --git a/fs/proc/base.c b/fs/proc/base.c -index 81d77b15b347..2c0ac4338e17 100644 +index f999e8bd3771..bf9476600c73 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1872,7 +1872,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, @@ -177,7 +177,7 @@ index 81d77b15b347..2c0ac4338e17 100644 if (IS_ERR(child)) goto end_instantiate; diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c -index d65390727541..abd4d1632e7c 100644 +index 7325baa8f9d4..31f25ff3999f 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -677,7 +677,7 @@ static bool proc_sys_fill_cache(struct file *file, @@ -190,7 +190,7 @@ index d65390727541..abd4d1632e7c 100644 if (IS_ERR(child)) return false; diff --git a/include/linux/dcache.h b/include/linux/dcache.h -index ef4b70f64f33..be6ab83705aa 100644 +index 0880baefd85f..8b4d6c8c1f7f 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -105,7 +105,7 @@ struct dentry { diff --git a/debian/patches-rt/0191-workqueue-Use-normal-rcu.patch b/debian/patches-rt/0191-workqueue-Use-normal-rcu.patch index 9806f4e41..208c26557 100644 --- a/debian/patches-rt/0191-workqueue-Use-normal-rcu.patch +++ b/debian/patches-rt/0191-workqueue-Use-normal-rcu.patch @@ -1,8 +1,8 @@ -From e29f4dc4c3456a8de27d079dc97e6489b05b61b0 Mon Sep 17 00:00:00 2001 +From 4018ce6d082178ff8281c68418cb65803b58482e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 24 Jul 2013 15:26:54 +0200 -Subject: [PATCH 191/269] workqueue: Use normal rcu -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 191/283] workqueue: Use normal rcu +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz There is no need for sched_rcu. The undocumented reason why sched_rcu is used is to avoid a few explicit rcu_read_lock()/unlock() pairs by @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index 0280deac392e..ca8014edaa84 100644 +index cd8b61bded78..88d7db5e0105 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -127,7 +127,7 @@ enum { @@ -211,7 +211,7 @@ index 0280deac392e..ca8014edaa84 100644 return false; } -@@ -3341,7 +3346,7 @@ static void rcu_free_pool(struct rcu_head *rcu) +@@ -3344,7 +3349,7 @@ static void rcu_free_pool(struct rcu_head *rcu) * put_unbound_pool - put a worker_pool * @pool: worker_pool to put * @@ -220,7 +220,7 @@ index 0280deac392e..ca8014edaa84 100644 * safe manner. get_unbound_pool() calls this function on its failure path * and this function should be able to release pools which went through, * successfully or not, init_worker_pool(). -@@ -3395,8 +3400,8 @@ static void put_unbound_pool(struct worker_pool *pool) +@@ -3398,8 +3403,8 @@ static void put_unbound_pool(struct worker_pool *pool) del_timer_sync(&pool->idle_timer); del_timer_sync(&pool->mayday_timer); @@ -231,7 +231,7 @@ index 0280deac392e..ca8014edaa84 100644 } /** -@@ -3503,14 +3508,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work) +@@ -3506,14 +3511,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work) put_unbound_pool(pool); mutex_unlock(&wq_pool_mutex); @@ -248,7 +248,7 @@ index 0280deac392e..ca8014edaa84 100644 } /** -@@ -4195,7 +4200,7 @@ void destroy_workqueue(struct workqueue_struct *wq) +@@ -4198,7 +4203,7 @@ void destroy_workqueue(struct workqueue_struct *wq) * The base ref is never dropped on per-cpu pwqs. Directly * schedule RCU free. */ @@ -257,7 +257,7 @@ index 0280deac392e..ca8014edaa84 100644 } else { /* * We're the sole accessor of @wq at this point. Directly -@@ -4305,7 +4310,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) +@@ -4308,7 +4313,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) struct pool_workqueue *pwq; bool ret; @@ -267,7 +267,7 @@ index 0280deac392e..ca8014edaa84 100644 if (cpu == WORK_CPU_UNBOUND) cpu = smp_processor_id(); -@@ -4316,7 +4322,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) +@@ -4319,7 +4325,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) pwq = unbound_pwq_by_node(wq, cpu_to_node(cpu)); ret = !list_empty(&pwq->delayed_works); @@ -277,7 +277,7 @@ index 0280deac392e..ca8014edaa84 100644 return ret; } -@@ -4342,15 +4349,15 @@ unsigned int work_busy(struct work_struct *work) +@@ -4345,15 +4352,15 @@ unsigned int work_busy(struct work_struct *work) if (work_pending(work)) ret |= WORK_BUSY_PENDING; @@ -297,7 +297,7 @@ index 0280deac392e..ca8014edaa84 100644 return ret; } -@@ -4534,7 +4541,7 @@ void show_workqueue_state(void) +@@ -4537,7 +4544,7 @@ void show_workqueue_state(void) unsigned long flags; int pi; @@ -306,7 +306,7 @@ index 0280deac392e..ca8014edaa84 100644 pr_info("Showing busy workqueues and worker pools:\n"); -@@ -4599,7 +4606,7 @@ void show_workqueue_state(void) +@@ -4602,7 +4609,7 @@ void show_workqueue_state(void) touch_nmi_watchdog(); } @@ -315,7 +315,7 @@ index 0280deac392e..ca8014edaa84 100644 } /* used to show worker information through /proc/PID/{comm,stat,status} */ -@@ -4986,16 +4993,16 @@ bool freeze_workqueues_busy(void) +@@ -4989,16 +4996,16 @@ bool freeze_workqueues_busy(void) * nr_active is monotonically decreasing. It's safe * to peek without lock. */ @@ -335,7 +335,7 @@ index 0280deac392e..ca8014edaa84 100644 } out_unlock: mutex_unlock(&wq_pool_mutex); -@@ -5190,7 +5197,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, +@@ -5193,7 +5200,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, const char *delim = ""; int node, written = 0; @@ -345,7 +345,7 @@ index 0280deac392e..ca8014edaa84 100644 for_each_node(node) { written += scnprintf(buf + written, PAGE_SIZE - written, "%s%d:%d", delim, node, -@@ -5198,7 +5206,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, +@@ -5201,7 +5209,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, delim = " "; } written += scnprintf(buf + written, PAGE_SIZE - written, "\n"); diff --git a/debian/patches-rt/0192-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch b/debian/patches-rt/0192-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch index 3a6ec1faf..2d5b38bd8 100644 --- a/debian/patches-rt/0192-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch +++ b/debian/patches-rt/0192-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch @@ -1,9 +1,9 @@ -From 693d52e4cc082c2aafb8154ee7581e38f4c584d3 Mon Sep 17 00:00:00 2001 +From c6764ccb97710b9c7026328c5403d2fac671b693 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:42:26 +0200 -Subject: [PATCH 192/269] workqueue: Use local irq lock instead of irq disable +Subject: [PATCH 192/283] workqueue: Use local irq lock instead of irq disable regions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Use a local_irq_lock as a replacement for irq off regions. We keep the semantic of irq-off in regard to the pool->lock and remain preemptible. @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index ca8014edaa84..1e8b2ff804e3 100644 +index 88d7db5e0105..d168a5581c7f 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -49,6 +49,7 @@ @@ -150,7 +150,7 @@ index ca8014edaa84..1e8b2ff804e3 100644 } /** -@@ -2999,7 +3014,7 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork) +@@ -3002,7 +3017,7 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork) /* tell other tasks trying to grab @work to back off */ mark_work_canceling(work); @@ -159,7 +159,7 @@ index ca8014edaa84..1e8b2ff804e3 100644 /* * This allows canceling during early boot. We know that @work -@@ -3060,10 +3075,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); +@@ -3063,10 +3078,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); */ bool flush_delayed_work(struct delayed_work *dwork) { @@ -172,7 +172,7 @@ index ca8014edaa84..1e8b2ff804e3 100644 return flush_work(&dwork->work); } EXPORT_SYMBOL(flush_delayed_work); -@@ -3101,7 +3116,7 @@ static bool __cancel_work(struct work_struct *work, bool is_dwork) +@@ -3104,7 +3119,7 @@ static bool __cancel_work(struct work_struct *work, bool is_dwork) return false; set_work_pool_and_clear_pending(work, get_work_pool_id(work)); diff --git a/debian/patches-rt/0193-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch b/debian/patches-rt/0193-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch index c591a7925..0856d4f67 100644 --- a/debian/patches-rt/0193-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch +++ b/debian/patches-rt/0193-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch @@ -1,8 +1,8 @@ -From d874f4bd157934c3b8f5f30c0291b9716f86e849 Mon Sep 17 00:00:00 2001 +From 95e529176f4d5f1da0194d25b6a7434f5dc66590 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 1 Jul 2013 11:02:42 +0200 -Subject: [PATCH 193/269] workqueue: Prevent workqueue versus ata-piix livelock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 193/283] workqueue: Prevent workqueue versus ata-piix livelock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz An Intel i7 system regularly detected rcu_preempt stalls after the kernel was upgraded from 3.6-rt to 3.8-rt. When the stall happened, disk I/O was no @@ -114,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index 1e8b2ff804e3..f6551d189ca4 100644 +index d168a5581c7f..0a11d2f64424 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -50,6 +50,7 @@ diff --git a/debian/patches-rt/0194-sched-Distangle-worker-accounting-from-rqlock.patch b/debian/patches-rt/0194-sched-Distangle-worker-accounting-from-rqlock.patch index c9b774d39..5a2485843 100644 --- a/debian/patches-rt/0194-sched-Distangle-worker-accounting-from-rqlock.patch +++ b/debian/patches-rt/0194-sched-Distangle-worker-accounting-from-rqlock.patch @@ -1,8 +1,8 @@ -From 4452796adea3514d123d9e41188dfcfc86adc6d0 Mon Sep 17 00:00:00 2001 +From 2a67f032ed0f4dc51e3cfbba38a8b4bedbf3f9a0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 22 Jun 2011 19:47:03 +0200 -Subject: [PATCH 194/269] sched: Distangle worker accounting from rqlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 194/283] sched: Distangle worker accounting from rqlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The worker accounting for cpu bound workers is plugged into the core scheduler code and the wakeup code. This is not a hard requirement and @@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior 3 files changed, 47 insertions(+), 100 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index fb205b1ec799..1cd1abc45097 100644 +index 36f791ff52bc..08052198031a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1704,10 +1704,6 @@ static inline void ttwu_activate(struct rq *rq, struct task_struct *p, int en_fl @@ -170,7 +170,7 @@ index fb205b1ec799..1cd1abc45097 100644 EXPORT_SYMBOL(schedule); diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index f6551d189ca4..bf7be926ce5f 100644 +index 0a11d2f64424..aa39924bd3b5 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -843,43 +843,32 @@ static void wake_up_worker(struct worker_pool *pool) diff --git a/debian/patches-rt/0195-debugobjects-Make-RT-aware.patch b/debian/patches-rt/0195-debugobjects-Make-RT-aware.patch index 5ee612e9b..f05ab0ddb 100644 --- a/debian/patches-rt/0195-debugobjects-Make-RT-aware.patch +++ b/debian/patches-rt/0195-debugobjects-Make-RT-aware.patch @@ -1,8 +1,8 @@ -From bfbfd69e3adaeffcc546f391f1f039dd715b2d57 Mon Sep 17 00:00:00 2001 +From a51785a98d1a72ead35a11a9fc57eaaf37789736 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:41:35 +0200 -Subject: [PATCH 195/269] debugobjects: Make RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 195/283] debugobjects: Make RT aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Avoid filling the pool / allocating memory with irqs off(). diff --git a/debian/patches-rt/0196-seqlock-Prevent-rt-starvation.patch b/debian/patches-rt/0196-seqlock-Prevent-rt-starvation.patch index aa6352f84..5d7b32ce2 100644 --- a/debian/patches-rt/0196-seqlock-Prevent-rt-starvation.patch +++ b/debian/patches-rt/0196-seqlock-Prevent-rt-starvation.patch @@ -1,8 +1,8 @@ -From 62e2b0613933b1d4557d86f4557375a9ee647fa7 Mon Sep 17 00:00:00 2001 +From 57407205aa8a3eacf4fb95e6ae48e68850c42cf4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 22 Feb 2012 12:03:30 +0100 -Subject: [PATCH 196/269] seqlock: Prevent rt starvation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 196/283] seqlock: Prevent rt starvation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz If a low prio writer gets preempted while holding the seqlock write locked, a high prio reader spins forever on RT. diff --git a/debian/patches-rt/0197-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches-rt/0197-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch index 5f2a75b29..5f7a3b86d 100644 --- a/debian/patches-rt/0197-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/debian/patches-rt/0197-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,9 +1,9 @@ -From b1572dc20a39a216ac1fbb36998f32af0f79b9ae Mon Sep 17 00:00:00 2001 +From 69eb884bf0625cc689fe528f261b51906bf389d1 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 18 Feb 2015 16:05:28 +0100 -Subject: [PATCH 197/269] sunrpc: Make svc_xprt_do_enqueue() use +Subject: [PATCH 197/283] sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd diff --git a/debian/patches-rt/0198-net-Use-skbufhead-with-raw-lock.patch b/debian/patches-rt/0198-net-Use-skbufhead-with-raw-lock.patch index bbeb25b0f..24ded5272 100644 --- a/debian/patches-rt/0198-net-Use-skbufhead-with-raw-lock.patch +++ b/debian/patches-rt/0198-net-Use-skbufhead-with-raw-lock.patch @@ -1,8 +1,8 @@ -From 4893c0317fda3cc20eac3b4bbfcdd808ef3db828 Mon Sep 17 00:00:00 2001 +From 21c221625426b72acf5aad55261378a107daab99 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 12 Jul 2011 15:38:34 +0200 -Subject: [PATCH 198/269] net: Use skbufhead with raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 198/283] net: Use skbufhead with raw lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Use the rps lock as rawlock so we can keep irq-off regions. It looks low latency. However we can't kfree() from this context therefore we defer this @@ -28,7 +28,7 @@ index 8c2fec0bcb26..384c63ecb9ae 100644 }; diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index 820903ceac4f..f7f3abb41acb 100644 +index 28baccb1efd5..b4412944db54 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -287,6 +287,7 @@ struct sk_buff_head { @@ -39,7 +39,7 @@ index 820903ceac4f..f7f3abb41acb 100644 }; struct sk_buff; -@@ -1702,6 +1703,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) +@@ -1704,6 +1705,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) __skb_queue_head_init(list); } @@ -53,7 +53,7 @@ index 820903ceac4f..f7f3abb41acb 100644 struct lock_class_key *class) { diff --git a/net/core/dev.c b/net/core/dev.c -index b8208b940b5d..327a985bf0c7 100644 +index abaf8a73403b..616429a4715c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -217,14 +217,14 @@ static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex) diff --git a/debian/patches-rt/0199-net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/debian/patches-rt/0199-net-move-xmit_recursion-to-per-task-variable-on-RT.patch index 6efd0219c..678fdcb76 100644 --- a/debian/patches-rt/0199-net-move-xmit_recursion-to-per-task-variable-on-RT.patch +++ b/debian/patches-rt/0199-net-move-xmit_recursion-to-per-task-variable-on-RT.patch @@ -1,8 +1,8 @@ -From e6cdcf7dbf2aa921c55ed19673c775491efc2a75 Mon Sep 17 00:00:00 2001 +From 2cb581744045c7aea758c05bbc5c84389753b1a5 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Jan 2016 15:55:02 +0100 -Subject: [PATCH 199/269] net: move xmit_recursion to per-task variable on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 199/283] net: move xmit_recursion to per-task variable on -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz A softirq on -RT can be preempted. That means one task is in __dev_queue_xmit(), gets preempted and another task may enter @@ -198,7 +198,7 @@ index a023e1ba5d8f..a9a5edfa9689 100644 int pagefault_disabled; #ifdef CONFIG_MMU diff --git a/net/core/dev.c b/net/core/dev.c -index 327a985bf0c7..ee90223959fc 100644 +index 616429a4715c..1a8677236939 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3537,8 +3537,10 @@ static void skb_update_prio(struct sk_buff *skb) @@ -249,7 +249,7 @@ index 327a985bf0c7..ee90223959fc 100644 queue->dev = dev; #ifdef CONFIG_BQL diff --git a/net/core/filter.c b/net/core/filter.c -index eb81e9db4093..2dd1f2eef4fa 100644 +index 34ec9324737b..03925960fb5c 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -2000,7 +2000,7 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) diff --git a/debian/patches-rt/0200-net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/debian/patches-rt/0200-net-provide-a-way-to-delegate-processing-a-softirq-t.patch index 3305be2c9..b876fd9eb 100644 --- a/debian/patches-rt/0200-net-provide-a-way-to-delegate-processing-a-softirq-t.patch +++ b/debian/patches-rt/0200-net-provide-a-way-to-delegate-processing-a-softirq-t.patch @@ -1,9 +1,9 @@ -From 0ba4f1b56a7639a293956b84416566f0211c8c77 Mon Sep 17 00:00:00 2001 +From 713b395adee9bc6d03ba74839407be41a05a6e89 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 15:39:05 +0100 -Subject: [PATCH 200/269] net: provide a way to delegate processing a softirq +Subject: [PATCH 200/283] net: provide a way to delegate processing a softirq to ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz If the NET_RX uses up all of his budget it moves the following NAPI invocations into the `ksoftirqd`. On -RT it does not do so. Instead it @@ -72,7 +72,7 @@ index 27a4bb2303d0..25bcf2f2714b 100644 * This function must run with irqs disabled! */ diff --git a/net/core/dev.c b/net/core/dev.c -index ee90223959fc..da95705ccb67 100644 +index 1a8677236939..0da36fb20153 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6382,7 +6382,7 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) diff --git a/debian/patches-rt/0201-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches-rt/0201-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index 8d4a8a1e6..09646ca05 100644 --- a/debian/patches-rt/0201-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/debian/patches-rt/0201-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,9 +1,9 @@ -From 9e7513a103f18db66ffaf2bcfd13c834cba602d7 Mon Sep 17 00:00:00 2001 +From d81c8e92081b67d58e45585afb0020c6759e671e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 30 Mar 2016 13:36:29 +0200 -Subject: [PATCH 201/269] net: dev: always take qdisc's busylock in +Subject: [PATCH 201/283] net: dev: always take qdisc's busylock in __dev_xmit_skb() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The root-lock is dropped before dev_hard_start_xmit() is invoked and after setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away @@ -22,7 +22,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 4 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c -index da95705ccb67..351e81f8a72d 100644 +index 0da36fb20153..305bf1240e8a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3465,7 +3465,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, diff --git a/debian/patches-rt/0202-net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches-rt/0202-net-Qdisc-use-a-seqlock-instead-seqcount.patch index f5c396888..0e4c548b9 100644 --- a/debian/patches-rt/0202-net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/debian/patches-rt/0202-net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,8 +1,8 @@ -From 8f5f7360b52bbe5081ba3204a2004f6fdeb75114 Mon Sep 17 00:00:00 2001 +From f0d7dcb8d6664bb3c716c75710d0a37f3ed3d107 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 17:36:35 +0200 -Subject: [PATCH 202/269] net/Qdisc: use a seqlock instead seqcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 202/283] net/Qdisc: use a seqlock instead seqcount +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The seqcount disables preemption on -RT while it is held which can't remove. Also we don't want the reader to spin for ages if the writer is diff --git a/debian/patches-rt/0203-net-add-back-the-missing-serialization-in-ip_send_un.patch b/debian/patches-rt/0203-net-add-back-the-missing-serialization-in-ip_send_un.patch index 622c57d05..5b0537d1b 100644 --- a/debian/patches-rt/0203-net-add-back-the-missing-serialization-in-ip_send_un.patch +++ b/debian/patches-rt/0203-net-add-back-the-missing-serialization-in-ip_send_un.patch @@ -1,12 +1,12 @@ -From de40c876cec758a0735fda3a4dffd05924f12a4b Mon Sep 17 00:00:00 2001 +From 65c80c3225a3398c6f65566593d114a2a92baa6c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:21:56 +0200 -Subject: [PATCH 203/269] net: add back the missing serialization in +Subject: [PATCH 203/283] net: add back the missing serialization in ip_send_unicast_reply() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Some time ago Sami Pietikäinen reported a crash on -RT in ip_send_unicast_reply() which was later fixed by Nicholas Mc Guire @@ -43,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 6 insertions(+) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index 11101cf8693b..2b7205ad261a 100644 +index b76cf96d5cfe..51358c73dada 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -62,6 +62,7 @@ diff --git a/debian/patches-rt/0204-net-add-a-lock-around-icmp_sk.patch b/debian/patches-rt/0204-net-add-a-lock-around-icmp_sk.patch index 2e7f049fc..13a30b850 100644 --- a/debian/patches-rt/0204-net-add-a-lock-around-icmp_sk.patch +++ b/debian/patches-rt/0204-net-add-a-lock-around-icmp_sk.patch @@ -1,8 +1,8 @@ -From c35d9dd75bf9f6d2e39202e23d04a8850172240f Mon Sep 17 00:00:00 2001 +From 46a531f02facc10cbd982f8de9c62e704d8f1815 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:54:09 +0200 -Subject: [PATCH 204/269] net: add a lock around icmp_sk() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 204/283] net: add a lock around icmp_sk() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz It looks like the this_cpu_ptr() access in icmp_sk() is protected with local_bh_disable(). To avoid missing serialization in -RT I am adding diff --git a/debian/patches-rt/0205-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/debian/patches-rt/0205-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index cba93650c..d6a067f1e 100644 --- a/debian/patches-rt/0205-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/debian/patches-rt/0205-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -1,9 +1,9 @@ -From bdd2169d3d5cc93fcaca144c2166ac375331e25d Mon Sep 17 00:00:00 2001 +From 6b041ae87c727d10384398ec51f0003ef02cdc38 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Tue, 6 Dec 2016 17:50:30 -0500 -Subject: [PATCH 205/269] net: Have __napi_schedule_irqoff() disable interrupts +Subject: [PATCH 205/283] net: Have __napi_schedule_irqoff() disable interrupts on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz A customer hit a crash where the napi sd->poll_list became corrupted. The customer had the bnx2x driver, which does a @@ -53,7 +53,7 @@ index b6a75296eb46..946875cae933 100644 static inline bool napi_disable_pending(struct napi_struct *n) { diff --git a/net/core/dev.c b/net/core/dev.c -index 351e81f8a72d..50fe1e3ee26d 100644 +index 305bf1240e8a..d86972449f63 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5952,6 +5952,7 @@ bool napi_schedule_prep(struct napi_struct *n) diff --git a/debian/patches-rt/0206-irqwork-push-most-work-into-softirq-context.patch b/debian/patches-rt/0206-irqwork-push-most-work-into-softirq-context.patch index 59765a7e6..c0fd5a20f 100644 --- a/debian/patches-rt/0206-irqwork-push-most-work-into-softirq-context.patch +++ b/debian/patches-rt/0206-irqwork-push-most-work-into-softirq-context.patch @@ -1,8 +1,8 @@ -From 01a7f110c5d6b059012d7f6cf4c1b3af79253a7c Mon Sep 17 00:00:00 2001 +From b1507e25e704c438e660c5c1825ec806b158f556 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 23 Jun 2015 15:32:51 +0200 -Subject: [PATCH 206/269] irqwork: push most work into softirq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 206/283] irqwork: push most work into softirq context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Initially we defered all irqwork into softirq because we didn't want the latency spikes if perf or another user was busy and delayed the RT task. @@ -23,13 +23,13 @@ Mike Galbraith, hard and soft variant] Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/irq_work.h | 8 ++++++ - kernel/irq_work.c | 60 +++++++++++++++++++++++++++++++--------- + include/linux/irq_work.h | 8 +++++ + kernel/irq_work.c | 75 ++++++++++++++++++++++++++++++---------- kernel/rcu/tree.c | 1 + kernel/sched/topology.c | 1 + kernel/time/tick-sched.c | 1 + kernel/time/timer.c | 2 ++ - 6 files changed, 60 insertions(+), 13 deletions(-) + 6 files changed, 70 insertions(+), 18 deletions(-) diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h index b11fcdfd0770..0c50559987c5 100644 @@ -56,7 +56,7 @@ index b11fcdfd0770..0c50559987c5 100644 + #endif /* _LINUX_IRQ_WORK_H */ diff --git a/kernel/irq_work.c b/kernel/irq_work.c -index 6b7cdf17ccf8..7b41d9aa3e9b 100644 +index 73288914ed5e..2940622da5b3 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -17,6 +17,7 @@ @@ -67,43 +67,13 @@ index 6b7cdf17ccf8..7b41d9aa3e9b 100644 #include -@@ -64,6 +65,8 @@ void __weak arch_irq_work_raise(void) - */ - bool irq_work_queue_on(struct irq_work *work, int cpu) +@@ -57,29 +58,35 @@ void __weak arch_irq_work_raise(void) + } + + /* Enqueue on current CPU, work must already be claimed and preempt disabled */ +-static void __irq_work_queue_local(struct irq_work *work) ++static void __irq_work_queue_local(struct irq_work *work, struct llist_head *list) { -+ struct llist_head *list; -+ - /* All work should have been flushed before going offline */ - WARN_ON_ONCE(cpu_is_offline(cpu)); - -@@ -76,7 +79,12 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) - if (!irq_work_claim(work)) - return false; - -- if (llist_add(&work->llnode, &per_cpu(raised_list, cpu))) -+ if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !(work->flags & IRQ_WORK_HARD_IRQ)) -+ list = &per_cpu(lazy_list, cpu); -+ else -+ list = &per_cpu(raised_list, cpu); -+ -+ if (llist_add(&work->llnode, list)) - arch_send_call_function_single_ipi(cpu); - - #else /* #ifdef CONFIG_SMP */ -@@ -89,6 +97,9 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) - /* Enqueue the irq work @work on the current CPU */ - bool irq_work_queue(struct irq_work *work) - { -+ struct llist_head *list; -+ bool lazy_work, realtime = IS_ENABLED(CONFIG_PREEMPT_RT_FULL); -+ - /* Only queue if not already pending */ - if (!irq_work_claim(work)) - return false; -@@ -96,13 +107,15 @@ bool irq_work_queue(struct irq_work *work) - /* Queue the entry and raise the IPI if needed. */ - preempt_disable(); - - /* If the work is "lazy", handle it from next tick if any */ - if (work->flags & IRQ_WORK_LAZY) { - if (llist_add(&work->llnode, this_cpu_ptr(&lazy_list)) && @@ -111,19 +81,74 @@ index 6b7cdf17ccf8..7b41d9aa3e9b 100644 - arch_irq_work_raise(); - } else { - if (llist_add(&work->llnode, this_cpu_ptr(&raised_list))) -+ lazy_work = work->flags & IRQ_WORK_LAZY; +- arch_irq_work_raise(); +- } ++ bool empty; + -+ if (lazy_work || (realtime && !(work->flags & IRQ_WORK_HARD_IRQ))) ++ empty = llist_add(&work->llnode, list); ++ ++ if (empty && ++ (!(work->flags & IRQ_WORK_LAZY) || ++ tick_nohz_tick_stopped())) ++ arch_irq_work_raise(); + } + + /* Enqueue the irq work @work on the current CPU */ + bool irq_work_queue(struct irq_work *work) + { ++ struct llist_head *list; ++ + /* Only queue if not already pending */ + if (!irq_work_claim(work)) + return false; + + /* Queue the entry and raise the IPI if needed. */ + preempt_disable(); +- __irq_work_queue_local(work); ++ if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !(work->flags & IRQ_WORK_HARD_IRQ)) + list = this_cpu_ptr(&lazy_list); + else + list = this_cpu_ptr(&raised_list); + -+ if (llist_add(&work->llnode, list)) { -+ if (!lazy_work || tick_nohz_tick_stopped()) - arch_irq_work_raise(); - } ++ __irq_work_queue_local(work, list); + preempt_enable(); -@@ -119,9 +132,8 @@ bool irq_work_needs_cpu(void) + return true; +@@ -98,6 +105,9 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) + return irq_work_queue(work); + + #else /* CONFIG_SMP: */ ++ struct llist_head *list; ++ bool lazy_work, realtime = IS_ENABLED(CONFIG_PREEMPT_RT_FULL); ++ + /* All work should have been flushed before going offline */ + WARN_ON_ONCE(cpu_is_offline(cpu)); + +@@ -106,13 +116,21 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) + return false; + + preempt_disable(); ++ ++ lazy_work = work->flags & IRQ_WORK_LAZY; ++ ++ if (lazy_work || (realtime && !(work->flags & IRQ_WORK_HARD_IRQ))) ++ list = &per_cpu(lazy_list, cpu); ++ else ++ list = &per_cpu(raised_list, cpu); ++ + if (cpu != smp_processor_id()) { + /* Arch remote IPI send/receive backend aren't NMI safe */ + WARN_ON_ONCE(in_nmi()); +- if (llist_add(&work->llnode, &per_cpu(raised_list, cpu))) ++ if (llist_add(&work->llnode, list)) + arch_send_call_function_single_ipi(cpu); + } else { +- __irq_work_queue_local(work); ++ __irq_work_queue_local(work, list); + } + preempt_enable(); + +@@ -128,9 +146,8 @@ bool irq_work_needs_cpu(void) raised = this_cpu_ptr(&raised_list); lazy = this_cpu_ptr(&lazy_list); @@ -135,7 +160,7 @@ index 6b7cdf17ccf8..7b41d9aa3e9b 100644 /* All work should have been flushed before going offline */ WARN_ON_ONCE(cpu_is_offline(smp_processor_id())); -@@ -135,8 +147,12 @@ static void irq_work_run_list(struct llist_head *list) +@@ -144,8 +161,12 @@ static void irq_work_run_list(struct llist_head *list) struct llist_node *llnode; unsigned long flags; @@ -149,7 +174,7 @@ index 6b7cdf17ccf8..7b41d9aa3e9b 100644 if (llist_empty(list)) return; -@@ -168,7 +184,16 @@ static void irq_work_run_list(struct llist_head *list) +@@ -177,7 +198,16 @@ static void irq_work_run_list(struct llist_head *list) void irq_work_run(void) { irq_work_run_list(this_cpu_ptr(&raised_list)); @@ -167,7 +192,7 @@ index 6b7cdf17ccf8..7b41d9aa3e9b 100644 } EXPORT_SYMBOL_GPL(irq_work_run); -@@ -178,8 +203,17 @@ void irq_work_tick(void) +@@ -187,8 +217,17 @@ void irq_work_tick(void) if (!llist_empty(raised) && !arch_irq_work_has_interrupt()) irq_work_run_list(raised); diff --git a/debian/patches-rt/0207-printk-Make-rt-aware.patch b/debian/patches-rt/0207-printk-Make-rt-aware.patch index b2e98eda1..5f655ebc9 100644 --- a/debian/patches-rt/0207-printk-Make-rt-aware.patch +++ b/debian/patches-rt/0207-printk-Make-rt-aware.patch @@ -1,8 +1,8 @@ -From 4d49bcfa2103be6571f2f53e06e8fa71d49feb9b Mon Sep 17 00:00:00 2001 +From fd90db4e8653f0ebf2a6959313658fcdaadec8fc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 19 Sep 2012 14:50:37 +0200 -Subject: [PATCH 207/269] printk: Make rt aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 207/283] printk: Make rt aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Drop the lock before calling the console driver and do not disable interrupts while printing to a serial console. diff --git a/debian/patches-rt/0208-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch b/debian/patches-rt/0208-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch index 9fa099d20..dd45846c8 100644 --- a/debian/patches-rt/0208-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch +++ b/debian/patches-rt/0208-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch @@ -1,8 +1,8 @@ -From 160a19dcfe1a664e430a678562901a32630f7ee2 Mon Sep 17 00:00:00 2001 +From af21e5c755447f232fe96ab7df9ecaf8df8a15a7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 19 May 2016 17:45:27 +0200 -Subject: [PATCH 208/269] kernel/printk: Don't try to print from IRQ/NMI region -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 208/283] kernel/printk: Don't try to print from IRQ/NMI region +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On -RT we try to acquire sleeping locks which might lead to warnings from lockdep or a warn_on() from spin_try_lock() (which is a rtmutex on diff --git a/debian/patches-rt/0209-printk-Drop-the-logbuf_lock-more-often.patch b/debian/patches-rt/0209-printk-Drop-the-logbuf_lock-more-often.patch index fce341649..9e0869700 100644 --- a/debian/patches-rt/0209-printk-Drop-the-logbuf_lock-more-often.patch +++ b/debian/patches-rt/0209-printk-Drop-the-logbuf_lock-more-often.patch @@ -1,8 +1,8 @@ -From bf31931f09583088100f40d4c4b255571cc72578 Mon Sep 17 00:00:00 2001 +From b0852ca451c4ab71a2ce94c00e267b8eb82e3ac2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Mar 2013 19:01:05 +0100 -Subject: [PATCH 209/269] printk: Drop the logbuf_lock more often -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 209/283] printk: Drop the logbuf_lock more often +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The lock is hold with irgs off. The latency drops 500us+ on my arm bugs with a "full" buffer after executing "dmesg" on the shell. diff --git a/debian/patches-rt/0210-ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches-rt/0210-ARM-enable-irq-in-translation-section-permission-fau.patch index 27bab5317..2038566c6 100644 --- a/debian/patches-rt/0210-ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/debian/patches-rt/0210-ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,12 +1,12 @@ -From 740bf3655673f2b77230957eb21238798aa0b203 Mon Sep 17 00:00:00 2001 +From d3668df4d5096d46b33e7f75444dcecf362dfb81 Mon Sep 17 00:00:00 2001 From: "Yadi.hu" Date: Wed, 10 Dec 2014 10:32:09 +0800 -Subject: [PATCH 210/269] ARM: enable irq in translation/section permission +Subject: [PATCH 210/283] ARM: enable irq in translation/section permission fault handlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL diff --git a/debian/patches-rt/0211-genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches-rt/0211-genirq-update-irq_set_irqchip_state-documentation.patch index 2faaaed4e..55cd910c7 100644 --- a/debian/patches-rt/0211-genirq-update-irq_set_irqchip_state-documentation.patch +++ b/debian/patches-rt/0211-genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,8 +1,8 @@ -From 9179df818d04fdf3d3cc195a5d19fac4b4c904f1 Mon Sep 17 00:00:00 2001 +From a44a97a7d302fab9e3435afc7023d3ebff277efd Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:00 -0600 -Subject: [PATCH 211/269] genirq: update irq_set_irqchip_state documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 211/283] genirq: update irq_set_irqchip_state documentation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On -rt kernels, the use of migrate_disable()/migrate_enable() is sufficient to guarantee a task isn't moved to another CPU. Update the @@ -15,10 +15,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index ba5bba5f1ffd..48c2690070f3 100644 +index 69b4bfd4654c..aafe2256bd39 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -2277,7 +2277,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); +@@ -2282,7 +2282,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); * This call sets the internal irqchip state of an interrupt, * depending on the value of @which. * diff --git a/debian/patches-rt/0212-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches-rt/0212-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index 354774ae4..879bd591a 100644 --- a/debian/patches-rt/0212-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/debian/patches-rt/0212-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,9 +1,9 @@ -From 7635f97cb803db25caa49d5fd48ecb46672272d9 Mon Sep 17 00:00:00 2001 +From a3a039471f58abf91d2007ede9a7e308c834b456 Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:01 -0600 -Subject: [PATCH 212/269] KVM: arm/arm64: downgrade preempt_disable()d region +Subject: [PATCH 212/283] KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating the vgic and timer states to prevent the calling task from migrating to @@ -24,10 +24,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c -index 1415e36fed3d..8d8caad49eb6 100644 +index 02bac8abd206..d36802fe2825 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c -@@ -709,7 +709,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) +@@ -712,7 +712,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) * involves poking the GIC, which must be done in a * non-preemptible context. */ @@ -36,7 +36,7 @@ index 1415e36fed3d..8d8caad49eb6 100644 kvm_pmu_flush_hwstate(vcpu); -@@ -758,7 +758,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) +@@ -761,7 +761,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) kvm_timer_sync_hwstate(vcpu); kvm_vgic_sync_hwstate(vcpu); local_irq_enable(); @@ -45,7 +45,7 @@ index 1415e36fed3d..8d8caad49eb6 100644 continue; } -@@ -836,7 +836,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) +@@ -839,7 +839,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) /* Exit types that need handling before we can be preempted */ handle_exit_early(vcpu, run, ret); diff --git a/debian/patches-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch b/debian/patches-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch index 6d0753409..d2cf2b5f1 100644 --- a/debian/patches-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +++ b/debian/patches-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch @@ -1,9 +1,9 @@ -From 25f8f6ec0e7c56b6029b247d513eec0ba512da9b Mon Sep 17 00:00:00 2001 +From d42064d787982281635b029761c83a285c877f51 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 25 Jul 2018 14:02:38 +0200 -Subject: [PATCH 213/269] arm64: fpsimd: use preemp_disable in addition to +Subject: [PATCH 213/283] arm64: fpsimd: use preemp_disable in addition to local_bh_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The code disables BH and expects that it is not preemptible. On -RT the diff --git a/debian/patches-rt/0214-kgdb-serial-Short-term-workaround.patch b/debian/patches-rt/0214-kgdb-serial-Short-term-workaround.patch index 32399b019..4199c9322 100644 --- a/debian/patches-rt/0214-kgdb-serial-Short-term-workaround.patch +++ b/debian/patches-rt/0214-kgdb-serial-Short-term-workaround.patch @@ -1,8 +1,8 @@ -From b9a4d200f0fc873f1ad960b730b283ea779c74a4 Mon Sep 17 00:00:00 2001 +From afa7e85db981a95a467d06226214ecfb0bbca27b Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Thu, 28 Jul 2011 12:42:23 -0500 -Subject: [PATCH 214/269] kgdb/serial: Short term workaround -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 214/283] kgdb/serial: Short term workaround +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On 07/27/2011 04:37 PM, Thomas Gleixner wrote: > - KGDB (not yet disabled) is reportedly unusable on -rt right now due @@ -25,7 +25,7 @@ Jason. 3 files changed, 7 insertions(+) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 851d7f6046a4..a2705b401efc 100644 +index 8d85448975d3..ebc98ce465b8 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -31,6 +31,7 @@ @@ -36,7 +36,7 @@ index 851d7f6046a4..a2705b401efc 100644 #include #include #include -@@ -3241,6 +3242,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, +@@ -3240,6 +3241,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, if (port->sysrq || oops_in_progress) locked = 0; diff --git a/debian/patches-rt/0215-sysfs-Add-sys-kernel-realtime-entry.patch b/debian/patches-rt/0215-sysfs-Add-sys-kernel-realtime-entry.patch index d36f7509e..7068b4175 100644 --- a/debian/patches-rt/0215-sysfs-Add-sys-kernel-realtime-entry.patch +++ b/debian/patches-rt/0215-sysfs-Add-sys-kernel-realtime-entry.patch @@ -1,8 +1,8 @@ -From 65880324093a78662b662259e6d79ad55ac8a4bf Mon Sep 17 00:00:00 2001 +From 012396ccc66ac609679e12d1bf475300918d4e31 Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Sat, 30 Jul 2011 21:55:53 -0500 -Subject: [PATCH 215/269] sysfs: Add /sys/kernel/realtime entry -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 215/283] sysfs: Add /sys/kernel/realtime entry +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. diff --git a/debian/patches-rt/0216-mm-rt-kmap_atomic-scheduling.patch b/debian/patches-rt/0216-mm-rt-kmap_atomic-scheduling.patch index 9903fe04d..3231431f9 100644 --- a/debian/patches-rt/0216-mm-rt-kmap_atomic-scheduling.patch +++ b/debian/patches-rt/0216-mm-rt-kmap_atomic-scheduling.patch @@ -1,8 +1,8 @@ -From e8dfb76eeb36e00d6827406f9b0d110eee60a084 Mon Sep 17 00:00:00 2001 +From 7852dee63089f616ea97bbbc5137c7312fab3ea8 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 28 Jul 2011 10:43:51 +0200 -Subject: [PATCH 216/269] mm, rt: kmap_atomic scheduling -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 216/283] mm, rt: kmap_atomic scheduling +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In fact, with migrate_disable() existing one could play games with kmap_atomic. You could save/restore the kmap_atomic slots on context @@ -31,7 +31,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins 7 files changed, 88 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c -index d3e593eb189f..84afe55625f8 100644 +index 020efe0f9614..5d0c975559ad 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -38,6 +38,7 @@ @@ -42,7 +42,7 @@ index d3e593eb189f..84afe55625f8 100644 #include #include -@@ -198,6 +199,35 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) +@@ -205,6 +206,35 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) } EXPORT_SYMBOL_GPL(start_thread); @@ -78,7 +78,7 @@ index d3e593eb189f..84afe55625f8 100644 /* * switch_to(x,y) should switch tasks from x to y. -@@ -267,6 +297,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) +@@ -274,6 +304,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) switch_to_extra(prev_p, next_p); diff --git a/debian/patches-rt/0217-x86-highmem-Add-a-already-used-pte-check.patch b/debian/patches-rt/0217-x86-highmem-Add-a-already-used-pte-check.patch index b1b7b954f..96e64361a 100644 --- a/debian/patches-rt/0217-x86-highmem-Add-a-already-used-pte-check.patch +++ b/debian/patches-rt/0217-x86-highmem-Add-a-already-used-pte-check.patch @@ -1,8 +1,8 @@ -From c22bb5db4da4e6b17aa8a6387ffcd503dea51ec5 Mon Sep 17 00:00:00 2001 +From 26d14743e5183f7a37bf0a4489428926868186de Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 17:09:55 +0100 -Subject: [PATCH 217/269] x86/highmem: Add a "already used pte" check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 217/283] x86/highmem: Add a "already used pte" check +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz This is a copy from kmap_atomic_prot(). diff --git a/debian/patches-rt/0218-arm-highmem-Flush-tlb-on-unmap.patch b/debian/patches-rt/0218-arm-highmem-Flush-tlb-on-unmap.patch index 7e0d0716c..aa407c2ea 100644 --- a/debian/patches-rt/0218-arm-highmem-Flush-tlb-on-unmap.patch +++ b/debian/patches-rt/0218-arm-highmem-Flush-tlb-on-unmap.patch @@ -1,8 +1,8 @@ -From fba4ff7b8883d22067b9453a1d158c520f067b70 Mon Sep 17 00:00:00 2001 +From 2335fd68385693465319a8ed36dc816837cc2d13 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 21:37:27 +0100 -Subject: [PATCH 218/269] arm/highmem: Flush tlb on unmap -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 218/283] arm/highmem: Flush tlb on unmap +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The tlb should be flushed on unmap and thus make the mapping entry invalid. This is only done in the non-debug case which does not look diff --git a/debian/patches-rt/0219-arm-Enable-highmem-for-rt.patch b/debian/patches-rt/0219-arm-Enable-highmem-for-rt.patch index 3fd47f8bc..32d6da4a2 100644 --- a/debian/patches-rt/0219-arm-Enable-highmem-for-rt.patch +++ b/debian/patches-rt/0219-arm-Enable-highmem-for-rt.patch @@ -1,8 +1,8 @@ -From 1a0e06d9a75c6d9d6ec21e345030430e78e81a84 Mon Sep 17 00:00:00 2001 +From dbd3e75fbbecfbb79a264b7c2b8f092d4671dfaa Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 13 Feb 2013 11:03:11 +0100 -Subject: [PATCH 219/269] arm: Enable highmem for rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 219/283] arm: Enable highmem for rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz fixup highmem for ARM. diff --git a/debian/patches-rt/0220-scsi-fcoe-Make-RT-aware.patch b/debian/patches-rt/0220-scsi-fcoe-Make-RT-aware.patch index 34e2e21a4..13f796594 100644 --- a/debian/patches-rt/0220-scsi-fcoe-Make-RT-aware.patch +++ b/debian/patches-rt/0220-scsi-fcoe-Make-RT-aware.patch @@ -1,8 +1,8 @@ -From f4644bebeab291324244e2cb3d957c692cec7168 Mon Sep 17 00:00:00 2001 +From e8f1bc60d8f9bb78f3671441af7f6dea46c576a9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 12 Nov 2011 14:00:48 +0100 -Subject: [PATCH 220/269] scsi/fcoe: Make RT aware. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 220/283] scsi/fcoe: Make RT aware. +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. diff --git a/debian/patches-rt/0221-x86-crypto-Reduce-preempt-disabled-regions.patch b/debian/patches-rt/0221-x86-crypto-Reduce-preempt-disabled-regions.patch index 9a663411e..a8f06ec60 100644 --- a/debian/patches-rt/0221-x86-crypto-Reduce-preempt-disabled-regions.patch +++ b/debian/patches-rt/0221-x86-crypto-Reduce-preempt-disabled-regions.patch @@ -1,8 +1,8 @@ -From 3f5be0658bbd8160961eec6f903d89aad36f03f1 Mon Sep 17 00:00:00 2001 +From db7f78bb12a8de39b10bf4c414283150adf48dad Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 14 Nov 2011 18:19:27 +0100 -Subject: [PATCH 221/269] x86: crypto: Reduce preempt disabled regions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 221/283] x86: crypto: Reduce preempt disabled regions +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Restrict the preempt disabled regions to the actual floating point operations and enable preemption for the administrative actions. diff --git a/debian/patches-rt/0222-crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches-rt/0222-crypto-Reduce-preempt-disabled-regions-more-algos.patch index da54a1ad1..38681aaaa 100644 --- a/debian/patches-rt/0222-crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/debian/patches-rt/0222-crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,8 +1,8 @@ -From e17c7ea4fb043fe1d4e89e4a42ff80b20d157f12 Mon Sep 17 00:00:00 2001 +From a9bad506610e589f70cb9bcd40a91ae40a6fcd96 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 21 Feb 2014 17:24:04 +0100 -Subject: [PATCH 222/269] crypto: Reduce preempt disabled regions, more algos -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 222/283] crypto: Reduce preempt disabled regions, more algos +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Don Estabrook reported | kernel: WARNING: CPU: 2 PID: 858 at kernel/sched/core.c:2428 migrate_disable+0xed/0x100() diff --git a/debian/patches-rt/0223-crypto-limit-more-FPU-enabled-sections.patch b/debian/patches-rt/0223-crypto-limit-more-FPU-enabled-sections.patch index eeb1e5d9a..f5f73ee39 100644 --- a/debian/patches-rt/0223-crypto-limit-more-FPU-enabled-sections.patch +++ b/debian/patches-rt/0223-crypto-limit-more-FPU-enabled-sections.patch @@ -1,11 +1,11 @@ -From da94fdf57dbc4e55dd359d103c8f61cc2811f47c Mon Sep 17 00:00:00 2001 +From 76870a6a1befc6db5eb65682cb8190cf093d49a5 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 30 Nov 2017 13:40:10 +0100 -Subject: [PATCH 223/269] crypto: limit more FPU-enabled sections +Subject: [PATCH 223/283] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Those crypto drivers use SSE/AVX/… for their crypto work and in order to do so in kernel they need to enable the "FPU" in kernel mode which @@ -69,11 +69,11 @@ index dce7c5d39c2f..6194160b7fbc 100644 } diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h -index a9caac9d4a72..18b31f22ca5d 100644 +index b56d504af654..e51c7094075d 100644 --- a/arch/x86/include/asm/fpu/api.h +++ b/arch/x86/include/asm/fpu/api.h -@@ -25,6 +25,7 @@ extern void __kernel_fpu_begin(void); - extern void __kernel_fpu_end(void); +@@ -20,6 +20,7 @@ + */ extern void kernel_fpu_begin(void); extern void kernel_fpu_end(void); +extern void kernel_fpu_resched(void); @@ -81,10 +81,10 @@ index a9caac9d4a72..18b31f22ca5d 100644 /* diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c -index 2ea85b32421a..6914dc569d1e 100644 +index 2e5003fef51a..768c53767bb2 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c -@@ -138,6 +138,18 @@ void kernel_fpu_end(void) +@@ -136,6 +136,18 @@ void kernel_fpu_end(void) } EXPORT_SYMBOL_GPL(kernel_fpu_end); diff --git a/debian/patches-rt/0224-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch b/debian/patches-rt/0224-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch index ea393c104..d4ccb716a 100644 --- a/debian/patches-rt/0224-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch +++ b/debian/patches-rt/0224-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch @@ -1,9 +1,9 @@ -From d46edae98108392143e56a64ada43af295b537a9 Mon Sep 17 00:00:00 2001 +From bb65fe43a0177184808e0426548a3e11bcd894e4 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 11 Jul 2018 17:14:47 +0200 -Subject: [PATCH 224/269] crypto: scompress - serialize RT percpu scratch +Subject: [PATCH 224/283] crypto: scompress - serialize RT percpu scratch buffer access with a local lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974 | in_atomic(): 1, irqs_disabled(): 0, pid: 1401, name: cryptomgr_test diff --git a/debian/patches-rt/0225-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch b/debian/patches-rt/0225-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch index baee55c9c..128912504 100644 --- a/debian/patches-rt/0225-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +++ b/debian/patches-rt/0225-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch @@ -1,9 +1,9 @@ -From b1616c1d9f52000a3614707e3c3ffe2b63c5fde9 Mon Sep 17 00:00:00 2001 +From 46ee243833b0300b7f72e77268030fba7d083f36 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 18:52:00 +0200 -Subject: [PATCH 225/269] crypto: cryptd - add a lock instead +Subject: [PATCH 225/283] crypto: cryptd - add a lock instead preempt_disable/local_bh_disable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz cryptd has a per-CPU lock which protected with local_bh_disable() and preempt_disable(). @@ -20,7 +20,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/crypto/cryptd.c b/crypto/cryptd.c -index addca7bae33f..8ad657cddc0a 100644 +index e0c8e907b086..e079f9a70201 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -39,6 +39,7 @@ MODULE_PARM_DESC(cryptd_max_cpu_qlen, "Set cryptd Max queue depth"); diff --git a/debian/patches-rt/0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch b/debian/patches-rt/0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch index 7787391ba..86b5fa33d 100644 --- a/debian/patches-rt/0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch +++ b/debian/patches-rt/0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch @@ -1,9 +1,9 @@ -From c3ce683225b678190d7c42bd8bc695ad74595ac8 Mon Sep 17 00:00:00 2001 +From f05daa36cd3745fd6096f84b064ecd32d32ba72c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 226/269] panic: skip get_random_bytes for RT_FULL in +Subject: [PATCH 226/283] panic: skip get_random_bytes for RT_FULL in init_oops_id -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Disable on -RT. If this is invoked from irq-context we will have problems to acquire the sleeping lock. diff --git a/debian/patches-rt/0227-x86-stackprotector-Avoid-random-pool-on-rt.patch b/debian/patches-rt/0227-x86-stackprotector-Avoid-random-pool-on-rt.patch index 4a6b86ef8..41dc6f5fd 100644 --- a/debian/patches-rt/0227-x86-stackprotector-Avoid-random-pool-on-rt.patch +++ b/debian/patches-rt/0227-x86-stackprotector-Avoid-random-pool-on-rt.patch @@ -1,8 +1,8 @@ -From 3daaf6574c9be1128d8384deff5de6c53bc2712f Mon Sep 17 00:00:00 2001 +From 7ca9435f9f9b0a1c4f286bfc916aaa6894d5b1ab Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 16 Dec 2010 14:25:18 +0100 -Subject: [PATCH 227/269] x86: stackprotector: Avoid random pool on rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 227/283] x86: stackprotector: Avoid random pool on rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz CPU bringup calls into the random pool to initialize the stack canary. During boot that works nicely even on RT as the might sleep diff --git a/debian/patches-rt/0228-random-Make-it-work-on-rt.patch b/debian/patches-rt/0228-random-Make-it-work-on-rt.patch index 3ca826704..2a710e1d4 100644 --- a/debian/patches-rt/0228-random-Make-it-work-on-rt.patch +++ b/debian/patches-rt/0228-random-Make-it-work-on-rt.patch @@ -1,8 +1,8 @@ -From 5310182891f60d9a88c1abbc7512eca69f680a99 Mon Sep 17 00:00:00 2001 +From d7138138dbb45015e20668ec13215dc198c4c4d9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 21 Aug 2012 20:38:50 +0200 -Subject: [PATCH 228/269] random: Make it work on rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 228/283] random: Make it work on rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq @@ -21,10 +21,10 @@ Signed-off-by: Thomas Gleixner 7 files changed, 26 insertions(+), 10 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c -index c75b6cdf0053..4c20da67edd5 100644 +index 0a84b7f468ad..75ae2d9e8720 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c -@@ -1229,28 +1229,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs) +@@ -1232,28 +1232,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs) return *ptr; } @@ -59,7 +59,7 @@ index c75b6cdf0053..4c20da67edd5 100644 fast_mix(fast_pool); add_interrupt_bench(cycles); diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c -index 748a1c4172a6..4258244fa314 100644 +index 8e923e70e594..e77716a62351 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -112,10 +112,12 @@ int hv_post_message(union hv_connection_id connection_id, @@ -146,10 +146,10 @@ index 38554bc35375..06a80bbf78af 100644 if (!noirqdebug) note_interrupt(desc, retval); diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index 48c2690070f3..9d7be2c33d19 100644 +index aafe2256bd39..7f4041357d2f 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -1079,6 +1079,12 @@ static int irq_thread(void *data) +@@ -1084,6 +1084,12 @@ static int irq_thread(void *data) if (action_ret == IRQ_WAKE_THREAD) irq_wake_secondary(desc, action); diff --git a/debian/patches-rt/0230-cpu-hotplug-Implement-CPU-pinning.patch b/debian/patches-rt/0229-cpu-hotplug-Implement-CPU-pinning.patch similarity index 94% rename from debian/patches-rt/0230-cpu-hotplug-Implement-CPU-pinning.patch rename to debian/patches-rt/0229-cpu-hotplug-Implement-CPU-pinning.patch index 64ff536f6..3e501c98e 100644 --- a/debian/patches-rt/0230-cpu-hotplug-Implement-CPU-pinning.patch +++ b/debian/patches-rt/0229-cpu-hotplug-Implement-CPU-pinning.patch @@ -1,8 +1,8 @@ -From d4c787bcf728f34398550a7ad54acb389cd41654 Mon Sep 17 00:00:00 2001 +From 8d14b62a0aef3f8f55641157c07a65df44f4cdda Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 19 Jul 2017 17:31:20 +0200 -Subject: [PATCH 230/269] cpu/hotplug: Implement CPU pinning -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 229/283] cpu/hotplug: Implement CPU pinning +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Signed-off-by: Thomas Gleixner --- @@ -23,7 +23,7 @@ index 76e6cdafb992..0445d5c7ced0 100644 int migrate_disable_atomic; # endif diff --git a/kernel/cpu.c b/kernel/cpu.c -index f684f41492d3..3340c4f873ad 100644 +index 9001e1779325..89b56880314d 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -75,6 +75,11 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { diff --git a/debian/patches-rt/0229-random-avoid-preempt_disable-ed-section.patch b/debian/patches-rt/0229-random-avoid-preempt_disable-ed-section.patch deleted file mode 100644 index 8de78e3a9..000000000 --- a/debian/patches-rt/0229-random-avoid-preempt_disable-ed-section.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 58450ccb54ddabe50f8c0990f4ea69f7cdaabdac Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior -Date: Fri, 12 May 2017 15:46:17 +0200 -Subject: [PATCH 229/269] random: avoid preempt_disable()ed section -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz - -extract_crng() will use sleeping locks while in a preempt_disable() -section due to get_cpu_var(). -Work around it with local_locks. - -Cc: stable-rt@vger.kernel.org # where it applies to -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/char/random.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/drivers/char/random.c b/drivers/char/random.c -index 4c20da67edd5..91c1972b6a17 100644 ---- a/drivers/char/random.c -+++ b/drivers/char/random.c -@@ -265,6 +265,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2223,6 +2224,7 @@ static rwlock_t batched_entropy_reset_lock = __RW_LOCK_UNLOCKED(batched_entropy_ - * at any point prior. - */ - static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u64); -+static DEFINE_LOCAL_IRQ_LOCK(batched_entropy_u64_lock); - u64 get_random_u64(void) - { - u64 ret; -@@ -2243,7 +2245,7 @@ u64 get_random_u64(void) - warn_unseeded_randomness(&previous); - - use_lock = READ_ONCE(crng_init) < 2; -- batch = &get_cpu_var(batched_entropy_u64); -+ batch = &get_locked_var(batched_entropy_u64_lock, batched_entropy_u64); - if (use_lock) - read_lock_irqsave(&batched_entropy_reset_lock, flags); - if (batch->position % ARRAY_SIZE(batch->entropy_u64) == 0) { -@@ -2253,12 +2255,13 @@ u64 get_random_u64(void) - ret = batch->entropy_u64[batch->position++]; - if (use_lock) - read_unlock_irqrestore(&batched_entropy_reset_lock, flags); -- put_cpu_var(batched_entropy_u64); -+ put_locked_var(batched_entropy_u64_lock, batched_entropy_u64); - return ret; - } - EXPORT_SYMBOL(get_random_u64); - - static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u32); -+static DEFINE_LOCAL_IRQ_LOCK(batched_entropy_u32_lock); - u32 get_random_u32(void) - { - u32 ret; -@@ -2273,7 +2276,7 @@ u32 get_random_u32(void) - warn_unseeded_randomness(&previous); - - use_lock = READ_ONCE(crng_init) < 2; -- batch = &get_cpu_var(batched_entropy_u32); -+ batch = &get_locked_var(batched_entropy_u32_lock, batched_entropy_u32); - if (use_lock) - read_lock_irqsave(&batched_entropy_reset_lock, flags); - if (batch->position % ARRAY_SIZE(batch->entropy_u32) == 0) { -@@ -2283,7 +2286,7 @@ u32 get_random_u32(void) - ret = batch->entropy_u32[batch->position++]; - if (use_lock) - read_unlock_irqrestore(&batched_entropy_reset_lock, flags); -- put_cpu_var(batched_entropy_u32); -+ put_locked_var(batched_entropy_u32_lock, batched_entropy_u32); - return ret; - } - EXPORT_SYMBOL(get_random_u32); --- -2.20.1 - diff --git a/debian/patches-rt/0231-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch b/debian/patches-rt/0230-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch similarity index 86% rename from debian/patches-rt/0231-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch rename to debian/patches-rt/0230-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch index f4a8f6da5..adaafaa13 100644 --- a/debian/patches-rt/0231-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch +++ b/debian/patches-rt/0230-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch @@ -1,9 +1,9 @@ -From 579810b4daa730ec872b6c1e8940d5ab6625bb44 Mon Sep 17 00:00:00 2001 +From 3ee298788bec1452e68227e1737ea65b196f5986 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 19 Aug 2018 08:28:35 +0200 -Subject: [PATCH 231/269] sched: Allow pinned user tasks to be awakened to the +Subject: [PATCH 230/283] sched: Allow pinned user tasks to be awakened to the CPU they pinned -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Since commit 7af443ee16976 ("sched/core: Require cpu_active() in select_task_rq(), for user tasks") select_fallback_rq() will BUG() if @@ -22,7 +22,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 1cd1abc45097..960271e088ab 100644 +index 08052198031a..33e81e7be168 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -904,7 +904,7 @@ static inline bool is_cpu_allowed(struct task_struct *p, int cpu) diff --git a/debian/patches-rt/0232-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/debian/patches-rt/0231-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch similarity index 93% rename from debian/patches-rt/0232-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch rename to debian/patches-rt/0231-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index e4e526801..c495c38d5 100644 --- a/debian/patches-rt/0232-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/debian/patches-rt/0231-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch @@ -1,8 +1,8 @@ -From e8484e1a8250b915f8da072e0693769465f9e956 Mon Sep 17 00:00:00 2001 +From 6068c578a8d9cb4f49e39b4ae7f0fd7e60c7d0b6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 18:31:00 +0200 -Subject: [PATCH 232/269] hotplug: duct-tape RT-rwlock usage for non-RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 231/283] hotplug: duct-tape RT-rwlock usage for non-RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz This type is only available on -RT. We need to craft something for non-RT. Since the only migrate_disable() user is -RT only, there is no @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c -index 3340c4f873ad..ad2d23d9fee2 100644 +index 89b56880314d..0523f2f0f4a2 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -75,7 +75,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { diff --git a/debian/patches-rt/0233-net-Remove-preemption-disabling-in-netif_rx.patch b/debian/patches-rt/0232-net-Remove-preemption-disabling-in-netif_rx.patch similarity index 91% rename from debian/patches-rt/0233-net-Remove-preemption-disabling-in-netif_rx.patch rename to debian/patches-rt/0232-net-Remove-preemption-disabling-in-netif_rx.patch index f503bf349..f82745b12 100644 --- a/debian/patches-rt/0233-net-Remove-preemption-disabling-in-netif_rx.patch +++ b/debian/patches-rt/0232-net-Remove-preemption-disabling-in-netif_rx.patch @@ -1,8 +1,8 @@ -From d11da9d22d701a9a3e48a6ce8b2e94bfb3c922c2 Mon Sep 17 00:00:00 2001 +From 6cb14a01753bb2d287133787ca0f71e692eb74a5 Mon Sep 17 00:00:00 2001 From: Priyanka Jain Date: Thu, 17 May 2012 09:35:11 +0530 -Subject: [PATCH 233/269] net: Remove preemption disabling in netif_rx() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 232/283] net: Remove preemption disabling in netif_rx() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by @@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c -index 50fe1e3ee26d..0c7238cc6ae2 100644 +index d86972449f63..cdf356fe054c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4484,7 +4484,7 @@ static int netif_rx_internal(struct sk_buff *skb) diff --git a/debian/patches-rt/0234-net-Another-local_irq_disable-kmalloc-headache.patch b/debian/patches-rt/0233-net-Another-local_irq_disable-kmalloc-headache.patch similarity index 90% rename from debian/patches-rt/0234-net-Another-local_irq_disable-kmalloc-headache.patch rename to debian/patches-rt/0233-net-Another-local_irq_disable-kmalloc-headache.patch index 3f82624fa..6d2458cd2 100644 --- a/debian/patches-rt/0234-net-Another-local_irq_disable-kmalloc-headache.patch +++ b/debian/patches-rt/0233-net-Another-local_irq_disable-kmalloc-headache.patch @@ -1,8 +1,8 @@ -From c82cf443e33d996e2ec0d6ea914dbb03c9540f12 Mon Sep 17 00:00:00 2001 +From d96d2893a46a35127c07a99df70a4c2b4bcde7c9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 26 Sep 2012 16:21:08 +0200 -Subject: [PATCH 234/269] net: Another local_irq_disable/kmalloc headache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 233/283] net: Another local_irq_disable/kmalloc headache +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Replace it by a local lock. Though that's pretty inefficient :( @@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index 8b5768113acd..f89d5388ea07 100644 +index 9b9f696281a9..9ce072fb662e 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -63,6 +63,7 @@ diff --git a/debian/patches-rt/0235-net-core-protect-users-of-napi_alloc_cache-against-r.patch b/debian/patches-rt/0234-net-core-protect-users-of-napi_alloc_cache-against-r.patch similarity index 95% rename from debian/patches-rt/0235-net-core-protect-users-of-napi_alloc_cache-against-r.patch rename to debian/patches-rt/0234-net-core-protect-users-of-napi_alloc_cache-against-r.patch index c3005d1ff..d1f81da8d 100644 --- a/debian/patches-rt/0235-net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/debian/patches-rt/0234-net-core-protect-users-of-napi_alloc_cache-against-r.patch @@ -1,9 +1,9 @@ -From aee85b9563699974c6712aa097ca316a0ad1949b Mon Sep 17 00:00:00 2001 +From a3b202fa9f0aec800acb97c47a90c7c0ca27283f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 15 Jan 2016 16:33:34 +0100 -Subject: [PATCH 235/269] net/core: protect users of napi_alloc_cache against +Subject: [PATCH 234/283] net/core: protect users of napi_alloc_cache against reentrance -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On -RT the code running in BH can not be moved to another CPU so CPU local variable remain local. However the code can be preempted @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index f89d5388ea07..e20b1f25a273 100644 +index 9ce072fb662e..15375d68b006 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -332,6 +332,7 @@ struct napi_alloc_cache { diff --git a/debian/patches-rt/0236-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch b/debian/patches-rt/0235-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch similarity index 92% rename from debian/patches-rt/0236-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch rename to debian/patches-rt/0235-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch index 19d5d2fdb..c014aaa1d 100644 --- a/debian/patches-rt/0236-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch +++ b/debian/patches-rt/0235-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch @@ -1,9 +1,9 @@ -From 0cabd4b2f5b341ccb079e8a59ec58999bd69ed9b Mon Sep 17 00:00:00 2001 +From 0e06ddd7109d337dafee0134e5e07c2a2ca1b4fb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 28 Oct 2012 11:18:08 +0100 -Subject: [PATCH 236/269] net: netfilter: Serialize xt_write_recseq sections on +Subject: [PATCH 235/283] net: netfilter: Serialize xt_write_recseq sections on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The netfilter code relies only on the implicit semantics of local_bh_disable() for serializing wt_write_recseq sections. RT breaks @@ -56,7 +56,7 @@ index 9077b3ebea08..1710f2aff350 100644 /* diff --git a/net/netfilter/core.c b/net/netfilter/core.c -index dc240cb47ddf..9bd8f062ebc1 100644 +index 93aaec3a54ec..b364cf8e5776 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c @@ -20,6 +20,7 @@ diff --git a/debian/patches-rt/0237-net-Add-a-mutex-around-devnet_rename_seq.patch b/debian/patches-rt/0236-net-Add-a-mutex-around-devnet_rename_seq.patch similarity index 94% rename from debian/patches-rt/0237-net-Add-a-mutex-around-devnet_rename_seq.patch rename to debian/patches-rt/0236-net-Add-a-mutex-around-devnet_rename_seq.patch index c22421167..51d603a59 100644 --- a/debian/patches-rt/0237-net-Add-a-mutex-around-devnet_rename_seq.patch +++ b/debian/patches-rt/0236-net-Add-a-mutex-around-devnet_rename_seq.patch @@ -1,8 +1,8 @@ -From 7beec1c3857d0010fff01b209cbb4fa4c6674c1b Mon Sep 17 00:00:00 2001 +From c9f595c704d979c0123fa62e3ef3a6254b32f2da Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Mar 2013 18:06:20 +0100 -Subject: [PATCH 237/269] net: Add a mutex around devnet_rename_seq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 236/283] net: Add a mutex around devnet_rename_seq +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On RT write_seqcount_begin() disables preemption and device_rename() allocates memory with GFP_KERNEL and grabs later the sysfs_mutex @@ -22,7 +22,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c -index 0c7238cc6ae2..848937d85a41 100644 +index cdf356fe054c..63b3058dd172 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -195,6 +195,7 @@ static unsigned int napi_gen_id = NR_CPUS; diff --git a/debian/patches-rt/0238-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch b/debian/patches-rt/0237-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch similarity index 93% rename from debian/patches-rt/0238-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch rename to debian/patches-rt/0237-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch index 0f6629c12..efecb4d6c 100644 --- a/debian/patches-rt/0238-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch +++ b/debian/patches-rt/0237-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch @@ -1,9 +1,9 @@ -From fdee0604e425474b4b3ba2935764f5b995764ba4 Mon Sep 17 00:00:00 2001 +From 817d0f6091be31075e77cb513f97d3087a692e82 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Mon, 16 Apr 2012 15:01:56 +0800 -Subject: [PATCH 238/269] lockdep: selftest: Only do hardirq context test for +Subject: [PATCH 237/283] lockdep: selftest: Only do hardirq context test for raw spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz On -rt there is no softirq context any more and rwlock is sleepable, disable softirq context test and rwlock+irq test. diff --git a/debian/patches-rt/0239-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches-rt/0238-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch similarity index 96% rename from debian/patches-rt/0239-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch rename to debian/patches-rt/0238-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index a34495d94..ff29e3968 100644 --- a/debian/patches-rt/0239-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/debian/patches-rt/0238-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,9 +1,9 @@ -From 726d6192b03ebe0886b0592a3cb6e071b84f9580 Mon Sep 17 00:00:00 2001 +From 26b50852450a192a47d4baaaeb4911d5fa54789a Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Wed, 28 Jan 2015 13:08:45 -0600 -Subject: [PATCH 239/269] lockdep: selftest: fix warnings due to missing +Subject: [PATCH 238/283] lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz "lockdep: Selftest: Only do hardirq context test for raw spinlock" disabled the execution of certain tests with PREEMPT_RT_FULL, but did diff --git a/debian/patches-rt/0240-sched-Add-support-for-lazy-preemption.patch b/debian/patches-rt/0239-sched-Add-support-for-lazy-preemption.patch similarity index 93% rename from debian/patches-rt/0240-sched-Add-support-for-lazy-preemption.patch rename to debian/patches-rt/0239-sched-Add-support-for-lazy-preemption.patch index 87e8f7a7f..750f2ebee 100644 --- a/debian/patches-rt/0240-sched-Add-support-for-lazy-preemption.patch +++ b/debian/patches-rt/0239-sched-Add-support-for-lazy-preemption.patch @@ -1,8 +1,8 @@ -From ccc79764a3c2281d5d0f7e15ba4628bceabd7a37 Mon Sep 17 00:00:00 2001 +From 8cc7d52a64f1f62c24514589af91171961b4b31a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 26 Oct 2012 18:50:54 +0100 -Subject: [PATCH 240/269] sched: Add support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 239/283] sched: Add support for lazy preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -245,7 +245,7 @@ index 907d72b3ba95..306567f72a3e 100644 prompt "Preemption Model" default PREEMPT_NONE diff --git a/kernel/cpu.c b/kernel/cpu.c -index ad2d23d9fee2..46118ba36e3e 100644 +index 0523f2f0f4a2..3857a0afdfbf 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -304,11 +304,13 @@ void pin_current_cpu(void) @@ -263,7 +263,7 @@ index ad2d23d9fee2..46118ba36e3e 100644 __read_rt_unlock(cpuhp_pin); goto again; diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 960271e088ab..6d06dd682cd5 100644 +index 33e81e7be168..7831756f2097 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -493,6 +493,48 @@ void resched_curr(struct rq *rq) @@ -395,7 +395,7 @@ index 960271e088ab..6d06dd682cd5 100644 /* * The idle tasks have their own, simple scheduling class: */ -@@ -7183,6 +7259,7 @@ void migrate_disable(void) +@@ -7190,6 +7266,7 @@ void migrate_disable(void) } preempt_disable(); @@ -403,7 +403,7 @@ index 960271e088ab..6d06dd682cd5 100644 pin_current_cpu(); migrate_disable_update_cpus_allowed(p); -@@ -7250,6 +7327,7 @@ void migrate_enable(void) +@@ -7257,6 +7334,7 @@ void migrate_enable(void) arg.dest_cpu = dest_cpu; unpin_current_cpu(); @@ -411,7 +411,7 @@ index 960271e088ab..6d06dd682cd5 100644 preempt_enable(); stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); tlb_migrate_finish(p->mm); -@@ -7258,6 +7336,7 @@ void migrate_enable(void) +@@ -7265,6 +7343,7 @@ void migrate_enable(void) } } unpin_current_cpu(); @@ -420,10 +420,10 @@ index 960271e088ab..6d06dd682cd5 100644 } EXPORT_SYMBOL(migrate_enable); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index c17d63b06026..3b29a0b6748a 100644 +index 0048a32a3b4d..2cca09d59019 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4017,7 +4017,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) +@@ -4021,7 +4021,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) ideal_runtime = sched_slice(cfs_rq, curr); delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; if (delta_exec > ideal_runtime) { @@ -432,7 +432,7 @@ index c17d63b06026..3b29a0b6748a 100644 /* * The current task ran long enough, ensure it doesn't get * re-elected due to buddy favours. -@@ -4041,7 +4041,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) +@@ -4045,7 +4045,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) return; if (delta > ideal_runtime) @@ -441,7 +441,7 @@ index c17d63b06026..3b29a0b6748a 100644 } static void -@@ -4183,7 +4183,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) +@@ -4187,7 +4187,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) * validating it and just reschedule. */ if (queued) { @@ -450,7 +450,7 @@ index c17d63b06026..3b29a0b6748a 100644 return; } /* -@@ -4367,7 +4367,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) +@@ -4371,7 +4371,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) * hierarchy can be throttled */ if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr)) @@ -459,7 +459,7 @@ index c17d63b06026..3b29a0b6748a 100644 } static __always_inline -@@ -5063,7 +5063,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) +@@ -5067,7 +5067,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) if (delta < 0) { if (rq->curr == p) @@ -468,7 +468,7 @@ index c17d63b06026..3b29a0b6748a 100644 return; } hrtick_start(rq, delta); -@@ -6639,7 +6639,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ +@@ -6643,7 +6643,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ return; preempt: @@ -477,7 +477,7 @@ index c17d63b06026..3b29a0b6748a 100644 /* * Only set the backward buddy when the current task is still * on the rq. This can happen when a wakeup gets interleaved -@@ -9726,7 +9726,7 @@ static void task_fork_fair(struct task_struct *p) +@@ -9734,7 +9734,7 @@ static void task_fork_fair(struct task_struct *p) * 'current' within the tree based on its new key value. */ swap(curr->vruntime, se->vruntime); @@ -486,7 +486,7 @@ index c17d63b06026..3b29a0b6748a 100644 } se->vruntime -= cfs_rq->min_vruntime; -@@ -9750,7 +9750,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) +@@ -9758,7 +9758,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) */ if (rq->curr == p) { if (p->prio > oldprio) @@ -510,7 +510,7 @@ index 68de18405857..12a12be6770b 100644 /* diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index dd6ae39957ce..58d3972ae0d4 100644 +index 49ae30da28ee..f7c1c262457f 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1638,6 +1638,15 @@ extern void reweight_task(struct task_struct *p, int prio); @@ -530,10 +530,10 @@ index dd6ae39957ce..58d3972ae0d4 100644 extern void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime); diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index 0af14953d52d..02a29282b828 100644 +index 496c5d358010..da619e974a11 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2134,6 +2134,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, +@@ -2137,6 +2137,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, struct task_struct *tsk = current; entry->preempt_count = pc & 0xff; @@ -541,7 +541,7 @@ index 0af14953d52d..02a29282b828 100644 entry->pid = (tsk) ? tsk->pid : 0; entry->flags = #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT -@@ -2144,7 +2145,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, +@@ -2147,7 +2148,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, ((pc & NMI_MASK ) ? TRACE_FLAG_NMI : 0) | ((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) | ((pc & SOFTIRQ_OFFSET) ? TRACE_FLAG_SOFTIRQ : 0) | @@ -551,7 +551,7 @@ index 0af14953d52d..02a29282b828 100644 (test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0); entry->migrate_disable = (tsk) ? __migrate_disabled(tsk) & 0xFF : 0; -@@ -3346,15 +3348,17 @@ get_total_entries(struct trace_buffer *buf, +@@ -3349,15 +3351,17 @@ get_total_entries(struct trace_buffer *buf, static void print_lat_help_header(struct seq_file *m) { @@ -578,7 +578,7 @@ index 0af14953d52d..02a29282b828 100644 } static void print_event_info(struct trace_buffer *buf, struct seq_file *m) -@@ -3392,15 +3396,17 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file +@@ -3395,15 +3399,17 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file tgid ? tgid_space : space); seq_printf(m, "# %s / _----=> need-resched\n", tgid ? tgid_space : space); @@ -602,7 +602,7 @@ index 0af14953d52d..02a29282b828 100644 } diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h -index 447bd96ee658..65afd0c04622 100644 +index d11d7bfc3fa5..6eba8c96f4bc 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -127,6 +127,7 @@ struct kretprobe_trace_entry_head { diff --git a/debian/patches-rt/0241-ftrace-Fix-trace-header-alignment.patch b/debian/patches-rt/0240-ftrace-Fix-trace-header-alignment.patch similarity index 89% rename from debian/patches-rt/0241-ftrace-Fix-trace-header-alignment.patch rename to debian/patches-rt/0240-ftrace-Fix-trace-header-alignment.patch index 8e6eab21f..7b48ce168 100644 --- a/debian/patches-rt/0241-ftrace-Fix-trace-header-alignment.patch +++ b/debian/patches-rt/0240-ftrace-Fix-trace-header-alignment.patch @@ -1,8 +1,8 @@ -From 9dc4f4dc93a57dce9f30fb429753a23f0e339749 Mon Sep 17 00:00:00 2001 +From 03fa817c57795a125667feb747f1c683b3c456c1 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 16 Oct 2016 05:08:30 +0200 -Subject: [PATCH 241/269] ftrace: Fix trace header alignment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 240/283] ftrace: Fix trace header alignment +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Line up helper arrows to the right column. @@ -15,10 +15,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index 02a29282b828..fb2ff2dfd134 100644 +index da619e974a11..f82da65109eb 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -3348,17 +3348,17 @@ get_total_entries(struct trace_buffer *buf, +@@ -3351,17 +3351,17 @@ get_total_entries(struct trace_buffer *buf, static void print_lat_help_header(struct seq_file *m) { diff --git a/debian/patches-rt/0242-x86-Support-for-lazy-preemption.patch b/debian/patches-rt/0241-x86-Support-for-lazy-preemption.patch similarity index 93% rename from debian/patches-rt/0242-x86-Support-for-lazy-preemption.patch rename to debian/patches-rt/0241-x86-Support-for-lazy-preemption.patch index e1ed1d6ab..7d89bf4b1 100644 --- a/debian/patches-rt/0242-x86-Support-for-lazy-preemption.patch +++ b/debian/patches-rt/0241-x86-Support-for-lazy-preemption.patch @@ -1,8 +1,8 @@ -From 85dc65ec7e8efc7a7842a1c52b964fe3a5f3214e Mon Sep 17 00:00:00 2001 +From fb20d310604701fc1f1d53bf74f792f58a83812f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 1 Nov 2012 11:03:47 +0100 -Subject: [PATCH 242/269] x86: Support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 241/283] x86: Support for lazy preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Implement the x86 pieces for lazy preempt. @@ -30,10 +30,10 @@ index 1b05ae86bdde..736e369e141b 100644 select HAVE_RCU_TABLE_INVALIDATE if HAVE_RCU_TABLE_FREE select HAVE_REGS_AND_STACK_ACCESS_API diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c -index ec46ee700791..fbb14008bd43 100644 +index 91676b0d2d4c..3b5e41d9b29d 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -133,7 +133,7 @@ static long syscall_trace_enter(struct pt_regs *regs) +@@ -134,7 +134,7 @@ static long syscall_trace_enter(struct pt_regs *regs) #define EXIT_TO_USERMODE_LOOP_FLAGS \ (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ @@ -42,7 +42,7 @@ index ec46ee700791..fbb14008bd43 100644 static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) { -@@ -148,7 +148,7 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) +@@ -149,7 +149,7 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) /* We have work to do. */ local_irq_enable(); @@ -52,10 +52,10 @@ index ec46ee700791..fbb14008bd43 100644 #ifdef ARCH_RT_DELAYS_SIGNAL_SEND diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S -index fbbf1ba57ec6..0169c257cfff 100644 +index b5c2b1091b18..83d43eb2f556 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S -@@ -764,8 +764,25 @@ END(ret_from_exception) +@@ -766,8 +766,25 @@ END(ret_from_exception) ENTRY(resume_kernel) DISABLE_INTERRUPTS(CLBR_ANY) .Lneed_resched: @@ -82,10 +82,10 @@ index fbbf1ba57ec6..0169c257cfff 100644 jz restore_all_kernel call preempt_schedule_irq diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S -index ce2a6587ed11..d01d68de64ae 100644 +index 7b29f2c10d01..23dda6f4a69f 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -706,7 +706,23 @@ retint_kernel: +@@ -708,7 +708,23 @@ retint_kernel: btl $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f 0: cmpl $0, PER_CPU_VAR(__preempt_count) diff --git a/debian/patches-rt/0243-x86-lazy-preempt-properly-check-against-preempt-mask.patch b/debian/patches-rt/0242-x86-lazy-preempt-properly-check-against-preempt-mask.patch similarity index 86% rename from debian/patches-rt/0243-x86-lazy-preempt-properly-check-against-preempt-mask.patch rename to debian/patches-rt/0242-x86-lazy-preempt-properly-check-against-preempt-mask.patch index 05bfba096..8769217ff 100644 --- a/debian/patches-rt/0243-x86-lazy-preempt-properly-check-against-preempt-mask.patch +++ b/debian/patches-rt/0242-x86-lazy-preempt-properly-check-against-preempt-mask.patch @@ -1,9 +1,9 @@ -From d35f3a1ee1cf19c8b8aefe555a8af80a5f5b8fe1 Mon Sep 17 00:00:00 2001 +From e9b59157aa2e702f58d3f7c6f1d6fbcef65dc75b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 18 Feb 2019 16:57:09 +0100 -Subject: [PATCH 243/269] x86: lazy-preempt: properly check against +Subject: [PATCH 242/283] x86: lazy-preempt: properly check against preempt-mask -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz should_resched() should check against preempt_offset after unmasking the need-resched-bit. Otherwise should_resched() won't work for diff --git a/debian/patches-rt/0244-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch b/debian/patches-rt/0243-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch similarity index 83% rename from debian/patches-rt/0244-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch rename to debian/patches-rt/0243-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch index e73b686df..81056a01d 100644 --- a/debian/patches-rt/0244-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch +++ b/debian/patches-rt/0243-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch @@ -1,9 +1,9 @@ -From 48a22e409d7de1904f5577d83d0c8f9cb69ce766 Mon Sep 17 00:00:00 2001 +From fb5b75a4b989c8e039eb585a99ee0c41ae05664b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 26 Feb 2019 14:53:49 +0100 -Subject: [PATCH 244/269] x86: lazy-preempt: use proper return label on +Subject: [PATCH 243/283] x86: lazy-preempt: use proper return label on 32bit-x86 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The lazy-preempt uses the wrong return label in case preemption isn't possible. This results crash while returning to the kernel. @@ -17,10 +17,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S -index 0169c257cfff..e6f61c813baf 100644 +index 83d43eb2f556..0b25d2efdb87 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S -@@ -773,15 +773,15 @@ ENTRY(resume_kernel) +@@ -775,15 +775,15 @@ ENTRY(resume_kernel) # atleast preempt count == 0 ? cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count) diff --git a/debian/patches-rt/0245-arm-Add-support-for-lazy-preemption.patch b/debian/patches-rt/0244-arm-Add-support-for-lazy-preemption.patch similarity index 96% rename from debian/patches-rt/0245-arm-Add-support-for-lazy-preemption.patch rename to debian/patches-rt/0244-arm-Add-support-for-lazy-preemption.patch index ef7109041..cba06055f 100644 --- a/debian/patches-rt/0245-arm-Add-support-for-lazy-preemption.patch +++ b/debian/patches-rt/0244-arm-Add-support-for-lazy-preemption.patch @@ -1,8 +1,8 @@ -From 4b5643e59aaece3f42def2a9ea0fe2dd07cab601 Mon Sep 17 00:00:00 2001 +From f83f8291ac518e18c94e68d86fe1639ba7b25a2f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 31 Oct 2012 12:04:11 +0100 -Subject: [PATCH 245/269] arm: Add support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 244/283] arm: Add support for lazy preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Implement the arm pieces for lazy preempt. @@ -17,7 +17,7 @@ Signed-off-by: Thomas Gleixner 6 files changed, 33 insertions(+), 8 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 91f4f80a6f24..cba596677f6e 100644 +index e122dd212ab3..9413ad933336 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -90,6 +90,7 @@ config ARM diff --git a/debian/patches-rt/0246-powerpc-Add-support-for-lazy-preemption.patch b/debian/patches-rt/0245-powerpc-Add-support-for-lazy-preemption.patch similarity index 97% rename from debian/patches-rt/0246-powerpc-Add-support-for-lazy-preemption.patch rename to debian/patches-rt/0245-powerpc-Add-support-for-lazy-preemption.patch index d9842b179..10e147614 100644 --- a/debian/patches-rt/0246-powerpc-Add-support-for-lazy-preemption.patch +++ b/debian/patches-rt/0245-powerpc-Add-support-for-lazy-preemption.patch @@ -1,8 +1,8 @@ -From 0f9163aaaab913d5d2fe2dc92e8c82e588eef09b Mon Sep 17 00:00:00 2001 +From 47a223b448c07e6c574e14e44d912dcd27ca4803 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 1 Nov 2012 10:14:11 +0100 -Subject: [PATCH 246/269] powerpc: Add support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 245/283] powerpc: Add support for lazy preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Implement the powerpc pieces for lazy preempt. diff --git a/debian/patches-rt/0247-arch-arm64-Add-lazy-preempt-support.patch b/debian/patches-rt/0246-arch-arm64-Add-lazy-preempt-support.patch similarity index 95% rename from debian/patches-rt/0247-arch-arm64-Add-lazy-preempt-support.patch rename to debian/patches-rt/0246-arch-arm64-Add-lazy-preempt-support.patch index e3042f7b2..7e41b42b0 100644 --- a/debian/patches-rt/0247-arch-arm64-Add-lazy-preempt-support.patch +++ b/debian/patches-rt/0246-arch-arm64-Add-lazy-preempt-support.patch @@ -1,8 +1,8 @@ -From 896a4ed8a9134811455719d2bc0ba8e5248c5a0f Mon Sep 17 00:00:00 2001 +From 283e7db367d829d84c78b83eb0099bc009fadcb4 Mon Sep 17 00:00:00 2001 From: Anders Roxell Date: Thu, 14 May 2015 17:52:17 +0200 -Subject: [PATCH 247/269] arch/arm64: Add lazy preempt support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 246/283] arch/arm64: Add lazy preempt support +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz arm64 is missing support for PREEMPT_RT. The main feature which is lacking is support for lazy preemption. The arch-specific entry code, @@ -21,7 +21,7 @@ Signed-off-by: Anders Roxell 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 1b1a0e95c751..418a75d30f5c 100644 +index 8790a29d0af4..4a4db69c5e9a 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -140,6 +140,7 @@ config ARM64 @@ -72,7 +72,7 @@ index cb2c10a8f0a8..f1820f7318b6 100644 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ _TIF_NOHZ) diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c -index 323aeb5f2fe6..7edd5a2668ea 100644 +index 92fba851ce53..844c71bc865b 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -41,6 +41,7 @@ int main(void) diff --git a/debian/patches-rt/0248-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/debian/patches-rt/0247-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch similarity index 94% rename from debian/patches-rt/0248-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch rename to debian/patches-rt/0247-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index 92c7d9489..a9926edc7 100644 --- a/debian/patches-rt/0248-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/debian/patches-rt/0247-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -1,9 +1,9 @@ -From 221c555911b760b4e7b8712860fe2368dd85d4e2 Mon Sep 17 00:00:00 2001 +From cb13c6a753442e63d2b8097a890892bdd36305f1 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 16 Oct 2016 05:11:54 +0200 -Subject: [PATCH 248/269] connector/cn_proc: Protect send_msg() with a local +Subject: [PATCH 247/283] connector/cn_proc: Protect send_msg() with a local lock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 |in_atomic(): 1, irqs_disabled(): 0, pid: 31807, name: sleep diff --git a/debian/patches-rt/0249-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches-rt/0248-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch similarity index 89% rename from debian/patches-rt/0249-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch rename to debian/patches-rt/0248-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index 521f569b2..2c3f4350b 100644 --- a/debian/patches-rt/0249-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/debian/patches-rt/0248-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -1,9 +1,9 @@ -From 666113236b467b8463b3a9f1976d21bd61e8f88e Mon Sep 17 00:00:00 2001 +From 0a9138797894a06ad63067de77df6b2dcd97b61e Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Thu, 31 Mar 2016 04:08:28 +0200 -Subject: [PATCH 249/269] drivers/block/zram: Replace bit spinlocks with +Subject: [PATCH 248/283] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. @@ -16,7 +16,7 @@ Signed-off-by: Sebastian Andrzej Siewior 2 files changed, 41 insertions(+) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c -index a65505db09e5..f35eccc43558 100644 +index 70cbd0ee1b07..42de45ebfb43 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -53,6 +53,40 @@ static size_t huge_class_size; @@ -68,7 +68,7 @@ index a65505db09e5..f35eccc43558 100644 static inline bool init_done(struct zram *zram) { -@@ -900,6 +935,8 @@ static DEVICE_ATTR_RO(io_stat); +@@ -901,6 +936,8 @@ static DEVICE_ATTR_RO(io_stat); static DEVICE_ATTR_RO(mm_stat); static DEVICE_ATTR_RO(debug_stat); @@ -77,7 +77,7 @@ index a65505db09e5..f35eccc43558 100644 static void zram_meta_free(struct zram *zram, u64 disksize) { size_t num_pages = disksize >> PAGE_SHIFT; -@@ -930,6 +967,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) +@@ -931,6 +968,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) if (!huge_class_size) huge_class_size = zs_huge_class_size(zram->mem_pool); diff --git a/debian/patches-rt/0250-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/debian/patches-rt/0249-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch similarity index 89% rename from debian/patches-rt/0250-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch rename to debian/patches-rt/0249-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index 72a9ac802..b71050cb0 100644 --- a/debian/patches-rt/0250-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/debian/patches-rt/0249-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -1,9 +1,9 @@ -From 84d4ca0b3c56c0dbc248508726c5f69cbf14d0cc Mon Sep 17 00:00:00 2001 +From 3af8e8733e58687a2fe72ce5b8d47e458d09a9b5 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Thu, 20 Oct 2016 11:15:22 +0200 -Subject: [PATCH 250/269] drivers/zram: Don't disable preemption in +Subject: [PATCH 249/283] drivers/zram: Don't disable preemption in zcomp_stream_get/put() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz In v4.7, the driver switched to percpu compression streams, disabling preemption via get/put_cpu_ptr(). Use a per-zcomp_strm lock here. We @@ -67,10 +67,10 @@ index 41c1002a7d7d..d424eafcbf8e 100644 /* dynamic per-device compression frontend */ diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c -index f35eccc43558..b2a347b8b517 100644 +index 42de45ebfb43..ffa3e9d67571 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c -@@ -1026,6 +1026,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, +@@ -1027,6 +1027,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, unsigned long handle; unsigned int size; void *src, *dst; @@ -78,7 +78,7 @@ index f35eccc43558..b2a347b8b517 100644 if (zram_wb_enabled(zram)) { zram_slot_lock(zram, index); -@@ -1060,6 +1061,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, +@@ -1061,6 +1062,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, size = zram_get_obj_size(zram, index); @@ -86,7 +86,7 @@ index f35eccc43558..b2a347b8b517 100644 src = zs_map_object(zram->mem_pool, handle, ZS_MM_RO); if (size == PAGE_SIZE) { dst = kmap_atomic(page); -@@ -1067,14 +1069,13 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, +@@ -1068,14 +1070,13 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, kunmap_atomic(dst); ret = 0; } else { diff --git a/debian/patches-rt/0251-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch b/debian/patches-rt/0250-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch similarity index 89% rename from debian/patches-rt/0251-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch rename to debian/patches-rt/0250-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch index 039009b28..48f6ba6fb 100644 --- a/debian/patches-rt/0251-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +++ b/debian/patches-rt/0250-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch @@ -1,9 +1,9 @@ -From 24fddbe29940c9217a8e2f5e9443ca29f941281a Mon Sep 17 00:00:00 2001 +From 50839b1e639f5c139278123e369ebdb5066c325e Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 23 Aug 2017 11:57:29 +0200 -Subject: [PATCH 251/269] drivers/zram: fix zcomp_stream_get() +Subject: [PATCH 250/283] drivers/zram: fix zcomp_stream_get() smp_processor_id() use in preemptible code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Use get_local_ptr() instead this_cpu_ptr() to avoid a warning regarding smp_processor_id() in preemptible code. diff --git a/debian/patches-rt/0252-tpm_tis-fix-stall-after-iowrite-s.patch b/debian/patches-rt/0251-tpm_tis-fix-stall-after-iowrite-s.patch similarity index 94% rename from debian/patches-rt/0252-tpm_tis-fix-stall-after-iowrite-s.patch rename to debian/patches-rt/0251-tpm_tis-fix-stall-after-iowrite-s.patch index d61bff256..f1f9f9349 100644 --- a/debian/patches-rt/0252-tpm_tis-fix-stall-after-iowrite-s.patch +++ b/debian/patches-rt/0251-tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,8 +1,8 @@ -From e17cfb4da190f56567819460296b640854ef8af0 Mon Sep 17 00:00:00 2001 +From fb66fc28332e7786f93815228991067bf2b7feff Mon Sep 17 00:00:00 2001 From: Haris Okanovic Date: Tue, 15 Aug 2017 15:13:08 -0500 -Subject: [PATCH 252/269] tpm_tis: fix stall after iowrite*()s -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 251/283] tpm_tis: fix stall after iowrite*()s +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. diff --git a/debian/patches-rt/0253-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch b/debian/patches-rt/0252-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch similarity index 95% rename from debian/patches-rt/0253-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch rename to debian/patches-rt/0252-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch index 323253ed6..c20b8e779 100644 --- a/debian/patches-rt/0253-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch +++ b/debian/patches-rt/0252-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch @@ -1,8 +1,8 @@ -From 2e143bef6376db39d9e876eae3e3f1f718ff0b23 Mon Sep 17 00:00:00 2001 +From 4ebb1f9be0a95dc2c8bb4b0b1d465d5c395f49a6 Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 -Subject: [PATCH 253/269] watchdog: prevent deferral of watchdogd wakeup on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 252/283] watchdog: prevent deferral of watchdogd wakeup on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz When PREEMPT_RT_FULL is enabled, all hrtimer expiry functions are deferred for execution into the context of ktimersoftd unless otherwise diff --git a/debian/patches-rt/0254-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch b/debian/patches-rt/0253-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch similarity index 91% rename from debian/patches-rt/0254-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch rename to debian/patches-rt/0253-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch index 4cff82db9..a72f3eeb0 100644 --- a/debian/patches-rt/0254-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch +++ b/debian/patches-rt/0253-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch @@ -1,9 +1,9 @@ -From 14ab946c30ebc65a97dd2a3a68f5f1bb0bfb8c7a Mon Sep 17 00:00:00 2001 +From 40e35f1fee95ea4707c63bde3f25068e2cc24cc5 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sat, 27 Feb 2016 08:09:11 +0100 -Subject: [PATCH 254/269] drm,radeon,i915: Use preempt_disable/enable_rt() +Subject: [PATCH 253/283] drm,radeon,i915: Use preempt_disable/enable_rt() where recommended -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz DRM folks identified the spots, so use them. @@ -37,7 +37,7 @@ index 29877969310d..f65817c51c2a 100644 spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c -index 9d3ac8b981da..bde228c7739a 100644 +index d8e2d7b3b836..072b831aaf4f 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -1813,6 +1813,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, diff --git a/debian/patches-rt/0255-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch b/debian/patches-rt/0254-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch similarity index 97% rename from debian/patches-rt/0255-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch rename to debian/patches-rt/0254-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch index c28d30fee..71ee6e425 100644 --- a/debian/patches-rt/0255-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch +++ b/debian/patches-rt/0254-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch @@ -1,9 +1,9 @@ -From fa836f911e7122a32cf1d934a9736497b5dee45d Mon Sep 17 00:00:00 2001 +From dc4f20a517dce3a46fc2bc46240fb2f9452ce1cd Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sat, 27 Feb 2016 09:01:42 +0100 -Subject: [PATCH 255/269] drm,i915: Use local_lock/unlock_irq() in +Subject: [PATCH 254/283] drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz [ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918 [ 8.014041] in_atomic(): 0, irqs_disabled(): 1, pid: 78, name: kworker/u4:4 diff --git a/debian/patches-rt/0256-drm-i915-disable-tracing-on-RT.patch b/debian/patches-rt/0255-drm-i915-disable-tracing-on-RT.patch similarity index 90% rename from debian/patches-rt/0256-drm-i915-disable-tracing-on-RT.patch rename to debian/patches-rt/0255-drm-i915-disable-tracing-on-RT.patch index 47877adde..2638cc47b 100644 --- a/debian/patches-rt/0256-drm-i915-disable-tracing-on-RT.patch +++ b/debian/patches-rt/0255-drm-i915-disable-tracing-on-RT.patch @@ -1,8 +1,8 @@ -From 0d087f448e0154cd673da85a57d305bb17f43f48 Mon Sep 17 00:00:00 2001 +From d884bf96bfbde9a4c7e1435aa0745e52891ae9fa Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 09:52:20 +0100 -Subject: [PATCH 256/269] drm/i915: disable tracing on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 255/283] drm/i915: disable tracing on -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 diff --git a/debian/patches-rt/0257-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch b/debian/patches-rt/0256-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch similarity index 87% rename from debian/patches-rt/0257-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch rename to debian/patches-rt/0256-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch index f4c6b7977..4a214c039 100644 --- a/debian/patches-rt/0257-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +++ b/debian/patches-rt/0256-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch @@ -1,9 +1,9 @@ -From 1e0d82558c60f1e889452550fe5766802e54c9bc Mon Sep 17 00:00:00 2001 +From 59051415a63f69b8eb7e36f6e30119334967d711 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 19 Dec 2018 10:47:02 +0100 -Subject: [PATCH 257/269] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with +Subject: [PATCH 256/283] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The order of the header files is important. If this header file is included after tracepoint.h was included then the NOTRACE here becomes a diff --git a/debian/patches-rt/0258-cgroups-use-simple-wait-in-css_release.patch b/debian/patches-rt/0257-cgroups-use-simple-wait-in-css_release.patch similarity index 89% rename from debian/patches-rt/0258-cgroups-use-simple-wait-in-css_release.patch rename to debian/patches-rt/0257-cgroups-use-simple-wait-in-css_release.patch index 2afb8adfc..014a2aac5 100644 --- a/debian/patches-rt/0258-cgroups-use-simple-wait-in-css_release.patch +++ b/debian/patches-rt/0257-cgroups-use-simple-wait-in-css_release.patch @@ -1,8 +1,8 @@ -From 12874386b3141dd4afa5b6e4aee17e99f529f37e Mon Sep 17 00:00:00 2001 +From bd17886ee0bbb3d61ca16373b799a2e9f4f71fb3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 15:52:24 +0100 -Subject: [PATCH 258/269] cgroups: use simple wait in css_release() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 257/283] cgroups: use simple wait in css_release() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 @@ -35,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h -index 6002275937f5..ba64953d53d9 100644 +index a6090154b2ab..46a706e2ba35 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -20,6 +20,7 @@ @@ -55,7 +55,7 @@ index 6002275937f5..ba64953d53d9 100644 /* diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c -index 63dae7e0ccae..4377e0fd8827 100644 +index 81441117f611..7b536796daf8 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -4628,10 +4628,10 @@ static void css_free_rwork_fn(struct work_struct *work) @@ -71,7 +71,7 @@ index 63dae7e0ccae..4377e0fd8827 100644 struct cgroup_subsys *ss = css->ss; struct cgroup *cgrp = css->cgroup; -@@ -4691,8 +4691,8 @@ static void css_release(struct percpu_ref *ref) +@@ -4693,8 +4693,8 @@ static void css_release(struct percpu_ref *ref) struct cgroup_subsys_state *css = container_of(ref, struct cgroup_subsys_state, refcnt); @@ -82,7 +82,7 @@ index 63dae7e0ccae..4377e0fd8827 100644 } static void init_and_link_css(struct cgroup_subsys_state *css, -@@ -5414,6 +5414,7 @@ static int __init cgroup_wq_init(void) +@@ -5420,6 +5420,7 @@ static int __init cgroup_wq_init(void) */ cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1); BUG_ON(!cgroup_destroy_wq); diff --git a/debian/patches-rt/0259-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0258-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch similarity index 96% rename from debian/patches-rt/0259-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch rename to debian/patches-rt/0258-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index 55d4e1c2d..83da24197 100644 --- a/debian/patches-rt/0259-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0258-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,8 +1,8 @@ -From 3bf07cd523e1ceabae1252c9c286b5fa88608994 Mon Sep 17 00:00:00 2001 +From ca3c9be1f8eb136f8c37c87c0eb8a528ebbbba72 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 8 Jan 2017 09:32:25 +0100 -Subject: [PATCH 259/269] cpuset: Convert callback_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 258/283] cpuset: Convert callback_lock to raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The two commits below add up to a cpuset might_sleep() splat for RT: @@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c -index ef085d84a940..3e5d90076368 100644 +index 7bb129c5b412..92575cb9b493 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -288,7 +288,7 @@ static struct cpuset top_cpuset = { @@ -256,8 +256,8 @@ index ef085d84a940..3e5d90076368 100644 + raw_spin_unlock_irqrestore(&callback_lock, flags); } - void cpuset_cpus_allowed_fallback(struct task_struct *tsk) -@@ -2477,11 +2477,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk) + /** +@@ -2490,11 +2490,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk) nodemask_t mask; unsigned long flags; @@ -271,7 +271,7 @@ index ef085d84a940..3e5d90076368 100644 return mask; } -@@ -2573,14 +2573,14 @@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask) +@@ -2586,14 +2586,14 @@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask) return true; /* Not hardwall and node outside mems_allowed: scan up cpusets */ diff --git a/debian/patches-rt/0260-apparmor-use-a-locallock-instead-preempt_disable.patch b/debian/patches-rt/0259-apparmor-use-a-locallock-instead-preempt_disable.patch similarity index 94% rename from debian/patches-rt/0260-apparmor-use-a-locallock-instead-preempt_disable.patch rename to debian/patches-rt/0259-apparmor-use-a-locallock-instead-preempt_disable.patch index dd40bed60..a9df89bad 100644 --- a/debian/patches-rt/0260-apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/debian/patches-rt/0259-apparmor-use-a-locallock-instead-preempt_disable.patch @@ -1,8 +1,8 @@ -From f03e611745700fad514b850296eab0b098b3c12d Mon Sep 17 00:00:00 2001 +From 304bb4fbcbaaf44ce6ea8b7605d79c64d72c47df Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 11 Oct 2017 17:43:49 +0200 -Subject: [PATCH 260/269] apparmor: use a locallock instead preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 259/283] apparmor: use a locallock instead preempt_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz get_buffers() disables preemption which acts as a lock for the per-CPU variable. Since we can't disable preemption here on RT, a local_lock is diff --git a/debian/patches-rt/0261-workqueue-Prevent-deadlock-stall-on-RT.patch b/debian/patches-rt/0260-workqueue-Prevent-deadlock-stall-on-RT.patch similarity index 96% rename from debian/patches-rt/0261-workqueue-Prevent-deadlock-stall-on-RT.patch rename to debian/patches-rt/0260-workqueue-Prevent-deadlock-stall-on-RT.patch index 66887316d..2ee749084 100644 --- a/debian/patches-rt/0261-workqueue-Prevent-deadlock-stall-on-RT.patch +++ b/debian/patches-rt/0260-workqueue-Prevent-deadlock-stall-on-RT.patch @@ -1,8 +1,8 @@ -From 936c037e636229e54d45ea6887e110d47d891059 Mon Sep 17 00:00:00 2001 +From 9d56ef1ce2d305509eb734d96c2bd1799ef7314f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 27 Jun 2014 16:24:52 +0200 -Subject: [PATCH 261/269] workqueue: Prevent deadlock/stall on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 260/283] workqueue: Prevent deadlock/stall on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Austin reported a XFS deadlock/stall on RT where scheduled work gets never exececuted and tasks are waiting for each other for ever. @@ -43,7 +43,7 @@ Cc: Steven Rostedt 2 files changed, 51 insertions(+), 15 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 6d06dd682cd5..d2a475e00af8 100644 +index 7831756f2097..91a9b2556fb0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3569,9 +3569,8 @@ void __noreturn do_task_dead(void) @@ -68,7 +68,7 @@ index 6d06dd682cd5..d2a475e00af8 100644 * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index bf7be926ce5f..84397c2a4465 100644 +index aa39924bd3b5..12137825bf5a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -125,6 +125,11 @@ enum { diff --git a/debian/patches-rt/0262-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches-rt/0261-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch similarity index 95% rename from debian/patches-rt/0262-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch rename to debian/patches-rt/0261-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 260c46ed0..ac308a129 100644 --- a/debian/patches-rt/0262-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches-rt/0261-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,8 +1,8 @@ -From d05a6a9bf872f14f98543e61c6ef160307078b7c Mon Sep 17 00:00:00 2001 +From 0eec97926a2deb4ccc517f574a40578bddc19cd7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:56 -0500 -Subject: [PATCH 262/269] signals: Allow rt tasks to cache one sigqueue struct -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 261/283] signals: Allow rt tasks to cache one sigqueue struct +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. @@ -55,10 +55,10 @@ index 5c0964dc805a..47d4161d1104 100644 spin_unlock(&sighand->siglock); diff --git a/kernel/fork.c b/kernel/fork.c -index f62ae61064c7..1cd87e9c9f17 100644 +index 96297e71019c..aa4905338ff4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1802,6 +1802,7 @@ static __latent_entropy struct task_struct *copy_process( +@@ -1827,6 +1827,7 @@ static __latent_entropy struct task_struct *copy_process( spin_lock_init(&p->alloc_lock); init_sigpending(&p->pending); @@ -67,7 +67,7 @@ index f62ae61064c7..1cd87e9c9f17 100644 p->utime = p->stime = p->gtime = 0; #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME diff --git a/kernel/signal.c b/kernel/signal.c -index 57c48b3d1491..367e10c919d1 100644 +index 56edb0580a3a..ac32b4f41d24 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -19,6 +19,7 @@ diff --git a/debian/patches-rt/0263-Add-localversion-for-RT-release.patch b/debian/patches-rt/0262-Add-localversion-for-RT-release.patch similarity index 74% rename from debian/patches-rt/0263-Add-localversion-for-RT-release.patch rename to debian/patches-rt/0262-Add-localversion-for-RT-release.patch index 7cd7faa57..7e4be4cc9 100644 --- a/debian/patches-rt/0263-Add-localversion-for-RT-release.patch +++ b/debian/patches-rt/0262-Add-localversion-for-RT-release.patch @@ -1,8 +1,8 @@ -From 7b48c4366f0f483bb81cc05f7f427176bff52bf8 Mon Sep 17 00:00:00 2001 +From 1d605947258bfd1a27d7d2d155e7466da763ffd2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 8 Jul 2011 20:25:16 +0200 -Subject: [PATCH 263/269] Add localversion for -RT release -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 262/283] Add localversion for -RT release +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches-rt/0264-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch b/debian/patches-rt/0263-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch similarity index 95% rename from debian/patches-rt/0264-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch rename to debian/patches-rt/0263-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch index 9469fb2cf..71b1a6fc8 100644 --- a/debian/patches-rt/0264-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch +++ b/debian/patches-rt/0263-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch @@ -1,9 +1,9 @@ -From 8c6c7ae29703351a50e4ab8c71d130f8c7c06c91 Mon Sep 17 00:00:00 2001 +From e3dd55f0a687316bb52bce0835070079b26a21a2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 26 Mar 2019 18:31:54 +0100 -Subject: [PATCH 264/269] powerpc/pseries/iommu: Use a locallock instead +Subject: [PATCH 263/283] powerpc/pseries/iommu: Use a locallock instead local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The locallock protects the per-CPU variable tce_page. The function attempts to allocate memory while tce_page is protected (by disabling diff --git a/debian/patches-rt/0265-powerpc-reshuffle-TIF-bits.patch b/debian/patches-rt/0264-powerpc-reshuffle-TIF-bits.patch similarity index 97% rename from debian/patches-rt/0265-powerpc-reshuffle-TIF-bits.patch rename to debian/patches-rt/0264-powerpc-reshuffle-TIF-bits.patch index 6b8c7c2e1..db37d3e74 100644 --- a/debian/patches-rt/0265-powerpc-reshuffle-TIF-bits.patch +++ b/debian/patches-rt/0264-powerpc-reshuffle-TIF-bits.patch @@ -1,8 +1,8 @@ -From 9b0199e0f5b4e5782a4588e31d4db3e75aa3bbff Mon Sep 17 00:00:00 2001 +From 76ccb7ba434581a4fa6338c0451f3f0752582520 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 22 Mar 2019 17:15:58 +0100 -Subject: [PATCH 265/269] powerpc: reshuffle TIF bits -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 264/283] powerpc: reshuffle TIF bits +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Powerpc32/64 does not compile because TIF_SYSCALL_TRACE's bit is higher than 15 and the assembly instructions don't expect that. diff --git a/debian/patches-rt/0266-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0265-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch similarity index 93% rename from debian/patches-rt/0266-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch rename to debian/patches-rt/0265-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch index 2bd18b3cb..a13e5b9a5 100644 --- a/debian/patches-rt/0266-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0265-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch @@ -1,8 +1,8 @@ -From 0c32e5dfe4724c249b8eda0c9194e96c4c7bf003 Mon Sep 17 00:00:00 2001 +From f264ec0373b575d16c232921fab39a5d7a6a3c21 Mon Sep 17 00:00:00 2001 From: Julien Grall Date: Wed, 13 Mar 2019 11:40:34 +0000 -Subject: [PATCH 266/269] tty/sysrq: Convert show_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Subject: [PATCH 265/283] tty/sysrq: Convert show_lock to raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Systems which don't provide arch_trigger_cpumask_backtrace() will invoke showacpu() from a smp_call_function() function which is invoked diff --git a/debian/patches-rt/0267-drm-i915-Don-t-disable-interrupts-independently-of-t.patch b/debian/patches-rt/0266-drm-i915-Don-t-disable-interrupts-independently-of-t.patch similarity index 91% rename from debian/patches-rt/0267-drm-i915-Don-t-disable-interrupts-independently-of-t.patch rename to debian/patches-rt/0266-drm-i915-Don-t-disable-interrupts-independently-of-t.patch index 6a2ac7a39..ab981e38a 100644 --- a/debian/patches-rt/0267-drm-i915-Don-t-disable-interrupts-independently-of-t.patch +++ b/debian/patches-rt/0266-drm-i915-Don-t-disable-interrupts-independently-of-t.patch @@ -1,9 +1,9 @@ -From 4f5c0777eb039305fafbfdf628f44cd4192d7dd8 Mon Sep 17 00:00:00 2001 +From da8db6d203d29fd33215f60a1948967f2fe76386 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 10 Apr 2019 11:01:37 +0200 -Subject: [PATCH 267/269] drm/i915: Don't disable interrupts independently of +Subject: [PATCH 266/283] drm/i915: Don't disable interrupts independently of the lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz The locks (timeline->lock and rq->lock) need to be taken with disabled interrupts. This is done in __retire_engine_request() by disabling the diff --git a/debian/patches-rt/0268-sched-completion-Fix-a-lockup-in-wait_for_completion.patch b/debian/patches-rt/0267-sched-completion-Fix-a-lockup-in-wait_for_completion.patch similarity index 93% rename from debian/patches-rt/0268-sched-completion-Fix-a-lockup-in-wait_for_completion.patch rename to debian/patches-rt/0267-sched-completion-Fix-a-lockup-in-wait_for_completion.patch index 0acdd2d8f..d5d7b7a07 100644 --- a/debian/patches-rt/0268-sched-completion-Fix-a-lockup-in-wait_for_completion.patch +++ b/debian/patches-rt/0267-sched-completion-Fix-a-lockup-in-wait_for_completion.patch @@ -1,9 +1,9 @@ -From 3fedc60594022bd98689b88034899528d221db8d Mon Sep 17 00:00:00 2001 +From 2de445a925a0c92865a6308ce0e1587ebc250ccb Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Thu, 9 May 2019 14:33:20 -0500 -Subject: [PATCH 268/269] sched/completion: Fix a lockup in +Subject: [PATCH 267/283] sched/completion: Fix a lockup in wait_for_completion() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz Consider following race: diff --git a/debian/patches-rt/0268-kthread-add-a-global-worker-thread.patch b/debian/patches-rt/0268-kthread-add-a-global-worker-thread.patch new file mode 100644 index 000000000..781442887 --- /dev/null +++ b/debian/patches-rt/0268-kthread-add-a-global-worker-thread.patch @@ -0,0 +1,180 @@ +From 59fa1a99358d2859eff36b2531fed5a219437ad5 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Tue, 12 Feb 2019 15:09:38 +0100 +Subject: [PATCH 268/283] kthread: add a global worker thread. +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit 0532e87d9d44795221aa921ba7024bde689cc894 ] + +Add kthread_schedule_work() which uses a global kthread for all its +jobs. +Split the cgroup include to avoid recussive includes from interrupt.h. +Fixup everything that fails to build (and did not include all header). + +Signed-off-by: Sebastian Andrzej Siewior +[ + Fixed up include in blk-cgroup.h reported by Juri Lelli + http://lkml.kernel.org/r/20190722083009.GE25636@localhost.localdomain +] +Signed-off-by: Steven Rostedt (VMware) +--- + drivers/block/loop.c | 2 +- + drivers/spi/spi-rockchip.c | 1 + + include/linux/blk-cgroup.h | 2 +- + include/linux/kthread-cgroup.h | 17 +++++++++++++++++ + include/linux/kthread.h | 17 +++++++---------- + init/main.c | 1 + + kernel/kthread.c | 14 ++++++++++++++ + 7 files changed, 42 insertions(+), 12 deletions(-) + create mode 100644 include/linux/kthread-cgroup.h + +diff --git a/drivers/block/loop.c b/drivers/block/loop.c +index f1e63eb7cbca..aa76c816dbb4 100644 +--- a/drivers/block/loop.c ++++ b/drivers/block/loop.c +@@ -70,7 +70,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c +index fdcf3076681b..b56619418cea 100644 +--- a/drivers/spi/spi-rockchip.c ++++ b/drivers/spi/spi-rockchip.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #define DRIVER_NAME "rockchip-spi" + +diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h +index 6d766a19f2bb..0473efda4c65 100644 +--- a/include/linux/blk-cgroup.h ++++ b/include/linux/blk-cgroup.h +@@ -14,7 +14,7 @@ + * Nauman Rafique + */ + +-#include ++#include + #include + #include + #include +diff --git a/include/linux/kthread-cgroup.h b/include/linux/kthread-cgroup.h +new file mode 100644 +index 000000000000..53d34bca9d72 +--- /dev/null ++++ b/include/linux/kthread-cgroup.h +@@ -0,0 +1,17 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_KTHREAD_CGROUP_H ++#define _LINUX_KTHREAD_CGROUP_H ++#include ++#include ++ ++#ifdef CONFIG_BLK_CGROUP ++void kthread_associate_blkcg(struct cgroup_subsys_state *css); ++struct cgroup_subsys_state *kthread_blkcg(void); ++#else ++static inline void kthread_associate_blkcg(struct cgroup_subsys_state *css) { } ++static inline struct cgroup_subsys_state *kthread_blkcg(void) ++{ ++ return NULL; ++} ++#endif ++#endif +diff --git a/include/linux/kthread.h b/include/linux/kthread.h +index ad292898f7f2..7cf56eb54103 100644 +--- a/include/linux/kthread.h ++++ b/include/linux/kthread.h +@@ -4,7 +4,6 @@ + /* Simple interface for creating and stopping kernel threads without mess. */ + #include + #include +-#include + + __printf(4, 5) + struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), +@@ -106,7 +105,7 @@ struct kthread_delayed_work { + }; + + #define KTHREAD_WORKER_INIT(worker) { \ +- .lock = __SPIN_LOCK_UNLOCKED((worker).lock), \ ++ .lock = __RAW_SPIN_LOCK_UNLOCKED((worker).lock), \ + .work_list = LIST_HEAD_INIT((worker).work_list), \ + .delayed_work_list = LIST_HEAD_INIT((worker).delayed_work_list),\ + } +@@ -198,14 +197,12 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work); + + void kthread_destroy_worker(struct kthread_worker *worker); + +-#ifdef CONFIG_BLK_CGROUP +-void kthread_associate_blkcg(struct cgroup_subsys_state *css); +-struct cgroup_subsys_state *kthread_blkcg(void); +-#else +-static inline void kthread_associate_blkcg(struct cgroup_subsys_state *css) { } +-static inline struct cgroup_subsys_state *kthread_blkcg(void) ++extern struct kthread_worker kthread_global_worker; ++void kthread_init_global_worker(void); ++ ++static inline bool kthread_schedule_work(struct kthread_work *work) + { +- return NULL; ++ return kthread_queue_work(&kthread_global_worker, work); + } +-#endif ++ + #endif /* _LINUX_KTHREAD_H */ +diff --git a/init/main.c b/init/main.c +index 4a7471606e53..b0e95351c22c 100644 +--- a/init/main.c ++++ b/init/main.c +@@ -1130,6 +1130,7 @@ static noinline void __init kernel_init_freeable(void) + smp_prepare_cpus(setup_max_cpus); + + workqueue_init(); ++ kthread_init_global_worker(); + + init_mm_internals(); + +diff --git a/kernel/kthread.c b/kernel/kthread.c +index 5641b55783a6..9db017761a1f 100644 +--- a/kernel/kthread.c ++++ b/kernel/kthread.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + + static DEFINE_SPINLOCK(kthread_create_lock); +@@ -1180,6 +1181,19 @@ void kthread_destroy_worker(struct kthread_worker *worker) + } + EXPORT_SYMBOL(kthread_destroy_worker); + ++DEFINE_KTHREAD_WORKER(kthread_global_worker); ++EXPORT_SYMBOL(kthread_global_worker); ++ ++__init void kthread_init_global_worker(void) ++{ ++ kthread_global_worker.task = kthread_create(kthread_worker_fn, ++ &kthread_global_worker, ++ "kswork"); ++ if (WARN_ON(IS_ERR(kthread_global_worker.task))) ++ return; ++ wake_up_process(kthread_global_worker.task); ++} ++ + #ifdef CONFIG_BLK_CGROUP + /** + * kthread_associate_blkcg - associate blkcg to current kthread +-- +2.20.1 + diff --git a/debian/patches-rt/0269-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch b/debian/patches-rt/0269-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch new file mode 100644 index 000000000..353c05277 --- /dev/null +++ b/debian/patches-rt/0269-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -0,0 +1,101 @@ +From 1c00699faf9b42d9e365cb0a9c4f701c72089d90 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 21 Aug 2013 17:48:46 +0200 +Subject: [PATCH 269/283] genirq: Do not invoke the affinity callback via a + workqueue on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit 2122adbe011cdc0eb62ad62494e181005b23c76a ] + +Joe Korty reported, that __irq_set_affinity_locked() schedules a +workqueue while holding a rawlock which results in a might_sleep() +warning. +This patch uses swork_queue() instead. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + include/linux/interrupt.h | 5 ++--- + kernel/irq/manage.c | 19 ++++--------------- + 2 files changed, 6 insertions(+), 18 deletions(-) + +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 72333899f043..a9321f6429f2 100644 +--- a/include/linux/interrupt.h ++++ b/include/linux/interrupt.h +@@ -13,7 +13,7 @@ + #include + #include + #include +-#include ++#include + + #include + #include +@@ -228,7 +228,6 @@ extern void resume_device_irqs(void); + * struct irq_affinity_notify - context for notification of IRQ affinity changes + * @irq: Interrupt to which notification applies + * @kref: Reference count, for internal use +- * @swork: Swork item, for internal use + * @work: Work item, for internal use + * @notify: Function to be called on change. This will be + * called in process context. +@@ -241,7 +240,7 @@ struct irq_affinity_notify { + unsigned int irq; + struct kref kref; + #ifdef CONFIG_PREEMPT_RT_BASE +- struct swork_event swork; ++ struct kthread_work work; + #else + struct work_struct work; + #endif +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index 7f4041357d2f..381305c48a0a 100644 +--- a/kernel/irq/manage.c ++++ b/kernel/irq/manage.c +@@ -261,7 +261,7 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, + kref_get(&desc->affinity_notify->kref); + + #ifdef CONFIG_PREEMPT_RT_BASE +- swork_queue(&desc->affinity_notify->swork); ++ kthread_schedule_work(&desc->affinity_notify->work); + #else + schedule_work(&desc->affinity_notify->work); + #endif +@@ -326,21 +326,11 @@ static void _irq_affinity_notify(struct irq_affinity_notify *notify) + } + + #ifdef CONFIG_PREEMPT_RT_BASE +-static void init_helper_thread(void) +-{ +- static int init_sworker_once; +- +- if (init_sworker_once) +- return; +- if (WARN_ON(swork_get())) +- return; +- init_sworker_once = 1; +-} + +-static void irq_affinity_notify(struct swork_event *swork) ++static void irq_affinity_notify(struct kthread_work *work) + { + struct irq_affinity_notify *notify = +- container_of(swork, struct irq_affinity_notify, swork); ++ container_of(work, struct irq_affinity_notify, work); + _irq_affinity_notify(notify); + } + +@@ -383,8 +373,7 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) + notify->irq = irq; + kref_init(¬ify->kref); + #ifdef CONFIG_PREEMPT_RT_BASE +- INIT_SWORK(¬ify->swork, irq_affinity_notify); +- init_helper_thread(); ++ kthread_init_work(¬ify->work, irq_affinity_notify); + #else + INIT_WORK(¬ify->work, irq_affinity_notify); + #endif +-- +2.20.1 + diff --git a/debian/patches-rt/0270-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch b/debian/patches-rt/0270-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch new file mode 100644 index 000000000..1a82d7a6f --- /dev/null +++ b/debian/patches-rt/0270-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch @@ -0,0 +1,42 @@ +From 1f38c3b121feba50524996f2cceb92eb47269e52 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Tue, 28 May 2019 10:42:15 +0200 +Subject: [PATCH 270/283] genirq: Handle missing work_struct in + irq_set_affinity_notifier() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit bbc4d2a7d6ff54ba923640d9a42c7bef7185fe98 ] + +The backported stable commit + 59c39840f5abf ("genirq: Prevent use-after-free and work list corruption") + +added cancel_work_sync() on a work_struct element which is not available +in RT. + +Replace cancel_work_sync() with kthread_cancel_work_sync() on RT. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/irq/manage.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index 381305c48a0a..b2736d7d863b 100644 +--- a/kernel/irq/manage.c ++++ b/kernel/irq/manage.c +@@ -385,8 +385,9 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) + raw_spin_unlock_irqrestore(&desc->lock, flags); + + if (old_notify) { +-#ifndef CONFIG_PREEMPT_RT_BASE +- /* Need to address this for PREEMPT_RT */ ++#ifdef CONFIG_PREEMPT_RT_BASE ++ kthread_cancel_work_sync(¬ify->work); ++#else + cancel_work_sync(&old_notify->work); + #endif + kref_put(&old_notify->kref, old_notify->release); +-- +2.20.1 + diff --git a/debian/patches-rt/0271-arm-imx6-cpuidle-Use-raw_spinlock_t.patch b/debian/patches-rt/0271-arm-imx6-cpuidle-Use-raw_spinlock_t.patch new file mode 100644 index 000000000..3f7c6388a --- /dev/null +++ b/debian/patches-rt/0271-arm-imx6-cpuidle-Use-raw_spinlock_t.patch @@ -0,0 +1,52 @@ +From 17d57bbeda05b3bfe93276333b7b1db0958796d7 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Tue, 14 May 2019 17:07:44 +0200 +Subject: [PATCH 271/283] arm: imx6: cpuidle: Use raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit 40d0332ec8312e9c090f0a5414d9c90e12b13611 ] + +The idle call back is invoked with disabled interrupts and requires +raw_spinlock_t locks to work. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + arch/arm/mach-imx/cpuidle-imx6q.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c +index 326e870d7123..d9ac80aa1eb0 100644 +--- a/arch/arm/mach-imx/cpuidle-imx6q.c ++++ b/arch/arm/mach-imx/cpuidle-imx6q.c +@@ -17,22 +17,22 @@ + #include "hardware.h" + + static int num_idle_cpus = 0; +-static DEFINE_SPINLOCK(cpuidle_lock); ++static DEFINE_RAW_SPINLOCK(cpuidle_lock); + + static int imx6q_enter_wait(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index) + { +- spin_lock(&cpuidle_lock); ++ raw_spin_lock(&cpuidle_lock); + if (++num_idle_cpus == num_online_cpus()) + imx6_set_lpm(WAIT_UNCLOCKED); +- spin_unlock(&cpuidle_lock); ++ raw_spin_unlock(&cpuidle_lock); + + cpu_do_idle(); + +- spin_lock(&cpuidle_lock); ++ raw_spin_lock(&cpuidle_lock); + if (num_idle_cpus-- == num_online_cpus()) + imx6_set_lpm(WAIT_CLOCKED); +- spin_unlock(&cpuidle_lock); ++ raw_spin_unlock(&cpuidle_lock); + + return index; + } +-- +2.20.1 + diff --git a/debian/patches-rt/0272-rcu-Don-t-allow-to-change-rcu_normal_after_boot-on-R.patch b/debian/patches-rt/0272-rcu-Don-t-allow-to-change-rcu_normal_after_boot-on-R.patch new file mode 100644 index 000000000..91498b208 --- /dev/null +++ b/debian/patches-rt/0272-rcu-Don-t-allow-to-change-rcu_normal_after_boot-on-R.patch @@ -0,0 +1,36 @@ +From 8f756e565320c9c32ed9f5e964f03f939dd38379 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 24 Jun 2019 18:29:13 +0200 +Subject: [PATCH 272/283] rcu: Don't allow to change rcu_normal_after_boot on + RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit c6c058c10577815a2491ce661876cff00a4c3b15 ] + +On RT rcu_normal_after_boot is enabled by default. +Don't allow to disable it on RT because the "expedited rcu" would +introduce latency spikes. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/rcu/update.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c +index 16d8dba23329..ed75addd3ccd 100644 +--- a/kernel/rcu/update.c ++++ b/kernel/rcu/update.c +@@ -69,7 +69,9 @@ module_param(rcu_expedited, int, 0); + extern int rcu_normal; /* from sysctl */ + module_param(rcu_normal, int, 0); + static int rcu_normal_after_boot = IS_ENABLED(CONFIG_PREEMPT_RT_FULL); ++#ifndef CONFIG_PREEMPT_RT_FULL + module_param(rcu_normal_after_boot, int, 0); ++#endif + #endif /* #ifndef CONFIG_TINY_RCU */ + + #ifdef CONFIG_DEBUG_LOCK_ALLOC +-- +2.20.1 + diff --git a/debian/patches-rt/0273-pci-switchtec-fix-stream_open.cocci-warnings.patch b/debian/patches-rt/0273-pci-switchtec-fix-stream_open.cocci-warnings.patch new file mode 100644 index 000000000..13c6de4a6 --- /dev/null +++ b/debian/patches-rt/0273-pci-switchtec-fix-stream_open.cocci-warnings.patch @@ -0,0 +1,40 @@ +From 652a25fea4d424e12f2f3ad7bcf5e30f6a6efa3d Mon Sep 17 00:00:00 2001 +From: kbuild test robot +Date: Sat, 13 Apr 2019 11:22:51 +0800 +Subject: [PATCH 273/283] pci/switchtec: fix stream_open.cocci warnings +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit 9462c69e29307adc95c289f50839d5d683973891 ] + +drivers/pci/switch/switchtec.c:395:1-17: ERROR: switchtec_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix. + +Generated by: scripts/coccinelle/api/stream_open.cocci + +Cc: Kirill Smelkov +Cc: Julia Lawall +Fixes: 8a29a3bae2a2 ("pci/switchtec: Don't use completion's wait queue") +Cc: stable-rt@vger.kernel.org # where it applies to +Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1904131849350.2536@hadrien +Signed-off-by: kbuild test robot +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + drivers/pci/switch/switchtec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c +index 77d4fb86d05b..ea70bc0b06e9 100644 +--- a/drivers/pci/switch/switchtec.c ++++ b/drivers/pci/switch/switchtec.c +@@ -360,7 +360,7 @@ static int switchtec_dev_open(struct inode *inode, struct file *filp) + return PTR_ERR(stuser); + + filp->private_data = stuser; +- nonseekable_open(inode, filp); ++ stream_open(inode, filp); + + dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); + +-- +2.20.1 + diff --git a/debian/patches-rt/0274-sched-core-Drop-a-preempt_disable_rt-statement.patch b/debian/patches-rt/0274-sched-core-Drop-a-preempt_disable_rt-statement.patch new file mode 100644 index 000000000..1bdd42cb5 --- /dev/null +++ b/debian/patches-rt/0274-sched-core-Drop-a-preempt_disable_rt-statement.patch @@ -0,0 +1,50 @@ +From 13885eb4d49323964f1067b3f1b9f6503f07e29e Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 24 Jun 2019 19:33:16 +0200 +Subject: [PATCH 274/283] sched/core: Drop a preempt_disable_rt() statement +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit 761126efdcbe3fa3e99c9079fa0ad6eca2f251f2 ] + +The caller holds a lock which already disables preemption. +Drop the preempt_disable_rt() statement in get_nohz_timer_target(). + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/core.c | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 91a9b2556fb0..1b2503b87473 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -558,14 +558,11 @@ void resched_cpu(int cpu) + */ + int get_nohz_timer_target(void) + { +- int i, cpu; ++ int i, cpu = smp_processor_id(); + struct sched_domain *sd; + +- preempt_disable_rt(); +- cpu = smp_processor_id(); +- + if (!idle_cpu(cpu) && housekeeping_cpu(cpu, HK_FLAG_TIMER)) +- goto preempt_en_rt; ++ return cpu; + + rcu_read_lock(); + for_each_domain(cpu, sd) { +@@ -584,8 +581,6 @@ int get_nohz_timer_target(void) + cpu = housekeeping_any_cpu(HK_FLAG_TIMER); + unlock: + rcu_read_unlock(); +-preempt_en_rt: +- preempt_enable_rt(); + return cpu; + } + +-- +2.20.1 + diff --git a/debian/patches-rt/0275-timers-Redo-the-notification-of-canceling-timers-on-.patch b/debian/patches-rt/0275-timers-Redo-the-notification-of-canceling-timers-on-.patch new file mode 100644 index 000000000..bd3db81a7 --- /dev/null +++ b/debian/patches-rt/0275-timers-Redo-the-notification-of-canceling-timers-on-.patch @@ -0,0 +1,650 @@ +From dc0135054565b6bea6821540271adc3643f1098c Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 24 Jun 2019 19:39:06 +0200 +Subject: [PATCH 275/283] timers: Redo the notification of canceling timers on + -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit c71273154c2ad12e13333aada340ff30e826a11b ] + +Rework of the hrtimer, timer and posix-timer cancelation interface +on -RT. Instead of the swait/schedule interface we now have locks +which are taken while timer is active. During the cancellation of an +active timer the lock is acquired. The lock will then either +PI-boost the timer or block and wait until the timer completed. +The new code looks simpler and does not trigger a warning from +rcu_note_context_switch() anymore like reported by Grygorii Strashko +and Daniel Wagner. +The patches were contributed by Anna-Maria Gleixner. + +This is an all in one commit of the following patches: +| [PATCH] timers: Introduce expiry spin lock +| [PATCH] timers: Drop expiry lock after each timer invocation +| [PATCH] hrtimer: Introduce expiry spin lock +| [PATCH] posix-timers: move rcu out of union +| [PATCH] posix-timers: Add expiry lock + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + fs/timerfd.c | 5 +- + include/linux/hrtimer.h | 17 ++---- + include/linux/posix-timers.h | 1 + + kernel/time/alarmtimer.c | 2 +- + kernel/time/hrtimer.c | 36 ++++--------- + kernel/time/itimer.c | 2 +- + kernel/time/posix-cpu-timers.c | 23 ++++++++ + kernel/time/posix-timers.c | 69 ++++++++++-------------- + kernel/time/posix-timers.h | 2 + + kernel/time/timer.c | 96 ++++++++++++++++------------------ + 10 files changed, 118 insertions(+), 135 deletions(-) + +diff --git a/fs/timerfd.c b/fs/timerfd.c +index 82d0f52414a6..f845093466be 100644 +--- a/fs/timerfd.c ++++ b/fs/timerfd.c +@@ -471,10 +471,11 @@ static int do_timerfd_settime(int ufd, int flags, + break; + } + spin_unlock_irq(&ctx->wqh.lock); ++ + if (isalarm(ctx)) +- hrtimer_wait_for_timer(&ctx->t.alarm.timer); ++ hrtimer_grab_expiry_lock(&ctx->t.alarm.timer); + else +- hrtimer_wait_for_timer(&ctx->t.tmr); ++ hrtimer_grab_expiry_lock(&ctx->t.tmr); + } + + /* +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 2bdb047c7656..6c4c38186c99 100644 +--- a/include/linux/hrtimer.h ++++ b/include/linux/hrtimer.h +@@ -22,7 +22,6 @@ + #include + #include + #include +-#include + + struct hrtimer_clock_base; + struct hrtimer_cpu_base; +@@ -193,6 +192,8 @@ enum hrtimer_base_type { + * @nr_retries: Total number of hrtimer interrupt retries + * @nr_hangs: Total number of hrtimer interrupt hangs + * @max_hang_time: Maximum time spent in hrtimer_interrupt ++ * @softirq_expiry_lock: Lock which is taken while softirq based hrtimer are ++ * expired + * @expires_next: absolute time of the next event, is required for remote + * hrtimer enqueue; it is the total first expiry time (hard + * and soft hrtimer are taken into account) +@@ -220,12 +221,10 @@ struct hrtimer_cpu_base { + unsigned short nr_hangs; + unsigned int max_hang_time; + #endif ++ spinlock_t softirq_expiry_lock; + ktime_t expires_next; + struct hrtimer *next_timer; + ktime_t softirq_expires_next; +-#ifdef CONFIG_PREEMPT_RT_BASE +- wait_queue_head_t wait; +-#endif + struct hrtimer *softirq_next_timer; + struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; + } ____cacheline_aligned; +@@ -426,6 +425,7 @@ static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim, + + extern int hrtimer_cancel(struct hrtimer *timer); + extern int hrtimer_try_to_cancel(struct hrtimer *timer); ++extern void hrtimer_grab_expiry_lock(const struct hrtimer *timer); + + static inline void hrtimer_start_expires(struct hrtimer *timer, + enum hrtimer_mode mode) +@@ -443,13 +443,6 @@ static inline void hrtimer_restart(struct hrtimer *timer) + hrtimer_start_expires(timer, HRTIMER_MODE_ABS); + } + +-/* Softirq preemption could deadlock timer removal */ +-#ifdef CONFIG_PREEMPT_RT_BASE +- extern void hrtimer_wait_for_timer(const struct hrtimer *timer); +-#else +-# define hrtimer_wait_for_timer(timer) do { cpu_relax(); } while (0) +-#endif +- + /* Query timers: */ + extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust); + +@@ -475,7 +468,7 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) + * Helper function to check, whether the timer is running the callback + * function + */ +-static inline int hrtimer_callback_running(const struct hrtimer *timer) ++static inline int hrtimer_callback_running(struct hrtimer *timer) + { + return timer->base->running == timer; + } +diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h +index 0571b498db73..3e6c91bdf2ef 100644 +--- a/include/linux/posix-timers.h ++++ b/include/linux/posix-timers.h +@@ -15,6 +15,7 @@ struct cpu_timer_list { + u64 expires, incr; + struct task_struct *task; + int firing; ++ int firing_cpu; + }; + + /* +diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c +index 966708e8ce14..efa1e433974b 100644 +--- a/kernel/time/alarmtimer.c ++++ b/kernel/time/alarmtimer.c +@@ -436,7 +436,7 @@ int alarm_cancel(struct alarm *alarm) + int ret = alarm_try_to_cancel(alarm); + if (ret >= 0) + return ret; +- hrtimer_wait_for_timer(&alarm->timer); ++ hrtimer_grab_expiry_lock(&alarm->timer); + } + } + EXPORT_SYMBOL_GPL(alarm_cancel); +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index e1040b80362c..4534e7871c8c 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -963,33 +963,16 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) + } + EXPORT_SYMBOL_GPL(hrtimer_forward); + +-#ifdef CONFIG_PREEMPT_RT_BASE +-# define wake_up_timer_waiters(b) wake_up(&(b)->wait) +- +-/** +- * hrtimer_wait_for_timer - Wait for a running timer +- * +- * @timer: timer to wait for +- * +- * The function waits in case the timers callback function is +- * currently executed on the waitqueue of the timer base. The +- * waitqueue is woken up after the timer callback function has +- * finished execution. +- */ +-void hrtimer_wait_for_timer(const struct hrtimer *timer) ++void hrtimer_grab_expiry_lock(const struct hrtimer *timer) + { + struct hrtimer_clock_base *base = timer->base; + +- if (base && base->cpu_base && +- base->index >= HRTIMER_BASE_MONOTONIC_SOFT) +- wait_event(base->cpu_base->wait, +- !(hrtimer_callback_running(timer))); ++ if (base && base->cpu_base) { ++ spin_lock(&base->cpu_base->softirq_expiry_lock); ++ spin_unlock(&base->cpu_base->softirq_expiry_lock); ++ } + } + +-#else +-# define wake_up_timer_waiters(b) do { } while (0) +-#endif +- + /* + * enqueue_hrtimer - internal function to (re)start a timer + * +@@ -1224,7 +1207,7 @@ int hrtimer_cancel(struct hrtimer *timer) + + if (ret >= 0) + return ret; +- hrtimer_wait_for_timer(timer); ++ hrtimer_grab_expiry_lock(timer); + } + } + EXPORT_SYMBOL_GPL(hrtimer_cancel); +@@ -1528,6 +1511,7 @@ static __latent_entropy void hrtimer_run_softirq(struct softirq_action *h) + unsigned long flags; + ktime_t now; + ++ spin_lock(&cpu_base->softirq_expiry_lock); + raw_spin_lock_irqsave(&cpu_base->lock, flags); + + now = hrtimer_update_base(cpu_base); +@@ -1537,7 +1521,7 @@ static __latent_entropy void hrtimer_run_softirq(struct softirq_action *h) + hrtimer_update_softirq_timer(cpu_base, true); + + raw_spin_unlock_irqrestore(&cpu_base->lock, flags); +- wake_up_timer_waiters(cpu_base); ++ spin_unlock(&cpu_base->softirq_expiry_lock); + } + + #ifdef CONFIG_HIGH_RES_TIMERS +@@ -1947,9 +1931,7 @@ int hrtimers_prepare_cpu(unsigned int cpu) + cpu_base->softirq_next_timer = NULL; + cpu_base->expires_next = KTIME_MAX; + cpu_base->softirq_expires_next = KTIME_MAX; +-#ifdef CONFIG_PREEMPT_RT_BASE +- init_waitqueue_head(&cpu_base->wait); +-#endif ++ spin_lock_init(&cpu_base->softirq_expiry_lock); + return 0; + } + +diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c +index 55b0e58368bf..a5ff222df4c7 100644 +--- a/kernel/time/itimer.c ++++ b/kernel/time/itimer.c +@@ -215,7 +215,7 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue) + /* We are sharing ->siglock with it_real_fn() */ + if (hrtimer_try_to_cancel(timer) < 0) { + spin_unlock_irq(&tsk->sighand->siglock); +- hrtimer_wait_for_timer(&tsk->signal->real_timer); ++ hrtimer_grab_expiry_lock(timer); + goto again; + } + expires = timeval_to_ktime(value->it_value); +diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c +index baeeaef3b721..59ceedbb03f0 100644 +--- a/kernel/time/posix-cpu-timers.c ++++ b/kernel/time/posix-cpu-timers.c +@@ -789,6 +789,7 @@ check_timers_list(struct list_head *timers, + return t->expires; + + t->firing = 1; ++ t->firing_cpu = smp_processor_id(); + list_move_tail(&t->entry, firing); + } + +@@ -1134,6 +1135,20 @@ static inline int fastpath_timer_check(struct task_struct *tsk) + return 0; + } + ++static DEFINE_PER_CPU(spinlock_t, cpu_timer_expiry_lock) = __SPIN_LOCK_UNLOCKED(cpu_timer_expiry_lock); ++ ++void cpu_timers_grab_expiry_lock(struct k_itimer *timer) ++{ ++ int cpu = timer->it.cpu.firing_cpu; ++ ++ if (cpu >= 0) { ++ spinlock_t *expiry_lock = per_cpu_ptr(&cpu_timer_expiry_lock, cpu); ++ ++ spin_lock_irq(expiry_lock); ++ spin_unlock_irq(expiry_lock); ++ } ++} ++ + /* + * This is called from the timer interrupt handler. The irq handler has + * already updated our counts. We need to check if any timers fire now. +@@ -1144,6 +1159,7 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) + LIST_HEAD(firing); + struct k_itimer *timer, *next; + unsigned long flags; ++ spinlock_t *expiry_lock; + + /* + * The fast path checks that there are no expired thread or thread +@@ -1152,6 +1168,9 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) + if (!fastpath_timer_check(tsk)) + return; + ++ expiry_lock = this_cpu_ptr(&cpu_timer_expiry_lock); ++ spin_lock(expiry_lock); ++ + if (!lock_task_sighand(tsk, &flags)) + return; + /* +@@ -1186,6 +1205,7 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) + list_del_init(&timer->it.cpu.entry); + cpu_firing = timer->it.cpu.firing; + timer->it.cpu.firing = 0; ++ timer->it.cpu.firing_cpu = -1; + /* + * The firing flag is -1 if we collided with a reset + * of the timer, which already reported this +@@ -1195,6 +1215,7 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) + cpu_timer_fire(timer); + spin_unlock(&timer->it_lock); + } ++ spin_unlock(expiry_lock); + } + + #ifdef CONFIG_PREEMPT_RT_BASE +@@ -1460,6 +1481,8 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags, + spin_unlock_irq(&timer.it_lock); + + while (error == TIMER_RETRY) { ++ ++ cpu_timers_grab_expiry_lock(&timer); + /* + * We need to handle case when timer was or is in the + * middle of firing. In other cases we already freed +diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c +index a5ec421e3437..c7e97d421590 100644 +--- a/kernel/time/posix-timers.c ++++ b/kernel/time/posix-timers.c +@@ -821,25 +821,20 @@ static void common_hrtimer_arm(struct k_itimer *timr, ktime_t expires, + hrtimer_start_expires(timer, HRTIMER_MODE_ABS); + } + +-/* +- * Protected by RCU! +- */ +-static void timer_wait_for_callback(const struct k_clock *kc, struct k_itimer *timr) ++static int common_hrtimer_try_to_cancel(struct k_itimer *timr) + { +-#ifdef CONFIG_PREEMPT_RT_FULL +- if (kc->timer_arm == common_hrtimer_arm) +- hrtimer_wait_for_timer(&timr->it.real.timer); +- else if (kc == &alarm_clock) +- hrtimer_wait_for_timer(&timr->it.alarm.alarmtimer.timer); +- else +- /* FIXME: Whacky hack for posix-cpu-timers */ +- schedule_timeout(1); +-#endif ++ return hrtimer_try_to_cancel(&timr->it.real.timer); + } + +-static int common_hrtimer_try_to_cancel(struct k_itimer *timr) ++static void timer_wait_for_callback(const struct k_clock *kc, struct k_itimer *timer) + { +- return hrtimer_try_to_cancel(&timr->it.real.timer); ++ if (kc->timer_arm == common_hrtimer_arm) ++ hrtimer_grab_expiry_lock(&timer->it.real.timer); ++ else if (kc == &alarm_clock) ++ hrtimer_grab_expiry_lock(&timer->it.alarm.alarmtimer.timer); ++ else ++ /* posix-cpu-timers */ ++ cpu_timers_grab_expiry_lock(timer); + } + + /* Set a POSIX.1b interval timer. */ +@@ -901,21 +896,21 @@ static int do_timer_settime(timer_t timer_id, int flags, + if (!timr) + return -EINVAL; + +- rcu_read_lock(); + kc = timr->kclock; + if (WARN_ON_ONCE(!kc || !kc->timer_set)) + error = -EINVAL; + else + error = kc->timer_set(timr, flags, new_spec64, old_spec64); + +- unlock_timer(timr, flag); + if (error == TIMER_RETRY) { ++ rcu_read_lock(); ++ unlock_timer(timr, flag); + timer_wait_for_callback(kc, timr); +- old_spec64 = NULL; // We already got the old time... + rcu_read_unlock(); ++ old_spec64 = NULL; // We already got the old time... + goto retry; + } +- rcu_read_unlock(); ++ unlock_timer(timr, flag); + + return error; + } +@@ -977,13 +972,21 @@ int common_timer_del(struct k_itimer *timer) + return 0; + } + +-static inline int timer_delete_hook(struct k_itimer *timer) ++static int timer_delete_hook(struct k_itimer *timer) + { + const struct k_clock *kc = timer->kclock; ++ int ret; + + if (WARN_ON_ONCE(!kc || !kc->timer_del)) + return -EINVAL; +- return kc->timer_del(timer); ++ ret = kc->timer_del(timer); ++ if (ret == TIMER_RETRY) { ++ rcu_read_lock(); ++ spin_unlock_irq(&timer->it_lock); ++ timer_wait_for_callback(kc, timer); ++ rcu_read_unlock(); ++ } ++ return ret; + } + + /* Delete a POSIX.1b interval timer. */ +@@ -997,15 +1000,8 @@ SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) + if (!timer) + return -EINVAL; + +- rcu_read_lock(); +- if (timer_delete_hook(timer) == TIMER_RETRY) { +- unlock_timer(timer, flags); +- timer_wait_for_callback(clockid_to_kclock(timer->it_clock), +- timer); +- rcu_read_unlock(); ++ if (timer_delete_hook(timer) == TIMER_RETRY) + goto retry_delete; +- } +- rcu_read_unlock(); + + spin_lock(¤t->sighand->siglock); + list_del(&timer->list); +@@ -1031,20 +1027,9 @@ static void itimer_delete(struct k_itimer *timer) + retry_delete: + spin_lock_irqsave(&timer->it_lock, flags); + +- /* On RT we can race with a deletion */ +- if (!timer->it_signal) { +- unlock_timer(timer, flags); +- return; +- } +- +- if (timer_delete_hook(timer) == TIMER_RETRY) { +- rcu_read_lock(); +- unlock_timer(timer, flags); +- timer_wait_for_callback(clockid_to_kclock(timer->it_clock), +- timer); +- rcu_read_unlock(); ++ if (timer_delete_hook(timer) == TIMER_RETRY) + goto retry_delete; +- } ++ + list_del(&timer->list); + /* + * This keeps any tasks waiting on the spin lock from thinking +diff --git a/kernel/time/posix-timers.h b/kernel/time/posix-timers.h +index ddb21145211a..725bd230a8db 100644 +--- a/kernel/time/posix-timers.h ++++ b/kernel/time/posix-timers.h +@@ -32,6 +32,8 @@ extern const struct k_clock clock_process; + extern const struct k_clock clock_thread; + extern const struct k_clock alarm_clock; + ++extern void cpu_timers_grab_expiry_lock(struct k_itimer *timer); ++ + int posix_timer_event(struct k_itimer *timr, int si_private); + + void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting); +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 781483c76b17..d6289d8df06b 100644 +--- a/kernel/time/timer.c ++++ b/kernel/time/timer.c +@@ -44,7 +44,6 @@ + #include + #include + #include +-#include + + #include + #include +@@ -198,9 +197,7 @@ EXPORT_SYMBOL(jiffies_64); + struct timer_base { + raw_spinlock_t lock; + struct timer_list *running_timer; +-#ifdef CONFIG_PREEMPT_RT_FULL +- struct swait_queue_head wait_for_running_timer; +-#endif ++ spinlock_t expiry_lock; + unsigned long clk; + unsigned long next_expiry; + unsigned int cpu; +@@ -1189,33 +1186,6 @@ void add_timer_on(struct timer_list *timer, int cpu) + } + EXPORT_SYMBOL_GPL(add_timer_on); + +-#ifdef CONFIG_PREEMPT_RT_FULL +-/* +- * Wait for a running timer +- */ +-static void wait_for_running_timer(struct timer_list *timer) +-{ +- struct timer_base *base; +- u32 tf = timer->flags; +- +- if (tf & TIMER_MIGRATING) +- return; +- +- base = get_timer_base(tf); +- swait_event_exclusive(base->wait_for_running_timer, +- base->running_timer != timer); +-} +- +-# define wakeup_timer_waiters(b) swake_up_all(&(b)->wait_for_running_timer) +-#else +-static inline void wait_for_running_timer(struct timer_list *timer) +-{ +- cpu_relax(); +-} +- +-# define wakeup_timer_waiters(b) do { } while (0) +-#endif +- + /** + * del_timer - deactivate a timer. + * @timer: the timer to be deactivated +@@ -1245,14 +1215,8 @@ int del_timer(struct timer_list *timer) + } + EXPORT_SYMBOL(del_timer); + +-/** +- * try_to_del_timer_sync - Try to deactivate a timer +- * @timer: timer to delete +- * +- * This function tries to deactivate a timer. Upon successful (ret >= 0) +- * exit the timer is not queued and the handler is not running on any CPU. +- */ +-int try_to_del_timer_sync(struct timer_list *timer) ++static int __try_to_del_timer_sync(struct timer_list *timer, ++ struct timer_base **basep) + { + struct timer_base *base; + unsigned long flags; +@@ -1260,7 +1224,7 @@ int try_to_del_timer_sync(struct timer_list *timer) + + debug_assert_init(timer); + +- base = lock_timer_base(timer, &flags); ++ *basep = base = lock_timer_base(timer, &flags); + + if (base->running_timer != timer) + ret = detach_if_pending(timer, base, true); +@@ -1269,9 +1233,42 @@ int try_to_del_timer_sync(struct timer_list *timer) + + return ret; + } ++ ++/** ++ * try_to_del_timer_sync - Try to deactivate a timer ++ * @timer: timer to delete ++ * ++ * This function tries to deactivate a timer. Upon successful (ret >= 0) ++ * exit the timer is not queued and the handler is not running on any CPU. ++ */ ++int try_to_del_timer_sync(struct timer_list *timer) ++{ ++ struct timer_base *base; ++ ++ return __try_to_del_timer_sync(timer, &base); ++} + EXPORT_SYMBOL(try_to_del_timer_sync); + + #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT_FULL) ++static int __del_timer_sync(struct timer_list *timer) ++{ ++ struct timer_base *base; ++ int ret; ++ ++ for (;;) { ++ ret = __try_to_del_timer_sync(timer, &base); ++ if (ret >= 0) ++ return ret; ++ ++ /* ++ * When accessing the lock, timers of base are no longer expired ++ * and so timer is no longer running. ++ */ ++ spin_lock(&base->expiry_lock); ++ spin_unlock(&base->expiry_lock); ++ } ++} ++ + /** + * del_timer_sync - deactivate a timer and wait for the handler to finish. + * @timer: the timer to be deactivated +@@ -1327,12 +1324,8 @@ int del_timer_sync(struct timer_list *timer) + * could lead to deadlock. + */ + WARN_ON(in_irq() && !(timer->flags & TIMER_IRQSAFE)); +- for (;;) { +- int ret = try_to_del_timer_sync(timer); +- if (ret >= 0) +- return ret; +- wait_for_running_timer(timer); +- } ++ ++ return __del_timer_sync(timer); + } + EXPORT_SYMBOL(del_timer_sync); + #endif +@@ -1397,11 +1390,15 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head) + raw_spin_unlock(&base->lock); + call_timer_fn(timer, fn); + base->running_timer = NULL; ++ spin_unlock(&base->expiry_lock); ++ spin_lock(&base->expiry_lock); + raw_spin_lock(&base->lock); + } else { + raw_spin_unlock_irq(&base->lock); + call_timer_fn(timer, fn); + base->running_timer = NULL; ++ spin_unlock(&base->expiry_lock); ++ spin_lock(&base->expiry_lock); + raw_spin_lock_irq(&base->lock); + } + } +@@ -1696,6 +1693,7 @@ static inline void __run_timers(struct timer_base *base) + if (!time_after_eq(jiffies, base->clk)) + return; + ++ spin_lock(&base->expiry_lock); + raw_spin_lock_irq(&base->lock); + + /* +@@ -1723,7 +1721,7 @@ static inline void __run_timers(struct timer_base *base) + expire_timers(base, heads + levels); + } + raw_spin_unlock_irq(&base->lock); +- wakeup_timer_waiters(base); ++ spin_unlock(&base->expiry_lock); + } + + /* +@@ -1970,9 +1968,7 @@ static void __init init_timer_cpu(int cpu) + base->cpu = cpu; + raw_spin_lock_init(&base->lock); + base->clk = jiffies; +-#ifdef CONFIG_PREEMPT_RT_FULL +- init_swait_queue_head(&base->wait_for_running_timer); +-#endif ++ spin_lock_init(&base->expiry_lock); + } + } + +-- +2.20.1 + diff --git a/debian/patches-rt/0276-Revert-futex-Ensure-lock-unlock-symetry-versus-pi_lo.patch b/debian/patches-rt/0276-Revert-futex-Ensure-lock-unlock-symetry-versus-pi_lo.patch new file mode 100644 index 000000000..d631ab169 --- /dev/null +++ b/debian/patches-rt/0276-Revert-futex-Ensure-lock-unlock-symetry-versus-pi_lo.patch @@ -0,0 +1,35 @@ +From d6630ac9f4bcf1f8fd51923ea266c42e87f9d312 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 26 Jun 2019 17:44:13 +0200 +Subject: [PATCH 276/283] Revert "futex: Ensure lock/unlock symetry versus + pi_lock and hash bucket lock" +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit 6a773b70cf105b46298ed3b44e77c102ce31d9ec ] + +Drop the RT fixup, the futex code will be changed to avoid the need for +the workaround. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/futex.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/kernel/futex.c b/kernel/futex.c +index fe90164aa6ec..a58af833bb77 100644 +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -918,9 +918,7 @@ void exit_pi_state_list(struct task_struct *curr) + if (head->next != next) { + /* retain curr->pi_lock for the loop invariant */ + raw_spin_unlock(&pi_state->pi_mutex.wait_lock); +- raw_spin_unlock_irq(&curr->pi_lock); + spin_unlock(&hb->lock); +- raw_spin_lock_irq(&curr->pi_lock); + put_pi_state(pi_state); + continue; + } +-- +2.20.1 + diff --git a/debian/patches-rt/0277-Revert-futex-Fix-bug-on-when-a-requeued-RT-task-time.patch b/debian/patches-rt/0277-Revert-futex-Fix-bug-on-when-a-requeued-RT-task-time.patch new file mode 100644 index 000000000..b0a52f50d --- /dev/null +++ b/debian/patches-rt/0277-Revert-futex-Fix-bug-on-when-a-requeued-RT-task-time.patch @@ -0,0 +1,83 @@ +From 9848e5129d0d928c27247ab10835cdfb2948bd60 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 26 Jun 2019 17:44:18 +0200 +Subject: [PATCH 277/283] Revert "futex: Fix bug on when a requeued RT task + times out" +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit f1a170cb3289a48df26cae3c60d77608f7a988bb ] + +Drop the RT fixup, the futex code will be changed to avoid the need for +the workaround. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/locking/rtmutex.c | 31 +------------------------------ + kernel/locking/rtmutex_common.h | 1 - + 2 files changed, 1 insertion(+), 31 deletions(-) + +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 2a9bf2443acc..7f6f402e04ae 100644 +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -144,8 +144,7 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) + + static int rt_mutex_real_waiter(struct rt_mutex_waiter *waiter) + { +- return waiter && waiter != PI_WAKEUP_INPROGRESS && +- waiter != PI_REQUEUE_INPROGRESS; ++ return waiter && waiter != PI_WAKEUP_INPROGRESS; + } + + /* +@@ -2350,34 +2349,6 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, + if (try_to_take_rt_mutex(lock, task, NULL)) + return 1; + +-#ifdef CONFIG_PREEMPT_RT_FULL +- /* +- * In PREEMPT_RT there's an added race. +- * If the task, that we are about to requeue, times out, +- * it can set the PI_WAKEUP_INPROGRESS. This tells the requeue +- * to skip this task. But right after the task sets +- * its pi_blocked_on to PI_WAKEUP_INPROGRESS it can then +- * block on the spin_lock(&hb->lock), which in RT is an rtmutex. +- * This will replace the PI_WAKEUP_INPROGRESS with the actual +- * lock that it blocks on. We *must not* place this task +- * on this proxy lock in that case. +- * +- * To prevent this race, we first take the task's pi_lock +- * and check if it has updated its pi_blocked_on. If it has, +- * we assume that it woke up and we return -EAGAIN. +- * Otherwise, we set the task's pi_blocked_on to +- * PI_REQUEUE_INPROGRESS, so that if the task is waking up +- * it will know that we are in the process of requeuing it. +- */ +- raw_spin_lock(&task->pi_lock); +- if (task->pi_blocked_on) { +- raw_spin_unlock(&task->pi_lock); +- return -EAGAIN; +- } +- task->pi_blocked_on = PI_REQUEUE_INPROGRESS; +- raw_spin_unlock(&task->pi_lock); +-#endif +- + /* We enforce deadlock detection for futexes */ + ret = task_blocks_on_rt_mutex(lock, waiter, task, + RT_MUTEX_FULL_CHAINWALK); +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index 546aaf058b9e..a501f3b47081 100644 +--- a/kernel/locking/rtmutex_common.h ++++ b/kernel/locking/rtmutex_common.h +@@ -133,7 +133,6 @@ enum rtmutex_chainwalk { + * PI-futex support (proxy locking functions, etc.): + */ + #define PI_WAKEUP_INPROGRESS ((struct rt_mutex_waiter *) 1) +-#define PI_REQUEUE_INPROGRESS ((struct rt_mutex_waiter *) 2) + + extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); + extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, +-- +2.20.1 + diff --git a/debian/patches-rt/0278-Revert-rtmutex-Handle-the-various-new-futex-race-con.patch b/debian/patches-rt/0278-Revert-rtmutex-Handle-the-various-new-futex-race-con.patch new file mode 100644 index 000000000..aca8a4daf --- /dev/null +++ b/debian/patches-rt/0278-Revert-rtmutex-Handle-the-various-new-futex-race-con.patch @@ -0,0 +1,258 @@ +From 0c3cb70fa05bdcb4ff249079bab804e098149371 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 26 Jun 2019 17:44:21 +0200 +Subject: [PATCH 278/283] Revert "rtmutex: Handle the various new futex race + conditions" +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit 9e0265c21af4d6388d47dcd5ce20f76ec3a2e468 ] + +Drop the RT fixup, the futex code will be changed to avoid the need for +the workaround. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/futex.c | 77 +++++++-------------------------- + kernel/locking/rtmutex.c | 36 +++------------ + kernel/locking/rtmutex_common.h | 2 - + 3 files changed, 21 insertions(+), 94 deletions(-) + +diff --git a/kernel/futex.c b/kernel/futex.c +index a58af833bb77..1d9423914bf4 100644 +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -2147,16 +2147,6 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, + requeue_pi_wake_futex(this, &key2, hb2); + drop_count++; + continue; +- } else if (ret == -EAGAIN) { +- /* +- * Waiter was woken by timeout or +- * signal and has set pi_blocked_on to +- * PI_WAKEUP_INPROGRESS before we +- * tried to enqueue it on the rtmutex. +- */ +- this->pi_state = NULL; +- put_pi_state(pi_state); +- continue; + } else if (ret) { + /* + * rt_mutex_start_proxy_lock() detected a +@@ -3235,7 +3225,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + struct hrtimer_sleeper timeout, *to = NULL; + struct futex_pi_state *pi_state = NULL; + struct rt_mutex_waiter rt_waiter; +- struct futex_hash_bucket *hb, *hb2; ++ struct futex_hash_bucket *hb; + union futex_key key2 = FUTEX_KEY_INIT; + struct futex_q q = futex_q_init; + int res, ret; +@@ -3293,55 +3283,20 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + /* Queue the futex_q, drop the hb lock, wait for wakeup. */ + futex_wait_queue_me(hb, &q, to); + +- /* +- * On RT we must avoid races with requeue and trying to block +- * on two mutexes (hb->lock and uaddr2's rtmutex) by +- * serializing access to pi_blocked_on with pi_lock. +- */ +- raw_spin_lock_irq(¤t->pi_lock); +- if (current->pi_blocked_on) { +- /* +- * We have been requeued or are in the process of +- * being requeued. +- */ +- raw_spin_unlock_irq(¤t->pi_lock); +- } else { +- /* +- * Setting pi_blocked_on to PI_WAKEUP_INPROGRESS +- * prevents a concurrent requeue from moving us to the +- * uaddr2 rtmutex. After that we can safely acquire +- * (and possibly block on) hb->lock. +- */ +- current->pi_blocked_on = PI_WAKEUP_INPROGRESS; +- raw_spin_unlock_irq(¤t->pi_lock); +- +- spin_lock(&hb->lock); +- +- /* +- * Clean up pi_blocked_on. We might leak it otherwise +- * when we succeeded with the hb->lock in the fast +- * path. +- */ +- raw_spin_lock_irq(¤t->pi_lock); +- current->pi_blocked_on = NULL; +- raw_spin_unlock_irq(¤t->pi_lock); +- +- ret = handle_early_requeue_pi_wakeup(hb, &q, &key2, to); +- spin_unlock(&hb->lock); +- if (ret) +- goto out_put_keys; +- } ++ spin_lock(&hb->lock); ++ ret = handle_early_requeue_pi_wakeup(hb, &q, &key2, to); ++ spin_unlock(&hb->lock); ++ if (ret) ++ goto out_put_keys; + + /* +- * In order to be here, we have either been requeued, are in +- * the process of being requeued, or requeue successfully +- * acquired uaddr2 on our behalf. If pi_blocked_on was +- * non-null above, we may be racing with a requeue. Do not +- * rely on q->lock_ptr to be hb2->lock until after blocking on +- * hb->lock or hb2->lock. The futex_requeue dropped our key1 +- * reference and incremented our key2 reference count. ++ * In order for us to be here, we know our q.key == key2, and since ++ * we took the hb->lock above, we also know that futex_requeue() has ++ * completed and we no longer have to concern ourselves with a wakeup ++ * race with the atomic proxy lock acquisition by the requeue code. The ++ * futex_requeue dropped our key1 reference and incremented our key2 ++ * reference count. + */ +- hb2 = hash_futex(&key2); + + /* Check if the requeue code acquired the second futex for us. */ + if (!q.rt_waiter) { +@@ -3350,8 +3305,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + * did a lock-steal - fix up the PI-state in that case. + */ + if (q.pi_state && (q.pi_state->owner != current)) { +- spin_lock(&hb2->lock); +- BUG_ON(&hb2->lock != q.lock_ptr); ++ spin_lock(q.lock_ptr); + ret = fixup_pi_state_owner(uaddr2, &q, current); + if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { + pi_state = q.pi_state; +@@ -3362,7 +3316,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + * the requeue_pi() code acquired for us. + */ + put_pi_state(q.pi_state); +- spin_unlock(&hb2->lock); ++ spin_unlock(q.lock_ptr); + } + } else { + struct rt_mutex *pi_mutex; +@@ -3376,8 +3330,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + pi_mutex = &q.pi_state->pi_mutex; + ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); + +- spin_lock(&hb2->lock); +- BUG_ON(&hb2->lock != q.lock_ptr); ++ spin_lock(q.lock_ptr); + if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) + ret = 0; + +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 7f6f402e04ae..44a33057a83a 100644 +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -142,11 +142,6 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) + WRITE_ONCE(*p, owner & ~RT_MUTEX_HAS_WAITERS); + } + +-static int rt_mutex_real_waiter(struct rt_mutex_waiter *waiter) +-{ +- return waiter && waiter != PI_WAKEUP_INPROGRESS; +-} +- + /* + * We can speed up the acquire/release, if there's no debugging state to be + * set up. +@@ -420,8 +415,7 @@ int max_lock_depth = 1024; + + static inline struct rt_mutex *task_blocked_on_lock(struct task_struct *p) + { +- return rt_mutex_real_waiter(p->pi_blocked_on) ? +- p->pi_blocked_on->lock : NULL; ++ return p->pi_blocked_on ? p->pi_blocked_on->lock : NULL; + } + + /* +@@ -557,7 +551,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + * reached or the state of the chain has changed while we + * dropped the locks. + */ +- if (!rt_mutex_real_waiter(waiter)) ++ if (!waiter) + goto out_unlock_pi; + + /* +@@ -1327,22 +1321,6 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + return -EDEADLK; + + raw_spin_lock(&task->pi_lock); +- /* +- * In the case of futex requeue PI, this will be a proxy +- * lock. The task will wake unaware that it is enqueueed on +- * this lock. Avoid blocking on two locks and corrupting +- * pi_blocked_on via the PI_WAKEUP_INPROGRESS +- * flag. futex_wait_requeue_pi() sets this when it wakes up +- * before requeue (due to a signal or timeout). Do not enqueue +- * the task if PI_WAKEUP_INPROGRESS is set. +- */ +- if (task != current && task->pi_blocked_on == PI_WAKEUP_INPROGRESS) { +- raw_spin_unlock(&task->pi_lock); +- return -EAGAIN; +- } +- +- BUG_ON(rt_mutex_real_waiter(task->pi_blocked_on)); +- + waiter->task = task; + waiter->lock = lock; + waiter->prio = task->prio; +@@ -1366,7 +1344,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + rt_mutex_enqueue_pi(owner, waiter); + + rt_mutex_adjust_prio(owner); +- if (rt_mutex_real_waiter(owner->pi_blocked_on)) ++ if (owner->pi_blocked_on) + chain_walk = 1; + } else if (rt_mutex_cond_detect_deadlock(waiter, chwalk)) { + chain_walk = 1; +@@ -1466,7 +1444,7 @@ static void remove_waiter(struct rt_mutex *lock, + { + bool is_top_waiter = (waiter == rt_mutex_top_waiter(lock)); + struct task_struct *owner = rt_mutex_owner(lock); +- struct rt_mutex *next_lock = NULL; ++ struct rt_mutex *next_lock; + + lockdep_assert_held(&lock->wait_lock); + +@@ -1492,8 +1470,7 @@ static void remove_waiter(struct rt_mutex *lock, + rt_mutex_adjust_prio(owner); + + /* Store the lock on which owner is blocked or NULL */ +- if (rt_mutex_real_waiter(owner->pi_blocked_on)) +- next_lock = task_blocked_on_lock(owner); ++ next_lock = task_blocked_on_lock(owner); + + raw_spin_unlock(&owner->pi_lock); + +@@ -1529,8 +1506,7 @@ void rt_mutex_adjust_pi(struct task_struct *task) + raw_spin_lock_irqsave(&task->pi_lock, flags); + + waiter = task->pi_blocked_on; +- if (!rt_mutex_real_waiter(waiter) || +- rt_mutex_waiter_equal(waiter, task_to_waiter(task))) { ++ if (!waiter || rt_mutex_waiter_equal(waiter, task_to_waiter(task))) { + raw_spin_unlock_irqrestore(&task->pi_lock, flags); + return; + } +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index a501f3b47081..758dc43872e5 100644 +--- a/kernel/locking/rtmutex_common.h ++++ b/kernel/locking/rtmutex_common.h +@@ -132,8 +132,6 @@ enum rtmutex_chainwalk { + /* + * PI-futex support (proxy locking functions, etc.): + */ +-#define PI_WAKEUP_INPROGRESS ((struct rt_mutex_waiter *) 1) +- + extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); + extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, + struct task_struct *proxy_owner); +-- +2.20.1 + diff --git a/debian/patches-rt/0279-Revert-futex-workaround-migrate_disable-enable-in-di.patch b/debian/patches-rt/0279-Revert-futex-workaround-migrate_disable-enable-in-di.patch new file mode 100644 index 000000000..4f5ffa9a7 --- /dev/null +++ b/debian/patches-rt/0279-Revert-futex-workaround-migrate_disable-enable-in-di.patch @@ -0,0 +1,70 @@ +From a4c6efd8adfd48a378c579bb7bc2c1a3162ced7f Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 26 Jun 2019 17:44:27 +0200 +Subject: [PATCH 279/283] Revert "futex: workaround migrate_disable/enable in + different context" +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit a71221d81cc4873891ae44f3aa02df596079b786 ] + +Drop the RT fixup, the futex code will be changed to avoid the need for +the workaround. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/futex.c | 19 ------------------- + 1 file changed, 19 deletions(-) + +diff --git a/kernel/futex.c b/kernel/futex.c +index 1d9423914bf4..54ffc25183ed 100644 +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -2875,14 +2875,6 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, + * before __rt_mutex_start_proxy_lock() is done. + */ + raw_spin_lock_irq(&q.pi_state->pi_mutex.wait_lock); +- /* +- * the migrate_disable() here disables migration in the in_atomic() fast +- * path which is enabled again in the following spin_unlock(). We have +- * one migrate_disable() pending in the slow-path which is reversed +- * after the raw_spin_unlock_irq() where we leave the atomic context. +- */ +- migrate_disable(); +- + spin_unlock(q.lock_ptr); + /* + * __rt_mutex_start_proxy_lock() unconditionally enqueues the @rt_waiter +@@ -2891,7 +2883,6 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, + */ + ret = __rt_mutex_start_proxy_lock(&q.pi_state->pi_mutex, &rt_waiter, current); + raw_spin_unlock_irq(&q.pi_state->pi_mutex.wait_lock); +- migrate_enable(); + + if (ret) { + if (ret == 1) +@@ -3040,21 +3031,11 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + * rt_waiter. Also see the WARN in wake_futex_pi(). + */ + raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); +- /* +- * Magic trickery for now to make the RT migrate disable +- * logic happy. The following spin_unlock() happens with +- * interrupts disabled so the internal migrate_enable() +- * won't undo the migrate_disable() which was issued when +- * locking hb->lock. +- */ +- migrate_disable(); + spin_unlock(&hb->lock); + + /* drops pi_state->pi_mutex.wait_lock */ + ret = wake_futex_pi(uaddr, uval, pi_state); + +- migrate_enable(); +- + put_pi_state(pi_state); + + /* +-- +2.20.1 + diff --git a/debian/patches-rt/0280-futex-Make-the-futex_hash_bucket-lock-raw.patch b/debian/patches-rt/0280-futex-Make-the-futex_hash_bucket-lock-raw.patch new file mode 100644 index 000000000..25335e04e --- /dev/null +++ b/debian/patches-rt/0280-futex-Make-the-futex_hash_bucket-lock-raw.patch @@ -0,0 +1,349 @@ +From b3425a889b12c0166d2eb44b8eaab8af20a73a22 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 26 Jun 2019 11:59:44 +0200 +Subject: [PATCH 280/283] futex: Make the futex_hash_bucket lock raw +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit f646521aadedab78801c9befe193e2e8a0c99298 ] + +Since commit 1a1fb985f2e2b ("futex: Handle early deadlock return +correctly") we can deadlock while we attempt to acquire the HB lock if +we fail to acquire the lock. +The RT waiter (for the futex lock) is still enqueued and acquiring the +HB lock may build up a lock chain which leads to a deadlock if the owner +of the lock futex-lock holds the HB lock. + +Make the hash bucket lock raw so it does not participate in the +lockchain. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/futex.c | 88 +++++++++++++++++++++++++------------------------- + 1 file changed, 44 insertions(+), 44 deletions(-) + +diff --git a/kernel/futex.c b/kernel/futex.c +index 54ffc25183ed..b02d9969330b 100644 +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -240,7 +240,7 @@ struct futex_q { + struct plist_node list; + + struct task_struct *task; +- spinlock_t *lock_ptr; ++ raw_spinlock_t *lock_ptr; + union futex_key key; + struct futex_pi_state *pi_state; + struct rt_mutex_waiter *rt_waiter; +@@ -261,7 +261,7 @@ static const struct futex_q futex_q_init = { + */ + struct futex_hash_bucket { + atomic_t waiters; +- spinlock_t lock; ++ raw_spinlock_t lock; + struct plist_head chain; + } ____cacheline_aligned_in_smp; + +@@ -908,7 +908,7 @@ void exit_pi_state_list(struct task_struct *curr) + } + raw_spin_unlock_irq(&curr->pi_lock); + +- spin_lock(&hb->lock); ++ raw_spin_lock(&hb->lock); + raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); + raw_spin_lock(&curr->pi_lock); + /* +@@ -918,7 +918,7 @@ void exit_pi_state_list(struct task_struct *curr) + if (head->next != next) { + /* retain curr->pi_lock for the loop invariant */ + raw_spin_unlock(&pi_state->pi_mutex.wait_lock); +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + put_pi_state(pi_state); + continue; + } +@@ -930,7 +930,7 @@ void exit_pi_state_list(struct task_struct *curr) + + raw_spin_unlock(&curr->pi_lock); + raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + + rt_mutex_futex_unlock(&pi_state->pi_mutex); + put_pi_state(pi_state); +@@ -1424,7 +1424,7 @@ static void __unqueue_futex(struct futex_q *q) + { + struct futex_hash_bucket *hb; + +- if (WARN_ON_SMP(!q->lock_ptr || !spin_is_locked(q->lock_ptr)) ++ if (WARN_ON_SMP(!q->lock_ptr || !raw_spin_is_locked(q->lock_ptr)) + || WARN_ON(plist_node_empty(&q->list))) + return; + +@@ -1552,21 +1552,21 @@ static inline void + double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2) + { + if (hb1 <= hb2) { +- spin_lock(&hb1->lock); ++ raw_spin_lock(&hb1->lock); + if (hb1 < hb2) +- spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING); ++ raw_spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING); + } else { /* hb1 > hb2 */ +- spin_lock(&hb2->lock); +- spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING); ++ raw_spin_lock(&hb2->lock); ++ raw_spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING); + } + } + + static inline void + double_unlock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2) + { +- spin_unlock(&hb1->lock); ++ raw_spin_unlock(&hb1->lock); + if (hb1 != hb2) +- spin_unlock(&hb2->lock); ++ raw_spin_unlock(&hb2->lock); + } + + /* +@@ -1594,7 +1594,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) + if (!hb_waiters_pending(hb)) + goto out_put_key; + +- spin_lock(&hb->lock); ++ raw_spin_lock(&hb->lock); + + plist_for_each_entry_safe(this, next, &hb->chain, list) { + if (match_futex (&this->key, &key)) { +@@ -1613,7 +1613,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) + } + } + +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + wake_up_q(&wake_q); + out_put_key: + put_futex_key(&key); +@@ -2218,7 +2218,7 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q) + + q->lock_ptr = &hb->lock; + +- spin_lock(&hb->lock); /* implies smp_mb(); (A) */ ++ raw_spin_lock(&hb->lock); /* implies smp_mb(); (A) */ + return hb; + } + +@@ -2226,7 +2226,7 @@ static inline void + queue_unlock(struct futex_hash_bucket *hb) + __releases(&hb->lock) + { +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + hb_waiters_dec(hb); + } + +@@ -2265,7 +2265,7 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) + __releases(&hb->lock) + { + __queue_me(q, hb); +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + } + + /** +@@ -2281,41 +2281,41 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) + */ + static int unqueue_me(struct futex_q *q) + { +- spinlock_t *lock_ptr; ++ raw_spinlock_t *lock_ptr; + int ret = 0; + + /* In the common case we don't take the spinlock, which is nice. */ + retry: + /* +- * q->lock_ptr can change between this read and the following spin_lock. +- * Use READ_ONCE to forbid the compiler from reloading q->lock_ptr and +- * optimizing lock_ptr out of the logic below. ++ * q->lock_ptr can change between this read and the following ++ * raw_spin_lock. Use READ_ONCE to forbid the compiler from reloading ++ * q->lock_ptr and optimizing lock_ptr out of the logic below. + */ + lock_ptr = READ_ONCE(q->lock_ptr); + if (lock_ptr != NULL) { +- spin_lock(lock_ptr); ++ raw_spin_lock(lock_ptr); + /* + * q->lock_ptr can change between reading it and +- * spin_lock(), causing us to take the wrong lock. This ++ * raw_spin_lock(), causing us to take the wrong lock. This + * corrects the race condition. + * + * Reasoning goes like this: if we have the wrong lock, + * q->lock_ptr must have changed (maybe several times) +- * between reading it and the spin_lock(). It can +- * change again after the spin_lock() but only if it was +- * already changed before the spin_lock(). It cannot, ++ * between reading it and the raw_spin_lock(). It can ++ * change again after the raw_spin_lock() but only if it was ++ * already changed before the raw_spin_lock(). It cannot, + * however, change back to the original value. Therefore + * we can detect whether we acquired the correct lock. + */ + if (unlikely(lock_ptr != q->lock_ptr)) { +- spin_unlock(lock_ptr); ++ raw_spin_unlock(lock_ptr); + goto retry; + } + __unqueue_futex(q); + + BUG_ON(q->pi_state); + +- spin_unlock(lock_ptr); ++ raw_spin_unlock(lock_ptr); + ret = 1; + } + +@@ -2337,7 +2337,7 @@ static void unqueue_me_pi(struct futex_q *q) + put_pi_state(q->pi_state); + q->pi_state = NULL; + +- spin_unlock(q->lock_ptr); ++ raw_spin_unlock(q->lock_ptr); + } + + static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, +@@ -2470,7 +2470,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, + */ + handle_err: + raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); +- spin_unlock(q->lock_ptr); ++ raw_spin_unlock(q->lock_ptr); + + switch (err) { + case -EFAULT: +@@ -2488,7 +2488,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, + break; + } + +- spin_lock(q->lock_ptr); ++ raw_spin_lock(q->lock_ptr); + raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); + + /* +@@ -2584,7 +2584,7 @@ static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q, + /* + * The task state is guaranteed to be set before another task can + * wake it. set_current_state() is implemented using smp_store_mb() and +- * queue_me() calls spin_unlock() upon completion, both serializing ++ * queue_me() calls raw_spin_unlock() upon completion, both serializing + * access to the hash list and forcing another memory barrier. + */ + set_current_state(TASK_INTERRUPTIBLE); +@@ -2875,7 +2875,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, + * before __rt_mutex_start_proxy_lock() is done. + */ + raw_spin_lock_irq(&q.pi_state->pi_mutex.wait_lock); +- spin_unlock(q.lock_ptr); ++ raw_spin_unlock(q.lock_ptr); + /* + * __rt_mutex_start_proxy_lock() unconditionally enqueues the @rt_waiter + * such that futex_unlock_pi() is guaranteed to observe the waiter when +@@ -2896,7 +2896,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, + ret = rt_mutex_wait_proxy_lock(&q.pi_state->pi_mutex, to, &rt_waiter); + + cleanup: +- spin_lock(q.lock_ptr); ++ raw_spin_lock(q.lock_ptr); + /* + * If we failed to acquire the lock (deadlock/signal/timeout), we must + * first acquire the hb->lock before removing the lock from the +@@ -2997,7 +2997,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + return ret; + + hb = hash_futex(&key); +- spin_lock(&hb->lock); ++ raw_spin_lock(&hb->lock); + + /* + * Check waiters first. We do not trust user space values at +@@ -3031,7 +3031,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + * rt_waiter. Also see the WARN in wake_futex_pi(). + */ + raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + + /* drops pi_state->pi_mutex.wait_lock */ + ret = wake_futex_pi(uaddr, uval, pi_state); +@@ -3070,7 +3070,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + * owner. + */ + if ((ret = cmpxchg_futex_value_locked(&curval, uaddr, uval, 0))) { +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + switch (ret) { + case -EFAULT: + goto pi_faulted; +@@ -3090,7 +3090,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + ret = (curval == uval) ? 0 : -EAGAIN; + + out_unlock: +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + out_putkey: + put_futex_key(&key); + return ret; +@@ -3264,9 +3264,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + /* Queue the futex_q, drop the hb lock, wait for wakeup. */ + futex_wait_queue_me(hb, &q, to); + +- spin_lock(&hb->lock); ++ raw_spin_lock(&hb->lock); + ret = handle_early_requeue_pi_wakeup(hb, &q, &key2, to); +- spin_unlock(&hb->lock); ++ raw_spin_unlock(&hb->lock); + if (ret) + goto out_put_keys; + +@@ -3286,7 +3286,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + * did a lock-steal - fix up the PI-state in that case. + */ + if (q.pi_state && (q.pi_state->owner != current)) { +- spin_lock(q.lock_ptr); ++ raw_spin_lock(q.lock_ptr); + ret = fixup_pi_state_owner(uaddr2, &q, current); + if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { + pi_state = q.pi_state; +@@ -3297,7 +3297,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + * the requeue_pi() code acquired for us. + */ + put_pi_state(q.pi_state); +- spin_unlock(q.lock_ptr); ++ raw_spin_unlock(q.lock_ptr); + } + } else { + struct rt_mutex *pi_mutex; +@@ -3311,7 +3311,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + pi_mutex = &q.pi_state->pi_mutex; + ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); + +- spin_lock(q.lock_ptr); ++ raw_spin_lock(q.lock_ptr); + if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) + ret = 0; + +@@ -3748,7 +3748,7 @@ static int __init futex_init(void) + for (i = 0; i < futex_hashsize; i++) { + atomic_set(&futex_queues[i].waiters, 0); + plist_head_init(&futex_queues[i].chain); +- spin_lock_init(&futex_queues[i].lock); ++ raw_spin_lock_init(&futex_queues[i].lock); + } + + return 0; +-- +2.20.1 + diff --git a/debian/patches-rt/0281-futex-Delay-deallocation-of-pi_state.patch b/debian/patches-rt/0281-futex-Delay-deallocation-of-pi_state.patch new file mode 100644 index 000000000..4db7f1857 --- /dev/null +++ b/debian/patches-rt/0281-futex-Delay-deallocation-of-pi_state.patch @@ -0,0 +1,183 @@ +From 640583a34e7d86efdc8dc382f0567af929cd2c94 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Wed, 26 Jun 2019 13:35:36 +0200 +Subject: [PATCH 281/283] futex: Delay deallocation of pi_state +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit d7c7cf8cb68b7df17e6e50be1f25f35d83e686c7 ] + +On -RT we can't invoke kfree() in a non-preemptible context. + +Defer the deallocation of pi_state to preemptible context. + +Signed-off-by: Thomas Gleixner +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/futex.c | 55 ++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 44 insertions(+), 11 deletions(-) + +diff --git a/kernel/futex.c b/kernel/futex.c +index b02d9969330b..688b6fcb79cb 100644 +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -822,13 +822,13 @@ static void get_pi_state(struct futex_pi_state *pi_state) + * Drops a reference to the pi_state object and frees or caches it + * when the last reference is gone. + */ +-static void put_pi_state(struct futex_pi_state *pi_state) ++static struct futex_pi_state *__put_pi_state(struct futex_pi_state *pi_state) + { + if (!pi_state) +- return; ++ return NULL; + + if (!atomic_dec_and_test(&pi_state->refcount)) +- return; ++ return NULL; + + /* + * If pi_state->owner is NULL, the owner is most probably dying +@@ -848,9 +848,7 @@ static void put_pi_state(struct futex_pi_state *pi_state) + raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); + } + +- if (current->pi_state_cache) { +- kfree(pi_state); +- } else { ++ if (!current->pi_state_cache) { + /* + * pi_state->list is already empty. + * clear pi_state->owner. +@@ -859,6 +857,30 @@ static void put_pi_state(struct futex_pi_state *pi_state) + pi_state->owner = NULL; + atomic_set(&pi_state->refcount, 1); + current->pi_state_cache = pi_state; ++ pi_state = NULL; ++ } ++ return pi_state; ++} ++ ++static void put_pi_state(struct futex_pi_state *pi_state) ++{ ++ kfree(__put_pi_state(pi_state)); ++} ++ ++static void put_pi_state_atomic(struct futex_pi_state *pi_state, ++ struct list_head *to_free) ++{ ++ if (__put_pi_state(pi_state)) ++ list_add(&pi_state->list, to_free); ++} ++ ++static void free_pi_state_list(struct list_head *to_free) ++{ ++ struct futex_pi_state *p, *next; ++ ++ list_for_each_entry_safe(p, next, to_free, list) { ++ list_del(&p->list); ++ kfree(p); + } + } + +@@ -875,6 +897,7 @@ void exit_pi_state_list(struct task_struct *curr) + struct futex_pi_state *pi_state; + struct futex_hash_bucket *hb; + union futex_key key = FUTEX_KEY_INIT; ++ LIST_HEAD(to_free); + + if (!futex_cmpxchg_enabled) + return; +@@ -919,7 +942,7 @@ void exit_pi_state_list(struct task_struct *curr) + /* retain curr->pi_lock for the loop invariant */ + raw_spin_unlock(&pi_state->pi_mutex.wait_lock); + raw_spin_unlock(&hb->lock); +- put_pi_state(pi_state); ++ put_pi_state_atomic(pi_state, &to_free); + continue; + } + +@@ -938,6 +961,8 @@ void exit_pi_state_list(struct task_struct *curr) + raw_spin_lock_irq(&curr->pi_lock); + } + raw_spin_unlock_irq(&curr->pi_lock); ++ ++ free_pi_state_list(&to_free); + } + + #endif +@@ -1920,6 +1945,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, + struct futex_hash_bucket *hb1, *hb2; + struct futex_q *this, *next; + DEFINE_WAKE_Q(wake_q); ++ LIST_HEAD(to_free); + + if (nr_wake < 0 || nr_requeue < 0) + return -EINVAL; +@@ -2157,7 +2183,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, + * object. + */ + this->pi_state = NULL; +- put_pi_state(pi_state); ++ put_pi_state_atomic(pi_state, &to_free); + /* + * We stop queueing more waiters and let user + * space deal with the mess. +@@ -2174,7 +2200,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, + * in futex_proxy_trylock_atomic() or in lookup_pi_state(). We + * need to drop it here again. + */ +- put_pi_state(pi_state); ++ put_pi_state_atomic(pi_state, &to_free); + + out_unlock: + double_unlock_hb(hb1, hb2); +@@ -2195,6 +2221,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, + out_put_key1: + put_futex_key(&key1); + out: ++ free_pi_state_list(&to_free); + return ret ? ret : task_count; + } + +@@ -2331,13 +2358,16 @@ static int unqueue_me(struct futex_q *q) + static void unqueue_me_pi(struct futex_q *q) + __releases(q->lock_ptr) + { ++ struct futex_pi_state *ps; ++ + __unqueue_futex(q); + + BUG_ON(!q->pi_state); +- put_pi_state(q->pi_state); ++ ps = __put_pi_state(q->pi_state); + q->pi_state = NULL; + + raw_spin_unlock(q->lock_ptr); ++ kfree(ps); + } + + static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, +@@ -3286,6 +3316,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + * did a lock-steal - fix up the PI-state in that case. + */ + if (q.pi_state && (q.pi_state->owner != current)) { ++ struct futex_pi_state *ps_free; ++ + raw_spin_lock(q.lock_ptr); + ret = fixup_pi_state_owner(uaddr2, &q, current); + if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { +@@ -3296,8 +3328,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + * Drop the reference to the pi state which + * the requeue_pi() code acquired for us. + */ +- put_pi_state(q.pi_state); ++ ps_free = __put_pi_state(q.pi_state); + raw_spin_unlock(q.lock_ptr); ++ kfree(ps_free); + } + } else { + struct rt_mutex *pi_mutex; +-- +2.20.1 + diff --git a/debian/patches-rt/0282-mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch b/debian/patches-rt/0282-mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch new file mode 100644 index 000000000..9fe262666 --- /dev/null +++ b/debian/patches-rt/0282-mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch @@ -0,0 +1,127 @@ +From 6c3c5543f7820dca5be5c020721d30a34374ccf9 Mon Sep 17 00:00:00 2001 +From: "Luis Claudio R. Goncalves" +Date: Tue, 25 Jun 2019 11:28:04 -0300 +Subject: [PATCH 282/283] mm/zswap: Do not disable preemption in + zswap_frontswap_store() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz + +[ Upstream commit 4e4cf4be79635e67144632d9135286381acbc95a ] + +Zswap causes "BUG: scheduling while atomic" by blocking on a rt_spin_lock() with +preemption disabled. The preemption is disabled by get_cpu_var() in +zswap_frontswap_store() to protect the access of the zswap_dstmem percpu variable. + +Use get_locked_var() to protect the percpu zswap_dstmem variable, making the +code preemptive. + +As get_cpu_ptr() also disables preemption, replace it by this_cpu_ptr() and +remove the counterpart put_cpu_ptr(). + +Steps to Reproduce: + + 1. # grubby --args "zswap.enabled=1" --update-kernel DEFAULT + 2. # reboot + 3. Calculate the amount o memory to be used by the test: + ---> grep MemAvailable /proc/meminfo + ---> Add 25% ~ 50% to that value + 4. # stress --vm 1 --vm-bytes ${MemAvailable+25%} --timeout 240s + +Usually, in less than 5 minutes the backtrace listed below appears, followed +by a kernel panic: + +| BUG: scheduling while atomic: kswapd1/181/0x00000002 +| +| Preemption disabled at: +| [] zswap_frontswap_store+0x21a/0x6e1 +| +| Kernel panic - not syncing: scheduling while atomic +| CPU: 14 PID: 181 Comm: kswapd1 Kdump: loaded Not tainted 5.0.14-rt9 #1 +| Hardware name: AMD Pence/Pence, BIOS WPN2321X_Weekly_12_03_21 03/19/2012 +| Call Trace: +| panic+0x106/0x2a7 +| __schedule_bug.cold+0x3f/0x51 +| __schedule+0x5cb/0x6f0 +| schedule+0x43/0xd0 +| rt_spin_lock_slowlock_locked+0x114/0x2b0 +| rt_spin_lock_slowlock+0x51/0x80 +| zbud_alloc+0x1da/0x2d0 +| zswap_frontswap_store+0x31a/0x6e1 +| __frontswap_store+0xab/0x130 +| swap_writepage+0x39/0x70 +| pageout.isra.0+0xe3/0x320 +| shrink_page_list+0xa8e/0xd10 +| shrink_inactive_list+0x251/0x840 +| shrink_node_memcg+0x213/0x770 +| shrink_node+0xd9/0x450 +| balance_pgdat+0x2d5/0x510 +| kswapd+0x218/0x470 +| kthread+0xfb/0x130 +| ret_from_fork+0x27/0x50 + +Cc: stable-rt@vger.kernel.org +Reported-by: Ping Fang +Signed-off-by: Luis Claudio R. Goncalves +Reviewed-by: Daniel Bristot de Oliveira +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + mm/zswap.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/mm/zswap.c b/mm/zswap.c +index cd91fd9d96b8..420225d3ff0b 100644 +--- a/mm/zswap.c ++++ b/mm/zswap.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -990,6 +991,8 @@ static void zswap_fill_page(void *ptr, unsigned long value) + memset_l(page, value, PAGE_SIZE / sizeof(unsigned long)); + } + ++/* protect zswap_dstmem from concurrency */ ++static DEFINE_LOCAL_IRQ_LOCK(zswap_dstmem_lock); + /********************************* + * frontswap hooks + **********************************/ +@@ -1066,12 +1069,11 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset, + } + + /* compress */ +- dst = get_cpu_var(zswap_dstmem); +- tfm = *get_cpu_ptr(entry->pool->tfm); ++ dst = get_locked_var(zswap_dstmem_lock, zswap_dstmem); ++ tfm = *this_cpu_ptr(entry->pool->tfm); + src = kmap_atomic(page); + ret = crypto_comp_compress(tfm, src, PAGE_SIZE, dst, &dlen); + kunmap_atomic(src); +- put_cpu_ptr(entry->pool->tfm); + if (ret) { + ret = -EINVAL; + goto put_dstmem; +@@ -1094,7 +1096,7 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset, + memcpy(buf, &zhdr, hlen); + memcpy(buf + hlen, dst, dlen); + zpool_unmap_handle(entry->pool->zpool, handle); +- put_cpu_var(zswap_dstmem); ++ put_locked_var(zswap_dstmem_lock, zswap_dstmem); + + /* populate entry */ + entry->offset = offset; +@@ -1122,7 +1124,7 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset, + return 0; + + put_dstmem: +- put_cpu_var(zswap_dstmem); ++ put_locked_var(zswap_dstmem_lock, zswap_dstmem); + zswap_pool_put(entry->pool); + freepage: + zswap_entry_cache_free(entry); +-- +2.20.1 + diff --git a/debian/patches-rt/0269-Linux-4.19.37-rt20-REBASE.patch b/debian/patches-rt/0283-Linux-4.19.59-rt24-REBASE.patch similarity index 57% rename from debian/patches-rt/0269-Linux-4.19.37-rt20-REBASE.patch rename to debian/patches-rt/0283-Linux-4.19.59-rt24-REBASE.patch index b65294554..b7272f17c 100644 --- a/debian/patches-rt/0269-Linux-4.19.37-rt20-REBASE.patch +++ b/debian/patches-rt/0283-Linux-4.19.59-rt24-REBASE.patch @@ -1,20 +1,20 @@ -From febb7083d474aead8166900edeb557681119dcc4 Mon Sep 17 00:00:00 2001 +From bfbf9b36800f945fc7bd6bf934e65b59831aa03d Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" -Date: Fri, 24 May 2019 14:22:06 -0400 -Subject: [PATCH 269/269] Linux 4.19.37-rt20 REBASE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz +Date: Fri, 19 Jul 2019 17:46:46 -0400 +Subject: [PATCH 283/283] Linux 4.19.59-rt24 REBASE +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.59-rt24.tar.xz --- localversion-rt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localversion-rt b/localversion-rt -index 1199ebade17b..e095ab819714 100644 +index 1199ebade17b..b2111a212663 100644 --- a/localversion-rt +++ b/localversion-rt @@ -1 +1 @@ --rt16 -+-rt20 ++-rt24 -- 2.20.1 diff --git a/debian/patches-rt/series b/debian/patches-rt/series index cf1161d03..9e8c5754c 100644 --- a/debian/patches-rt/series +++ b/debian/patches-rt/series @@ -226,44 +226,58 @@ 0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch 0227-x86-stackprotector-Avoid-random-pool-on-rt.patch 0228-random-Make-it-work-on-rt.patch -0229-random-avoid-preempt_disable-ed-section.patch -0230-cpu-hotplug-Implement-CPU-pinning.patch -0231-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch -0232-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch -0233-net-Remove-preemption-disabling-in-netif_rx.patch -0234-net-Another-local_irq_disable-kmalloc-headache.patch -0235-net-core-protect-users-of-napi_alloc_cache-against-r.patch -0236-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch -0237-net-Add-a-mutex-around-devnet_rename_seq.patch -0238-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch -0239-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch -0240-sched-Add-support-for-lazy-preemption.patch -0241-ftrace-Fix-trace-header-alignment.patch -0242-x86-Support-for-lazy-preemption.patch -0243-x86-lazy-preempt-properly-check-against-preempt-mask.patch -0244-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch -0245-arm-Add-support-for-lazy-preemption.patch -0246-powerpc-Add-support-for-lazy-preemption.patch -0247-arch-arm64-Add-lazy-preempt-support.patch -0248-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch -0249-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch -0250-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch -0251-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch -0252-tpm_tis-fix-stall-after-iowrite-s.patch -0253-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch -0254-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch -0255-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch -0256-drm-i915-disable-tracing-on-RT.patch -0257-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch -0258-cgroups-use-simple-wait-in-css_release.patch -0259-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch -0260-apparmor-use-a-locallock-instead-preempt_disable.patch -0261-workqueue-Prevent-deadlock-stall-on-RT.patch -0262-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch -0263-Add-localversion-for-RT-release.patch -0264-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch -0265-powerpc-reshuffle-TIF-bits.patch -0266-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch -0267-drm-i915-Don-t-disable-interrupts-independently-of-t.patch -0268-sched-completion-Fix-a-lockup-in-wait_for_completion.patch -0269-Linux-4.19.37-rt20-REBASE.patch +0229-cpu-hotplug-Implement-CPU-pinning.patch +0230-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch +0231-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +0232-net-Remove-preemption-disabling-in-netif_rx.patch +0233-net-Another-local_irq_disable-kmalloc-headache.patch +0234-net-core-protect-users-of-napi_alloc_cache-against-r.patch +0235-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch +0236-net-Add-a-mutex-around-devnet_rename_seq.patch +0237-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch +0238-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +0239-sched-Add-support-for-lazy-preemption.patch +0240-ftrace-Fix-trace-header-alignment.patch +0241-x86-Support-for-lazy-preemption.patch +0242-x86-lazy-preempt-properly-check-against-preempt-mask.patch +0243-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch +0244-arm-Add-support-for-lazy-preemption.patch +0245-powerpc-Add-support-for-lazy-preemption.patch +0246-arch-arm64-Add-lazy-preempt-support.patch +0247-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +0248-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +0249-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +0250-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +0251-tpm_tis-fix-stall-after-iowrite-s.patch +0252-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch +0253-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch +0254-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch +0255-drm-i915-disable-tracing-on-RT.patch +0256-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +0257-cgroups-use-simple-wait-in-css_release.patch +0258-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +0259-apparmor-use-a-locallock-instead-preempt_disable.patch +0260-workqueue-Prevent-deadlock-stall-on-RT.patch +0261-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch +0262-Add-localversion-for-RT-release.patch +0263-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch +0264-powerpc-reshuffle-TIF-bits.patch +0265-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch +0266-drm-i915-Don-t-disable-interrupts-independently-of-t.patch +0267-sched-completion-Fix-a-lockup-in-wait_for_completion.patch +0268-kthread-add-a-global-worker-thread.patch +0269-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch +0270-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch +0271-arm-imx6-cpuidle-Use-raw_spinlock_t.patch +0272-rcu-Don-t-allow-to-change-rcu_normal_after_boot-on-R.patch +0273-pci-switchtec-fix-stream_open.cocci-warnings.patch +0274-sched-core-Drop-a-preempt_disable_rt-statement.patch +0275-timers-Redo-the-notification-of-canceling-timers-on-.patch +0276-Revert-futex-Ensure-lock-unlock-symetry-versus-pi_lo.patch +0277-Revert-futex-Fix-bug-on-when-a-requeued-RT-task-time.patch +0278-Revert-rtmutex-Handle-the-various-new-futex-race-con.patch +0279-Revert-futex-workaround-migrate_disable-enable-in-di.patch +0280-futex-Make-the-futex_hash_bucket-lock-raw.patch +0281-futex-Delay-deallocation-of-pi_state.patch +0282-mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch +0283-Linux-4.19.59-rt24-REBASE.patch