diff --git a/examples/rt-for-vmware.yml b/examples/rt-for-vmware.yml index 48ffdcc5a..f9cc7e076 100644 --- a/examples/rt-for-vmware.yml +++ b/examples/rt-for-vmware.yml @@ -1,5 +1,5 @@ kernel: - image: linuxkit/kernel:4.19.59-rt + image: linuxkit/kernel:4.19.106-rt cmdline: "console=tty0" init: - linuxkit/init:a0246dd478a24abbee0a4cede99662ffc4931691 diff --git a/kernel/Makefile b/kernel/Makefile index ab56c9d63..491621d23 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -255,12 +255,12 @@ ifeq ($(ARCH),x86_64) $(eval $(call kernel,5.4.28,5.4.x,$(EXTRA),$(DEBUG))) $(eval $(call kernel,4.19.113,4.19.x,$(EXTRA),$(DEBUG))) $(eval $(call kernel,4.19.113,4.19.x,,-dbg)) -$(eval $(call kernel,4.19.59,4.19.x,-rt,)) +$(eval $(call kernel,4.19.106,4.19.x,-rt,)) $(eval $(call kernel,4.14.174,4.14.x,$(EXTRA),$(DEBUG))) else ifeq ($(ARCH),aarch64) $(eval $(call kernel,5.4.28,5.4.x,$(EXTRA),$(DEBUG))) -$(eval $(call kernel,4.19.59,4.19.x,-rt,)) +$(eval $(call kernel,4.19.106,4.19.x,-rt,)) else ifeq ($(ARCH),s390x) $(eval $(call kernel,5.4.28,5.4.x,$(EXTRA),$(DEBUG))) diff --git a/kernel/patches-4.19.x-rt/0001-ARM-at91-add-TCB-registers-definitions.patch b/kernel/patches-4.19.x-rt/0001-ARM-at91-add-TCB-registers-definitions.patch index 112eac1fc..8d219af90 100644 --- a/kernel/patches-4.19.x-rt/0001-ARM-at91-add-TCB-registers-definitions.patch +++ b/kernel/patches-4.19.x-rt/0001-ARM-at91-add-TCB-registers-definitions.patch @@ -1,7 +1,7 @@ -From 200fca9a9f123bcca859fadc996b1e40c0384269 Mon Sep 17 00:00:00 2001 +From d831f2ac120e802a4ff642f48f6b88e543665514 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:18 +0200 -Subject: [PATCH 001/283] ARM: at91: add TCB registers definitions +Subject: [PATCH 001/328] ARM: at91: add TCB registers definitions Add registers and bits definitions for the timer counter blocks found on Atmel ARM SoCs. @@ -205,5 +205,5 @@ index 000000000000..657e234b1483 + +#endif /* __SOC_ATMEL_TCB_H */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch b/kernel/patches-4.19.x-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch index 09b3a68fd..868fc0ef3 100644 --- a/kernel/patches-4.19.x-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch +++ b/kernel/patches-4.19.x-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch @@ -1,7 +1,7 @@ -From 13e8b97c81d4029a2c41ce13ffc84507af252845 Mon Sep 17 00:00:00 2001 +From a8f6e3cf352d669d8b870469ab3bff8fc64c3367 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:19 +0200 -Subject: [PATCH 002/283] clocksource/drivers: Add a new driver for the Atmel +Subject: [PATCH 002/328] clocksource/drivers: Add a new driver for the Atmel ARM TC blocks Add a driver for the Atmel Timer Counter Blocks. This driver provides a @@ -480,5 +480,5 @@ index 000000000000..21fbe430f91b +} +TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch b/kernel/patches-4.19.x-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch index 56c334c68..9b9e0e7f6 100644 --- a/kernel/patches-4.19.x-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch +++ b/kernel/patches-4.19.x-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch @@ -1,7 +1,7 @@ -From 108301f18eaae6fde1bf8b864d52052bdc2a7043 Mon Sep 17 00:00:00 2001 +From f2e0ea85054574af7f632ca36991c5c1a25a7bfd Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:20 +0200 -Subject: [PATCH 003/283] clocksource/drivers: timer-atmel-tcb: add clockevent +Subject: [PATCH 003/328] clocksource/drivers: timer-atmel-tcb: add clockevent device on separate channel Add an other clockevent device that uses a separate TCB channel when @@ -266,5 +266,5 @@ index 21fbe430f91b..63ce3b69338a 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch b/kernel/patches-4.19.x-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch index b69a612c1..68eae4c5a 100644 --- a/kernel/patches-4.19.x-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch +++ b/kernel/patches-4.19.x-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch @@ -1,7 +1,7 @@ -From e60c9d976e3462237d2f3644c18091ac1e7746c6 Mon Sep 17 00:00:00 2001 +From 23ef2fe8b6933933fb81af9decf35cfae8c14571 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:21 +0200 -Subject: [PATCH 004/283] clocksource/drivers: atmel-pit: make option silent +Subject: [PATCH 004/328] clocksource/drivers: atmel-pit: make option silent To conform with the other option, make the ATMEL_PIT option silent so it can be selected from the platform @@ -31,5 +31,5 @@ index 0ab22e7037f4..34b07047b91f 100644 config ATMEL_ST bool "Atmel ST timer support" if COMPILE_TEST -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0005-ARM-at91-Implement-clocksource-selection.patch b/kernel/patches-4.19.x-rt/0005-ARM-at91-Implement-clocksource-selection.patch index 94f4a1dc7..704145406 100644 --- a/kernel/patches-4.19.x-rt/0005-ARM-at91-Implement-clocksource-selection.patch +++ b/kernel/patches-4.19.x-rt/0005-ARM-at91-Implement-clocksource-selection.patch @@ -1,7 +1,7 @@ -From 8cd066d01a3bc84384ba64a7521fdc80598a3418 Mon Sep 17 00:00:00 2001 +From 56d1624c2b43a84717f237d3c2d58ac52cb37b33 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:22 +0200 -Subject: [PATCH 005/283] ARM: at91: Implement clocksource selection +Subject: [PATCH 005/328] ARM: at91: Implement clocksource selection Allow selecting and unselecting the PIT clocksource driver so it doesn't have to be compile when unused. @@ -50,5 +50,5 @@ index 903f23c309df..fa493a86e2bb 100644 bool -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch b/kernel/patches-4.19.x-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch index 1933b4abf..e34a6a737 100644 --- a/kernel/patches-4.19.x-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch +++ b/kernel/patches-4.19.x-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch @@ -1,7 +1,7 @@ -From db6f702c9d0558505d757c28c61f4f6a567a898a Mon Sep 17 00:00:00 2001 +From 9591e618026011c31f7275edd0643d390e185e38 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:23 +0200 -Subject: [PATCH 006/283] ARM: configs: at91: use new TCB timer driver +Subject: [PATCH 006/328] ARM: configs: at91: use new TCB timer driver Unselecting ATMEL_TCLIB switches the TCB timer driver from tcb_clksrc to timer-atmel-tcb. @@ -38,5 +38,5 @@ index 2080025556b5..f2bbc6339ca6 100644 CONFIG_EEPROM_AT24=y CONFIG_SCSI=y -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0007-ARM-configs-at91-unselect-PIT.patch b/kernel/patches-4.19.x-rt/0007-ARM-configs-at91-unselect-PIT.patch index 771f4ba5e..94a0aaa1f 100644 --- a/kernel/patches-4.19.x-rt/0007-ARM-configs-at91-unselect-PIT.patch +++ b/kernel/patches-4.19.x-rt/0007-ARM-configs-at91-unselect-PIT.patch @@ -1,7 +1,7 @@ -From 95cda24e3882fa19a569c029275d14089e8418e9 Mon Sep 17 00:00:00 2001 +From f58179ebd23db67a287e5267a5cbc2c1ae5d75d9 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:24 +0200 -Subject: [PATCH 007/283] ARM: configs: at91: unselect PIT +Subject: [PATCH 007/328] ARM: configs: at91: unselect PIT 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. @@ -39,5 +39,5 @@ index f2bbc6339ca6..be92871ab155 100644 CONFIG_UACCESS_WITH_MEMCPY=y CONFIG_ZBOOT_ROM_TEXT=0x0 -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch b/kernel/patches-4.19.x-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch index 43803c3cd..855ce47d4 100644 --- a/kernel/patches-4.19.x-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch +++ b/kernel/patches-4.19.x-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch @@ -1,7 +1,7 @@ -From 44f074c1b1621cbfa2d9f8f44aa69231154399d9 Mon Sep 17 00:00:00 2001 +From f5fc79f507ee8c22a6f18709552cecbada48d328 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Fri, 27 Jul 2018 13:38:54 +0100 -Subject: [PATCH 008/283] irqchip/gic-v3-its: Move pending table allocation to +Subject: [PATCH 008/328] irqchip/gic-v3-its: Move pending table allocation to init time Signed-off-by: Marc Zyngier @@ -12,7 +12,7 @@ Signed-off-by: Sebastian Andrzej Siewior 2 files changed, 53 insertions(+), 28 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c -index 65ab2c80529c..21681f0f85f4 100644 +index bf7b69449b43..f93b8cd5eea2 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -179,6 +179,7 @@ static DEFINE_RAW_SPINLOCK(vmovp_lock); @@ -23,7 +23,7 @@ index 65ab2c80529c..21681f0f85f4 100644 #define gic_data_rdist_rd_base() (gic_data_rdist()->rd_base) #define gic_data_rdist_vlpi_base() (gic_data_rdist_rd_base() + SZ_128K) -@@ -1631,7 +1632,7 @@ static void its_free_prop_table(struct page *prop_page) +@@ -1659,7 +1660,7 @@ static void its_free_prop_table(struct page *prop_page) get_order(LPI_PROPBASE_SZ)); } @@ -32,7 +32,7 @@ index 65ab2c80529c..21681f0f85f4 100644 { phys_addr_t paddr; -@@ -1979,30 +1980,47 @@ static u64 its_clear_vpend_valid(void __iomem *vlpi_base) +@@ -2007,30 +2008,47 @@ static u64 its_clear_vpend_valid(void __iomem *vlpi_base) return val; } @@ -95,7 +95,7 @@ index 65ab2c80529c..21681f0f85f4 100644 /* set PROPBASE */ val = (page_to_phys(gic_rdists->prop_page) | GICR_PROPBASER_InnerShareable | -@@ -2078,6 +2096,10 @@ static void its_cpu_init_lpis(void) +@@ -2106,6 +2124,10 @@ static void its_cpu_init_lpis(void) /* Make sure the GIC has seen the above */ dsb(sy); @@ -106,7 +106,7 @@ index 65ab2c80529c..21681f0f85f4 100644 } static void its_cpu_init_collection(struct its_node *its) -@@ -3558,16 +3580,6 @@ static int redist_disable_lpis(void) +@@ -3585,16 +3607,6 @@ static int redist_disable_lpis(void) u64 timeout = USEC_PER_SEC; u64 val; @@ -123,7 +123,7 @@ index 65ab2c80529c..21681f0f85f4 100644 if (!gic_rdists_supports_plpis()) { pr_info("CPU%d: LPIs not supported\n", smp_processor_id()); return -ENXIO; -@@ -3577,7 +3589,18 @@ static int redist_disable_lpis(void) +@@ -3604,7 +3616,18 @@ static int redist_disable_lpis(void) if (!(val & GICR_CTLR_ENABLE_LPIS)) return 0; @@ -143,7 +143,7 @@ index 65ab2c80529c..21681f0f85f4 100644 smp_processor_id()); add_taint(TAINT_CRAP, LOCKDEP_STILL_OK); -@@ -3833,7 +3856,8 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, +@@ -3860,7 +3883,8 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, } gic_rdists = rdists; @@ -154,7 +154,7 @@ index 65ab2c80529c..21681f0f85f4 100644 return err; diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h -index 3188c0bef3e7..5b57501fd2e7 100644 +index 1d21e98d6854..fdddead7e307 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -585,6 +585,7 @@ struct rdists { @@ -166,5 +166,5 @@ index 3188c0bef3e7..5b57501fd2e7 100644 struct page *prop_page; u64 flags; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch b/kernel/patches-4.19.x-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch index 1e6ccac5f..971d152da 100644 --- a/kernel/patches-4.19.x-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch +++ b/kernel/patches-4.19.x-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch @@ -1,7 +1,7 @@ -From cd9320a1954642117f572891a8b45b177e6b0ebf Mon Sep 17 00:00:00 2001 +From 89b3ba99261e5321ba2276305f817b5c0c9817ad Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 -Subject: [PATCH 009/283] kthread: convert worker lock to raw spinlock +Subject: [PATCH 009/328] kthread: convert worker lock to raw spinlock In order to enable the queuing of kthread work items from hardirq context even when PREEMPT_RT_FULL is enabled, convert the worker @@ -198,5 +198,5 @@ index 087d18d771b5..5641b55783a6 100644 return ret; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch b/kernel/patches-4.19.x-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch index 8afb44c13..aa23d75dc 100644 --- a/kernel/patches-4.19.x-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch +++ b/kernel/patches-4.19.x-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch @@ -1,7 +1,7 @@ -From d4cc8969937e548b95b4d6f40804a4b706c9b441 Mon Sep 17 00:00:00 2001 +From 1e7f9f15b5cb5088ac28a0919a2fcc74bfc5f5c7 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/283] crypto: caam/qi - simplify CGR allocation, freeing +Subject: [PATCH 010/328] crypto: caam/qi - simplify CGR allocation, freeing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -135,5 +135,5 @@ index 357b69f57072..b6c8acc30853 100644 /** * qi_cache_alloc - Allocate buffers from CAAM-QI cache -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch b/kernel/patches-4.19.x-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch index daf2d0c2f..e25fabcbe 100644 --- a/kernel/patches-4.19.x-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch +++ b/kernel/patches-4.19.x-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch @@ -1,7 +1,7 @@ -From 256f2e459fd2eea3e04b6b9934f06c46e19185bb Mon Sep 17 00:00:00 2001 +From 2a9fed89a7bea6fbe31e717ab5f277405e20826e Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 7 Jan 2019 13:52:31 +0100 -Subject: [PATCH 011/283] sched/fair: Robustify CFS-bandwidth timer locking +Subject: [PATCH 011/328] sched/fair: Robustify CFS-bandwidth timer locking Traditionally hrtimer callbacks were run with IRQs disabled, but with the introduction of HRTIMER_MODE_SOFT it is possible they run from @@ -29,10 +29,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 4a433608ba74..289c966f907a 100644 +index 7f4f4ab5bfef..0f1ba3d72336 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4557,7 +4557,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, +@@ -4576,7 +4576,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, u64 remaining) struct rq *rq = rq_of(cfs_rq); struct rq_flags rf; @@ -41,7 +41,7 @@ index 4a433608ba74..289c966f907a 100644 if (!cfs_rq_throttled(cfs_rq)) goto next; -@@ -4574,7 +4574,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, +@@ -4595,7 +4595,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, u64 remaining) unthrottle_cfs_rq(cfs_rq); next: @@ -50,35 +50,33 @@ index 4a433608ba74..289c966f907a 100644 if (!remaining) break; -@@ -4590,7 +4590,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, +@@ -4611,7 +4611,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, u64 remaining) * period the timer is deactivated until scheduling resumes; cfs_b->idle is * used to track this state. */ -static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun) +static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun, unsigned long flags) { - u64 runtime, runtime_expires; + u64 runtime; int throttled; -@@ -4632,11 +4632,11 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun) +@@ -4651,10 +4651,10 @@ 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; - raw_spin_unlock(&cfs_b->lock); + raw_spin_unlock_irqrestore(&cfs_b->lock, flags); /* we can't nest cfs_b->lock while distributing bandwidth */ - runtime = distribute_cfs_runtime(cfs_b, runtime, - runtime_expires); + runtime = distribute_cfs_runtime(cfs_b, runtime); - raw_spin_lock(&cfs_b->lock); + raw_spin_lock_irqsave(&cfs_b->lock, flags); cfs_b->distribute_running = 0; throttled = !list_empty(&cfs_b->throttled_cfs_rq); -@@ -4745,17 +4745,18 @@ static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq) +@@ -4762,16 +4762,17 @@ 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(); + unsigned long flags; - u64 expires; /* confirm we're still not at a refresh boundary */ - raw_spin_lock(&cfs_b->lock); @@ -95,7 +93,7 @@ index 4a433608ba74..289c966f907a 100644 return; } -@@ -4766,18 +4767,18 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) +@@ -4781,17 +4782,17 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) if (runtime) cfs_b->distribute_running = 1; @@ -105,19 +103,18 @@ index 4a433608ba74..289c966f907a 100644 if (!runtime) return; - runtime = distribute_cfs_runtime(cfs_b, runtime, expires); + runtime = distribute_cfs_runtime(cfs_b, runtime); - raw_spin_lock(&cfs_b->lock); + raw_spin_lock_irqsave(&cfs_b->lock, flags); - if (expires == cfs_b->runtime_expires) - cfs_b->runtime -= min(runtime, cfs_b->runtime); + cfs_b->runtime -= min(runtime, cfs_b->runtime); cfs_b->distribute_running = 0; - raw_spin_unlock(&cfs_b->lock); + raw_spin_unlock_irqrestore(&cfs_b->lock, flags); } /* -@@ -4857,11 +4858,12 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) +@@ -4871,11 +4872,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); @@ -131,7 +128,7 @@ index 4a433608ba74..289c966f907a 100644 for (;;) { overrun = hrtimer_forward_now(timer, cfs_b->period); if (!overrun) -@@ -4889,11 +4891,11 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) +@@ -4911,11 +4913,11 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) count = 0; } @@ -146,5 +143,5 @@ index 4a433608ba74..289c966f907a 100644 return idle ? HRTIMER_NORESTART : HRTIMER_RESTART; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch b/kernel/patches-4.19.x-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch index d96ae5bbf..1bcf9b842 100644 --- a/kernel/patches-4.19.x-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch +++ b/kernel/patches-4.19.x-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch @@ -1,7 +1,7 @@ -From 3c866fa6b40a3acfe50a091680cd9f51a54cd45b Mon Sep 17 00:00:00 2001 +From 7c89d978bdfea369853567288ced4880deddd0b1 Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Mon, 19 Sep 2011 14:51:14 -0700 -Subject: [PATCH 012/283] arm: Convert arm boot_lock to raw +Subject: [PATCH 012/328] arm: Convert arm boot_lock to raw 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. @@ -427,5 +427,5 @@ index c2366510187a..6b60f582b738 100644 return pen_release != -1 ? -ENOSYS : 0; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch b/kernel/patches-4.19.x-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch index 8c642ca24..d5caf7030 100644 --- a/kernel/patches-4.19.x-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch +++ b/kernel/patches-4.19.x-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch @@ -1,7 +1,7 @@ -From abbec8803a7e474a1e1a1b1ee105de8ffd0c8cbc Mon Sep 17 00:00:00 2001 +From 9ecaf2a8f433399cc3fabcfb9fbce9a88fe6f200 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 17 Jul 2018 18:25:31 +0200 -Subject: [PATCH 013/283] x86/ioapic: Don't let setaffinity unmask threaded EOI +Subject: [PATCH 013/328] x86/ioapic: Don't let setaffinity unmask threaded EOI interrupt too early There is an issue with threaded interrupts which are marked ONESHOT @@ -30,27 +30,23 @@ Signed-off-by: Thomas Gleixner ifdef paths (spotted by Andy Shevchenko)] Signed-off-by: Sebastian Andrzej Siewior --- - arch/x86/kernel/apic/io_apic.c | 23 +++++++++++++---------- - 1 file changed, 13 insertions(+), 10 deletions(-) + arch/x86/kernel/apic/io_apic.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c -index ff0d14cd9e82..c2bd6e0433f8 100644 +index fa3b85b222e3..1bdad61a3ef7 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c -@@ -1722,19 +1722,20 @@ static bool io_apic_level_ack_pending(struct mp_chip_data *data) +@@ -1722,7 +1722,7 @@ static bool io_apic_level_ack_pending(struct mp_chip_data *data) return false; } -static inline bool ioapic_irqd_mask(struct irq_data *data) +static inline bool ioapic_prepare_move(struct irq_data *data) { - /* If we are moving the irq we need to mask it */ + /* If we are moving the IRQ we need to mask it */ if (unlikely(irqd_is_setaffinity_pending(data))) { -- mask_ioapic_irq(data); -+ if (!irqd_irq_masked(data)) -+ mask_ioapic_irq(data); - return true; - } +@@ -1733,9 +1733,9 @@ static inline bool ioapic_irqd_mask(struct irq_data *data) return false; } @@ -62,14 +58,7 @@ index ff0d14cd9e82..c2bd6e0433f8 100644 /* Only migrate the irq if the ack has been received. * * On rare occasions the broadcast level triggered ack gets -@@ -1763,15 +1764,17 @@ static inline void ioapic_irqd_unmask(struct irq_data *data, bool masked) - */ - if (!io_apic_level_ack_pending(data->chip_data)) - irq_move_masked_irq(data); -- unmask_ioapic_irq(data); -+ /* If the irq is masked in the core, leave it */ -+ if (!irqd_irq_masked(data)) -+ unmask_ioapic_irq(data); +@@ -1770,11 +1770,11 @@ static inline void ioapic_irqd_unmask(struct irq_data *data, bool masked) } } #else @@ -83,7 +72,7 @@ index ff0d14cd9e82..c2bd6e0433f8 100644 { } #endif -@@ -1780,11 +1783,11 @@ static void ioapic_ack_level(struct irq_data *irq_data) +@@ -1783,11 +1783,11 @@ static void ioapic_ack_level(struct irq_data *irq_data) { struct irq_cfg *cfg = irqd_cfg(irq_data); unsigned long v; @@ -97,7 +86,7 @@ index ff0d14cd9e82..c2bd6e0433f8 100644 /* * It appears there is an erratum which affects at least version 0x11 -@@ -1839,7 +1842,7 @@ static void ioapic_ack_level(struct irq_data *irq_data) +@@ -1842,7 +1842,7 @@ static void ioapic_ack_level(struct irq_data *irq_data) eoi_ioapic_pin(cfg->vector, irq_data->chip_data); } @@ -107,5 +96,5 @@ index ff0d14cd9e82..c2bd6e0433f8 100644 static void ioapic_ir_ack_level(struct irq_data *irq_data) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0014-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch b/kernel/patches-4.19.x-rt/0014-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch index 9cc2e9ef2..3d2838508 100644 --- a/kernel/patches-4.19.x-rt/0014-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +++ b/kernel/patches-4.19.x-rt/0014-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch @@ -1,7 +1,7 @@ -From 39150ca165ea6d7d6b5ffe76efb6170893ffdb06 Mon Sep 17 00:00:00 2001 +From 759e6d7c318bbcff7507641d5a9fb6b5074b2a87 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 18:19:48 +0200 -Subject: [PATCH 014/283] cgroup: use irqsave in cgroup_rstat_flush_locked() +Subject: [PATCH 014/328] cgroup: use irqsave in cgroup_rstat_flush_locked() All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock either with spin_lock_irq() or spin_lock_irqsave(). @@ -45,5 +45,5 @@ index bb95a35e8c2d..3266a9781b4e 100644 /* if @may_sleep, play nice and yield if necessary */ if (may_sleep && (need_resched() || -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0015-fscache-initialize-cookie-hash-table-raw-spinlocks.patch b/kernel/patches-4.19.x-rt/0015-fscache-initialize-cookie-hash-table-raw-spinlocks.patch index 08ae3a9c7..f95c71d80 100644 --- a/kernel/patches-4.19.x-rt/0015-fscache-initialize-cookie-hash-table-raw-spinlocks.patch +++ b/kernel/patches-4.19.x-rt/0015-fscache-initialize-cookie-hash-table-raw-spinlocks.patch @@ -1,7 +1,7 @@ -From 6c83cc3183d8efc6378788160d78a3a917a5ae96 Mon Sep 17 00:00:00 2001 +From 934128f28dd37073d6513a37f0433df6399c7953 Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Tue, 3 Jul 2018 13:34:30 -0500 -Subject: [PATCH 015/283] fscache: initialize cookie hash table raw spinlocks +Subject: [PATCH 015/328] fscache: initialize cookie hash table raw spinlocks 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 @@ -59,5 +59,5 @@ index 84b90a79d75a..87a9330eafa2 100644 /** * fscache_register_netfs - Register a filesystem as desiring caching services -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0016-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch b/kernel/patches-4.19.x-rt/0016-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch index eecc295c3..20e23203e 100644 --- a/kernel/patches-4.19.x-rt/0016-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch +++ b/kernel/patches-4.19.x-rt/0016-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch @@ -1,7 +1,7 @@ -From fdfc7c94f7e160bd80c27ac31c6823fbb20330f7 Mon Sep 17 00:00:00 2001 +From 2a2f1a8c287a6b6fb14a4a1b5583e043d5897df4 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 29 Aug 2018 21:59:04 +0200 -Subject: [PATCH 016/283] Drivers: hv: vmbus: include header for get_irq_regs() +Subject: [PATCH 016/328] Drivers: hv: vmbus: include header for get_irq_regs() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -35,5 +35,5 @@ index 87d3d7da78f8..1d2d8a4b837d 100644 #include "hv_trace.h" -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0017-percpu-include-irqflags.h-for-raw_local_irq_save.patch b/kernel/patches-4.19.x-rt/0017-percpu-include-irqflags.h-for-raw_local_irq_save.patch index ad4ed292c..8d53fc488 100644 --- a/kernel/patches-4.19.x-rt/0017-percpu-include-irqflags.h-for-raw_local_irq_save.patch +++ b/kernel/patches-4.19.x-rt/0017-percpu-include-irqflags.h-for-raw_local_irq_save.patch @@ -1,7 +1,7 @@ -From 31f7158d8389cec550de5964422b1123fc94079b Mon Sep 17 00:00:00 2001 +From d487edd01d698abf2b4f3ea4e3f27897b227250c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 11 Oct 2018 16:39:59 +0200 -Subject: [PATCH 017/283] percpu: include irqflags.h for raw_local_irq_save() +Subject: [PATCH 017/328] percpu: include irqflags.h for raw_local_irq_save() 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 @@ -28,5 +28,5 @@ index 1817a8415a5e..942d64c0476e 100644 #ifdef CONFIG_SMP -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0018-efi-Allow-efi-runtime.patch b/kernel/patches-4.19.x-rt/0018-efi-Allow-efi-runtime.patch index bbe046eaf..f2953cabf 100644 --- a/kernel/patches-4.19.x-rt/0018-efi-Allow-efi-runtime.patch +++ b/kernel/patches-4.19.x-rt/0018-efi-Allow-efi-runtime.patch @@ -1,7 +1,7 @@ -From fcb3ebea1da6aede14a10c28a06902043072f250 Mon Sep 17 00:00:00 2001 +From 5c77a75aaa23c5fc32b5485897d0d14e66fafd37 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:06:10 +0200 -Subject: [PATCH 018/283] efi: Allow efi=runtime +Subject: [PATCH 018/328] efi: Allow efi=runtime In case the option "efi=noruntime" is default at built-time, the user could overwrite its sate by `efi=runtime' and allow it again. @@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c -index 2a29dd9c986d..ab668e17fd05 100644 +index d54fca902e64..5db20908aa9c 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -113,6 +113,9 @@ static int __init parse_efi_cmdline(char *str) @@ -27,5 +27,5 @@ index 2a29dd9c986d..ab668e17fd05 100644 } early_param("efi", parse_efi_cmdline); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0019-x86-efi-drop-task_lock-from-efi_switch_mm.patch b/kernel/patches-4.19.x-rt/0019-x86-efi-drop-task_lock-from-efi_switch_mm.patch index 126a042eb..1e792ebbc 100644 --- a/kernel/patches-4.19.x-rt/0019-x86-efi-drop-task_lock-from-efi_switch_mm.patch +++ b/kernel/patches-4.19.x-rt/0019-x86-efi-drop-task_lock-from-efi_switch_mm.patch @@ -1,7 +1,7 @@ -From 9dda6e746277e68f244d5660b5a3f3f85b0d9be0 Mon Sep 17 00:00:00 2001 +From af50891c552632469b09b7b97abd197545aec804 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 24 Jul 2018 14:48:55 +0200 -Subject: [PATCH 019/283] x86/efi: drop task_lock() from efi_switch_mm() +Subject: [PATCH 019/328] x86/efi: drop task_lock() from efi_switch_mm() efi_switch_mm() is a wrapper around switch_mm() which saves current's ->active_mm, sets the requests mm as ->active_mm and invokes @@ -23,10 +23,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c -index ee5d08f25ce4..e8da7f492970 100644 +index 6db8f3598c80..c9ccaef8df57 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c -@@ -619,18 +619,16 @@ void __init efi_dump_pagetable(void) +@@ -620,18 +620,16 @@ void __init efi_dump_pagetable(void) /* * Makes the calling thread switch to/from efi_mm context. Can be used @@ -50,5 +50,5 @@ index ee5d08f25ce4..e8da7f492970 100644 #ifdef CONFIG_EFI_MIXED -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0020-arm64-KVM-compute_layout-before-altenates-are-applie.patch b/kernel/patches-4.19.x-rt/0020-arm64-KVM-compute_layout-before-altenates-are-applie.patch index a3d37cef7..b47cd87bf 100644 --- a/kernel/patches-4.19.x-rt/0020-arm64-KVM-compute_layout-before-altenates-are-applie.patch +++ b/kernel/patches-4.19.x-rt/0020-arm64-KVM-compute_layout-before-altenates-are-applie.patch @@ -1,7 +1,7 @@ -From b66a9f85a9e8ee817d0e2de1637bf95b7710127f Mon Sep 17 00:00:00 2001 +From c96c598b9bc12e2909dcec0a1bf8f4a1b846107e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 09:13:42 +0200 -Subject: [PATCH 020/283] arm64: KVM: compute_layout before altenates are +Subject: [PATCH 020/328] arm64: KVM: compute_layout before altenates are applied compute_layout() is invoked as part of an alternative fixup under @@ -17,7 +17,7 @@ Signed-off-by: Sebastian Andrzej Siewior 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h -index 4b650ec1d7dd..f561ea0ac645 100644 +index 887a8512bf10..376561351bae 100644 --- a/arch/arm64/include/asm/alternative.h +++ b/arch/arm64/include/asm/alternative.h @@ -35,6 +35,12 @@ void apply_alternatives_module(void *start, size_t length); @@ -30,9 +30,9 @@ index 4b650ec1d7dd..f561ea0ac645 100644 +static inline void kvm_compute_layout(void) { } +#endif + - #define ALTINSTR_ENTRY(feature,cb) \ + #define ALTINSTR_ENTRY(feature) \ " .word 661b - .\n" /* label */ \ - " .if " __stringify(cb) " == 0\n" \ + " .word 663f - .\n" /* new instruction */ \ diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c index b5d603992d40..f92815d56d17 100644 --- a/arch/arm64/kernel/alternative.c @@ -78,5 +78,5 @@ index c712a7376bc1..792da0e125de 100644 * Compute HYP VA by using the same computation as kern_hyp_va() */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0021-of-allocate-free-phandle-cache-outside-of-the-devtre.patch b/kernel/patches-4.19.x-rt/0021-of-allocate-free-phandle-cache-outside-of-the-devtre.patch index 2c6a8d7aa..2776fca61 100644 --- a/kernel/patches-4.19.x-rt/0021-of-allocate-free-phandle-cache-outside-of-the-devtre.patch +++ b/kernel/patches-4.19.x-rt/0021-of-allocate-free-phandle-cache-outside-of-the-devtre.patch @@ -1,7 +1,7 @@ -From 6d0f5b28de481062ee69b0d62ae5ef2fc5101f9c Mon Sep 17 00:00:00 2001 +From 8779fdd5686d1f9be670c7ee5ea6dfaece9e37d8 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 31 Aug 2018 14:16:30 +0200 -Subject: [PATCH 021/283] of: allocate / free phandle cache outside of the +Subject: [PATCH 021/328] of: allocate / free phandle cache outside of the devtree_lock The phandle cache code allocates memory while holding devtree_lock which @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c -index 3f21ea6a90dc..2c7cf83b200c 100644 +index f0dbb7ad88cf..c59b30bab0e0 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -130,31 +130,34 @@ static u32 phandle_cache_mask; @@ -98,5 +98,5 @@ index 3f21ea6a90dc..2c7cf83b200c 100644 void __init of_core_init(void) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0022-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch b/kernel/patches-4.19.x-rt/0022-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch index 29206d29a..32dadfc61 100644 --- a/kernel/patches-4.19.x-rt/0022-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch +++ b/kernel/patches-4.19.x-rt/0022-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch @@ -1,7 +1,7 @@ -From 3ec52d2ee13b6e83429a4f7a048a0005305b8033 Mon Sep 17 00:00:00 2001 +From 7841950d4460ea93ee4ddd6a400ad67cfacee592 Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Tue, 18 Sep 2018 10:29:31 -0500 -Subject: [PATCH 022/283] mm/kasan: make quarantine_lock a raw_spinlock_t +Subject: [PATCH 022/328] mm/kasan: make quarantine_lock a raw_spinlock_t The static lock quarantine_lock is used in quarantine.c to protect the quarantine queue datastructures. It is taken inside quarantine queue @@ -93,5 +93,5 @@ index 3a8ddf8baf7d..b209dbaefde8 100644 qlist_free_all(&to_free, cache); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0023-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch b/kernel/patches-4.19.x-rt/0023-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch index 24c775279..3b418ce06 100644 --- a/kernel/patches-4.19.x-rt/0023-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch +++ b/kernel/patches-4.19.x-rt/0023-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch @@ -1,7 +1,7 @@ -From 22ddccee8b48a817b261c98dda99967345475755 Mon Sep 17 00:00:00 2001 +From c7753a6fd996fcaa0285c1c8285fde721d519a0a Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Mon, 29 Oct 2018 11:53:01 +0100 -Subject: [PATCH 023/283] EXP rcu: Revert expedited GP parallelization +Subject: [PATCH 023/328] EXP rcu: Revert expedited GP parallelization cleverness (Commit 258ba8e089db23f760139266c232f01bad73f85c from linux-rcu) @@ -46,5 +46,5 @@ index 0b2c2ad69629..a0486414edb4 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0024-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch b/kernel/patches-4.19.x-rt/0024-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch index b464e2722..2c2317515 100644 --- a/kernel/patches-4.19.x-rt/0024-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0024-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch @@ -1,7 +1,7 @@ -From ced9290a5d8460c8a46615a475cd094bc3b0c344 Mon Sep 17 00:00:00 2001 +From 4b0c7eda4403c5a7146714857bd1abffd2b080f8 Mon Sep 17 00:00:00 2001 From: He Zhe Date: Wed, 19 Dec 2018 16:30:57 +0100 -Subject: [PATCH 024/283] kmemleak: Turn kmemleak_lock to raw spinlock on RT +Subject: [PATCH 024/328] kmemleak: Turn kmemleak_lock to raw spinlock on RT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -78,7 +78,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 72e3fb3bb037..0ed549045074 100644 +index 5eeabece0c17..92ce99b15f2b 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -26,7 +26,7 @@ @@ -164,5 +164,5 @@ index 72e3fb3bb037..0ed549045074 100644 /* -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0025-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/kernel/patches-4.19.x-rt/0025-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index 040038b59..9a58a6b2d 100644 --- a/kernel/patches-4.19.x-rt/0025-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/kernel/patches-4.19.x-rt/0025-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -1,7 +1,7 @@ -From e1b321401ca437984b8973749826aea3a245e15b Mon Sep 17 00:00:00 2001 +From 7cb617c6dac1356dfe57b1c4a976ec78ead046a0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 28 Oct 2016 23:05:11 +0200 -Subject: [PATCH 025/283] NFSv4: replace seqcount_t with a seqlock_t +Subject: [PATCH 025/328] NFSv4: replace seqcount_t with a seqlock_t 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 @@ -26,25 +26,25 @@ Signed-off-by: Sebastian Andrzej Siewior 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c -index 75fe92eaa681..e8d05393443f 100644 +index b0c0c2fc2fba..26565ba05dc1 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c -@@ -152,11 +152,11 @@ static int nfs_delegation_claim_opens(struct inode *inode, +@@ -162,11 +162,11 @@ static int nfs_delegation_claim_opens(struct inode *inode, sp = state->owner; /* Block nfs4_proc_unlck */ mutex_lock(&sp->so_delegreturn_mutex); - seq = raw_seqcount_begin(&sp->so_reclaim_seqcount); + seq = read_seqbegin(&sp->so_reclaim_seqlock); - err = nfs4_open_delegation_recall(ctx, state, stateid, type); + err = nfs4_open_delegation_recall(ctx, state, stateid); if (!err) - err = nfs_delegation_claim_locks(ctx, state, stateid); + err = nfs_delegation_claim_locks(state, stateid); - if (!err && read_seqcount_retry(&sp->so_reclaim_seqcount, seq)) + if (!err && read_seqretry(&sp->so_reclaim_seqlock, seq)) err = -EAGAIN; mutex_unlock(&sp->so_delegreturn_mutex); put_nfs_open_context(ctx); diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h -index 63287d911c08..2ae55eaa4a1e 100644 +index 5b61520dce88..2771aafaca19 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -114,7 +114,7 @@ struct nfs4_state_owner { @@ -57,10 +57,10 @@ index 63287d911c08..2ae55eaa4a1e 100644 }; diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c -index 1de855e0ae61..78c3f4359e76 100644 +index 668b648064b7..187d411668ed 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c -@@ -2865,7 +2865,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, +@@ -2870,7 +2870,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, unsigned int seq; int ret; @@ -69,7 +69,7 @@ index 1de855e0ae61..78c3f4359e76 100644 ret = _nfs4_proc_open(opendata, ctx); if (ret != 0) -@@ -2906,7 +2906,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, +@@ -2911,7 +2911,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, if (d_inode(dentry) == state->inode) { nfs_inode_attach_open_context(ctx); @@ -79,7 +79,7 @@ index 1de855e0ae61..78c3f4359e76 100644 } diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c -index 3ba2087469ac..f10952680bd9 100644 +index b3086e99420c..c9bf1eb7e1b2 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -515,7 +515,7 @@ nfs4_alloc_state_owner(struct nfs_server *server, @@ -91,7 +91,7 @@ index 3ba2087469ac..f10952680bd9 100644 mutex_init(&sp->so_delegreturn_mutex); return sp; } -@@ -1568,8 +1568,12 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs +@@ -1583,8 +1583,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. */ @@ -105,7 +105,7 @@ index 3ba2087469ac..f10952680bd9 100644 restart: list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) -@@ -1656,14 +1660,20 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs +@@ -1671,14 +1675,20 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs spin_lock(&sp->so_lock); goto restart; } @@ -131,5 +131,5 @@ index 3ba2087469ac..f10952680bd9 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0026-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/kernel/patches-4.19.x-rt/0026-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index 20fef60db..a3763e42c 100644 --- a/kernel/patches-4.19.x-rt/0026-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/kernel/patches-4.19.x-rt/0026-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -1,7 +1,7 @@ -From 02954bb06eedf19db3637fea6699d0dc1761b270 Mon Sep 17 00:00:00 2001 +From 4906d6c574d916416e92a9de0b959c4d0ed0bc17 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 4 Apr 2017 12:50:16 +0200 -Subject: [PATCH 026/283] kernel: sched: Provide a pointer to the valid CPU +Subject: [PATCH 026/328] kernel: sched: Provide a pointer to the valid CPU mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -165,10 +165,10 @@ 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 912d53939f4f..6b8dc68b5ccc 100644 +index a999a58ca331..d6410d0740ea 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) +@@ -1445,7 +1445,7 @@ static int pseudo_lock_dev_mmap(struct file *filp, struct vm_area_struct *vma) * may be scheduled elsewhere and invalidate entries in the * pseudo-locked region. */ @@ -178,10 +178,10 @@ index 912d53939f4f..6b8dc68b5ccc 100644 return -EINVAL; } diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c -index bedd5fba33b0..3f4259f11a35 100644 +index 01ed0a667928..2c62de6b5bf1 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c -@@ -1037,7 +1037,7 @@ int hfi1_get_proc_affinity(int node) +@@ -1039,7 +1039,7 @@ int hfi1_get_proc_affinity(int node) struct hfi1_affinity_node *entry; cpumask_var_t diff, hw_thread_mask, available_mask, intrs_mask; const struct cpumask *node_mask, @@ -190,7 +190,7 @@ index bedd5fba33b0..3f4259f11a35 100644 struct hfi1_affinity_node_list *affinity = &node_affinity; struct cpu_mask_set *set = &affinity->proc; -@@ -1045,7 +1045,7 @@ int hfi1_get_proc_affinity(int node) +@@ -1047,7 +1047,7 @@ int hfi1_get_proc_affinity(int node) * check whether process/context affinity has already * been set */ @@ -199,7 +199,7 @@ index bedd5fba33b0..3f4259f11a35 100644 hfi1_cdbg(PROC, "PID %u %s affinity set to CPU %*pbl", current->pid, current->comm, cpumask_pr_args(proc_mask)); -@@ -1056,7 +1056,7 @@ int hfi1_get_proc_affinity(int node) +@@ -1058,7 +1058,7 @@ int hfi1_get_proc_affinity(int node) cpu = cpumask_first(proc_mask); cpumask_set_cpu(cpu, &set->used); goto done; @@ -209,10 +209,10 @@ index bedd5fba33b0..3f4259f11a35 100644 current->pid, current->comm, cpumask_pr_args(proc_mask)); diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c -index 88e326d6cc49..b0d01ace6611 100644 +index 291c12f588b5..05e7b28a03c1 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c -@@ -855,14 +855,13 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd, +@@ -853,14 +853,13 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd, { struct sdma_rht_node *rht_node; struct sdma_engine *sde = NULL; @@ -270,7 +270,7 @@ index 9eb99a43f849..e4d0cfebaac5 100644 static inline void task_core_dumping(struct seq_file *m, struct mm_struct *mm) diff --git a/include/linux/sched.h b/include/linux/sched.h -index 5dc024e28397..fdb8ba398ea8 100644 +index 0530de9a4efc..4298a87b9de6 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -660,7 +660,8 @@ struct task_struct { @@ -283,7 +283,7 @@ index 5dc024e28397..fdb8ba398ea8 100644 #ifdef CONFIG_PREEMPT_RCU int rcu_read_lock_nesting; -@@ -1390,7 +1391,7 @@ extern struct pid *cad_pid; +@@ -1398,7 +1399,7 @@ extern struct pid *cad_pid; #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ #define PF_RANDOMIZE 0x00400000 /* Randomize virtual address space */ #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ @@ -320,10 +320,10 @@ index ff956ccbb6df..7bb129c5b412 100644 } diff --git a/kernel/fork.c b/kernel/fork.c -index 69874db3fba8..98c971cb1d36 100644 +index 1a2d18e98bf9..bc182d6fa2a9 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) +@@ -850,6 +850,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) #ifdef CONFIG_STACKPROTECTOR tsk->stack_canary = get_random_canary(); #endif @@ -333,7 +333,7 @@ index 69874db3fba8..98c971cb1d36 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 6859ea1d5c04..d6f690064cce 100644 +index 2befd2c4ce9e..07dc66137a26 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) @@ -371,7 +371,7 @@ index 6859ea1d5c04..d6f690064cce 100644 + if (cpumask_equal(p->cpus_ptr, new_mask)) goto out; - if (!cpumask_intersects(new_mask, cpu_valid_mask)) { + dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask); @@ -1237,10 +1237,10 @@ static int migrate_swap_stop(void *data) if (task_cpu(arg->src_task) != arg->src_cpu) goto unlock; @@ -456,7 +456,7 @@ index 6859ea1d5c04..d6f690064cce 100644 * - any previously selected CPU might disappear through hotplug * * Use __set_task_cpu() to avoid calling sched_class::migrate_task_rq, -@@ -4275,7 +4275,7 @@ static int __sched_setscheduler(struct task_struct *p, +@@ -4316,7 +4316,7 @@ static int __sched_setscheduler(struct task_struct *p, * the entire root_domain to become SCHED_DEADLINE. We * will also fail if there's no bandwidth available. */ @@ -465,7 +465,7 @@ index 6859ea1d5c04..d6f690064cce 100644 rq->rd->dl_bw.bw == 0) { task_rq_unlock(rq, p, &rf); return -EPERM; -@@ -4874,7 +4874,7 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) +@@ -4915,7 +4915,7 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) goto out_unlock; raw_spin_lock_irqsave(&p->pi_lock, flags); @@ -474,7 +474,7 @@ index 6859ea1d5c04..d6f690064cce 100644 raw_spin_unlock_irqrestore(&p->pi_lock, flags); out_unlock: -@@ -5454,7 +5454,7 @@ int task_can_attach(struct task_struct *p, +@@ -5496,7 +5496,7 @@ int task_can_attach(struct task_struct *p, * allowed nodes is unnecessary. Thus, cpusets are not * applicable for such threads. This prevents checking for * success of set_cpus_allowed_ptr() on all attached tasks @@ -483,7 +483,7 @@ index 6859ea1d5c04..d6f690064cce 100644 */ if (p->flags & PF_NO_SETAFFINITY) { ret = -EINVAL; -@@ -5481,7 +5481,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu) +@@ -5523,7 +5523,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu) if (curr_cpu == target_cpu) return 0; @@ -492,7 +492,7 @@ index 6859ea1d5c04..d6f690064cce 100644 return -EINVAL; /* TODO: This is not properly updating schedstats */ -@@ -5619,7 +5619,7 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf) +@@ -5661,7 +5661,7 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf) put_prev_task(rq, next); /* @@ -541,10 +541,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 72c07059ef37..fb6e64417470 100644 +index ebec37cb3be9..4b13df38c069 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -538,7 +538,7 @@ static struct rq *dl_task_offline_migration(struct rq *rq, struct task_struct *p +@@ -539,7 +539,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: */ @@ -553,7 +553,7 @@ index 72c07059ef37..fb6e64417470 100644 if (cpu >= nr_cpu_ids) { /* * Failed to find any suitable CPU. -@@ -1823,7 +1823,7 @@ static void set_curr_task_dl(struct rq *rq) +@@ -1856,7 +1856,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) && @@ -562,7 +562,7 @@ index 72c07059ef37..fb6e64417470 100644 return 1; return 0; } -@@ -1973,7 +1973,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq) +@@ -2006,7 +2006,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 || @@ -572,10 +572,10 @@ index 72c07059ef37..fb6e64417470 100644 !dl_task(task) || !task_on_rq_queued(task))) { diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 289c966f907a..0048a32a3b4d 100644 +index 0f1ba3d72336..27f9f9a785c1 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, +@@ -1678,7 +1678,7 @@ static void task_numa_compare(struct task_numa_env *env, * be incurred if the tasks were swapped. */ /* Skip this swap candidate if cannot move to the source cpu */ @@ -584,7 +584,7 @@ index 289c966f907a..0048a32a3b4d 100644 goto unlock; /* -@@ -1727,7 +1727,7 @@ static void task_numa_find_cpu(struct task_numa_env *env, +@@ -1776,7 +1776,7 @@ static void task_numa_find_cpu(struct task_numa_env *env, for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) { /* Skip this CPU if the source task cannot migrate */ @@ -593,7 +593,7 @@ index 289c966f907a..0048a32a3b4d 100644 continue; env->dst_cpu = cpu; -@@ -5741,7 +5741,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, +@@ -5782,7 +5782,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), @@ -602,7 +602,7 @@ index 289c966f907a..0048a32a3b4d 100644 continue; local_group = cpumask_test_cpu(this_cpu, -@@ -5873,7 +5873,7 @@ find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, int this +@@ -5914,7 +5914,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 */ @@ -611,7 +611,7 @@ index 289c966f907a..0048a32a3b4d 100644 if (available_idle_cpu(i)) { struct rq *rq = cpu_rq(i); struct cpuidle_state *idle = idle_get_state(rq); -@@ -5913,7 +5913,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p +@@ -5954,7 +5954,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p { int new_cpu = cpu; @@ -620,7 +620,7 @@ index 289c966f907a..0048a32a3b4d 100644 return prev_cpu; /* -@@ -6030,7 +6030,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int +@@ -6071,7 +6071,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int if (!test_idle_cores(target, false)) return -1; @@ -629,7 +629,7 @@ index 289c966f907a..0048a32a3b4d 100644 for_each_cpu_wrap(core, cpus, target) { bool idle = true; -@@ -6064,7 +6064,7 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t +@@ -6105,7 +6105,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)) { @@ -638,7 +638,7 @@ index 289c966f907a..0048a32a3b4d 100644 continue; if (available_idle_cpu(cpu)) return cpu; -@@ -6127,7 +6127,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t +@@ -6168,7 +6168,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; @@ -647,7 +647,7 @@ index 289c966f907a..0048a32a3b4d 100644 continue; if (available_idle_cpu(cpu)) break; -@@ -6164,7 +6164,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) +@@ -6205,7 +6205,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) && @@ -656,7 +656,7 @@ index 289c966f907a..0048a32a3b4d 100644 /* * Replace recent_used_cpu with prev as it is a potential * candidate for the next wake: -@@ -6382,7 +6382,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f +@@ -6423,7 +6423,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) @@ -665,7 +665,7 @@ index 289c966f907a..0048a32a3b4d 100644 } rcu_read_lock(); -@@ -7121,14 +7121,14 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) +@@ -7162,14 +7162,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 @@ -682,7 +682,7 @@ index 289c966f907a..0048a32a3b4d 100644 int cpu; schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -7148,7 +7148,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) +@@ -7189,7 +7189,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) { @@ -691,7 +691,7 @@ index 289c966f907a..0048a32a3b4d 100644 env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; break; -@@ -7745,7 +7745,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) +@@ -7786,7 +7786,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -700,7 +700,7 @@ index 289c966f907a..0048a32a3b4d 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. -@@ -8360,7 +8360,7 @@ static struct sched_group *find_busiest_group(struct lb_env *env) +@@ -8401,7 +8401,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 @@ -709,7 +709,7 @@ index 289c966f907a..0048a32a3b4d 100644 */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -8756,7 +8756,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, +@@ -8797,7 +8797,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: */ @@ -741,10 +741,10 @@ index b980cc96604f..b6ca4a630050 100644 !rt_task(task) || !task_on_rq_queued(task))) { diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c -index 1e6db9cbe4dc..fa95139445b2 100644 +index 8030e24dbf14..862f4b0139fc 100644 --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c -@@ -277,7 +277,7 @@ static void move_to_next_cpu(void) +@@ -279,7 +279,7 @@ static void move_to_next_cpu(void) * of this thread, than stop migrating for the duration * of the current test. */ @@ -780,5 +780,5 @@ index 5522692100ba..8b4be8e1802a 100644 trace_foo_with_template_simple("HELLO", cnt); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0027-kernel-sched-core-add-migrate_disable.patch b/kernel/patches-4.19.x-rt/0027-kernel-sched-core-add-migrate_disable.patch index af6667cc9..d362bea4a 100644 --- a/kernel/patches-4.19.x-rt/0027-kernel-sched-core-add-migrate_disable.patch +++ b/kernel/patches-4.19.x-rt/0027-kernel-sched-core-add-migrate_disable.patch @@ -1,7 +1,7 @@ -From bda814671dc9f9f74cabd99a65cad3101b68ee83 Mon Sep 17 00:00:00 2001 +From 9f9cd889fa22fc1e25802f565f7210b271d136a2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: [PATCH 027/283] kernel/sched/core: add migrate_disable() +Subject: [PATCH 027/328] kernel/sched/core: add migrate_disable() --- include/linux/preempt.h | 23 +++++++ @@ -53,7 +53,7 @@ index c01813c3fbe9..3196d0e76719 100644 #ifdef MODULE diff --git a/include/linux/sched.h b/include/linux/sched.h -index fdb8ba398ea8..df39ad5916e7 100644 +index 4298a87b9de6..0489d3e0e78c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -662,6 +662,13 @@ struct task_struct { @@ -85,7 +85,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 d6f690064cce..b658f0147c3b 100644 +index 07dc66137a26..d0450f06612c 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 @@ -126,7 +126,7 @@ index d6f690064cce..b658f0147c3b 100644 /* * Change a given task's CPU affinity. Migrate the thread to a * proper CPU and schedule it away if the CPU it's executing on -@@ -1095,9 +1117,16 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, +@@ -1096,9 +1118,16 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, } /* Can the task run on the task's current CPU? If so, we're done */ @@ -141,10 +141,10 @@ index d6f690064cce..b658f0147c3b 100644 + } +#endif + - 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 }; -@@ -7067,3 +7096,100 @@ const u32 sched_prio_to_wmult[40] = { + /* Need help from migration thread: drop lock and wait. */ +@@ -7105,3 +7134,100 @@ const u32 sched_prio_to_wmult[40] = { }; #undef CREATE_TRACE_POINTS @@ -261,5 +261,5 @@ index 78fadf0438ea..5027158d3908 100644 #undef PN #undef __PN -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0028-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch b/kernel/patches-4.19.x-rt/0028-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch index 078f8ec1e..7ba951819 100644 --- a/kernel/patches-4.19.x-rt/0028-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch +++ b/kernel/patches-4.19.x-rt/0028-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch @@ -1,7 +1,7 @@ -From 6fb56185df42e49e0e2d8fe12d315356a57f4bce Mon Sep 17 00:00:00 2001 +From db2220843fd1c19c7b89db5f6e20382b5622fa05 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 9 Oct 2018 17:34:50 +0200 -Subject: [PATCH 028/283] sched/migrate_disable: Add export_symbol_gpl for +Subject: [PATCH 028/328] sched/migrate_disable: Add export_symbol_gpl for __migrate_disabled Jonathan reported that lttng/modules can't use __migrate_disabled(). @@ -21,7 +21,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 b658f0147c3b..7a39d56f6a6b 100644 +index d0450f06612c..e6022cc2605b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1013,6 +1013,7 @@ int __migrate_disabled(struct task_struct *p) @@ -33,5 +33,5 @@ index b658f0147c3b..7a39d56f6a6b 100644 static void __do_set_cpus_allowed_tail(struct task_struct *p, -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0029-arm-at91-do-not-disable-enable-clocks-in-a-row.patch b/kernel/patches-4.19.x-rt/0029-arm-at91-do-not-disable-enable-clocks-in-a-row.patch index e5e4f86c4..345f756c2 100644 --- a/kernel/patches-4.19.x-rt/0029-arm-at91-do-not-disable-enable-clocks-in-a-row.patch +++ b/kernel/patches-4.19.x-rt/0029-arm-at91-do-not-disable-enable-clocks-in-a-row.patch @@ -1,7 +1,7 @@ -From 35e0294d43f7c53bdb7ecba19df0710037d888ec Mon Sep 17 00:00:00 2001 +From b978b0a313d26ed5e51a9120c8744385a99e541a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 9 Mar 2016 10:51:06 +0100 -Subject: [PATCH 029/283] arm: at91: do not disable/enable clocks in a row +Subject: [PATCH 029/328] arm: at91: do not disable/enable clocks in a row Currently the driver will disable the clock and enable it one line later if it is switching from periodic mode into one shot. @@ -93,5 +93,5 @@ index 43f4d5c4d6fa..de6baf564dfe 100644 .set_state_oneshot = tc_set_oneshot, }, -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0030-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch b/kernel/patches-4.19.x-rt/0030-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch index 8d453986f..ad025f020 100644 --- a/kernel/patches-4.19.x-rt/0030-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch +++ b/kernel/patches-4.19.x-rt/0030-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch @@ -1,7 +1,7 @@ -From 4d4322de76f7b52df1529acfc6e5fc46e25761f1 Mon Sep 17 00:00:00 2001 +From 8549d4577f0573dddbc34e310c4310920a6bb714 Mon Sep 17 00:00:00 2001 From: Benedikt Spranger Date: Mon, 8 Mar 2010 18:57:04 +0100 -Subject: [PATCH 030/283] clocksource: TCLIB: Allow higher clock rates for +Subject: [PATCH 030/328] clocksource: TCLIB: Allow higher clock rates for clock events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -165,5 +165,5 @@ index 3726eacdf65d..0900dec7ec04 100644 tristate "Dummy IRQ handler" default n -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0031-timekeeping-Split-jiffies-seqlock.patch b/kernel/patches-4.19.x-rt/0031-timekeeping-Split-jiffies-seqlock.patch index 328725562..1086979bc 100644 --- a/kernel/patches-4.19.x-rt/0031-timekeeping-Split-jiffies-seqlock.patch +++ b/kernel/patches-4.19.x-rt/0031-timekeeping-Split-jiffies-seqlock.patch @@ -1,7 +1,7 @@ -From 64f770d93319861d308ce265a4389e4ca0a6ed5f Mon Sep 17 00:00:00 2001 +From 4948d026b217faebc43bfe4a21cb3c5e781508ad Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 14 Feb 2013 22:36:59 +0100 -Subject: [PATCH 031/283] timekeeping: Split jiffies seqlock +Subject: [PATCH 031/328] timekeeping: Split jiffies seqlock Replace jiffies_lock seqlock with a simple seqcounter and a rawlock so it can be taken in atomic context on RT. @@ -76,10 +76,10 @@ index a02e0f6b287c..32f5101f07ce 100644 clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT); diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index 5b33e2f5c0ed..54fd344ef973 100644 +index 48403fb653c2..e774a49176cc 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -67,7 +67,8 @@ static void tick_do_update_jiffies64(ktime_t now) +@@ -68,7 +68,8 @@ static void tick_do_update_jiffies64(ktime_t now) return; /* Reevaluate with jiffies_lock held */ @@ -89,7 +89,7 @@ index 5b33e2f5c0ed..54fd344ef973 100644 delta = ktime_sub(now, last_jiffies_update); if (delta >= tick_period) { -@@ -90,10 +91,12 @@ static void tick_do_update_jiffies64(ktime_t now) +@@ -94,10 +95,12 @@ static void tick_do_update_jiffies64(ktime_t now) /* Keep the tick_next_period variable up to date */ tick_next_period = ktime_add(last_jiffies_update, tick_period); } else { @@ -104,7 +104,7 @@ index 5b33e2f5c0ed..54fd344ef973 100644 update_wall_time(); } -@@ -104,12 +107,14 @@ static ktime_t tick_init_jiffy_update(void) +@@ -108,12 +111,14 @@ static ktime_t tick_init_jiffy_update(void) { ktime_t period; @@ -121,7 +121,7 @@ index 5b33e2f5c0ed..54fd344ef973 100644 return period; } -@@ -652,10 +657,10 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) +@@ -656,10 +661,10 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) /* Read jiffies and the time when jiffies were updated last */ do { @@ -135,10 +135,10 @@ index 5b33e2f5c0ed..54fd344ef973 100644 ts->timer_expires_base = basemono; diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c -index 443edcddac8a..0517bc42c6b6 100644 +index 81ee5b83c920..512db778f442 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c -@@ -2418,8 +2418,10 @@ EXPORT_SYMBOL(hardpps); +@@ -2394,8 +2394,10 @@ EXPORT_SYMBOL(hardpps); */ void xtime_update(unsigned long ticks) { @@ -166,5 +166,5 @@ index 141ab3ab0354..099737f6f10c 100644 #define CS_NAME_LEN 32 -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0032-signal-Revert-ptrace-preempt-magic.patch b/kernel/patches-4.19.x-rt/0032-signal-Revert-ptrace-preempt-magic.patch index 33aabab5e..3f73d08e0 100644 --- a/kernel/patches-4.19.x-rt/0032-signal-Revert-ptrace-preempt-magic.patch +++ b/kernel/patches-4.19.x-rt/0032-signal-Revert-ptrace-preempt-magic.patch @@ -1,7 +1,7 @@ -From 8cf90f7e58f51438a7ec0e4e704918afaa450ff1 Mon Sep 17 00:00:00 2001 +From dad624b7531ae0a0275cab3c82ea0d7c6a29cc7c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 21 Sep 2011 19:57:12 +0200 -Subject: [PATCH 032/283] signal: Revert ptrace preempt magic +Subject: [PATCH 032/328] signal: Revert ptrace preempt magic Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a @@ -13,10 +13,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 8 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c -index 0e6bc3049427..d5a9646b3538 100644 +index 08911bb6fe9a..5e278f1540ad 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) +@@ -2103,15 +2103,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info) if (gstop_done && ptrace_reparented(current)) do_notify_parent_cldstop(current, false, why); @@ -33,5 +33,5 @@ index 0e6bc3049427..d5a9646b3538 100644 } else { /* -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0033-net-sched-Use-msleep-instead-of-yield.patch b/kernel/patches-4.19.x-rt/0033-net-sched-Use-msleep-instead-of-yield.patch index dbe773d3a..f07dcdce6 100644 --- a/kernel/patches-4.19.x-rt/0033-net-sched-Use-msleep-instead-of-yield.patch +++ b/kernel/patches-4.19.x-rt/0033-net-sched-Use-msleep-instead-of-yield.patch @@ -1,7 +1,7 @@ -From 882c4f88db8d6179773dc733e794fa504aef75e3 Mon Sep 17 00:00:00 2001 +From 5b974aebb7a0797ecc4c47dda6158e8c6788d50b Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Wed, 5 Mar 2014 00:49:47 +0100 -Subject: [PATCH 033/283] net: sched: Use msleep() instead of yield() +Subject: [PATCH 033/328] net: sched: Use msleep() instead of yield() 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 @@ -46,10 +46,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c -index 77b289da7763..31b9c2b415b4 100644 +index 8a4d01e427a2..4ab20f1138fd 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -1183,7 +1183,7 @@ void dev_deactivate_many(struct list_head *head) +@@ -1204,7 +1204,7 @@ void dev_deactivate_many(struct list_head *head) /* Wait for outstanding qdisc_run calls. */ list_for_each_entry(dev, head, close_list) { while (some_qdisc_is_busy(dev)) @@ -59,5 +59,5 @@ index 77b289da7763..31b9c2b415b4 100644 * unwind stale skb lists and qdisc statistics */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0034-dm-rq-remove-BUG_ON-irqs_disabled-check.patch b/kernel/patches-4.19.x-rt/0034-dm-rq-remove-BUG_ON-irqs_disabled-check.patch index 329582cea..99ed4d9ac 100644 --- a/kernel/patches-4.19.x-rt/0034-dm-rq-remove-BUG_ON-irqs_disabled-check.patch +++ b/kernel/patches-4.19.x-rt/0034-dm-rq-remove-BUG_ON-irqs_disabled-check.patch @@ -1,7 +1,7 @@ -From ea6d238547b58b5fe9ce953cd818ef8bf6cb8915 Mon Sep 17 00:00:00 2001 +From 38dbd44808bcdd34f0b973698b0f9bd65d2f2db5 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 27 Mar 2018 16:24:15 +0200 -Subject: [PATCH 034/283] dm rq: remove BUG_ON(!irqs_disabled) check +Subject: [PATCH 034/328] dm rq: remove BUG_ON(!irqs_disabled) check In commit 052189a2ec95 ("dm: remove superfluous irq disablement in dm_request_fn") the spin_lock_irq() was replaced with spin_lock() + a @@ -20,10 +20,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 deletion(-) diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c -index 6e547b8dd298..29736c7e5f1f 100644 +index 4d36373e1c0f..12ed08245130 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c -@@ -688,7 +688,6 @@ static void dm_old_request_fn(struct request_queue *q) +@@ -692,7 +692,6 @@ static void dm_old_request_fn(struct request_queue *q) /* Establish tio->ti before queuing work (map_tio_request) */ tio->ti = ti; kthread_queue_work(&md->kworker, &tio->work); @@ -32,5 +32,5 @@ index 6e547b8dd298..29736c7e5f1f 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0035-usb-do-no-disable-interrupts-in-giveback.patch b/kernel/patches-4.19.x-rt/0035-usb-do-no-disable-interrupts-in-giveback.patch index 0ae2929a5..5df7c8925 100644 --- a/kernel/patches-4.19.x-rt/0035-usb-do-no-disable-interrupts-in-giveback.patch +++ b/kernel/patches-4.19.x-rt/0035-usb-do-no-disable-interrupts-in-giveback.patch @@ -1,7 +1,7 @@ -From b91ae27f3efa2e15087397591db35dd1d11f5120 Mon Sep 17 00:00:00 2001 +From f31d5f36bfd80c261ba37fe3b8849f2be819c088 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 8 Nov 2013 17:34:54 +0100 -Subject: [PATCH 035/283] usb: do no disable interrupts in giveback +Subject: [PATCH 035/328] usb: do no disable interrupts in giveback Since commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet context") the USB code disables interrupts before invoking the complete @@ -41,5 +41,5 @@ index b82a7d787add..2f3015356124 100644 usb_anchor_resume_wakeups(anchor); atomic_dec(&urb->use_count); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0036-rt-Provide-PREEMPT_RT_BASE-config-switch.patch b/kernel/patches-4.19.x-rt/0036-rt-Provide-PREEMPT_RT_BASE-config-switch.patch index 7935c14fd..d5b2435b1 100644 --- a/kernel/patches-4.19.x-rt/0036-rt-Provide-PREEMPT_RT_BASE-config-switch.patch +++ b/kernel/patches-4.19.x-rt/0036-rt-Provide-PREEMPT_RT_BASE-config-switch.patch @@ -1,7 +1,7 @@ -From 79f8ad95ffc5f1cd2ac721ab3d01291d4ad055df Mon Sep 17 00:00:00 2001 +From f93f63735dec865d4013677969324e66da7f02c4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 17 Jun 2011 12:39:57 +0200 -Subject: [PATCH 036/283] rt: Provide PREEMPT_RT_BASE config switch +Subject: [PATCH 036/328] rt: Provide PREEMPT_RT_BASE config switch Introduce PREEMPT_RT_BASE which enables parts of PREEMPT_RT_FULL. Forces interrupt threading and enables some of the RT @@ -59,5 +59,5 @@ index cd1655122ec0..027db5976c2f 100644 \ No newline at end of file + bool -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0037-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch b/kernel/patches-4.19.x-rt/0037-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch index cd9cc998c..298ed7566 100644 --- a/kernel/patches-4.19.x-rt/0037-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch +++ b/kernel/patches-4.19.x-rt/0037-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch @@ -1,7 +1,7 @@ -From 75df679c581581978487f6f6de91bf86a9f72e7c Mon Sep 17 00:00:00 2001 +From 824fc9b2ae92b317da3e2a42406a49f330e20a6d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 14 Dec 2011 01:03:49 +0100 -Subject: [PATCH 037/283] cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT +Subject: [PATCH 037/328] cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT There are "valid" GFP_ATOMIC allocations such as @@ -46,7 +46,7 @@ Signed-off-by: Thomas Gleixner 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index e76d16ac2776..04a45d6d0167 100644 +index af35f5caadbe..e40ba59efe7f 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -934,7 +934,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT @@ -71,5 +71,5 @@ index a3928d4438b5..a50b2158f7cd 100644 Use dynamic allocation for cpumask_var_t, instead of putting them on the stack. This is a bit more expensive, but avoids -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0038-jump-label-disable-if-stop_machine-is-used.patch b/kernel/patches-4.19.x-rt/0038-jump-label-disable-if-stop_machine-is-used.patch index e391c4ac9..1af339a2b 100644 --- a/kernel/patches-4.19.x-rt/0038-jump-label-disable-if-stop_machine-is-used.patch +++ b/kernel/patches-4.19.x-rt/0038-jump-label-disable-if-stop_machine-is-used.patch @@ -1,7 +1,7 @@ -From b5d77d6b4b4bcead77cd720e8a93f4ae78420034 Mon Sep 17 00:00:00 2001 +From feb8e4e9bfee1c054ec0c83ae2a12897d85da9b3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 8 Jul 2015 17:14:48 +0200 -Subject: [PATCH 038/283] jump-label: disable if stop_machine() is used +Subject: [PATCH 038/328] jump-label: disable if stop_machine() is used Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. @@ -24,7 +24,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 51794c7fa6d5..7d11242a37d2 100644 +index e2f7c50dbace..91ba9fe945ff 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -51,7 +51,7 @@ config ARM @@ -37,5 +37,5 @@ index 51794c7fa6d5..7d11242a37d2 100644 select HAVE_ARCH_MMAP_RND_BITS if MMU select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0039-kconfig-Disable-config-options-which-are-not-RT-comp.patch b/kernel/patches-4.19.x-rt/0039-kconfig-Disable-config-options-which-are-not-RT-comp.patch index d03898953..2bed68593 100644 --- a/kernel/patches-4.19.x-rt/0039-kconfig-Disable-config-options-which-are-not-RT-comp.patch +++ b/kernel/patches-4.19.x-rt/0039-kconfig-Disable-config-options-which-are-not-RT-comp.patch @@ -1,7 +1,7 @@ -From 94fd428643474b867a8cac432d7d911a5250c367 Mon Sep 17 00:00:00 2001 +From 521872fd8b19b111a7001f6388912ab9d506f741 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 24 Jul 2011 12:11:43 +0200 -Subject: [PATCH 039/283] kconfig: Disable config options which are not RT +Subject: [PATCH 039/328] kconfig: Disable config options which are not RT compatible Disable stuff which is known to have issues on RT @@ -38,5 +38,5 @@ index b457e94ae618..0dddbb2a3282 100644 select RADIX_TREE_MULTIORDER help -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0040-lockdep-disable-self-test.patch b/kernel/patches-4.19.x-rt/0040-lockdep-disable-self-test.patch index 21f32fbf2..b42b5849d 100644 --- a/kernel/patches-4.19.x-rt/0040-lockdep-disable-self-test.patch +++ b/kernel/patches-4.19.x-rt/0040-lockdep-disable-self-test.patch @@ -1,7 +1,7 @@ -From 1a9e9b418236c18717a91955eeafe5bd72a00598 Mon Sep 17 00:00:00 2001 +From 464fd34dd6dc53c357221cff371377ca19601e14 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 17 Oct 2017 16:36:18 +0200 -Subject: [PATCH 040/283] lockdep: disable self-test +Subject: [PATCH 040/328] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -17,7 +17,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 3dea52f7be9c..1504e6aa8418 100644 +index 46a910acce3f..38cf7f81daa7 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1207,7 +1207,7 @@ config DEBUG_ATOMIC_SLEEP @@ -30,5 +30,5 @@ index 3dea52f7be9c..1504e6aa8418 100644 Say Y here if you want the kernel to run a short self-test during bootup. The self-test checks whether common types of locking bugs -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0041-mm-Allow-only-slub-on-RT.patch b/kernel/patches-4.19.x-rt/0041-mm-Allow-only-slub-on-RT.patch index e70af310f..de669f423 100644 --- a/kernel/patches-4.19.x-rt/0041-mm-Allow-only-slub-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0041-mm-Allow-only-slub-on-RT.patch @@ -1,7 +1,7 @@ -From 75102ff5e253e5ababc30c7512e0c07f2b7dc297 Mon Sep 17 00:00:00 2001 +From bb8c948b260e99e7c7ad2dc38ea03a958be18769 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:44:03 -0500 -Subject: [PATCH 041/283] mm: Allow only slub on RT +Subject: [PATCH 041/328] mm: Allow only slub on RT Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. @@ -32,5 +32,5 @@ index 47035b5a46f6..ae9a0113a699 100644 SLOB replaces the stock allocator with a drastically simpler allocator. SLOB is generally more space efficient but -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0042-locking-Disable-spin-on-owner-for-RT.patch b/kernel/patches-4.19.x-rt/0042-locking-Disable-spin-on-owner-for-RT.patch index 80046d4f2..a473ecb25 100644 --- a/kernel/patches-4.19.x-rt/0042-locking-Disable-spin-on-owner-for-RT.patch +++ b/kernel/patches-4.19.x-rt/0042-locking-Disable-spin-on-owner-for-RT.patch @@ -1,7 +1,7 @@ -From 32697a0be9afdc5c631cc3d232a298b5880ed65c Mon Sep 17 00:00:00 2001 +From 6bbedb933d43f1bc2283d96523412298d765b8a2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:51:45 +0200 -Subject: [PATCH 042/283] locking: Disable spin on owner for RT +Subject: [PATCH 042/328] locking: Disable spin on owner for RT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -33,5 +33,5 @@ index 84d882f3e299..af27c4000812 100644 config LOCK_SPIN_ON_OWNER def_bool y -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0043-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch b/kernel/patches-4.19.x-rt/0043-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch index 713fa4120..333cc4080 100644 --- a/kernel/patches-4.19.x-rt/0043-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0043-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch @@ -1,7 +1,7 @@ -From 708879e986c1b552ee69d6444b808a196bba0f5f Mon Sep 17 00:00:00 2001 +From 0942d8d1880802a3a19df4dfdff1ec5769d92fe3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 28 Oct 2012 13:26:09 +0000 -Subject: [PATCH 043/283] rcu: Disable RCU_FAST_NO_HZ on RT +Subject: [PATCH 043/328] rcu: Disable RCU_FAST_NO_HZ on RT This uses a timer_list timer from the irq disabled guts of the idle code. Disable it for now to prevent wreckage. @@ -25,5 +25,5 @@ index 9210379c0353..644264be90f0 100644 help This option permits CPUs to enter dynticks-idle state even if -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0044-rcu-make-RCU_BOOST-default-on-RT.patch b/kernel/patches-4.19.x-rt/0044-rcu-make-RCU_BOOST-default-on-RT.patch index 3b5aa9c21..a5e8953a8 100644 --- a/kernel/patches-4.19.x-rt/0044-rcu-make-RCU_BOOST-default-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0044-rcu-make-RCU_BOOST-default-on-RT.patch @@ -1,7 +1,7 @@ -From a14822b6d5fcc441064faf3edc2f91b5d461e703 Mon Sep 17 00:00:00 2001 +From b784c987142020d5cc32de03823004d362b390ec Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 21 Mar 2014 20:19:05 +0100 -Subject: [PATCH 044/283] rcu: make RCU_BOOST default on RT +Subject: [PATCH 044/328] rcu: make RCU_BOOST default on RT 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 @@ -29,5 +29,5 @@ index 644264be90f0..a243a78ff38c 100644 This option boosts the priority of preempted RCU readers that block the current preemptible RCU grace period for too long. -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0045-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch b/kernel/patches-4.19.x-rt/0045-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch index 836daa95f..22a79886f 100644 --- a/kernel/patches-4.19.x-rt/0045-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0045-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch @@ -1,7 +1,7 @@ -From 36c33c65b461082612dffa7be01862b7bd55270e Mon Sep 17 00:00:00 2001 +From 648e8c04474df9ed71c649af1d1e5a161cddaf41 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:03:52 +0200 -Subject: [PATCH 045/283] sched: Disable CONFIG_RT_GROUP_SCHED on RT +Subject: [PATCH 045/328] sched: Disable CONFIG_RT_GROUP_SCHED on RT Carsten reported problems when running: @@ -30,5 +30,5 @@ index ae9a0113a699..61e8b531649b 100644 help This feature lets you explicitly allocate real CPU bandwidth -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0046-net-core-disable-NET_RX_BUSY_POLL.patch b/kernel/patches-4.19.x-rt/0046-net-core-disable-NET_RX_BUSY_POLL.patch index b9723934d..f2fd8f604 100644 --- a/kernel/patches-4.19.x-rt/0046-net-core-disable-NET_RX_BUSY_POLL.patch +++ b/kernel/patches-4.19.x-rt/0046-net-core-disable-NET_RX_BUSY_POLL.patch @@ -1,7 +1,7 @@ -From f2b7e396c43d3607ee0a0090c7470da50f833e93 Mon Sep 17 00:00:00 2001 +From 0b90609a04c39529c4ff712a4786aecde55a0733 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: [PATCH 046/283] net/core: disable NET_RX_BUSY_POLL +Subject: [PATCH 046/328] net/core: disable NET_RX_BUSY_POLL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -33,5 +33,5 @@ index 228dfa382eec..bc8d01996f22 100644 config BQL bool -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0047-arm-disable-NEON-in-kernel-mode.patch b/kernel/patches-4.19.x-rt/0047-arm-disable-NEON-in-kernel-mode.patch index f94e6325b..e766e5474 100644 --- a/kernel/patches-4.19.x-rt/0047-arm-disable-NEON-in-kernel-mode.patch +++ b/kernel/patches-4.19.x-rt/0047-arm-disable-NEON-in-kernel-mode.patch @@ -1,7 +1,7 @@ -From 477660c22f2036e69299438b1292307ee1dba46b Mon Sep 17 00:00:00 2001 +From af731f1e8edb7e93c5977a0da70bd61c5d9fa7b1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 1 Dec 2017 10:42:03 +0100 -Subject: [PATCH 047/283] arm*: disable NEON in kernel mode +Subject: [PATCH 047/328] arm*: disable NEON in kernel mode 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 @@ -20,10 +20,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 7d11242a37d2..e122dd212ab3 100644 +index 91ba9fe945ff..bd9d180db5c7 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -2162,7 +2162,7 @@ config NEON +@@ -2163,7 +2163,7 @@ config NEON config KERNEL_MODE_NEON bool "Support for NEON in kernel mode" @@ -161,5 +161,5 @@ index 34b4e3d46aab..ae055cdad8cf 100644 crc32_pmull_algs[1].update = crc32c_pmull_update; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0048-powerpc-Use-generic-rwsem-on-RT.patch b/kernel/patches-4.19.x-rt/0048-powerpc-Use-generic-rwsem-on-RT.patch index 50aec59f6..907e877bf 100644 --- a/kernel/patches-4.19.x-rt/0048-powerpc-Use-generic-rwsem-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0048-powerpc-Use-generic-rwsem-on-RT.patch @@ -1,7 +1,7 @@ -From 297ef639cbc4bc3aac2e5a8835090136753796fc Mon Sep 17 00:00:00 2001 +From c90bc1f0bbce77f2baf2b4213125fb5b7870fc20 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 048/283] powerpc: Use generic rwsem on RT +Subject: [PATCH 048/328] powerpc: Use generic rwsem on RT Use generic code which uses rtmutex @@ -11,7 +11,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig -index a80669209155..9952764db9c5 100644 +index 6f475dc5829b..3d5c86336072 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -105,10 +105,11 @@ config LOCKDEP_SUPPORT @@ -28,5 +28,5 @@ index a80669209155..9952764db9c5 100644 config GENERIC_LOCKBREAK bool -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0049-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/kernel/patches-4.19.x-rt/0049-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index b3fb730ac..f63cc135d 100644 --- a/kernel/patches-4.19.x-rt/0049-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/kernel/patches-4.19.x-rt/0049-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,7 +1,7 @@ -From 3bead4e3fc7560659c1982ace99de374aa9df79c Mon Sep 17 00:00:00 2001 +From 3460880af8146f0e3e05acd590e7e52d450bbf80 Mon Sep 17 00:00:00 2001 From: Bogdan Purcareata Date: Fri, 24 Apr 2015 15:53:13 +0000 -Subject: [PATCH 049/283] powerpc/kvm: Disable in-kernel MPIC emulation for +Subject: [PATCH 049/328] powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT_FULL While converting the openpic emulation code to use a raw_spinlock_t enables @@ -40,5 +40,5 @@ index 68a0e9d5b440..6f4d5d7615af 100644 select HAVE_KVM_IRQFD select HAVE_KVM_IRQ_ROUTING -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0050-powerpc-Disable-highmem-on-RT.patch b/kernel/patches-4.19.x-rt/0050-powerpc-Disable-highmem-on-RT.patch index 9b69bb6c8..a5c4b4983 100644 --- a/kernel/patches-4.19.x-rt/0050-powerpc-Disable-highmem-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0050-powerpc-Disable-highmem-on-RT.patch @@ -1,7 +1,7 @@ -From ae9000e3c66794249fbca61b8a71bcdf690910e0 Mon Sep 17 00:00:00 2001 +From 13e6a60aad3edc7b4efd2168abcca0447ff20763 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:08:34 +0200 -Subject: [PATCH 050/283] powerpc: Disable highmem on RT +Subject: [PATCH 050/328] powerpc: Disable highmem on RT The current highmem handling on -RT is not compatible and needs fixups. @@ -11,10 +11,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig -index 9952764db9c5..1563820a37e8 100644 +index 3d5c86336072..1b332f69dd36 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig -@@ -398,7 +398,7 @@ menu "Kernel options" +@@ -399,7 +399,7 @@ menu "Kernel options" config HIGHMEM bool "High memory support" @@ -24,5 +24,5 @@ index 9952764db9c5..1563820a37e8 100644 source kernel/Kconfig.hz -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0051-mips-Disable-highmem-on-RT.patch b/kernel/patches-4.19.x-rt/0051-mips-Disable-highmem-on-RT.patch index c8ecd3a42..168f53b19 100644 --- a/kernel/patches-4.19.x-rt/0051-mips-Disable-highmem-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0051-mips-Disable-highmem-on-RT.patch @@ -1,7 +1,7 @@ -From 454e636edd0bb26495afb3850a37aa5e5214a4ed Mon Sep 17 00:00:00 2001 +From 55ff21a4418f35a443f2c210779a9ff4dee33e93 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:10:12 +0200 -Subject: [PATCH 051/283] mips: Disable highmem on RT +Subject: [PATCH 051/328] mips: Disable highmem on RT The current highmem handling on -RT is not compatible and needs fixups. @@ -11,10 +11,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig -index 201caf226b47..bd268302efa4 100644 +index a830a9701e50..3d5fae3891be 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2517,7 +2517,7 @@ config MIPS_CRC_SUPPORT +@@ -2518,7 +2518,7 @@ config MIPS_CRC_SUPPORT # config HIGHMEM bool "High Memory Support" @@ -24,5 +24,5 @@ index 201caf226b47..bd268302efa4 100644 config CPU_SUPPORTS_HIGHMEM bool -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0052-x86-Use-generic-rwsem_spinlocks-on-rt.patch b/kernel/patches-4.19.x-rt/0052-x86-Use-generic-rwsem_spinlocks-on-rt.patch index 93935d4e2..198cf07af 100644 --- a/kernel/patches-4.19.x-rt/0052-x86-Use-generic-rwsem_spinlocks-on-rt.patch +++ b/kernel/patches-4.19.x-rt/0052-x86-Use-generic-rwsem_spinlocks-on-rt.patch @@ -1,7 +1,7 @@ -From 5c86aec91ae10f140d18bd33cd62783cdde0922d Mon Sep 17 00:00:00 2001 +From d0b5d43931b3de89c64c8a697256eb60eb9c0ebb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 26 Jul 2009 02:21:32 +0200 -Subject: [PATCH 052/283] x86: Use generic rwsem_spinlocks on -rt +Subject: [PATCH 052/328] x86: Use generic rwsem_spinlocks on -rt Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt. @@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 04a45d6d0167..1b05ae86bdde 100644 +index e40ba59efe7f..f22e787329cf 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -264,8 +264,11 @@ config ARCH_MAY_HAVE_PC_FDC @@ -29,5 +29,5 @@ index 04a45d6d0167..1b05ae86bdde 100644 config GENERIC_CALIBRATE_DELAY def_bool y -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0053-leds-trigger-disable-CPU-trigger-on-RT.patch b/kernel/patches-4.19.x-rt/0053-leds-trigger-disable-CPU-trigger-on-RT.patch index e330c8328..e66474b3e 100644 --- a/kernel/patches-4.19.x-rt/0053-leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0053-leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,7 +1,7 @@ -From 9cd1a715d85ace3e9b1d3ae703eb16744dd3ebb6 Mon Sep 17 00:00:00 2001 +From 9c164cac4dbebd9bf5376428113db97b366625a0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 23 Jan 2014 14:45:59 +0100 -Subject: [PATCH 053/283] leds: trigger: disable CPU trigger on -RT +Subject: [PATCH 053/328] leds: trigger: disable CPU trigger on -RT as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 @@ -36,5 +36,5 @@ index 4018af769969..b4ce8c115949 100644 This allows LEDs to be controlled by active CPUs. This shows the active CPUs across an array of LEDs so you can see which -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0054-cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/kernel/patches-4.19.x-rt/0054-cpufreq-drop-K8-s-driver-from-beeing-selected.patch index b6db4ddad..225290bf5 100644 --- a/kernel/patches-4.19.x-rt/0054-cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/kernel/patches-4.19.x-rt/0054-cpufreq-drop-K8-s-driver-from-beeing-selected.patch @@ -1,7 +1,7 @@ -From f19ffb87fe48ba1e8904df670b13d52f8b9c08f1 Mon Sep 17 00:00:00 2001 +From fa67192faa15cd98f554bcf82f0ecc40a26d9165 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 9 Apr 2015 15:23:01 +0200 -Subject: [PATCH 054/283] cpufreq: drop K8's driver from beeing selected +Subject: [PATCH 054/328] cpufreq: drop K8's driver from beeing selected Ralf posted a picture of a backtrace from @@ -34,5 +34,5 @@ index 35f71825b7f3..bb4a6160d0f7 100644 This adds the CPUFreq driver for K8/early Opteron/Athlon64 processors. Support for K10 and newer processors is now in acpi-cpufreq. -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0055-md-disable-bcache.patch b/kernel/patches-4.19.x-rt/0055-md-disable-bcache.patch index 297731318..88247b572 100644 --- a/kernel/patches-4.19.x-rt/0055-md-disable-bcache.patch +++ b/kernel/patches-4.19.x-rt/0055-md-disable-bcache.patch @@ -1,7 +1,7 @@ -From 3b1c3bc41b87cd7a714ebfa5e88651d4f3326f2e Mon Sep 17 00:00:00 2001 +From 274246f0cc33aabdc562929c114eae24541eb9a3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 11:48:57 +0200 -Subject: [PATCH 055/283] md: disable bcache +Subject: [PATCH 055/328] md: disable bcache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36,5 +36,5 @@ index f6e0a8b3a61e..18c03d79a442 100644 help Allows a block device to be used as cache for other devices; uses -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0056-efi-Disable-runtime-services-on-RT.patch b/kernel/patches-4.19.x-rt/0056-efi-Disable-runtime-services-on-RT.patch index 25f7d8f34..5cfb78dbf 100644 --- a/kernel/patches-4.19.x-rt/0056-efi-Disable-runtime-services-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0056-efi-Disable-runtime-services-on-RT.patch @@ -1,7 +1,7 @@ -From f0e7a6e0f76d2ab27a0c5ef0f7872d971ec1dd23 Mon Sep 17 00:00:00 2001 +From b453602d0f02b94edf714d46e6293b037ea94b67 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:03:16 +0200 -Subject: [PATCH 056/283] efi: Disable runtime services on RT +Subject: [PATCH 056/328] efi: Disable runtime services on RT Based on meassurements the EFI functions get_variable / get_next_variable take up to 2us which looks okay. @@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c -index ab668e17fd05..f58ab9ed4ade 100644 +index 5db20908aa9c..1708505fdf5d 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -87,7 +87,7 @@ struct mm_struct efi_mm = { @@ -41,5 +41,5 @@ index ab668e17fd05..f58ab9ed4ade 100644 { disable_runtime = true; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0057-printk-Add-a-printk-kill-switch.patch b/kernel/patches-4.19.x-rt/0057-printk-Add-a-printk-kill-switch.patch index 29ecbea4a..264e226bb 100644 --- a/kernel/patches-4.19.x-rt/0057-printk-Add-a-printk-kill-switch.patch +++ b/kernel/patches-4.19.x-rt/0057-printk-Add-a-printk-kill-switch.patch @@ -1,7 +1,7 @@ -From d1e9e20fe16f16a1665eabaa44a0f1c2a4cebfec Mon Sep 17 00:00:00 2001 +From dc16c6a47edf44cb0f69ff6124d6a85ee6dd3dcc Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 22 Jul 2011 17:58:40 +0200 -Subject: [PATCH 057/283] printk: Add a printk kill switch +Subject: [PATCH 057/328] printk: Add a printk kill switch Add a prinkt-kill-switch. This is used from (NMI) watchdog to ensure that it does not dead-lock with the early printk code. @@ -30,7 +30,7 @@ index cf3eccfe1543..30ebf5f82a7c 100644 #ifdef CONFIG_PRINTK_NMI diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 06045abd1887..413160a93814 100644 +index 7a2fdc097c8c..29838e532f46 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -405,6 +405,58 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); @@ -92,9 +92,9 @@ index 06045abd1887..413160a93814 100644 #ifdef CONFIG_PRINTK DECLARE_WAIT_QUEUE_HEAD(log_wait); /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -1897,6 +1949,13 @@ asmlinkage int vprintk_emit(int facility, int level, - bool in_sched = false; +@@ -1905,6 +1957,13 @@ asmlinkage int vprintk_emit(int facility, int level, unsigned long flags; + u64 curr_log_seq; + /* + * Fall back to early_printk if a debugging subsystem has @@ -106,7 +106,7 @@ index 06045abd1887..413160a93814 100644 if (level == LOGLEVEL_SCHED) { level = LOGLEVEL_DEFAULT; in_sched = true; -@@ -2037,26 +2096,6 @@ static bool suppress_message_printing(int level) { return false; } +@@ -2049,26 +2108,6 @@ static bool suppress_message_printing(int level) { return false; } #endif /* CONFIG_PRINTK */ @@ -169,5 +169,5 @@ index 71381168dede..685443375dc0 100644 nmi_panic(regs, "Hard LOCKUP"); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0058-printk-Add-force_early_printk-boot-param-to-help-wit.patch b/kernel/patches-4.19.x-rt/0058-printk-Add-force_early_printk-boot-param-to-help-wit.patch index aa218e634..fb083d330 100644 --- a/kernel/patches-4.19.x-rt/0058-printk-Add-force_early_printk-boot-param-to-help-wit.patch +++ b/kernel/patches-4.19.x-rt/0058-printk-Add-force_early_printk-boot-param-to-help-wit.patch @@ -1,7 +1,7 @@ -From 3d881bc012788bea38e0bf55b03d9996eb40b1b9 Mon Sep 17 00:00:00 2001 +From bfe8e0affbc2a1d3f23e9aec43198b31d1115f3d Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Fri, 2 Sep 2011 14:41:29 +0200 -Subject: [PATCH 058/283] printk: Add "force_early_printk" boot param to help +Subject: [PATCH 058/328] printk: Add "force_early_printk" boot param to help with debugging Gives me an option to screw printk and actually see what the machine @@ -16,7 +16,7 @@ Link: http://lkml.kernel.org/n/tip-ykb97nsfmobq44xketrxs977@git.kernel.org 1 file changed, 7 insertions(+) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 413160a93814..6553508ff388 100644 +index 29838e532f46..f934baed564d 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -435,6 +435,13 @@ asmlinkage void early_printk(const char *fmt, ...) @@ -34,5 +34,5 @@ index 413160a93814..6553508ff388 100644 { printk_killswitch = true; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0059-preempt-Provide-preempt_-_-no-rt-variants.patch b/kernel/patches-4.19.x-rt/0059-preempt-Provide-preempt_-_-no-rt-variants.patch index d93b423c3..668b9aa66 100644 --- a/kernel/patches-4.19.x-rt/0059-preempt-Provide-preempt_-_-no-rt-variants.patch +++ b/kernel/patches-4.19.x-rt/0059-preempt-Provide-preempt_-_-no-rt-variants.patch @@ -1,7 +1,7 @@ -From 6a3ec551d9ea7e49f20d8f9d3d45fb8d9ca1b720 Mon Sep 17 00:00:00 2001 +From f3b0b7d6dafcddd6bed43f78535a5494b0e09aa8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 24 Jul 2009 12:38:56 +0200 -Subject: [PATCH 059/283] preempt: Provide preempt_*_(no)rt variants +Subject: [PATCH 059/328] preempt: Provide preempt_*_(no)rt variants RT needs a few preempt_disable/enable points which are not necessary otherwise. Implement variants to avoid #ifdeffery. @@ -48,5 +48,5 @@ index 3196d0e76719..f7a17fcc3fec 100644 struct preempt_notifier; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0060-futex-workaround-migrate_disable-enable-in-different.patch b/kernel/patches-4.19.x-rt/0060-futex-workaround-migrate_disable-enable-in-different.patch index 7d4b732a2..dbbe56b87 100644 --- a/kernel/patches-4.19.x-rt/0060-futex-workaround-migrate_disable-enable-in-different.patch +++ b/kernel/patches-4.19.x-rt/0060-futex-workaround-migrate_disable-enable-in-different.patch @@ -1,7 +1,7 @@ -From 02487d0393920e03426a2378e40bc7547193c3aa Mon Sep 17 00:00:00 2001 +From a2a505f1e5d127a2c3b1ee184d27d0f402dcdf63 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 8 Mar 2017 14:23:35 +0100 -Subject: [PATCH 060/283] futex: workaround migrate_disable/enable in different +Subject: [PATCH 060/328] futex: workaround migrate_disable/enable in different context migrate_disable()/migrate_enable() takes a different path in atomic() vs @@ -16,10 +16,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 19 insertions(+) diff --git a/kernel/futex.c b/kernel/futex.c -index afdc5eadce6e..304f07d08c95 100644 +index e75ad30aa7bc..5c8053098fc8 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2876,6 +2876,14 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2879,6 +2879,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); @@ -34,7 +34,7 @@ index afdc5eadce6e..304f07d08c95 100644 spin_unlock(q.lock_ptr); /* * __rt_mutex_start_proxy_lock() unconditionally enqueues the @rt_waiter -@@ -2884,6 +2892,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2887,6 +2895,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); @@ -42,7 +42,7 @@ index afdc5eadce6e..304f07d08c95 100644 if (ret) { if (ret == 1) -@@ -3032,11 +3041,21 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) +@@ -3035,11 +3044,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); @@ -65,5 +65,5 @@ index afdc5eadce6e..304f07d08c95 100644 /* -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0061-rt-Add-local-irq-locks.patch b/kernel/patches-4.19.x-rt/0061-rt-Add-local-irq-locks.patch index 79a34778c..7be11bb74 100644 --- a/kernel/patches-4.19.x-rt/0061-rt-Add-local-irq-locks.patch +++ b/kernel/patches-4.19.x-rt/0061-rt-Add-local-irq-locks.patch @@ -1,7 +1,7 @@ -From 1e4195bafdb198d778c98aece678c7b16cd035c8 Mon Sep 17 00:00:00 2001 +From 4db63a0605ac780bf1525c6a90667aef3f897dc1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 20 Jun 2011 09:03:47 +0200 -Subject: [PATCH 061/283] rt: Add local irq locks +Subject: [PATCH 061/328] rt: Add local irq locks Introduce locallock. For !RT this maps to preempt_disable()/ local_irq_disable() so there is not much that changes. For RT this will @@ -336,5 +336,5 @@ index 70b7123f38c7..24421bf8c4b3 100644 #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch b/kernel/patches-4.19.x-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch index ba512347b..e20ba81c2 100644 --- a/kernel/patches-4.19.x-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch +++ b/kernel/patches-4.19.x-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch @@ -1,7 +1,7 @@ -From 58ee9341c0c3521cdb41239c83807a98cef97bd0 Mon Sep 17 00:00:00 2001 +From 0e057064ed654b5f7fa22cc5f159ed67eeb332dc Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Mon, 7 May 2018 08:58:56 -0500 -Subject: [PATCH 062/283] locallock: provide {get,put}_locked_ptr() variants +Subject: [PATCH 062/328] locallock: provide {get,put}_locked_ptr() variants Provide a set of locallocked accessors for pointers to per-CPU data; this is useful for dynamically-allocated per-CPU regions, for example. @@ -44,5 +44,5 @@ index d658c2552601..921eab83cd34 100644 #define local_lock_cpu(lvar) get_cpu() #define local_unlock_cpu(lvar) put_cpu() -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0063-mm-scatterlist-Do-not-disable-irqs-on-RT.patch b/kernel/patches-4.19.x-rt/0063-mm-scatterlist-Do-not-disable-irqs-on-RT.patch index 659dd3b38..3a55eb75b 100644 --- a/kernel/patches-4.19.x-rt/0063-mm-scatterlist-Do-not-disable-irqs-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0063-mm-scatterlist-Do-not-disable-irqs-on-RT.patch @@ -1,7 +1,7 @@ -From a6c38f0b349a8921a1bfe4dcef5972cf1e2224a0 Mon Sep 17 00:00:00 2001 +From a132d9a98679bcc505c36c80270ddaa741c15cbc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:34 -0500 -Subject: [PATCH 063/283] mm/scatterlist: Do not disable irqs on RT +Subject: [PATCH 063/328] mm/scatterlist: Do not disable irqs on RT For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). @@ -12,10 +12,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scatterlist.c b/lib/scatterlist.c -index 7c6096a71704..5c2c68962709 100644 +index 60e7eca2f4be..aad8b9ecd496 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c -@@ -776,7 +776,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter) +@@ -777,7 +777,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter) flush_kernel_dcache_page(miter->page); if (miter->__flags & SG_MITER_ATOMIC) { @@ -25,5 +25,5 @@ index 7c6096a71704..5c2c68962709 100644 } else kunmap(miter->page); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0064-signal-x86-Delay-calling-signals-in-atomic.patch b/kernel/patches-4.19.x-rt/0064-signal-x86-Delay-calling-signals-in-atomic.patch index fc2b07c35..e3aa226f9 100644 --- a/kernel/patches-4.19.x-rt/0064-signal-x86-Delay-calling-signals-in-atomic.patch +++ b/kernel/patches-4.19.x-rt/0064-signal-x86-Delay-calling-signals-in-atomic.patch @@ -1,7 +1,7 @@ -From f994c5279fb1173131e67419c540713cd25a59e3 Mon Sep 17 00:00:00 2001 +From f95acea987d23816f8094d7db13ae2afb94136ce Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 064/283] signal/x86: Delay calling signals in atomic +Subject: [PATCH 064/328] signal/x86: Delay calling signals in atomic On x86_64 we must disable preemption before we enable interrupts for stack faults, int3 and debugging, because the current task is using @@ -79,7 +79,7 @@ index 33d3c88a7225..fb0438d06ca7 100644 typedef sigset_t compat_sigset_t; #endif diff --git a/include/linux/sched.h b/include/linux/sched.h -index df39ad5916e7..535e57775208 100644 +index 0489d3e0e78c..e4af260f81c5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -881,6 +881,10 @@ struct task_struct { @@ -94,10 +94,10 @@ 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 d5a9646b3538..56edb0580a3a 100644 +index 5e278f1540ad..d5e764bb2444 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, +@@ -1277,8 +1277,8 @@ int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p, * We don't want to have recursive SIGSEGV's etc, for example, * that is why we also clear SIGNAL_UNKILLABLE. */ @@ -108,7 +108,7 @@ index d5a9646b3538..56edb0580a3a 100644 { unsigned long int flags; int ret, blocked, ignored; -@@ -1298,6 +1298,39 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) +@@ -1307,6 +1307,39 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) return ret; } @@ -149,5 +149,5 @@ index d5a9646b3538..56edb0580a3a 100644 * Nuke all other threads in the group. */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0065-x86-signal-delay-calling-signals-on-32bit.patch b/kernel/patches-4.19.x-rt/0065-x86-signal-delay-calling-signals-on-32bit.patch index 0118cc134..264b0e6dc 100644 --- a/kernel/patches-4.19.x-rt/0065-x86-signal-delay-calling-signals-on-32bit.patch +++ b/kernel/patches-4.19.x-rt/0065-x86-signal-delay-calling-signals-on-32bit.patch @@ -1,7 +1,7 @@ -From 77f58646e4722365c6b6b91802d5feddd57dff34 Mon Sep 17 00:00:00 2001 +From 44575d6c7e6fb548a6bf67f427d151301cd1dfd8 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Thu, 10 Dec 2015 10:58:51 -0800 -Subject: [PATCH 065/283] x86/signal: delay calling signals on 32bit +Subject: [PATCH 065/328] x86/signal: delay calling signals on 32bit When running some ptrace single step tests on x86-32 machine, the below problem is triggered: @@ -44,5 +44,5 @@ index fb0438d06ca7..c00e27af2205 100644 #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0066-buffer_head-Replace-bh_uptodate_lock-for-rt.patch b/kernel/patches-4.19.x-rt/0066-buffer_head-Replace-bh_uptodate_lock-for-rt.patch index 0ee5dfabc..9525d4317 100644 --- a/kernel/patches-4.19.x-rt/0066-buffer_head-Replace-bh_uptodate_lock-for-rt.patch +++ b/kernel/patches-4.19.x-rt/0066-buffer_head-Replace-bh_uptodate_lock-for-rt.patch @@ -1,7 +1,7 @@ -From 86a1cbd4eddbe083ad0331f0eeec002f6fa7b322 Mon Sep 17 00:00:00 2001 +From 6b9121d4d6cf25eabc1b638027345308486f88b1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 18 Mar 2011 09:18:52 +0100 -Subject: [PATCH 066/283] buffer_head: Replace bh_uptodate_lock for -rt +Subject: [PATCH 066/328] buffer_head: Replace bh_uptodate_lock for -rt Wrap the bit_spin_lock calls into a separate inline and add the RT replacements with a real spinlock. @@ -86,7 +86,7 @@ index a550e0d8e965..a5b3a456dbff 100644 __this_cpu_inc(bh_accounting.nr); recalc_bh_state(); diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c -index db7590178dfc..d76364124443 100644 +index 9cc79b7b0df1..3f4ba2011499 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -95,8 +95,7 @@ static void ext4_finish_bio(struct bio *bio) @@ -192,5 +192,5 @@ index 96225a77c112..8a1bcfb145d7 100644 * macro tricks to expand the set_buffer_foo(), clear_buffer_foo() * and buffer_foo() functions. -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0067-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch b/kernel/patches-4.19.x-rt/0067-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch index 742f848b7..40dd8b43d 100644 --- a/kernel/patches-4.19.x-rt/0067-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch +++ b/kernel/patches-4.19.x-rt/0067-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch @@ -1,7 +1,7 @@ -From a0ac5bf9b179bff5745bd4c15d14cb2ec5c81c16 Mon Sep 17 00:00:00 2001 +From 72ca6594764d9a6523352dc609644bea68a3a74b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 18 Mar 2011 10:11:25 +0100 -Subject: [PATCH 067/283] fs: jbd/jbd2: Make state lock and journal head lock +Subject: [PATCH 067/328] fs: jbd/jbd2: Make state lock and journal head lock rt safe bit_spin_locks break under RT. @@ -44,7 +44,7 @@ index 8a1bcfb145d7..5869330d1f38 100644 } diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h -index 583b82b5a1e9..57f4ad8d45a5 100644 +index 268f3000d1b3..8f5d6ecb802e 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) @@ -105,5 +105,5 @@ index 583b82b5a1e9..57f4ad8d45a5 100644 #define J_ASSERT(assert) BUG_ON(!(assert)) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0068-list_bl-Make-list-head-locking-RT-safe.patch b/kernel/patches-4.19.x-rt/0068-list_bl-Make-list-head-locking-RT-safe.patch index 5fd8fb1b6..4266c50ce 100644 --- a/kernel/patches-4.19.x-rt/0068-list_bl-Make-list-head-locking-RT-safe.patch +++ b/kernel/patches-4.19.x-rt/0068-list_bl-Make-list-head-locking-RT-safe.patch @@ -1,7 +1,7 @@ -From 575440eb3e514693de4892b3589bd02b584834ef Mon Sep 17 00:00:00 2001 +From eb37c3d2df6895d5c86504fdb1a509d075414f52 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Fri, 21 Jun 2013 15:07:25 -0400 -Subject: [PATCH 068/283] list_bl: Make list head locking RT safe +Subject: [PATCH 068/328] list_bl: Make list head locking RT safe 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 @@ -116,5 +116,5 @@ index 3fc2cc57ba1b..69b659259bac 100644 static inline bool hlist_bl_is_locked(struct hlist_bl_head *b) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0069-list_bl-fixup-bogus-lockdep-warning.patch b/kernel/patches-4.19.x-rt/0069-list_bl-fixup-bogus-lockdep-warning.patch index 919bcbd7e..541210fc8 100644 --- a/kernel/patches-4.19.x-rt/0069-list_bl-fixup-bogus-lockdep-warning.patch +++ b/kernel/patches-4.19.x-rt/0069-list_bl-fixup-bogus-lockdep-warning.patch @@ -1,7 +1,7 @@ -From 386260fdddeed151902355b8c816f9b166c1c2b8 Mon Sep 17 00:00:00 2001 +From a294373c35c31ae762358146f49c3c48f1429526 Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 31 Mar 2016 00:04:25 -0500 -Subject: [PATCH 069/283] list_bl: fixup bogus lockdep warning +Subject: [PATCH 069/328] list_bl: fixup bogus lockdep warning At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). @@ -99,5 +99,5 @@ index 69b659259bac..0b5de7d9ffcf 100644 static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0070-genirq-Disable-irqpoll-on-rt.patch b/kernel/patches-4.19.x-rt/0070-genirq-Disable-irqpoll-on-rt.patch index 03c1d8bbc..3345bb3ec 100644 --- a/kernel/patches-4.19.x-rt/0070-genirq-Disable-irqpoll-on-rt.patch +++ b/kernel/patches-4.19.x-rt/0070-genirq-Disable-irqpoll-on-rt.patch @@ -1,7 +1,7 @@ -From d884d2bff2d643468c5e37727aa29e8f5c88b3be Mon Sep 17 00:00:00 2001 +From 974bfebe6d809861b9a25af561668633ef3168a7 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:57 -0500 -Subject: [PATCH 070/283] genirq: Disable irqpoll on -rt +Subject: [PATCH 070/328] genirq: Disable irqpoll on -rt Creates long latencies for no value @@ -38,5 +38,5 @@ index d867d6ddafdd..cd12ee86c01e 100644 printk(KERN_WARNING "Misrouted IRQ fixup and polling support " "enabled\n"); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0071-genirq-Force-interrupt-thread-on-RT.patch b/kernel/patches-4.19.x-rt/0071-genirq-Force-interrupt-thread-on-RT.patch index 811c5459a..67a5776c6 100644 --- a/kernel/patches-4.19.x-rt/0071-genirq-Force-interrupt-thread-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0071-genirq-Force-interrupt-thread-on-RT.patch @@ -1,7 +1,7 @@ -From 91f768aed73cc93826112811b4e622dce0c1915f Mon Sep 17 00:00:00 2001 +From 056e2667682c7afa14f71cb6d97ccf2217c0c08b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 3 Apr 2011 11:57:29 +0200 -Subject: [PATCH 071/283] genirq: Force interrupt thread on RT +Subject: [PATCH 071/328] genirq: Force interrupt thread on RT Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. @@ -29,10 +29,10 @@ index eeceac3376fc..315f852b4981 100644 #define force_irqthreads (0) #endif diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index cd4f9f3e8345..c3b9f6dacd8f 100644 +index 23bcfa71077f..3c26d0708709 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 @@ -40,14 +40,14 @@ index cd4f9f3e8345..c3b9f6dacd8f 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_irqthreads(char *arg) return 0; } early_param("threadirqs", setup_forced_irqthreads); +# endif #endif - static void __synchronize_hardirq(struct irq_desc *desc) + static void __synchronize_hardirq(struct irq_desc *desc, bool sync_chip) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0072-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/kernel/patches-4.19.x-rt/0072-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 33ce3b1b6..a4886a69c 100644 --- a/kernel/patches-4.19.x-rt/0072-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/kernel/patches-4.19.x-rt/0072-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -1,7 +1,7 @@ -From 6ec0e8d1526370de73bd18c096f7f96827594308 Mon Sep 17 00:00:00 2001 +From 4c6015fdf87fb7f0f38ce92c85d5630d79c6ae23 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:20 +0200 -Subject: [PATCH 072/283] Split IRQ-off and zone->lock while freeing pages from +Subject: [PATCH 072/328] Split IRQ-off and zone->lock while freeing pages from PCP list #1 Split the IRQ-off section while accessing the PCP list from zone->lock @@ -17,7 +17,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 2d04bd2e1ced..332b48f38d1e 100644 +index e5c610d711f3..0cfcd42517a4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1095,7 +1095,7 @@ static inline void prefetch_buddy(struct page *page) @@ -111,7 +111,7 @@ index 2d04bd2e1ced..332b48f38d1e 100644 } static void free_one_page(struct zone *zone, -@@ -2536,13 +2543,18 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) +@@ -2544,13 +2551,18 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) { unsigned long flags; int to_drain, batch; @@ -131,7 +131,7 @@ index 2d04bd2e1ced..332b48f38d1e 100644 } #endif -@@ -2558,14 +2570,21 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) +@@ -2566,14 +2578,21 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) unsigned long flags; struct per_cpu_pageset *pset; struct per_cpu_pages *pcp; @@ -155,7 +155,7 @@ index 2d04bd2e1ced..332b48f38d1e 100644 } /* -@@ -2787,7 +2806,10 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn) +@@ -2795,7 +2814,10 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn) pcp->count++; if (pcp->count >= pcp->high) { unsigned long batch = READ_ONCE(pcp->batch); @@ -168,5 +168,5 @@ index 2d04bd2e1ced..332b48f38d1e 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0073-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/kernel/patches-4.19.x-rt/0073-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index f60adfde3..48c39e6d8 100644 --- a/kernel/patches-4.19.x-rt/0073-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/kernel/patches-4.19.x-rt/0073-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -1,7 +1,7 @@ -From f9efb76f365f15eaca8f29ee7f2648de90925a76 Mon Sep 17 00:00:00 2001 +From dba8e6d7ab200ab5fe544af8c6093bcb3d215320 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:21 +0200 -Subject: [PATCH 073/283] Split IRQ-off and zone->lock while freeing pages from +Subject: [PATCH 073/328] Split IRQ-off and zone->lock while freeing pages from PCP list #2 Split the IRQ-off section while accessing the PCP list from zone->lock @@ -17,7 +17,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 332b48f38d1e..55cee9a17a36 100644 +index 0cfcd42517a4..9a4d150ea5b7 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1105,8 +1105,8 @@ static inline void prefetch_buddy(struct page *page) @@ -59,7 +59,7 @@ index 332b48f38d1e..55cee9a17a36 100644 __free_one_page(page, page_to_pfn(page), zone, 0, mt); trace_mm_page_pcpu_drain(page, 0, mt); } -@@ -2554,7 +2569,7 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) +@@ -2562,7 +2577,7 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) local_irq_restore(flags); if (to_drain > 0) @@ -68,7 +68,7 @@ index 332b48f38d1e..55cee9a17a36 100644 } #endif -@@ -2584,7 +2599,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) +@@ -2592,7 +2607,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) local_irq_restore(flags); if (count) @@ -77,7 +77,7 @@ index 332b48f38d1e..55cee9a17a36 100644 } /* -@@ -2777,7 +2792,8 @@ static bool free_unref_page_prepare(struct page *page, unsigned long pfn) +@@ -2785,7 +2800,8 @@ static bool free_unref_page_prepare(struct page *page, unsigned long pfn) return true; } @@ -87,7 +87,7 @@ index 332b48f38d1e..55cee9a17a36 100644 { struct zone *zone = page_zone(page); struct per_cpu_pages *pcp; -@@ -2806,10 +2822,8 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn) +@@ -2814,10 +2830,8 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn) pcp->count++; if (pcp->count >= pcp->high) { unsigned long batch = READ_ONCE(pcp->batch); @@ -99,7 +99,7 @@ index 332b48f38d1e..55cee9a17a36 100644 } } -@@ -2820,13 +2834,17 @@ void free_unref_page(struct page *page) +@@ -2828,13 +2842,17 @@ void free_unref_page(struct page *page) { unsigned long flags; unsigned long pfn = page_to_pfn(page); @@ -118,7 +118,7 @@ index 332b48f38d1e..55cee9a17a36 100644 } /* -@@ -2837,6 +2855,11 @@ void free_unref_page_list(struct list_head *list) +@@ -2845,6 +2863,11 @@ void free_unref_page_list(struct list_head *list) struct page *page, *next; unsigned long flags, pfn; int batch_count = 0; @@ -130,7 +130,7 @@ index 332b48f38d1e..55cee9a17a36 100644 /* Prepare pages for freeing */ list_for_each_entry_safe(page, next, list, lru) { -@@ -2849,10 +2872,12 @@ void free_unref_page_list(struct list_head *list) +@@ -2857,10 +2880,12 @@ void free_unref_page_list(struct list_head *list) local_irq_save(flags); list_for_each_entry_safe(page, next, list, lru) { unsigned long pfn = page_private(page); @@ -144,7 +144,7 @@ index 332b48f38d1e..55cee9a17a36 100644 /* * Guard against excessive IRQ disabled times when we get -@@ -2865,6 +2890,21 @@ void free_unref_page_list(struct list_head *list) +@@ -2873,6 +2898,21 @@ void free_unref_page_list(struct list_head *list) } } local_irq_restore(flags); @@ -167,5 +167,5 @@ index 332b48f38d1e..55cee9a17a36 100644 /* -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0074-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch b/kernel/patches-4.19.x-rt/0074-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch index 5762eea2f..39cee1d14 100644 --- a/kernel/patches-4.19.x-rt/0074-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch +++ b/kernel/patches-4.19.x-rt/0074-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ -From 302fcfd8e9527e8f7b6ec9d733a5a3a760af64ef Mon Sep 17 00:00:00 2001 +From abbdf6516e6ac19a92a3c08fc7a2f1ecc66c2bc6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 28 May 2018 15:24:22 +0200 -Subject: [PATCH 074/283] mm/SLxB: change list_lock to raw_spinlock_t +Subject: [PATCH 074/328] mm/SLxB: change list_lock to raw_spinlock_t 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 @@ -398,7 +398,7 @@ index 9632772e14be..d6b01d61f768 100644 #ifdef CONFIG_SLAB struct list_head slabs_partial; /* partial list first, better asm code */ diff --git a/mm/slub.c b/mm/slub.c -index 09c0e24a06d8..9450fb6da89f 100644 +index 9c3937c5ce38..ba20c68a9cfd 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1167,7 +1167,7 @@ static noinline int free_debug_processing( @@ -614,5 +614,5 @@ index 09c0e24a06d8..9450fb6da89f 100644 for (i = 0; i < t.count; i++) { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0075-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch b/kernel/patches-4.19.x-rt/0075-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch index 953a10b67..2b64f2bc7 100644 --- a/kernel/patches-4.19.x-rt/0075-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch +++ b/kernel/patches-4.19.x-rt/0075-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch @@ -1,7 +1,7 @@ -From 9da82885e5b9187857b5fdc2eaa482752e814fbc Mon Sep 17 00:00:00 2001 +From b3c42996e1092269d6fac0652b22140250f11b7b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 21 Jun 2018 17:29:19 +0200 -Subject: [PATCH 075/283] mm/SLUB: delay giving back empty slubs to IRQ enabled +Subject: [PATCH 075/328] mm/SLUB: delay giving back empty slubs to IRQ enabled regions __free_slab() is invoked with disabled interrupts which increases the @@ -17,7 +17,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/mm/slub.c b/mm/slub.c -index 9450fb6da89f..7fd47a914f61 100644 +index ba20c68a9cfd..224663e20772 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1330,6 +1330,12 @@ static inline void dec_slabs_node(struct kmem_cache *s, int node, @@ -218,5 +218,5 @@ index 9450fb6da89f..7fd47a914f61 100644 if (debug_guardpage_minorder()) slub_max_order = 0; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0076-mm-page_alloc-rt-friendly-per-cpu-pages.patch b/kernel/patches-4.19.x-rt/0076-mm-page_alloc-rt-friendly-per-cpu-pages.patch index 698762232..0aca78d05 100644 --- a/kernel/patches-4.19.x-rt/0076-mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/kernel/patches-4.19.x-rt/0076-mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,7 +1,7 @@ -From 4cd1dede47de27525631161fdc6cdfc9d8608c31 Mon Sep 17 00:00:00 2001 +From d3dec69695332f82af11a39b0fd327ad173c4715 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:37 -0500 -Subject: [PATCH 076/283] mm: page_alloc: rt-friendly per-cpu pages +Subject: [PATCH 076/328] mm: page_alloc: rt-friendly per-cpu pages rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. @@ -17,7 +17,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 55cee9a17a36..99b3861b1ef6 100644 +index 9a4d150ea5b7..d6f9be9c6635 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -60,6 +60,7 @@ @@ -60,7 +60,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 } static void __init __free_pages_boot_core(struct page *page, unsigned int order) -@@ -2560,13 +2573,13 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) +@@ -2568,13 +2581,13 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) int to_drain, batch; LIST_HEAD(dst); @@ -76,7 +76,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 if (to_drain > 0) free_pcppages_bulk(zone, &dst, false); -@@ -2588,7 +2601,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) +@@ -2596,7 +2609,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) LIST_HEAD(dst); int count; @@ -85,7 +85,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 pset = per_cpu_ptr(zone->pageset, cpu); pcp = &pset->pcp; -@@ -2596,7 +2609,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) +@@ -2604,7 +2617,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) if (count) isolate_pcp_pages(count, pcp, &dst); @@ -94,7 +94,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 if (count) free_pcppages_bulk(zone, &dst, false); -@@ -2634,6 +2647,7 @@ void drain_local_pages(struct zone *zone) +@@ -2642,6 +2655,7 @@ void drain_local_pages(struct zone *zone) drain_pages(cpu); } @@ -102,7 +102,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 static void drain_local_pages_wq(struct work_struct *work) { /* -@@ -2647,6 +2661,7 @@ static void drain_local_pages_wq(struct work_struct *work) +@@ -2655,6 +2669,7 @@ static void drain_local_pages_wq(struct work_struct *work) drain_local_pages(NULL); preempt_enable(); } @@ -110,7 +110,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 /* * Spill all the per-cpu pages from all CPUs back into the buddy allocator. -@@ -2713,7 +2728,14 @@ void drain_all_pages(struct zone *zone) +@@ -2721,7 +2736,14 @@ void drain_all_pages(struct zone *zone) else cpumask_clear_cpu(cpu, &cpus_with_pcps); } @@ -126,7 +126,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 for_each_cpu(cpu, &cpus_with_pcps) { struct work_struct *work = per_cpu_ptr(&pcpu_drain, cpu); INIT_WORK(work, drain_local_pages_wq); -@@ -2721,6 +2743,7 @@ void drain_all_pages(struct zone *zone) +@@ -2729,6 +2751,7 @@ void drain_all_pages(struct zone *zone) } for_each_cpu(cpu, &cpus_with_pcps) flush_work(per_cpu_ptr(&pcpu_drain, cpu)); @@ -134,7 +134,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 mutex_unlock(&pcpu_drain_mutex); } -@@ -2840,9 +2863,9 @@ void free_unref_page(struct page *page) +@@ -2848,9 +2871,9 @@ void free_unref_page(struct page *page) if (!free_unref_page_prepare(page, pfn)) return; @@ -146,7 +146,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 if (!list_empty(&dst)) free_pcppages_bulk(zone, &dst, false); } -@@ -2869,7 +2892,7 @@ void free_unref_page_list(struct list_head *list) +@@ -2877,7 +2900,7 @@ void free_unref_page_list(struct list_head *list) set_page_private(page, pfn); } @@ -155,7 +155,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 list_for_each_entry_safe(page, next, list, lru) { unsigned long pfn = page_private(page); enum zone_type type; -@@ -2884,12 +2907,12 @@ void free_unref_page_list(struct list_head *list) +@@ -2892,12 +2915,12 @@ void free_unref_page_list(struct list_head *list) * a large list of pages to free. */ if (++batch_count == SWAP_CLUSTER_MAX) { @@ -171,7 +171,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 for (i = 0; i < __MAX_NR_ZONES; ) { struct page *page; -@@ -3038,7 +3061,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, +@@ -3046,7 +3069,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, struct page *page; unsigned long flags; @@ -180,7 +180,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 pcp = &this_cpu_ptr(zone->pageset)->pcp; list = &pcp->lists[migratetype]; page = __rmqueue_pcplist(zone, migratetype, pcp, list); -@@ -3046,7 +3069,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, +@@ -3054,7 +3077,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); } @@ -189,7 +189,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 return page; } -@@ -3073,7 +3096,7 @@ struct page *rmqueue(struct zone *preferred_zone, +@@ -3081,7 +3104,7 @@ struct page *rmqueue(struct zone *preferred_zone, * allocate greater than order-1 page units with __GFP_NOFAIL. */ WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1)); @@ -198,7 +198,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 do { page = NULL; -@@ -3093,14 +3116,14 @@ struct page *rmqueue(struct zone *preferred_zone, +@@ -3101,14 +3124,14 @@ struct page *rmqueue(struct zone *preferred_zone, __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); @@ -215,7 +215,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 return NULL; } -@@ -8096,7 +8119,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -8129,7 +8152,7 @@ void zone_pcp_reset(struct zone *zone) struct per_cpu_pageset *pset; /* avoid races with drain_pages() */ @@ -224,7 +224,7 @@ index 55cee9a17a36..99b3861b1ef6 100644 if (zone->pageset != &boot_pageset) { for_each_online_cpu(cpu) { pset = per_cpu_ptr(zone->pageset, cpu); -@@ -8105,7 +8128,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -8138,7 +8161,7 @@ void zone_pcp_reset(struct zone *zone) free_percpu(zone->pageset); zone->pageset = &boot_pageset; } @@ -234,5 +234,5 @@ index 55cee9a17a36..99b3861b1ef6 100644 #ifdef CONFIG_MEMORY_HOTREMOVE -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0077-mm-swap-Convert-to-percpu-locked.patch b/kernel/patches-4.19.x-rt/0077-mm-swap-Convert-to-percpu-locked.patch index bc037c26b..a3a58d20a 100644 --- a/kernel/patches-4.19.x-rt/0077-mm-swap-Convert-to-percpu-locked.patch +++ b/kernel/patches-4.19.x-rt/0077-mm-swap-Convert-to-percpu-locked.patch @@ -1,7 +1,7 @@ -From 98c01e9756e741d807b1198eb885a26e0998fcde Mon Sep 17 00:00:00 2001 +From a03a4ee82ac46307acebdfe58e602aea9835a9a1 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:51 -0500 -Subject: [PATCH 077/283] mm/swap: Convert to percpu locked +Subject: [PATCH 077/328] mm/swap: Convert to percpu locked Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". @@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h -index 7bd0a6f2ac2b..e643672fa802 100644 +index ee8f9f554a9e..2ad000e362bd 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -12,6 +12,7 @@ @@ -36,10 +36,10 @@ index 7bd0a6f2ac2b..e643672fa802 100644 extern void lru_cache_add_anon(struct page *page); extern void lru_cache_add_file(struct page *page); diff --git a/mm/compaction.c b/mm/compaction.c -index faca45ebe62d..f8ccb9d9daa3 100644 +index 5079ddbec8f9..c40d3a13cbbd 100644 --- a/mm/compaction.c +++ b/mm/compaction.c -@@ -1657,10 +1657,12 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro +@@ -1668,10 +1668,12 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro block_start_pfn(cc->migrate_pfn, cc->order); if (cc->last_migrated_pfn < current_block_start) { @@ -55,10 +55,10 @@ index faca45ebe62d..f8ccb9d9daa3 100644 cc->last_migrated_pfn = 0; } diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 99b3861b1ef6..1679f5883307 100644 +index d6f9be9c6635..a1547f1be42c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7207,8 +7207,9 @@ void __init free_area_init(unsigned long *zones_size) +@@ -7242,8 +7242,9 @@ void __init free_area_init(unsigned long *zones_size) static int page_alloc_cpu_dead(unsigned int cpu) { @@ -70,7 +70,7 @@ index 99b3861b1ef6..1679f5883307 100644 /* diff --git a/mm/swap.c b/mm/swap.c -index a3fc028e338e..4bac22ec1328 100644 +index 45fdbfb6b2a6..92f994b962f0 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -33,6 +33,7 @@ @@ -206,5 +206,5 @@ index a3fc028e338e..4bac22ec1328 100644 #ifdef CONFIG_SMP -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0078-mm-perform-lru_add_drain_all-remotely.patch b/kernel/patches-4.19.x-rt/0078-mm-perform-lru_add_drain_all-remotely.patch index 568e1f70f..8894d8756 100644 --- a/kernel/patches-4.19.x-rt/0078-mm-perform-lru_add_drain_all-remotely.patch +++ b/kernel/patches-4.19.x-rt/0078-mm-perform-lru_add_drain_all-remotely.patch @@ -1,7 +1,7 @@ -From f4f53c9fdf55676d783a4fbad5049f39401a0542 Mon Sep 17 00:00:00 2001 +From c48feb8fe1bad2aed0a15440a28da0bca8b5292a Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 27 May 2016 15:03:28 +0200 -Subject: [PATCH 078/283] mm: perform lru_add_drain_all() remotely +Subject: [PATCH 078/328] mm: perform lru_add_drain_all() remotely 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 @@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/mm/swap.c b/mm/swap.c -index 4bac22ec1328..0457927d3f0c 100644 +index 92f994b962f0..3885645a45ce 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -585,9 +585,15 @@ void lru_add_drain_cpu(int cpu) @@ -104,5 +104,5 @@ index 4bac22ec1328..0457927d3f0c 100644 mutex_unlock(&lock); } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0079-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch b/kernel/patches-4.19.x-rt/0079-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch index e86cd6984..5a2e64b68 100644 --- a/kernel/patches-4.19.x-rt/0079-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch +++ b/kernel/patches-4.19.x-rt/0079-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch @@ -1,7 +1,7 @@ -From 3e1b4a0068b41c1782264376379985fb992bd41e Mon Sep 17 00:00:00 2001 +From 4e41266214b4e88cf9fb9d2c20b5bbc83dcfbdcc Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:13 -0500 -Subject: [PATCH 079/283] mm/vmstat: Protect per cpu variables with preempt +Subject: [PATCH 079/328] mm/vmstat: Protect per cpu variables with preempt disable on RT Disable preemption on -RT for the vmstat code. On vanila the code runs in @@ -40,7 +40,7 @@ index f25cef84b41d..febee8649220 100644 static inline void count_vm_events(enum vm_event_item item, long delta) diff --git a/mm/vmstat.c b/mm/vmstat.c -index 4a387937f9f5..0cd11c5e3999 100644 +index ce81b0a7d018..cfa2a3bbdf91 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -320,6 +320,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item, @@ -140,5 +140,5 @@ index 4a387937f9f5..0cd11c5e3999 100644 void __dec_zone_page_state(struct page *page, enum zone_stat_item item) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0080-ARM-Initialize-split-page-table-locks-for-vector-pag.patch b/kernel/patches-4.19.x-rt/0080-ARM-Initialize-split-page-table-locks-for-vector-pag.patch index 8e1c123f1..df160893a 100644 --- a/kernel/patches-4.19.x-rt/0080-ARM-Initialize-split-page-table-locks-for-vector-pag.patch +++ b/kernel/patches-4.19.x-rt/0080-ARM-Initialize-split-page-table-locks-for-vector-pag.patch @@ -1,7 +1,7 @@ -From fb089e89b26bc5653a90d9983021813e15fa04d9 Mon Sep 17 00:00:00 2001 +From 5af4ea849237914c63d3fd50079e6975aa28f9b2 Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Sat, 1 Oct 2011 18:58:13 -0700 -Subject: [PATCH 080/283] ARM: Initialize split page table locks for vector +Subject: [PATCH 080/328] ARM: Initialize split page table locks for vector page Without this patch, ARM can not use SPLIT_PTLOCK_CPUS if @@ -71,5 +71,5 @@ index 82ab015bf42b..8d3c7ce34c24 100644 /* * The vectors page is always readable from user space for the -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0081-mm-Enable-SLUB-for-RT.patch b/kernel/patches-4.19.x-rt/0081-mm-Enable-SLUB-for-RT.patch index 27e96e11c..71ed40eb6 100644 --- a/kernel/patches-4.19.x-rt/0081-mm-Enable-SLUB-for-RT.patch +++ b/kernel/patches-4.19.x-rt/0081-mm-Enable-SLUB-for-RT.patch @@ -1,7 +1,7 @@ -From b01d03c695bcba2149713f4425c806b5b5e3410d Mon Sep 17 00:00:00 2001 +From 5bc9982e129b20ecb8f6c32d3d342af5087ffdae Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 25 Oct 2012 10:32:35 +0100 -Subject: [PATCH 081/283] mm: Enable SLUB for RT +Subject: [PATCH 081/328] mm: Enable SLUB for RT Avoid the memory allocation in IRQ section @@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 6 insertions(+) diff --git a/mm/slub.c b/mm/slub.c -index 7fd47a914f61..efd441e79e6f 100644 +index 224663e20772..cbe47408c6eb 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3680,6 +3680,11 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, @@ -37,5 +37,5 @@ index 7fd47a914f61..efd441e79e6f 100644 /* -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0082-slub-Enable-irqs-for-__GFP_WAIT.patch b/kernel/patches-4.19.x-rt/0082-slub-Enable-irqs-for-__GFP_WAIT.patch index fd0874e0b..feb440ef6 100644 --- a/kernel/patches-4.19.x-rt/0082-slub-Enable-irqs-for-__GFP_WAIT.patch +++ b/kernel/patches-4.19.x-rt/0082-slub-Enable-irqs-for-__GFP_WAIT.patch @@ -1,7 +1,7 @@ -From 14471a3281f661b8b8bccdb64820879a699fb2ad Mon Sep 17 00:00:00 2001 +From c908b13d5d4d0e1154b41e93d9fb8349b7b7197a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 9 Jan 2013 12:08:15 +0100 -Subject: [PATCH 082/283] slub: Enable irqs for __GFP_WAIT +Subject: [PATCH 082/328] slub: Enable irqs for __GFP_WAIT SYSTEM_RUNNING might be too late for enabling interrupts. Allocations with GFP_WAIT can happen before that. So use this as an indicator. @@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c -index efd441e79e6f..2240b51a0549 100644 +index cbe47408c6eb..81c32ceab228 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1570,10 +1570,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) @@ -43,5 +43,5 @@ index efd441e79e6f..2240b51a0549 100644 if (!page) return NULL; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0083-slub-Disable-SLUB_CPU_PARTIAL.patch b/kernel/patches-4.19.x-rt/0083-slub-Disable-SLUB_CPU_PARTIAL.patch index 8f6640441..e909d74b8 100644 --- a/kernel/patches-4.19.x-rt/0083-slub-Disable-SLUB_CPU_PARTIAL.patch +++ b/kernel/patches-4.19.x-rt/0083-slub-Disable-SLUB_CPU_PARTIAL.patch @@ -1,7 +1,7 @@ -From fb6bfe69057a4177f5f5b273cace7ea5cbb5f649 Mon Sep 17 00:00:00 2001 +From 41e0143022ef4180dafc14f033e72efa7ac652de Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 15 Apr 2015 19:00:47 +0200 -Subject: [PATCH 083/283] slub: Disable SLUB_CPU_PARTIAL +Subject: [PATCH 083/328] slub: Disable SLUB_CPU_PARTIAL |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 87, name: rcuop/7 @@ -49,5 +49,5 @@ index 61e8b531649b..b4e88fb19c26 100644 help Per cpu partial caches accellerate objects allocation and freeing -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0084-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/kernel/patches-4.19.x-rt/0084-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index 6b18cd5f7..51d1f568f 100644 --- a/kernel/patches-4.19.x-rt/0084-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/kernel/patches-4.19.x-rt/0084-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,7 +1,7 @@ -From b64de8d2bb376abf6af01c84a94e1a201aecc6ec Mon Sep 17 00:00:00 2001 +From 5d6ef143b9e65be0cda54dcea9150f3cfa951ffd Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Wed, 30 Oct 2013 11:48:33 -0700 -Subject: [PATCH 084/283] mm/memcontrol: Don't call schedule_work_on in +Subject: [PATCH 084/328] mm/memcontrol: Don't call schedule_work_on in preemption disabled context The following trace is triggered when running ltp oom test cases: @@ -48,10 +48,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index 7e7cc0cd89fe..174329de4779 100644 +index 3a3d109dce21..cf9e81fb342d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -2063,7 +2063,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) +@@ -2082,7 +2082,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) * as well as workers from this path always operate on the local * per-cpu data. CPU up doesn't touch memcg_stock at all. */ @@ -60,7 +60,7 @@ index 7e7cc0cd89fe..174329de4779 100644 for_each_online_cpu(cpu) { struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); struct mem_cgroup *memcg; -@@ -2083,7 +2083,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) +@@ -2102,7 +2102,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) } css_put(&memcg->css); } @@ -70,5 +70,5 @@ index 7e7cc0cd89fe..174329de4779 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0085-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch b/kernel/patches-4.19.x-rt/0085-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch index 1188a7203..278c8aa39 100644 --- a/kernel/patches-4.19.x-rt/0085-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch +++ b/kernel/patches-4.19.x-rt/0085-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch @@ -1,7 +1,7 @@ -From 3cb7dde3b41a847eefeac79763e46ce167c8521f Mon Sep 17 00:00:00 2001 +From ab73b56574e07b881a37aa1a4b0040a331352d7c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 28 Jan 2015 17:14:16 +0100 -Subject: [PATCH 085/283] mm/memcontrol: Replace local_irq_disable with local +Subject: [PATCH 085/328] mm/memcontrol: Replace local_irq_disable with local locks There are a few local_irq_disable() which then take sleeping locks. This @@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index 174329de4779..d0f245d80f93 100644 +index cf9e81fb342d..421ac74450f6 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -69,6 +69,7 @@ @@ -33,7 +33,7 @@ index 174329de4779..d0f245d80f93 100644 /* Whether legacy memory+swap accounting is active */ static bool do_memsw_account(void) { -@@ -4884,12 +4887,12 @@ static int mem_cgroup_move_account(struct page *page, +@@ -4922,12 +4925,12 @@ static int mem_cgroup_move_account(struct page *page, ret = 0; @@ -48,7 +48,7 @@ index 174329de4779..d0f245d80f93 100644 out_unlock: unlock_page(page); out: -@@ -6008,10 +6011,10 @@ void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, +@@ -6046,10 +6049,10 @@ void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, commit_charge(page, memcg, lrucare); @@ -61,7 +61,7 @@ index 174329de4779..d0f245d80f93 100644 if (do_memsw_account() && PageSwapCache(page)) { swp_entry_t entry = { .val = page_private(page) }; -@@ -6080,7 +6083,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) +@@ -6118,7 +6121,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) memcg_oom_recover(ug->memcg); } @@ -70,7 +70,7 @@ index 174329de4779..d0f245d80f93 100644 __mod_memcg_state(ug->memcg, MEMCG_RSS, -ug->nr_anon); __mod_memcg_state(ug->memcg, MEMCG_CACHE, -ug->nr_file); __mod_memcg_state(ug->memcg, MEMCG_RSS_HUGE, -ug->nr_huge); -@@ -6088,7 +6091,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) +@@ -6126,7 +6129,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) __count_memcg_events(ug->memcg, PGPGOUT, ug->pgpgout); __this_cpu_add(ug->memcg->stat_cpu->nr_page_events, nr_pages); memcg_check_events(ug->memcg, ug->dummy_page); @@ -79,7 +79,7 @@ index 174329de4779..d0f245d80f93 100644 if (!mem_cgroup_is_root(ug->memcg)) css_put_many(&ug->memcg->css, nr_pages); -@@ -6251,10 +6254,10 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) +@@ -6289,10 +6292,10 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) commit_charge(newpage, memcg, false); @@ -92,7 +92,7 @@ index 174329de4779..d0f245d80f93 100644 } DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); -@@ -6446,6 +6449,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) +@@ -6484,6 +6487,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) struct mem_cgroup *memcg, *swap_memcg; unsigned int nr_entries; unsigned short oldid; @@ -100,7 +100,7 @@ index 174329de4779..d0f245d80f93 100644 VM_BUG_ON_PAGE(PageLRU(page), page); VM_BUG_ON_PAGE(page_count(page), page); -@@ -6491,13 +6495,17 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) +@@ -6529,13 +6533,17 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) * important here to have the interrupts disabled because it is the * only synchronisation we have for updating the per-CPU variables. */ @@ -119,5 +119,5 @@ index 174329de4779..d0f245d80f93 100644 /** -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0086-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch b/kernel/patches-4.19.x-rt/0086-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch index 2639dfede..dc8f568c2 100644 --- a/kernel/patches-4.19.x-rt/0086-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch +++ b/kernel/patches-4.19.x-rt/0086-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch @@ -1,7 +1,7 @@ -From 50eae40f0475c039a273e2f5441f4ecda84d104e Mon Sep 17 00:00:00 2001 +From c8eeca08279f6363742db822856cc18ae1b7bdbd Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Tue, 22 Mar 2016 11:16:09 +0100 -Subject: [PATCH 086/283] mm/zsmalloc: copy with get_cpu_var() and locking +Subject: [PATCH 086/328] mm/zsmalloc: copy with get_cpu_var() and locking get_cpu_var() disables preemption and triggers a might_sleep() splat later. This is replaced with get_locked_var(). @@ -17,18 +17,18 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c -index 9da65552e7ca..63c193c1ff96 100644 +index 85cc29c93d93..63e83b47fa99 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c -@@ -55,6 +55,7 @@ - #include +@@ -56,6 +56,7 @@ + #include #include #include +#include #define ZSPAGE_MAGIC 0x58 -@@ -72,9 +73,22 @@ +@@ -73,9 +74,22 @@ */ #define ZS_MAX_ZSPAGE_ORDER 2 #define ZS_MAX_PAGES_PER_ZSPAGE (_AC(1, UL) << ZS_MAX_ZSPAGE_ORDER) @@ -52,7 +52,7 @@ index 9da65552e7ca..63c193c1ff96 100644 /* * Object location (, ) is encoded as * as single (unsigned long) handle value. -@@ -320,7 +334,7 @@ static void SetZsPageMovable(struct zs_pool *pool, struct zspage *zspage) {} +@@ -325,7 +339,7 @@ static void SetZsPageMovable(struct zs_pool *pool, struct zspage *zspage) {} static int create_cache(struct zs_pool *pool) { @@ -61,7 +61,7 @@ index 9da65552e7ca..63c193c1ff96 100644 0, 0, NULL); if (!pool->handle_cachep) return 1; -@@ -344,10 +358,27 @@ static void destroy_cache(struct zs_pool *pool) +@@ -349,10 +363,27 @@ static void destroy_cache(struct zs_pool *pool) static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp) { @@ -91,7 +91,7 @@ index 9da65552e7ca..63c193c1ff96 100644 static void cache_free_handle(struct zs_pool *pool, unsigned long handle) { kmem_cache_free(pool->handle_cachep, (void *)handle); -@@ -366,12 +397,18 @@ static void cache_free_zspage(struct zs_pool *pool, struct zspage *zspage) +@@ -371,12 +402,18 @@ static void cache_free_zspage(struct zs_pool *pool, struct zspage *zspage) static void record_obj(unsigned long handle, unsigned long obj) { @@ -110,7 +110,7 @@ index 9da65552e7ca..63c193c1ff96 100644 } /* zpool driver */ -@@ -453,6 +490,7 @@ MODULE_ALIAS("zpool-zsmalloc"); +@@ -458,6 +495,7 @@ MODULE_ALIAS("zpool-zsmalloc"); /* per-cpu VM mapping areas for zspage accesses that cross page boundaries */ static DEFINE_PER_CPU(struct mapping_area, zs_map_area); @@ -118,7 +118,7 @@ index 9da65552e7ca..63c193c1ff96 100644 static bool is_zspage_isolated(struct zspage *zspage) { -@@ -882,7 +920,13 @@ static unsigned long location_to_obj(struct page *page, unsigned int obj_idx) +@@ -887,7 +925,13 @@ static unsigned long location_to_obj(struct page *page, unsigned int obj_idx) static unsigned long handle_to_obj(unsigned long handle) { @@ -132,7 +132,7 @@ index 9da65552e7ca..63c193c1ff96 100644 } static unsigned long obj_to_head(struct page *page, void *obj) -@@ -896,22 +940,46 @@ static unsigned long obj_to_head(struct page *page, void *obj) +@@ -901,22 +945,46 @@ static unsigned long obj_to_head(struct page *page, void *obj) static inline int testpin_tag(unsigned long handle) { @@ -179,7 +179,7 @@ index 9da65552e7ca..63c193c1ff96 100644 } static void reset_page(struct page *page) -@@ -1337,7 +1405,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, +@@ -1342,7 +1410,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, class = pool->size_class[class_idx]; off = (class->size * obj_idx) & ~PAGE_MASK; @@ -188,7 +188,7 @@ index 9da65552e7ca..63c193c1ff96 100644 area->vm_mm = mm; if (off + class->size <= PAGE_SIZE) { /* this object is contained entirely within a page */ -@@ -1391,7 +1459,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) +@@ -1396,7 +1464,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) __zs_unmap_object(area, pages, off, class->size); } @@ -198,5 +198,5 @@ index 9da65552e7ca..63c193c1ff96 100644 migrate_read_unlock(zspage); unpin_tag(handle); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0087-x86-mm-pat-disable-preemption-__split_large_page-aft.patch b/kernel/patches-4.19.x-rt/0087-x86-mm-pat-disable-preemption-__split_large_page-aft.patch index 1b991502b..b5589878b 100644 --- a/kernel/patches-4.19.x-rt/0087-x86-mm-pat-disable-preemption-__split_large_page-aft.patch +++ b/kernel/patches-4.19.x-rt/0087-x86-mm-pat-disable-preemption-__split_large_page-aft.patch @@ -1,7 +1,7 @@ -From 3d625e1fb1f5adff8191330efe6d47017b0806bd Mon Sep 17 00:00:00 2001 +From 58952b3995a060f4fc7fbc02552ac489639d565e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 11 Dec 2018 21:53:43 +0100 -Subject: [PATCH 087/283] x86/mm/pat: disable preemption __split_large_page() +Subject: [PATCH 087/328] x86/mm/pat: disable preemption __split_large_page() after spin_lock() Commit "x86/mm/pat: Disable preemption around __flush_tlb_all()" added a @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 8 insertions(+) diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c -index e2d4b25c7aa4..9626ebb9e3c8 100644 +index 101f3ad0d6ad..0b0396261ca1 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -687,12 +687,18 @@ __split_large_page(struct cpa_data *cpa, pte_t *kpte, unsigned long address, @@ -57,5 +57,5 @@ index e2d4b25c7aa4..9626ebb9e3c8 100644 return 0; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0088-radix-tree-use-local-locks.patch b/kernel/patches-4.19.x-rt/0088-radix-tree-use-local-locks.patch index 7e37768f9..883509d16 100644 --- a/kernel/patches-4.19.x-rt/0088-radix-tree-use-local-locks.patch +++ b/kernel/patches-4.19.x-rt/0088-radix-tree-use-local-locks.patch @@ -1,7 +1,7 @@ -From 0a7a65a5055b7a5a94c57ee2dc8404116cff804b Mon Sep 17 00:00:00 2001 +From 7f7e6402ea1895f3d2197122d4379c46a3a7fe14 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 25 Jan 2017 16:34:27 +0100 -Subject: [PATCH 088/283] radix-tree: use local locks +Subject: [PATCH 088/328] radix-tree: use local locks The preload functionality uses per-CPU variables and preempt-disable to ensure that it does not switch CPUs during its usage. This patch adds @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/include/linux/idr.h b/include/linux/idr.h -index 3ec8628ce17f..54af68158f7d 100644 +index b6c6151c7446..81c9df5c04fa 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h @@ -169,10 +169,7 @@ static inline bool idr_is_empty(const struct idr *idr) @@ -59,7 +59,7 @@ index 34149e8b5f73..affb0fc4c5b6 100644 int radix_tree_split(struct radix_tree_root *, unsigned long index, unsigned new_order); diff --git a/lib/radix-tree.c b/lib/radix-tree.c -index bc03ecc4dfd2..44257463f683 100644 +index e5cab5c4e383..9309e813bc1f 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -38,7 +38,7 @@ @@ -171,5 +171,5 @@ index bc03ecc4dfd2..44257463f683 100644 if (!this_cpu_read(ida_bitmap)) { struct ida_bitmap *bitmap = kzalloc(sizeof(*bitmap), gfp); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0089-timers-Prepare-for-full-preemption.patch b/kernel/patches-4.19.x-rt/0089-timers-Prepare-for-full-preemption.patch index 7edf7ae23..1b9809ecd 100644 --- a/kernel/patches-4.19.x-rt/0089-timers-Prepare-for-full-preemption.patch +++ b/kernel/patches-4.19.x-rt/0089-timers-Prepare-for-full-preemption.patch @@ -1,7 +1,7 @@ -From 5bbf9de052f34cd8d685120f60da34937f2b0772 Mon Sep 17 00:00:00 2001 +From bb113ab4c9dea8e53db84af84d34864c4f3e9b2d Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 -Subject: [PATCH 089/283] timers: Prepare for full preemption +Subject: [PATCH 089/328] timers: Prepare for full preemption 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 @@ -29,7 +29,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 7a39d56f6a6b..5de80f29ef57 100644 +index e6022cc2605b..986ed04425be 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -498,11 +498,14 @@ void resched_cpu(int cpu) @@ -59,7 +59,7 @@ index 7a39d56f6a6b..5de80f29ef57 100644 } diff --git a/kernel/time/timer.c b/kernel/time/timer.c -index fa49cd753dea..bbe24e241643 100644 +index ae64cb819a9a..9019c9caf146 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -44,6 +44,7 @@ @@ -150,7 +150,7 @@ index fa49cd753dea..bbe24e241643 100644 raw_spin_lock_irq(&base->lock); } } -@@ -1681,8 +1715,8 @@ static inline void __run_timers(struct timer_base *base) +@@ -1683,8 +1717,8 @@ static inline void __run_timers(struct timer_base *base) while (levels--) expire_timers(base, heads + levels); } @@ -160,7 +160,7 @@ index fa49cd753dea..bbe24e241643 100644 } /* -@@ -1927,6 +1961,9 @@ static void __init init_timer_cpu(int cpu) +@@ -1929,6 +1963,9 @@ static void __init init_timer_cpu(int cpu) base->cpu = cpu; raw_spin_lock_init(&base->lock); base->clk = jiffies; @@ -171,5 +171,5 @@ index fa49cd753dea..bbe24e241643 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0090-x86-kvm-Require-const-tsc-for-RT.patch b/kernel/patches-4.19.x-rt/0090-x86-kvm-Require-const-tsc-for-RT.patch index a6b3954fa..2d63f704a 100644 --- a/kernel/patches-4.19.x-rt/0090-x86-kvm-Require-const-tsc-for-RT.patch +++ b/kernel/patches-4.19.x-rt/0090-x86-kvm-Require-const-tsc-for-RT.patch @@ -1,7 +1,7 @@ -From 49f95baf1667e4853406b63d30062b94afff4a25 Mon Sep 17 00:00:00 2001 +From c87615728aaaf5a59575f49682ed6339a9cb116f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 6 Nov 2011 12:26:18 +0100 -Subject: [PATCH 090/283] x86: kvm Require const tsc for RT +Subject: [PATCH 090/328] x86: kvm Require const tsc for RT Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds @@ -14,10 +14,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 cea6568667c4..c90545667fd6 100644 +index ade694f94a49..2dfb7c81743e 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -6756,6 +6756,13 @@ int kvm_arch_init(void *opaque) +@@ -6873,6 +6873,13 @@ int kvm_arch_init(void *opaque) goto out; } @@ -32,5 +32,5 @@ index cea6568667c4..c90545667fd6 100644 if (r) goto out_free_percpu; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0091-pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/kernel/patches-4.19.x-rt/0091-pci-switchtec-Don-t-use-completion-s-wait-queue.patch index 0e73ede1d..b46e06c28 100644 --- a/kernel/patches-4.19.x-rt/0091-pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/kernel/patches-4.19.x-rt/0091-pci-switchtec-Don-t-use-completion-s-wait-queue.patch @@ -1,7 +1,7 @@ -From 99fc3867798d14c5cff8c71c3872af84605d572d Mon Sep 17 00:00:00 2001 +From d46161e1a4fa5ff7b32deb64ac2e7698d0a56e49 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 10:24:23 +0200 -Subject: [PATCH 091/283] pci/switchtec: Don't use completion's wait queue +Subject: [PATCH 091/328] pci/switchtec: Don't use completion's wait queue 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 @@ -23,7 +23,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 72db2e0ebced..77d4fb86d05b 100644 +index 43431816412c..a8df847bedee 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -43,10 +43,11 @@ struct switchtec_user { @@ -48,7 +48,7 @@ index 72db2e0ebced..77d4fb86d05b 100644 stuser->event_cnt = atomic_read(&stdev->event_cnt); dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); -@@ -151,7 +152,7 @@ static int mrpc_queue_cmd(struct switchtec_user *stuser) +@@ -147,7 +148,7 @@ static int mrpc_queue_cmd(struct switchtec_user *stuser) kref_get(&stuser->kref); stuser->read_len = sizeof(stuser->data); stuser_set_state(stuser, MRPC_QUEUED); @@ -57,7 +57,7 @@ index 72db2e0ebced..77d4fb86d05b 100644 list_add_tail(&stuser->list, &stdev->mrpc_queue); mrpc_cmd_submit(stdev); -@@ -188,7 +189,8 @@ static void mrpc_complete_cmd(struct switchtec_dev *stdev) +@@ -184,7 +185,8 @@ static void mrpc_complete_cmd(struct switchtec_dev *stdev) stuser->read_len); out: @@ -67,7 +67,7 @@ index 72db2e0ebced..77d4fb86d05b 100644 list_del_init(&stuser->list); stuser_put(stuser); stdev->mrpc_busy = 0; -@@ -458,10 +460,11 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data, +@@ -454,10 +456,11 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data, mutex_unlock(&stdev->mrpc_mutex); if (filp->f_flags & O_NONBLOCK) { @@ -81,7 +81,7 @@ index 72db2e0ebced..77d4fb86d05b 100644 if (rc < 0) return rc; } -@@ -509,7 +512,7 @@ static __poll_t switchtec_dev_poll(struct file *filp, poll_table *wait) +@@ -505,7 +508,7 @@ static __poll_t switchtec_dev_poll(struct file *filp, poll_table *wait) struct switchtec_dev *stdev = stuser->stdev; __poll_t ret = 0; @@ -90,7 +90,7 @@ index 72db2e0ebced..77d4fb86d05b 100644 poll_wait(filp, &stdev->event_wq, wait); if (lock_mutex_and_test_alive(stdev)) -@@ -517,7 +520,7 @@ static __poll_t switchtec_dev_poll(struct file *filp, poll_table *wait) +@@ -513,7 +516,7 @@ static __poll_t switchtec_dev_poll(struct file *filp, poll_table *wait) mutex_unlock(&stdev->mrpc_mutex); @@ -99,7 +99,7 @@ index 72db2e0ebced..77d4fb86d05b 100644 ret |= EPOLLIN | EPOLLRDNORM; if (stuser->event_cnt != atomic_read(&stdev->event_cnt)) -@@ -1041,7 +1044,8 @@ static void stdev_kill(struct switchtec_dev *stdev) +@@ -1037,7 +1040,8 @@ static void stdev_kill(struct switchtec_dev *stdev) /* Wake up and kill any users waiting on an MRPC request */ list_for_each_entry_safe(stuser, tmpuser, &stdev->mrpc_queue, list) { @@ -110,5 +110,5 @@ index 72db2e0ebced..77d4fb86d05b 100644 stuser_put(stuser); } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0092-wait.h-include-atomic.h.patch b/kernel/patches-4.19.x-rt/0092-wait.h-include-atomic.h.patch index 0d975c37a..4e02896e0 100644 --- a/kernel/patches-4.19.x-rt/0092-wait.h-include-atomic.h.patch +++ b/kernel/patches-4.19.x-rt/0092-wait.h-include-atomic.h.patch @@ -1,7 +1,7 @@ -From 88037fc07062d469557427c97507d3f95d7ca3a6 Mon Sep 17 00:00:00 2001 +From 5048f6148f091b822260d482639172336a66cbc3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 28 Oct 2013 12:19:57 +0100 -Subject: [PATCH 092/283] wait.h: include atomic.h +Subject: [PATCH 092/328] wait.h: include atomic.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -37,5 +37,5 @@ index ed7c122cb31f..2b5ef8e94d19 100644 typedef struct wait_queue_entry wait_queue_entry_t; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0093-work-simple-Simple-work-queue-implemenation.patch b/kernel/patches-4.19.x-rt/0093-work-simple-Simple-work-queue-implemenation.patch index 3489114bc..8dc5a28a1 100644 --- a/kernel/patches-4.19.x-rt/0093-work-simple-Simple-work-queue-implemenation.patch +++ b/kernel/patches-4.19.x-rt/0093-work-simple-Simple-work-queue-implemenation.patch @@ -1,7 +1,7 @@ -From 67478d9c6704de32600fd4363f3853bcdffcf391 Mon Sep 17 00:00:00 2001 +From 370c2439db620266b1bb104cc624841eec515e5c Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 11 Jul 2014 15:26:11 +0200 -Subject: [PATCH 093/283] work-simple: Simple work queue implemenation +Subject: [PATCH 093/328] work-simple: Simple work queue implemenation Provides a framework for enqueuing callbacks from irq context PREEMPT_RT_FULL safe. The callbacks are executed in kthread context. @@ -241,5 +241,5 @@ index 000000000000..a5b89fdacf19 +} +EXPORT_SYMBOL_GPL(swork_put); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0094-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch b/kernel/patches-4.19.x-rt/0094-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch index 92c4a2856..d3f38820c 100644 --- a/kernel/patches-4.19.x-rt/0094-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch +++ b/kernel/patches-4.19.x-rt/0094-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch @@ -1,7 +1,7 @@ -From 147a7822bfe8f027b88fa0ca82ae0d210e57bf34 Mon Sep 17 00:00:00 2001 +From 8c88098a7081d7cd354fb9e2a64598e6e10ce525 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 10 Sep 2018 18:00:31 +0200 -Subject: [PATCH 094/283] work-simple: drop a shit statement in +Subject: [PATCH 094/328] work-simple: drop a shit statement in SWORK_EVENT_PENDING Dan Carpenter reported @@ -32,5 +32,5 @@ index a5b89fdacf19..c90d14b9b126 100644 static DEFINE_MUTEX(worker_mutex); static struct sworker *glob_worker; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0095-completion-Use-simple-wait-queues.patch b/kernel/patches-4.19.x-rt/0095-completion-Use-simple-wait-queues.patch index 6ef29cbb9..1a63fb2da 100644 --- a/kernel/patches-4.19.x-rt/0095-completion-Use-simple-wait-queues.patch +++ b/kernel/patches-4.19.x-rt/0095-completion-Use-simple-wait-queues.patch @@ -1,7 +1,7 @@ -From 334dc78522991ee04c4704a53d24f0009be71172 Mon Sep 17 00:00:00 2001 +From ae24940034c02ed671e3a5cc9c4cf31ebfc24fed Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 11 Jan 2013 11:23:51 +0100 -Subject: [PATCH 095/283] completion: Use simple wait queues +Subject: [PATCH 095/328] completion: Use simple wait queues Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the @@ -39,7 +39,7 @@ index e7075aaff1bb..1580464a9d5b 100644 res = -EINTR; if (res) { diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c -index 94ad6fe29e69..52a49f0bbc19 100644 +index b704e4bce171..c364abaac548 100644 --- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c @@ -697,8 +697,8 @@ static void ezusb_req_ctx_wait(struct ezusb_priv *upriv, @@ -54,10 +54,10 @@ index 94ad6fe29e69..52a49f0bbc19 100644 break; default: diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c -index aa15593a3ac4..5e9269cd14fa 100644 +index 2050993fb58b..e2ca75a6e241 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c -@@ -1624,7 +1624,7 @@ static void ffs_data_put(struct ffs_data *ffs) +@@ -1626,7 +1626,7 @@ static void ffs_data_put(struct ffs_data *ffs) pr_info("%s(): freeing\n", __func__); ffs_data_clear(ffs); BUG_ON(waitqueue_active(&ffs->ev.waitq) || @@ -319,10 +319,10 @@ index a1ad5b7d5521..755a58084978 100644 } EXPORT_SYMBOL(completion_done); diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 5de80f29ef57..337cc72e6a6a 100644 +index 986ed04425be..584978640512 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7116,7 +7116,10 @@ void migrate_disable(void) +@@ -7154,7 +7154,10 @@ void migrate_disable(void) return; } #ifdef CONFIG_SCHED_DEBUG @@ -334,7 +334,7 @@ index 5de80f29ef57..337cc72e6a6a 100644 #endif if (p->migrate_disable) { -@@ -7146,7 +7149,10 @@ void migrate_enable(void) +@@ -7184,7 +7187,10 @@ void migrate_enable(void) } #ifdef CONFIG_SCHED_DEBUG @@ -386,5 +386,5 @@ index 66b59ac77c22..c7cb30cdd1b7 100644 wait->task = current; if (list_empty(&wait->task_list)) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0096-fs-aio-simple-simple-work.patch b/kernel/patches-4.19.x-rt/0096-fs-aio-simple-simple-work.patch index 077962d3e..c54f8c1db 100644 --- a/kernel/patches-4.19.x-rt/0096-fs-aio-simple-simple-work.patch +++ b/kernel/patches-4.19.x-rt/0096-fs-aio-simple-simple-work.patch @@ -1,7 +1,7 @@ -From b576efb7cedb58ffa58242d7b0df24d14063ba0e Mon Sep 17 00:00:00 2001 +From 4ab27b1ec5f678a5dd444c6e1d3cdff6eeabfa12 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 16 Feb 2015 18:49:10 +0100 -Subject: [PATCH 096/283] fs/aio: simple simple work +Subject: [PATCH 096/328] fs/aio: simple simple work |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:768 |in_atomic(): 1, irqs_disabled(): 0, pid: 26, name: rcuos/2 @@ -29,7 +29,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 911e23087dfb..16dcf8521c2c 100644 +index b5fbf2061868..93f8cf7fdeab 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -42,6 +42,7 @@ @@ -84,5 +84,5 @@ index 911e23087dfb..16dcf8521c2c 100644 { unsigned i, new_nr; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0097-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch b/kernel/patches-4.19.x-rt/0097-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch index dc3f70a2c..4d7bb8075 100644 --- a/kernel/patches-4.19.x-rt/0097-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/kernel/patches-4.19.x-rt/0097-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,7 +1,7 @@ -From bac483c38a96edeadc43fa8dcf03c3e57c41cc62 Mon Sep 17 00:00:00 2001 +From d349b691ea7fdefe94bb546a0533b63786c1857d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 21 Aug 2013 17:48:46 +0200 -Subject: [PATCH 097/283] genirq: Do not invoke the affinity callback via a +Subject: [PATCH 097/328] genirq: Do not invoke the affinity callback via a workqueue on RT Joe Korty reported, that __irq_set_affinity_locked() schedules a @@ -48,10 +48,10 @@ index 315f852b4981..a943c07b54ba 100644 void (*release)(struct kref *ref); }; diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index c3b9f6dacd8f..af2a8757abfb 100644 +index 3c26d0708709..eadcbfbd434a 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, +@@ -285,7 +285,12 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, if (desc->affinity_notify) { kref_get(&desc->affinity_notify->kref); @@ -64,7 +64,7 @@ index c3b9f6dacd8f..af2a8757abfb 100644 } irqd_set(data, IRQD_AFFINITY_SET); -@@ -297,10 +302,8 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) +@@ -323,10 +328,8 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) } EXPORT_SYMBOL_GPL(irq_set_affinity_hint); @@ -76,7 +76,7 @@ index c3b9f6dacd8f..af2a8757abfb 100644 struct irq_desc *desc = irq_to_desc(notify->irq); cpumask_var_t cpumask; unsigned long flags; -@@ -322,6 +325,35 @@ static void irq_affinity_notify(struct work_struct *work) +@@ -348,6 +351,35 @@ static void irq_affinity_notify(struct work_struct *work) kref_put(¬ify->kref, notify->release); } @@ -112,7 +112,7 @@ index c3b9f6dacd8f..af2a8757abfb 100644 /** * irq_set_affinity_notifier - control notification of IRQ affinity changes * @irq: Interrupt for which to enable/disable notification -@@ -350,7 +382,12 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) +@@ -376,7 +408,12 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) if (notify) { notify->irq = irq; kref_init(¬ify->kref); @@ -125,7 +125,7 @@ index c3b9f6dacd8f..af2a8757abfb 100644 } raw_spin_lock_irqsave(&desc->lock, flags); -@@ -359,7 +396,10 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) +@@ -385,7 +422,10 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) raw_spin_unlock_irqrestore(&desc->lock, flags); if (old_notify) { @@ -137,5 +137,5 @@ index c3b9f6dacd8f..af2a8757abfb 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0098-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch b/kernel/patches-4.19.x-rt/0098-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch index 0e1a7aaa2..dce3d07e0 100644 --- a/kernel/patches-4.19.x-rt/0098-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +++ b/kernel/patches-4.19.x-rt/0098-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch @@ -1,7 +1,7 @@ -From 7ada38687fe4d4f0ff8b7390d1588f7fed28a28d Mon Sep 17 00:00:00 2001 +From 059e9b393e1838e4ad06a521a8e11c21e7ea7919 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 15 Nov 2017 17:29:51 +0100 -Subject: [PATCH 098/283] time/hrtimer: avoid schedule_work() with interrupts +Subject: [PATCH 098/328] time/hrtimer: avoid schedule_work() with interrupts disabled The NOHZ code tries to schedule a workqueue with interrupts disabled. @@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c -index bbe24e241643..696e7583137c 100644 +index 9019c9caf146..3fab1c50bf1b 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -217,8 +217,7 @@ static DEFINE_PER_CPU(struct timer_base, timer_bases[NR_BASES]); @@ -55,5 +55,5 @@ index bbe24e241643..696e7583137c 100644 void __user *buffer, size_t *lenp, loff_t *ppos) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0099-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/kernel/patches-4.19.x-rt/0099-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index b63eb5494..3048a89a5 100644 --- a/kernel/patches-4.19.x-rt/0099-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/kernel/patches-4.19.x-rt/0099-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -1,7 +1,7 @@ -From 2decd81945344204be663182b0eac46997f297b2 Mon Sep 17 00:00:00 2001 +From 10f79182845e34e88499d6ef178e5a7e79a1f0b5 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 11:25:41 +0200 -Subject: [PATCH 099/283] hrtimer: consolidate hrtimer_init() + +Subject: [PATCH 099/328] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() calls hrtimer_init_sleeper() calls require a prior initialisation of the @@ -27,7 +27,7 @@ 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 70d839b9c3b0..e3e7a88e03a6 100644 +index 684acaa96db7..4aa3284874f6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3128,10 +3128,9 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, @@ -43,10 +43,10 @@ index 70d839b9c3b0..e3e7a88e03a6 100644 if (blk_mq_rq_state(rq) == MQ_RQ_COMPLETE) break; diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c -index 22571abcaa4e..78a529d363f3 100644 +index 034d86869772..d089b2cb5dd7 100644 --- a/drivers/staging/android/vsoc.c +++ b/drivers/staging/android/vsoc.c -@@ -437,12 +437,10 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg) +@@ -438,12 +438,10 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg) return -EINVAL; wake_time = ktime_set(arg->wake_time_sec, arg->wake_time_nsec); @@ -62,7 +62,7 @@ index 22571abcaa4e..78a529d363f3 100644 while (1) { diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h -index 3892e9c8b2de..b8bbaabd5aff 100644 +index 542b4fa2cda9..cbd041b22088 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -364,10 +364,17 @@ DECLARE_PER_CPU(struct tick_device, tick_cpu_device); @@ -99,7 +99,7 @@ index 3892e9c8b2de..b8bbaabd5aff 100644 static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } #endif -@@ -480,9 +496,6 @@ extern long hrtimer_nanosleep(const struct timespec64 *rqtp, +@@ -486,9 +502,6 @@ extern long hrtimer_nanosleep(const struct timespec64 *rqtp, const enum hrtimer_mode mode, const clockid_t clockid); @@ -125,10 +125,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 304f07d08c95..ccf933ac2997 100644 +index 5c8053098fc8..23e1f8a478e8 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2701,10 +2701,9 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, +@@ -2704,10 +2704,9 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, if (abs_time) { to = &timeout; @@ -142,7 +142,7 @@ index 304f07d08c95..ccf933ac2997 100644 hrtimer_set_expires_range_ns(&to->timer, *abs_time, current->timer_slack_ns); } -@@ -2803,9 +2802,8 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2806,9 +2805,8 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, if (time) { to = &timeout; @@ -154,7 +154,7 @@ index 304f07d08c95..ccf933ac2997 100644 hrtimer_set_expires(&to->timer, *time); } -@@ -3242,10 +3240,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3245,10 +3243,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, if (abs_time) { to = &timeout; @@ -169,10 +169,10 @@ index 304f07d08c95..ccf933ac2997 100644 current->timer_slack_ns); } diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index e1a549c9e399..4f43ece42f3b 100644 +index 7362554416fd..c6f755495a63 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1648,13 +1648,44 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer) +@@ -1651,13 +1651,44 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer) return HRTIMER_NORESTART; } @@ -218,7 +218,7 @@ index e1a549c9e399..4f43ece42f3b 100644 int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) { switch(restart->nanosleep.type) { -@@ -1678,8 +1709,6 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod +@@ -1681,8 +1712,6 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod { struct restart_block *restart; @@ -227,7 +227,7 @@ index e1a549c9e399..4f43ece42f3b 100644 do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t->timer, mode); -@@ -1716,10 +1745,9 @@ static long __sched hrtimer_nanosleep_restart(struct restart_block *restart) +@@ -1719,10 +1748,9 @@ static long __sched hrtimer_nanosleep_restart(struct restart_block *restart) struct hrtimer_sleeper t; int ret; @@ -240,7 +240,7 @@ index e1a549c9e399..4f43ece42f3b 100644 ret = do_nanosleep(&t, HRTIMER_MODE_ABS); destroy_hrtimer_on_stack(&t.timer); return ret; -@@ -1737,7 +1765,7 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp, +@@ -1740,7 +1768,7 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp, if (dl_task(current) || rt_task(current)) slack = 0; @@ -249,7 +249,7 @@ index e1a549c9e399..4f43ece42f3b 100644 hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); ret = do_nanosleep(&t, mode); if (ret != -ERESTART_RESTARTBLOCK) -@@ -1936,11 +1964,9 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, +@@ -1939,11 +1967,9 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, return -EINTR; } @@ -285,5 +285,5 @@ index 092fa3d75b32..9d472d626aaa 100644 set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0100-hrtimers-Prepare-full-preemption.patch b/kernel/patches-4.19.x-rt/0100-hrtimers-Prepare-full-preemption.patch index 911522b9c..757d56dfe 100644 --- a/kernel/patches-4.19.x-rt/0100-hrtimers-Prepare-full-preemption.patch +++ b/kernel/patches-4.19.x-rt/0100-hrtimers-Prepare-full-preemption.patch @@ -1,7 +1,7 @@ -From 15ee476637495474369f2b444a8ae5c041e59ed4 Mon Sep 17 00:00:00 2001 +From 46ce0d2ba1077d583aa36bef4e8ffb712246bf2e Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 -Subject: [PATCH 100/283] hrtimers: Prepare full preemption +Subject: [PATCH 100/328] hrtimers: Prepare full preemption Make cancellation of a running callback in softirq context safe against preemption. @@ -35,7 +35,7 @@ index d69ad801eb80..82d0f52414a6 100644 /* diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h -index b8bbaabd5aff..73ad7309436a 100644 +index cbd041b22088..8714f1a37d84 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -22,6 +22,7 @@ @@ -70,7 +70,7 @@ index b8bbaabd5aff..73ad7309436a 100644 /* Query timers: */ extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust); -@@ -458,7 +469,7 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) +@@ -464,7 +475,7 @@ static inline bool hrtimer_is_queued(struct hrtimer *timer) * Helper function to check, whether the timer is running the callback * function */ @@ -94,10 +94,10 @@ index ee7e987ea1b4..0571b498db73 100644 void run_posix_cpu_timers(struct task_struct *task); diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c -index fdeb9bc6affb..966708e8ce14 100644 +index 9eece67f29f3..a465564367ec 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c -@@ -436,7 +436,7 @@ int alarm_cancel(struct alarm *alarm) +@@ -438,7 +438,7 @@ int alarm_cancel(struct alarm *alarm) int ret = alarm_try_to_cancel(alarm); if (ret >= 0) return ret; @@ -107,7 +107,7 @@ index fdeb9bc6affb..966708e8ce14 100644 } EXPORT_SYMBOL_GPL(alarm_cancel); diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index 4f43ece42f3b..923a650e5c35 100644 +index c6f755495a63..e135cb27db39 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -939,6 +939,33 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) @@ -144,7 +144,7 @@ index 4f43ece42f3b..923a650e5c35 100644 /* * enqueue_hrtimer - internal function to (re)start a timer * -@@ -1171,7 +1198,7 @@ int hrtimer_cancel(struct hrtimer *timer) +@@ -1174,7 +1201,7 @@ int hrtimer_cancel(struct hrtimer *timer) if (ret >= 0) return ret; @@ -153,7 +153,7 @@ index 4f43ece42f3b..923a650e5c35 100644 } } EXPORT_SYMBOL_GPL(hrtimer_cancel); -@@ -1477,6 +1504,7 @@ static __latent_entropy void hrtimer_run_softirq(struct softirq_action *h) +@@ -1480,6 +1507,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); @@ -161,7 +161,7 @@ index 4f43ece42f3b..923a650e5c35 100644 } #ifdef CONFIG_HIGH_RES_TIMERS -@@ -1846,6 +1874,9 @@ int hrtimers_prepare_cpu(unsigned int cpu) +@@ -1849,6 +1877,9 @@ 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; @@ -285,5 +285,5 @@ index 5a01c4fdbfef..a5ec421e3437 100644 } list_del(&timer->list); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0101-hrtimer-by-timers-by-default-into-the-softirq-contex.patch b/kernel/patches-4.19.x-rt/0101-hrtimer-by-timers-by-default-into-the-softirq-contex.patch index 457b6f33a..e4612188c 100644 --- a/kernel/patches-4.19.x-rt/0101-hrtimer-by-timers-by-default-into-the-softirq-contex.patch +++ b/kernel/patches-4.19.x-rt/0101-hrtimer-by-timers-by-default-into-the-softirq-contex.patch @@ -1,7 +1,7 @@ -From da6822e02b92c82126e1e2ef3846912c9874b024 Mon Sep 17 00:00:00 2001 +From 11c94409951908175bc4fab549d79ee48bcbc102 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 3 Jul 2009 08:44:31 -0500 -Subject: [PATCH 101/283] hrtimer: by timers by default into the softirq +Subject: [PATCH 101/328] hrtimer: by timers by default into the softirq context We can't have hrtimers callbacks running in hardirq context on RT. Therefore @@ -28,10 +28,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 031bd7f91f98..4b2a399f1df5 100644 +index 05905961ecca..9f08b74cda59 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c -@@ -2252,7 +2252,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) +@@ -2262,7 +2262,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) apic->vcpu = vcpu; hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC, @@ -41,7 +41,7 @@ index 031bd7f91f98..4b2a399f1df5 100644 /* diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h -index 73ad7309436a..2bdb047c7656 100644 +index 8714f1a37d84..082147c07831 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -42,6 +42,7 @@ enum hrtimer_mode { @@ -65,7 +65,7 @@ index 73ad7309436a..2bdb047c7656 100644 /* diff --git a/kernel/events/core.c b/kernel/events/core.c -index 171b83ebed4a..a7807c609c22 100644 +index 8c70ee23fbe9..9804b1a8b0fa 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) @@ -77,7 +77,7 @@ index 171b83ebed4a..a7807c609c22 100644 timer->function = perf_mux_hrtimer_handler; } -@@ -9216,7 +9216,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event) +@@ -9269,7 +9269,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event) if (!is_sampling_event(event)) return; @@ -87,7 +87,7 @@ index 171b83ebed4a..a7807c609c22 100644 /* diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 337cc72e6a6a..1f997ceec454 100644 +index 584978640512..2f6b4365d070 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -315,7 +315,7 @@ static void hrtick_rq_init(struct rq *rq) @@ -100,10 +100,10 @@ index 337cc72e6a6a..1f997ceec454 100644 } #else /* CONFIG_SCHED_HRTICK */ diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c -index fb6e64417470..1794e152d888 100644 +index 4b13df38c069..974a8f9b615a 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -1053,7 +1053,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se) +@@ -1086,7 +1086,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se) { struct hrtimer *timer = &dl_se->dl_timer; @@ -113,10 +113,10 @@ index fb6e64417470..1794e152d888 100644 } diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 0048a32a3b4d..4022ad749d85 100644 +index 27f9f9a785c1..d801e6c763ee 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4908,9 +4908,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) +@@ -4930,9 +4930,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); @@ -144,10 +144,10 @@ index b6ca4a630050..aeb99395c03b 100644 } diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index 923a650e5c35..abf24e60b6e8 100644 +index e135cb27db39..1fd5ec39e7f4 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1135,7 +1135,9 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, +@@ -1138,7 +1138,9 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft * match. */ @@ -157,7 +157,7 @@ index 923a650e5c35..abf24e60b6e8 100644 base = lock_hrtimer_base(timer, &flags); -@@ -1295,10 +1297,17 @@ static inline int hrtimer_clockid_to_base(clockid_t clock_id) +@@ -1298,10 +1300,17 @@ static inline int hrtimer_clockid_to_base(clockid_t clock_id) static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode mode) { @@ -177,7 +177,7 @@ index 923a650e5c35..abf24e60b6e8 100644 memset(timer, 0, sizeof(struct hrtimer)); cpu_base = raw_cpu_ptr(&hrtimer_bases); -@@ -1681,6 +1690,14 @@ static void __hrtimer_init_sleeper(struct hrtimer_sleeper *sl, +@@ -1684,6 +1693,14 @@ static void __hrtimer_init_sleeper(struct hrtimer_sleeper *sl, enum hrtimer_mode mode, struct task_struct *task) { @@ -193,10 +193,10 @@ index 923a650e5c35..abf24e60b6e8 100644 sl->timer.function = hrtimer_wakeup; sl->task = task; diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c -index a59641fb88b6..52649fdea3b5 100644 +index a836efd34589..c50e8f3262de 100644 --- a/kernel/time/tick-broadcast-hrtimer.c +++ b/kernel/time/tick-broadcast-hrtimer.c -@@ -106,7 +106,7 @@ static enum hrtimer_restart bc_handler(struct hrtimer *t) +@@ -107,7 +107,7 @@ static enum hrtimer_restart bc_handler(struct hrtimer *t) void tick_setup_hrtimer_broadcast(void) { @@ -206,10 +206,10 @@ index a59641fb88b6..52649fdea3b5 100644 clockevents_register_device(&ce_broadcast_hrtimer); } diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index 54fd344ef973..c217af74dddf 100644 +index e774a49176cc..012bc81879bf 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -1310,7 +1310,7 @@ void tick_setup_sched_timer(void) +@@ -1314,7 +1314,7 @@ void tick_setup_sched_timer(void) /* * Emulate tick processing via per-CPU hrtimers: */ @@ -219,10 +219,10 @@ index 54fd344ef973..c217af74dddf 100644 /* Get the next period (per-CPU) */ diff --git a/kernel/watchdog.c b/kernel/watchdog.c -index bbc4940f21af..defd493ba967 100644 +index 6d60701dc636..328620fe85f6 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c -@@ -483,7 +483,7 @@ static void watchdog_enable(unsigned int cpu) +@@ -485,7 +485,7 @@ static void watchdog_enable(unsigned int cpu) * Start the timer first to prevent the NMI watchdog triggering * before the timer has a chance to fire. */ @@ -232,5 +232,5 @@ index bbc4940f21af..defd493ba967 100644 hrtimer_start(hrtimer, ns_to_ktime(sample_period), HRTIMER_MODE_REL_PINNED); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0102-sched-fair-Make-the-hrtimers-non-hard-again.patch b/kernel/patches-4.19.x-rt/0102-sched-fair-Make-the-hrtimers-non-hard-again.patch index fea1dfbea..c9aa6dea6 100644 --- a/kernel/patches-4.19.x-rt/0102-sched-fair-Make-the-hrtimers-non-hard-again.patch +++ b/kernel/patches-4.19.x-rt/0102-sched-fair-Make-the-hrtimers-non-hard-again.patch @@ -1,7 +1,7 @@ -From bccc05d43b6e3443288909080b555413b80fe36a Mon Sep 17 00:00:00 2001 +From 80511ff61a43b8db5ac26d665ef32b73cbc03471 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 8 Jan 2019 12:31:06 +0100 -Subject: [PATCH 102/283] sched/fair: Make the hrtimers non-hard again +Subject: [PATCH 102/328] sched/fair: Make the hrtimers non-hard again Since commit "sched/fair: Robustify CFS-bandwidth timer locking" both hrtimer can run in softirq context because now interrupts are disabled @@ -13,10 +13,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 4022ad749d85..0048a32a3b4d 100644 +index d801e6c763ee..27f9f9a785c1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4908,9 +4908,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) +@@ -4930,9 +4930,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); @@ -29,5 +29,5 @@ index 4022ad749d85..0048a32a3b4d 100644 cfs_b->distribute_running = 0; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0103-hrtimer-Move-schedule_work-call-to-helper-thread.patch b/kernel/patches-4.19.x-rt/0103-hrtimer-Move-schedule_work-call-to-helper-thread.patch index ce5b11097..308d5d0ae 100644 --- a/kernel/patches-4.19.x-rt/0103-hrtimer-Move-schedule_work-call-to-helper-thread.patch +++ b/kernel/patches-4.19.x-rt/0103-hrtimer-Move-schedule_work-call-to-helper-thread.patch @@ -1,7 +1,7 @@ -From 73842c09ad741a2814a0df56dccd630cbd503cf9 Mon Sep 17 00:00:00 2001 +From 78baf86e1ae9ffb52fdbd93f63afc3fb3ecc3f26 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Mon, 16 Sep 2013 14:09:19 -0700 -Subject: [PATCH 103/283] hrtimer: Move schedule_work call to helper thread +Subject: [PATCH 103/328] hrtimer: Move schedule_work call to helper thread When run ltp leapsec_timer test, the following call trace is caught: @@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 24 insertions(+) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index abf24e60b6e8..c72eb8bfc471 100644 +index 1fd5ec39e7f4..9f3412acdb16 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -730,6 +730,29 @@ static void hrtimer_switch_to_hres(void) @@ -93,5 +93,5 @@ index abf24e60b6e8..c72eb8bfc471 100644 #else -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0104-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch b/kernel/patches-4.19.x-rt/0104-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch index ac1c935b7..8ed3b2add 100644 --- a/kernel/patches-4.19.x-rt/0104-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch +++ b/kernel/patches-4.19.x-rt/0104-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch @@ -1,7 +1,7 @@ -From f9cb7c14dad693481c5b5dfea9223e1904a63a09 Mon Sep 17 00:00:00 2001 +From 4cb6829518eaf4e33821ad23eca2672efd3c8292 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 10:15:13 +0100 -Subject: [PATCH 104/283] hrtimer: move state change before hrtimer_cancel in +Subject: [PATCH 104/328] hrtimer: move state change before hrtimer_cancel in do_nanosleep() There is a small window between setting t->task to NULL and waking the @@ -28,10 +28,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index c72eb8bfc471..cfa3599fa789 100644 +index 9f3412acdb16..b800efb64238 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1785,12 +1785,12 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod +@@ -1788,12 +1788,12 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod if (likely(t->task)) freezable_schedule(); @@ -46,5 +46,5 @@ index c72eb8bfc471..cfa3599fa789 100644 if (!t->task) return 0; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0105-posix-timers-Thread-posix-cpu-timers-on-rt.patch b/kernel/patches-4.19.x-rt/0105-posix-timers-Thread-posix-cpu-timers-on-rt.patch index 67bf0e77a..dfd42f230 100644 --- a/kernel/patches-4.19.x-rt/0105-posix-timers-Thread-posix-cpu-timers-on-rt.patch +++ b/kernel/patches-4.19.x-rt/0105-posix-timers-Thread-posix-cpu-timers-on-rt.patch @@ -1,7 +1,7 @@ -From f7d44ae1ff53ff9277b2207c7987b8ffa0a65738 Mon Sep 17 00:00:00 2001 +From 502c5fa30dc1a4c295e2f42049d7c79b0245db74 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Fri, 3 Jul 2009 08:29:58 -0500 -Subject: [PATCH 105/283] posix-timers: Thread posix-cpu-timers on -rt +Subject: [PATCH 105/328] posix-timers: Thread posix-cpu-timers on -rt posix-cpu-timer code takes non -rt safe locks in hard irq context. Move it to a thread. @@ -18,7 +18,7 @@ Signed-off-by: Thomas Gleixner 4 files changed, 164 insertions(+), 3 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h -index 535e57775208..c2dfe6939773 100644 +index e4af260f81c5..a90b6be626cd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -832,6 +832,9 @@ struct task_struct { @@ -57,10 +57,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 98c971cb1d36..492bc898b09a 100644 +index bc182d6fa2a9..ccfcd44a370f 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1585,6 +1585,9 @@ static void rt_mutex_init_task(struct task_struct *p) +@@ -1590,6 +1590,9 @@ static void rt_mutex_init_task(struct task_struct *p) */ static void posix_cpu_timers_init(struct task_struct *tsk) { @@ -71,7 +71,7 @@ index 98c971cb1d36..492bc898b09a 100644 tsk->cputime_expires.virt_exp = 0; tsk->cputime_expires.sched_exp = 0; diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c -index 76801b9b481e..baeeaef3b721 100644 +index d62d7ae5201c..8d95e8de98b2 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -3,8 +3,10 @@ @@ -93,7 +93,7 @@ index 76801b9b481e..baeeaef3b721 100644 #include "posix-timers.h" -@@ -1136,14 +1139,12 @@ static inline int fastpath_timer_check(struct task_struct *tsk) +@@ -1140,14 +1143,12 @@ static inline int fastpath_timer_check(struct task_struct *tsk) * already updated our counts. We need to check if any timers fire now. * Interrupts are disabled. */ @@ -109,7 +109,7 @@ index 76801b9b481e..baeeaef3b721 100644 /* * The fast path checks that there are no expired thread or thread * group timers. If that's so, just return. -@@ -1196,6 +1197,153 @@ void run_posix_cpu_timers(struct task_struct *tsk) +@@ -1200,6 +1201,153 @@ void run_posix_cpu_timers(struct task_struct *tsk) } } @@ -264,5 +264,5 @@ index 76801b9b481e..baeeaef3b721 100644 * Set one of the process-wide special case CPU timers or RLIMIT_CPU. * The tsk->sighand->siglock must be held by the caller. -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0106-sched-Move-task_struct-cleanup-to-RCU.patch b/kernel/patches-4.19.x-rt/0106-sched-Move-task_struct-cleanup-to-RCU.patch index ef4420fbe..59d68b25d 100644 --- a/kernel/patches-4.19.x-rt/0106-sched-Move-task_struct-cleanup-to-RCU.patch +++ b/kernel/patches-4.19.x-rt/0106-sched-Move-task_struct-cleanup-to-RCU.patch @@ -1,7 +1,7 @@ -From bc6dc2730e93dec5ead183a44781b5c8bf47b3d7 Mon Sep 17 00:00:00 2001 +From 11ee26b0db121f202fdb0adaea13a37ae4ee31f9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 31 May 2011 16:59:16 +0200 -Subject: [PATCH 106/283] sched: Move task_struct cleanup to RCU +Subject: [PATCH 106/328] sched: Move task_struct cleanup to RCU __put_task_struct() does quite some expensive work. We don't want to burden random tasks with that. @@ -14,10 +14,10 @@ Signed-off-by: Thomas Gleixner 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h -index c2dfe6939773..a6f2f76b1162 100644 +index a90b6be626cd..0b8850b6093b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1186,6 +1186,9 @@ struct task_struct { +@@ -1194,6 +1194,9 @@ struct task_struct { unsigned int sequential_io; unsigned int sequential_io_avg; #endif @@ -28,10 +28,10 @@ index c2dfe6939773..a6f2f76b1162 100644 unsigned long task_state_change; #endif diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h -index 108ede99e533..bb98c5b43f81 100644 +index 44c6f15800ff..d2b33e57c636 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h -@@ -88,6 +88,15 @@ extern void sched_exec(void); +@@ -90,6 +90,15 @@ extern void sched_exec(void); #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) @@ -47,7 +47,7 @@ index 108ede99e533..bb98c5b43f81 100644 extern void __put_task_struct(struct task_struct *t); static inline void put_task_struct(struct task_struct *t) -@@ -95,7 +104,7 @@ static inline void put_task_struct(struct task_struct *t) +@@ -97,7 +106,7 @@ static inline void put_task_struct(struct task_struct *t) if (atomic_dec_and_test(&t->usage)) __put_task_struct(t); } @@ -57,10 +57,10 @@ index 108ede99e533..bb98c5b43f81 100644 #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT diff --git a/kernel/fork.c b/kernel/fork.c -index 492bc898b09a..cba3cade3d5b 100644 +index ccfcd44a370f..309f4a20d4ac 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -671,7 +671,9 @@ static inline void put_signal_struct(struct signal_struct *sig) +@@ -676,7 +676,9 @@ static inline void put_signal_struct(struct signal_struct *sig) if (atomic_dec_and_test(&sig->sigcnt)) free_signal_struct(sig); } @@ -71,7 +71,7 @@ index 492bc898b09a..cba3cade3d5b 100644 void __put_task_struct(struct task_struct *tsk) { WARN_ON(!tsk->exit_state); -@@ -688,7 +690,18 @@ void __put_task_struct(struct task_struct *tsk) +@@ -693,7 +695,18 @@ void __put_task_struct(struct task_struct *tsk) if (!profile_handoff_task(tsk)) free_task(tsk); } @@ -91,5 +91,5 @@ index 492bc898b09a..cba3cade3d5b 100644 void __init __weak arch_task_cache_init(void) { } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0107-sched-Limit-the-number-of-task-migrations-per-batch.patch b/kernel/patches-4.19.x-rt/0107-sched-Limit-the-number-of-task-migrations-per-batch.patch index 714f63d5c..82e563c9a 100644 --- a/kernel/patches-4.19.x-rt/0107-sched-Limit-the-number-of-task-migrations-per-batch.patch +++ b/kernel/patches-4.19.x-rt/0107-sched-Limit-the-number-of-task-migrations-per-batch.patch @@ -1,7 +1,7 @@ -From 5e09842f9bc61a1babc80804a7c2e003b56989c3 Mon Sep 17 00:00:00 2001 +From 1ecb69a3b71549668399060338d4e216c3886d67 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 6 Jun 2011 12:12:51 +0200 -Subject: [PATCH 107/283] sched: Limit the number of task migrations per batch +Subject: [PATCH 107/328] sched: Limit the number of task migrations per batch Put an upper limit on the number of tasks which are migrated per batch to avoid large latencies. @@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 4 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 1f997ceec454..88a886c751ca 100644 +index 2f6b4365d070..5c23d1272429 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -44,7 +44,11 @@ const_debug unsigned int sysctl_sched_features = @@ -28,5 +28,5 @@ index 1f997ceec454..88a886c751ca 100644 /* * period over which we measure -rt task CPU usage in us. -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0108-sched-Move-mmdrop-to-RCU-on-RT.patch b/kernel/patches-4.19.x-rt/0108-sched-Move-mmdrop-to-RCU-on-RT.patch index 88af0a54d..a494f4290 100644 --- a/kernel/patches-4.19.x-rt/0108-sched-Move-mmdrop-to-RCU-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0108-sched-Move-mmdrop-to-RCU-on-RT.patch @@ -1,7 +1,7 @@ -From a07363220fb1b9eb6ed3a28d5eef11e4b95f6170 Mon Sep 17 00:00:00 2001 +From 81ab4eb4f9ca9097217f44a6961e60ebb82725b1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 6 Jun 2011 12:20:33 +0200 -Subject: [PATCH 108/283] sched: Move mmdrop to RCU on RT +Subject: [PATCH 108/328] sched: Move mmdrop to RCU on RT Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index 5ed8f6292a53..f430cf0a377e 100644 +index 3a9a996af229..202b736ccbfa 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -12,6 +12,7 @@ @@ -26,7 +26,7 @@ index 5ed8f6292a53..f430cf0a377e 100644 #include #include -@@ -482,6 +483,9 @@ struct mm_struct { +@@ -487,6 +488,9 @@ struct mm_struct { bool tlb_flush_batched; #endif struct uprobes_state uprobes_state; @@ -37,7 +37,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 0d10b7ce0da7..b6758c6fffbf 100644 +index e9d4e389aed9..fb59f96fdd2e 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) @@ -59,10 +59,10 @@ index 0d10b7ce0da7..b6758c6fffbf 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 cba3cade3d5b..098130002cda 100644 +index 309f4a20d4ac..d4ec53c72577 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -637,6 +637,19 @@ void __mmdrop(struct mm_struct *mm) +@@ -642,6 +642,19 @@ void __mmdrop(struct mm_struct *mm) } EXPORT_SYMBOL_GPL(__mmdrop); @@ -83,7 +83,7 @@ index cba3cade3d5b..098130002cda 100644 { struct mm_struct *mm; diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 88a886c751ca..0c916e7010a2 100644 +index 5c23d1272429..cb89c90513dd 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) @@ -101,7 +101,7 @@ index 88a886c751ca..0c916e7010a2 100644 } if (unlikely(prev_state == TASK_DEAD)) { if (prev->sched_class->task_dead) -@@ -5559,6 +5563,8 @@ void sched_setnuma(struct task_struct *p, int nid) +@@ -5601,6 +5605,8 @@ void sched_setnuma(struct task_struct *p, int nid) #endif /* CONFIG_NUMA_BALANCING */ #ifdef CONFIG_HOTPLUG_CPU @@ -110,7 +110,7 @@ index 88a886c751ca..0c916e7010a2 100644 /* * Ensure that the idle task is using init_mm right before its CPU goes * offline. -@@ -5574,7 +5580,11 @@ void idle_task_exit(void) +@@ -5616,7 +5622,11 @@ void idle_task_exit(void) current->active_mm = &init_mm; finish_arch_post_lock_switch(); } @@ -123,7 +123,7 @@ index 88a886c751ca..0c916e7010a2 100644 } /* -@@ -5886,6 +5896,10 @@ int sched_cpu_dying(unsigned int cpu) +@@ -5928,6 +5938,10 @@ int sched_cpu_dying(unsigned int cpu) update_max_interval(); nohz_balance_exit_idle(rq); hrtick_clear(rq); @@ -135,5 +135,5 @@ index 88a886c751ca..0c916e7010a2 100644 } #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0109-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/kernel/patches-4.19.x-rt/0109-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index e173edf85..8c2fd8933 100644 --- a/kernel/patches-4.19.x-rt/0109-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/kernel/patches-4.19.x-rt/0109-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -1,7 +1,7 @@ -From fcd92c128f39749e17ad0c95cf7154f14f3b575a Mon Sep 17 00:00:00 2001 +From 375e6c07eb8de47fab60360d59bbeb611508c54c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 21 Nov 2016 19:31:08 +0100 -Subject: [PATCH 109/283] kernel/sched: move stack + kprobe clean up to +Subject: [PATCH 109/328] kernel/sched: move stack + kprobe clean up to __put_task_struct() There is no need to free the stack before the task struct (except for reasons @@ -17,7 +17,7 @@ Signed-off-by: Sebastian Andrzej Siewior 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c -index 098130002cda..247b08eb66c8 100644 +index d4ec53c72577..29b54a64daf5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -40,6 +40,7 @@ @@ -28,7 +28,7 @@ index 098130002cda..247b08eb66c8 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_struct *tsk) WARN_ON(atomic_read(&tsk->usage)); WARN_ON(tsk == current); @@ -42,10 +42,10 @@ index 098130002cda..247b08eb66c8 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 0c916e7010a2..31d8e5828ece 100644 +index cb89c90513dd..79e0d052e848 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) @@ -65,5 +65,5 @@ index 0c916e7010a2..31d8e5828ece 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0110-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch b/kernel/patches-4.19.x-rt/0110-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch index 1bb313334..fe7a4b093 100644 --- a/kernel/patches-4.19.x-rt/0110-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch +++ b/kernel/patches-4.19.x-rt/0110-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch @@ -1,7 +1,7 @@ -From 1b7fcb7ee765eafbf39fa9f1427f38370c00eff3 Mon Sep 17 00:00:00 2001 +From 713f8459593a71106384c1a9ba33189561ea892e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 25 Jun 2011 09:21:04 +0200 -Subject: [PATCH 110/283] sched: Add saved_state for tasks blocked on sleeping +Subject: [PATCH 110/328] sched: Add saved_state for tasks blocked on sleeping locks Spinlocks are state preserving in !RT. RT changes the state when a @@ -18,7 +18,7 @@ Signed-off-by: Thomas Gleixner 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h -index a6f2f76b1162..ad44849fba2e 100644 +index 0b8850b6093b..f180bfadff33 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -600,6 +600,8 @@ struct task_struct { @@ -30,7 +30,7 @@ index a6f2f76b1162..ad44849fba2e 100644 /* * This begins the randomizable portion of task_struct. Only -@@ -1613,6 +1615,7 @@ extern struct task_struct *find_get_task_by_vpid(pid_t nr); +@@ -1621,6 +1623,7 @@ extern struct task_struct *find_get_task_by_vpid(pid_t nr); extern int wake_up_state(struct task_struct *tsk, unsigned int state); extern int wake_up_process(struct task_struct *tsk); @@ -39,7 +39,7 @@ index a6f2f76b1162..ad44849fba2e 100644 #ifdef CONFIG_SMP diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 31d8e5828ece..5734699b0812 100644 +index 79e0d052e848..d1c564acff76 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) @@ -91,10 +91,10 @@ index 31d8e5828ece..5734699b0812 100644 { return try_to_wake_up(p, state, 0); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index 9a7c3d08b39f..49ae30da28ee 100644 +index 94bec97bd5e2..c79e32488940 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) +@@ -1439,6 +1439,7 @@ static inline int task_on_rq_migrating(struct task_struct *p) #define WF_SYNC 0x01 /* Waker goes to sleep after wakeup */ #define WF_FORK 0x02 /* Child wakeup after fork */ #define WF_MIGRATED 0x4 /* Internal use, task got migrated */ @@ -103,5 +103,5 @@ index 9a7c3d08b39f..49ae30da28ee 100644 /* * To aid in avoiding the subversion of "niceness" due to uneven distribution -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0111-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch b/kernel/patches-4.19.x-rt/0111-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch index 58a963410..9a40c694b 100644 --- a/kernel/patches-4.19.x-rt/0111-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch +++ b/kernel/patches-4.19.x-rt/0111-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch @@ -1,7 +1,7 @@ -From 833fc1aa92cf522d59c1a02d410198e8ba4d1832 Mon Sep 17 00:00:00 2001 +From d8deeba7aff8ef76350524de5c15b1c12563e91d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 7 Jun 2011 09:19:06 +0200 -Subject: [PATCH 111/283] sched: Do not account rcu_preempt_depth on RT in +Subject: [PATCH 111/328] sched: Do not account rcu_preempt_depth on RT in might_sleep() RT changes the rcu_preempt_depth semantics, so we cannot check for it @@ -14,7 +14,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 e102c5bccbb9..87eafcb3312f 100644 +index 68cbe111420b..027c58cdbb6e 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -73,6 +73,11 @@ void synchronize_rcu(void); @@ -39,10 +39,10 @@ index e102c5bccbb9..87eafcb3312f 100644 /* Internal to kernel */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 5734699b0812..0be1cc1120db 100644 +index d1c564acff76..59d43c084023 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -6156,7 +6156,7 @@ void __init sched_init(void) +@@ -6198,7 +6198,7 @@ void __init sched_init(void) #ifdef CONFIG_DEBUG_ATOMIC_SLEEP static inline int preempt_count_equals(int preempt_offset) { @@ -52,5 +52,5 @@ index 5734699b0812..0be1cc1120db 100644 return (nested == preempt_offset); } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0112-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch b/kernel/patches-4.19.x-rt/0112-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch index 8bb210d42..0035821cb 100644 --- a/kernel/patches-4.19.x-rt/0112-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch +++ b/kernel/patches-4.19.x-rt/0112-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch @@ -1,7 +1,7 @@ -From be9eeaeabb9966cc740ca075b3bbffe54b2506a4 Mon Sep 17 00:00:00 2001 +From 875b7c458428cc65b17950157a9e804383864d31 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 22:51:33 +0200 -Subject: [PATCH 112/283] sched: Use the proper LOCK_OFFSET for cond_resched() +Subject: [PATCH 112/328] sched: Use the proper LOCK_OFFSET for cond_resched() RT does not increment preempt count when a 'sleeping' spinlock is locked. Update PREEMPT_LOCK_OFFSET for that case. @@ -28,5 +28,5 @@ index f7a17fcc3fec..b7fe717eb1f4 100644 /* * The preempt_count offset needed for things like: -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0113-sched-Disable-TTWU_QUEUE-on-RT.patch b/kernel/patches-4.19.x-rt/0113-sched-Disable-TTWU_QUEUE-on-RT.patch index ace574056..8a0a8ff17 100644 --- a/kernel/patches-4.19.x-rt/0113-sched-Disable-TTWU_QUEUE-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0113-sched-Disable-TTWU_QUEUE-on-RT.patch @@ -1,7 +1,7 @@ -From a6ae12a40e837ece98c723e624820e41421b70a0 Mon Sep 17 00:00:00 2001 +From 365d52b7071fa4453be6483864c31584995053b6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 13 Sep 2011 16:42:35 +0200 -Subject: [PATCH 113/283] sched: Disable TTWU_QUEUE on RT +Subject: [PATCH 113/328] sched: Disable TTWU_QUEUE on RT The queued remote wakeup mechanism can introduce rather large latencies if the number of migrated tasks is high. Disable it for RT. @@ -33,5 +33,5 @@ index 85ae8488039c..68de18405857 100644 /* * When doing wakeups, attempt to limit superfluous scans of the LLC domain. -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0114-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/kernel/patches-4.19.x-rt/0114-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch index 86dc7f63c..1e950adcf 100644 --- a/kernel/patches-4.19.x-rt/0114-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +++ b/kernel/patches-4.19.x-rt/0114-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch @@ -1,7 +1,7 @@ -From 4ad0a976dcfe34e35355f20f464dd7eb08dd38e5 Mon Sep 17 00:00:00 2001 +From eb876f743020816179d1fc4b036e540d72c771f4 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Mon, 18 Mar 2013 15:12:49 -0400 -Subject: [PATCH 114/283] sched/workqueue: Only wake up idle workers if not +Subject: [PATCH 114/328] sched/workqueue: Only wake up idle workers if not blocked on sleeping spin lock In -rt, most spin_locks() turn into mutexes. One of these spin_lock @@ -24,10 +24,10 @@ 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 0be1cc1120db..5ca8f53ba4fd 100644 +index 59d43c084023..e792543de8eb 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3498,8 +3498,10 @@ static void __sched notrace __schedule(bool preempt) +@@ -3539,8 +3539,10 @@ static void __sched notrace __schedule(bool preempt) * If a worker went to sleep, notify and ask workqueue * whether it wants to wake up a task to maintain * concurrency. @@ -40,5 +40,5 @@ index 0be1cc1120db..5ca8f53ba4fd 100644 to_wakeup = wq_worker_sleeping(prev); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0115-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/kernel/patches-4.19.x-rt/0115-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index 3af1e3ecd..527c94903 100644 --- a/kernel/patches-4.19.x-rt/0115-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/kernel/patches-4.19.x-rt/0115-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch @@ -1,7 +1,7 @@ -From 807cb05d929f39b81b980b673d69ea33c6473b96 Mon Sep 17 00:00:00 2001 +From d5c888e692b5c34315ee9d6c6019dc054bb3650c Mon Sep 17 00:00:00 2001 From: Daniel Bristot de Oliveira Date: Mon, 26 Jun 2017 17:07:15 +0200 -Subject: [PATCH 115/283] rt: Increase/decrease the nr of migratory tasks when +Subject: [PATCH 115/328] rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration There is a problem in the migrate_disable()/enable() implementation @@ -81,10 +81,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 5ca8f53ba4fd..434fd8946629 100644 +index e792543de8eb..57617777c4ba 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7147,6 +7147,47 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7185,6 +7185,47 @@ const u32 sched_prio_to_wmult[40] = { #if defined(CONFIG_PREEMPT_COUNT) && defined(CONFIG_SMP) @@ -132,7 +132,7 @@ index 5ca8f53ba4fd..434fd8946629 100644 void migrate_disable(void) { struct task_struct *p = current; -@@ -7170,10 +7211,9 @@ void migrate_disable(void) +@@ -7208,10 +7249,9 @@ void migrate_disable(void) } preempt_disable(); @@ -145,7 +145,7 @@ index 5ca8f53ba4fd..434fd8946629 100644 preempt_enable(); } -@@ -7205,9 +7245,8 @@ void migrate_enable(void) +@@ -7243,9 +7283,8 @@ void migrate_enable(void) preempt_disable(); @@ -157,5 +157,5 @@ index 5ca8f53ba4fd..434fd8946629 100644 if (p->migrate_disable_update) { struct rq *rq; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0116-hotplug-Lightweight-get-online-cpus.patch b/kernel/patches-4.19.x-rt/0116-hotplug-Lightweight-get-online-cpus.patch index 9ba8924e0..4b56ddd36 100644 --- a/kernel/patches-4.19.x-rt/0116-hotplug-Lightweight-get-online-cpus.patch +++ b/kernel/patches-4.19.x-rt/0116-hotplug-Lightweight-get-online-cpus.patch @@ -1,7 +1,7 @@ -From 6c5886f66d8a616f3294c2fd8ca26b4c638e430b Mon Sep 17 00:00:00 2001 +From 54abe9a86c78a78b978f91e21929db155fc9f342 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 15 Jun 2011 12:36:06 +0200 -Subject: [PATCH 116/283] hotplug: Lightweight get online cpus +Subject: [PATCH 116/328] hotplug: Lightweight get online cpus get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only @@ -19,10 +19,10 @@ Signed-off-by: Thomas Gleixner 3 files changed, 24 insertions(+) diff --git a/include/linux/cpu.h b/include/linux/cpu.h -index 006f69f9277b..d45ea5c98cdd 100644 +index aab4273810e3..e67645924404 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h -@@ -113,6 +113,8 @@ extern void cpu_hotplug_disable(void); +@@ -118,6 +118,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); @@ -31,7 +31,7 @@ index 006f69f9277b..d45ea5c98cdd 100644 #else /* CONFIG_HOTPLUG_CPU */ -@@ -124,6 +126,9 @@ static inline int cpus_read_trylock(void) { return true; } +@@ -129,6 +131,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) { } @@ -42,7 +42,7 @@ index 006f69f9277b..d45ea5c98cdd 100644 /* Wrappers which go away once all code is converted */ diff --git a/kernel/cpu.c b/kernel/cpu.c -index 46aefe5c0e35..9001e1779325 100644 +index 2d850eaaf82e..328d7bf67d2f 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -281,6 +281,21 @@ static int cpu_hotplug_disabled; @@ -68,10 +68,10 @@ index 46aefe5c0e35..9001e1779325 100644 void cpus_read_lock(void) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 434fd8946629..a8e9283f018c 100644 +index 57617777c4ba..42b42ebf52bc 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7211,6 +7211,7 @@ void migrate_disable(void) +@@ -7249,6 +7249,7 @@ void migrate_disable(void) } preempt_disable(); @@ -79,7 +79,7 @@ index 434fd8946629..a8e9283f018c 100644 migrate_disable_update_cpus_allowed(p); p->migrate_disable = 1; -@@ -7276,12 +7277,15 @@ void migrate_enable(void) +@@ -7314,12 +7315,15 @@ void migrate_enable(void) arg.task = p; arg.dest_cpu = dest_cpu; @@ -96,5 +96,5 @@ index 434fd8946629..a8e9283f018c 100644 } EXPORT_SYMBOL(migrate_enable); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0117-trace-Add-migrate-disabled-counter-to-tracing-output.patch b/kernel/patches-4.19.x-rt/0117-trace-Add-migrate-disabled-counter-to-tracing-output.patch index 19a6ad264..e545a2e3c 100644 --- a/kernel/patches-4.19.x-rt/0117-trace-Add-migrate-disabled-counter-to-tracing-output.patch +++ b/kernel/patches-4.19.x-rt/0117-trace-Add-migrate-disabled-counter-to-tracing-output.patch @@ -1,7 +1,7 @@ -From cea179e4bc61a9548573e2f5ece3e78b976c35eb Mon Sep 17 00:00:00 2001 +From b04beb8ffbac46b3e231d5032cabf43bb8638052 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:56:42 +0200 -Subject: [PATCH 117/283] trace: Add migrate-disabled counter to tracing output +Subject: [PATCH 117/328] trace: Add migrate-disabled counter to tracing output Signed-off-by: Thomas Gleixner --- @@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h -index 78a010e19ed4..0403d9696944 100644 +index 0643c083ed86..1cc4d2da954c 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -62,6 +62,8 @@ struct trace_entry { @@ -25,7 +25,7 @@ index 78a010e19ed4..0403d9696944 100644 #define TRACE_EVENT_TYPE_MAX \ diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index 3b0de19b9ed7..496c5d358010 100644 +index e61aa1c68e99..5eccf1c201db 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2149,6 +2149,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, @@ -52,7 +52,7 @@ index 3b0de19b9ed7..496c5d358010 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 7345f5f8f3fe..6455e2ca7987 100644 +index ec340e1cbffc..1febb0ca4c81 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -188,6 +188,8 @@ static int trace_define_common_fields(void) @@ -81,5 +81,5 @@ index 6e6cc64faa38..46c96744f09d 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0118-lockdep-Make-it-RT-aware.patch b/kernel/patches-4.19.x-rt/0118-lockdep-Make-it-RT-aware.patch index 8862d371d..e654afef3 100644 --- a/kernel/patches-4.19.x-rt/0118-lockdep-Make-it-RT-aware.patch +++ b/kernel/patches-4.19.x-rt/0118-lockdep-Make-it-RT-aware.patch @@ -1,7 +1,7 @@ -From d2810fd8e650b96863a15b748cf385698ecde121 Mon Sep 17 00:00:00 2001 +From b65e89f6b27831323b600bce37aa38ce596bdcd3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 18:51:23 +0200 -Subject: [PATCH 118/283] lockdep: Make it RT aware +Subject: [PATCH 118/328] lockdep: Make it RT aware teach lockdep that we don't really do softirqs on -RT. @@ -53,10 +53,10 @@ index 21619c92c377..b20eeb25e9fa 100644 defined(CONFIG_PREEMPT_TRACER) extern void stop_critical_timings(void); diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c -index 26b57e24476f..6daeb369f691 100644 +index 1e272f6a01e7..1938b4bfb098 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c -@@ -3823,6 +3823,7 @@ static void check_flags(unsigned long flags) +@@ -3826,6 +3826,7 @@ static void check_flags(unsigned long flags) } } @@ -64,7 +64,7 @@ index 26b57e24476f..6daeb369f691 100644 /* * We dont accurately track softirq state in e.g. * hardirq contexts (such as on 4KSTACKS), so only -@@ -3837,6 +3838,7 @@ static void check_flags(unsigned long flags) +@@ -3840,6 +3841,7 @@ static void check_flags(unsigned long flags) DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled); } } @@ -73,5 +73,5 @@ index 26b57e24476f..6daeb369f691 100644 if (!debug_locks) print_irqtrace_events(current); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0119-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch b/kernel/patches-4.19.x-rt/0119-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch index a80369cfa..e92a5bfc8 100644 --- a/kernel/patches-4.19.x-rt/0119-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch +++ b/kernel/patches-4.19.x-rt/0119-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch @@ -1,7 +1,7 @@ -From bb78f12d34959257b4413ff817644ce7477a93cd Mon Sep 17 00:00:00 2001 +From 7d6dc49f4a2794dc14d0fb1bb4f669616ac12d88 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Tue, 29 Nov 2011 20:18:22 -0500 -Subject: [PATCH 119/283] tasklet: Prevent tasklets from going into infinite +Subject: [PATCH 119/328] tasklet: Prevent tasklets from going into infinite spin in RT When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, @@ -298,5 +298,5 @@ index 6f584861d329..1d3a482246cc 100644 { return local_softirq_pending(); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0120-softirq-Check-preemption-after-reenabling-interrupts.patch b/kernel/patches-4.19.x-rt/0120-softirq-Check-preemption-after-reenabling-interrupts.patch index 5f8408cc5..b753ac4d5 100644 --- a/kernel/patches-4.19.x-rt/0120-softirq-Check-preemption-after-reenabling-interrupts.patch +++ b/kernel/patches-4.19.x-rt/0120-softirq-Check-preemption-after-reenabling-interrupts.patch @@ -1,7 +1,7 @@ -From 573f3d4984a2aa2239e4e28c0df1dc28517397d2 Mon Sep 17 00:00:00 2001 +From 4f7f72bc0ff5be0e440cf01595c7b333d8f27f70 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 13 Nov 2011 17:17:09 +0100 -Subject: [PATCH 120/283] softirq: Check preemption after reenabling interrupts +Subject: [PATCH 120/328] softirq: Check preemption after reenabling interrupts raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, @@ -116,10 +116,10 @@ index 86a709954f5a..9c069ef83d6d 100644 return 0; } diff --git a/net/core/dev.c b/net/core/dev.c -index 138951d28643..48c4dc728d1b 100644 +index c1a3baf16957..45ff62d35a1f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2726,6 +2726,7 @@ static void __netif_reschedule(struct Qdisc *q) +@@ -2727,6 +2727,7 @@ static void __netif_reschedule(struct Qdisc *q) sd->output_queue_tailp = &q->next_sched; raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_restore(flags); @@ -127,7 +127,7 @@ index 138951d28643..48c4dc728d1b 100644 } void __netif_schedule(struct Qdisc *q) -@@ -2788,6 +2789,7 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason) +@@ -2789,6 +2790,7 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason) __this_cpu_write(softnet_data.completion_queue, skb); raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_restore(flags); @@ -135,7 +135,7 @@ index 138951d28643..48c4dc728d1b 100644 } EXPORT_SYMBOL(__dev_kfree_skb_irq); -@@ -4260,6 +4262,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, +@@ -4261,6 +4263,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, rps_unlock(sd); local_irq_restore(flags); @@ -143,7 +143,7 @@ index 138951d28643..48c4dc728d1b 100644 atomic_long_inc(&skb->dev->rx_dropped); kfree_skb(skb); -@@ -5815,12 +5818,14 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd) +@@ -5801,12 +5804,14 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd) sd->rps_ipi_list = NULL; local_irq_enable(); @@ -158,7 +158,7 @@ index 138951d28643..48c4dc728d1b 100644 } static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) -@@ -5898,6 +5903,7 @@ void __napi_schedule(struct napi_struct *n) +@@ -5884,6 +5889,7 @@ void __napi_schedule(struct napi_struct *n) local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); @@ -166,7 +166,7 @@ index 138951d28643..48c4dc728d1b 100644 } EXPORT_SYMBOL(__napi_schedule); -@@ -9305,6 +9311,7 @@ static int dev_cpu_dead(unsigned int oldcpu) +@@ -9486,6 +9492,7 @@ static int dev_cpu_dead(unsigned int oldcpu) raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -175,5 +175,5 @@ index 138951d28643..48c4dc728d1b 100644 #ifdef CONFIG_RPS remsd = oldsd->rps_ipi_list; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0121-softirq-Disable-softirq-stacks-for-RT.patch b/kernel/patches-4.19.x-rt/0121-softirq-Disable-softirq-stacks-for-RT.patch index 0b1735d0f..5990b2d37 100644 --- a/kernel/patches-4.19.x-rt/0121-softirq-Disable-softirq-stacks-for-RT.patch +++ b/kernel/patches-4.19.x-rt/0121-softirq-Disable-softirq-stacks-for-RT.patch @@ -1,7 +1,7 @@ -From ac1ed27a8471e837c8ea8811ca8322f47f47add2 Mon Sep 17 00:00:00 2001 +From 72daa94331fe79e1c1b596147ec920920f1cd87a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 13:59:17 +0200 -Subject: [PATCH 121/283] softirq: Disable softirq stacks for RT +Subject: [PATCH 121/328] softirq: Disable softirq stacks for RT Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. @@ -19,7 +19,7 @@ Signed-off-by: Thomas Gleixner 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c -index 916ddc4aac44..833d27f85aea 100644 +index d37704ebccdb..b45a9849b687 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -766,6 +766,7 @@ void irq_ctx_init(void) @@ -59,7 +59,7 @@ index 695b24a2d954..032ada21b7bd 100644 /* * void call_do_irq(struct pt_regs *regs, struct thread_info *irqtp); diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S -index 262ba9481781..4935ef9a142e 100644 +index facc02964ab3..8b1774186c68 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S @@ -32,6 +32,7 @@ @@ -119,10 +119,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 c90e00db5c13..7b29f2c10d01 100644 +index ccb5e3486aee..7ffd83c57ef2 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -1059,6 +1059,7 @@ bad_gs: +@@ -1083,6 +1083,7 @@ bad_gs: jmp 2b .previous @@ -130,7 +130,7 @@ index c90e00db5c13..7b29f2c10d01 100644 /* Call softirq on interrupt stack. Interrupts are off. */ ENTRY(do_softirq_own_stack) pushq %rbp -@@ -1069,6 +1070,7 @@ ENTRY(do_softirq_own_stack) +@@ -1093,6 +1094,7 @@ ENTRY(do_softirq_own_stack) leaveq ret ENDPROC(do_softirq_own_stack) @@ -172,5 +172,5 @@ index e74936c7be48..cb2d1384cb0d 100644 #else static inline void do_softirq_own_stack(void) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0122-softirq-Split-softirq-locks.patch b/kernel/patches-4.19.x-rt/0122-softirq-Split-softirq-locks.patch index bafab2489..f77e66b2b 100644 --- a/kernel/patches-4.19.x-rt/0122-softirq-Split-softirq-locks.patch +++ b/kernel/patches-4.19.x-rt/0122-softirq-Split-softirq-locks.patch @@ -1,7 +1,7 @@ -From 92ea7fb3bb1aa31dbfaa1aa02e6a83b3d5e2e476 Mon Sep 17 00:00:00 2001 +From d9b80fda665aeecc128e15d7771a29dcf01f3e36 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 4 Oct 2012 14:20:47 +0100 -Subject: [PATCH 122/283] softirq: Split softirq locks +Subject: [PATCH 122/328] softirq: Split softirq locks The 3.x RT series removed the split softirq implementation in favour of pushing softirq processing into the context of the thread which @@ -177,10 +177,10 @@ index 9984f2b75b73..27c3176d88d2 100644 #define in_task() (!(preempt_count() & \ (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET))) diff --git a/include/linux/sched.h b/include/linux/sched.h -index ad44849fba2e..7ecccccbd358 100644 +index f180bfadff33..f4ff928e6be3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1190,6 +1190,8 @@ struct task_struct { +@@ -1198,6 +1198,8 @@ struct task_struct { #endif #ifdef CONFIG_PREEMPT_RT_BASE struct rcu_head put_rcu; @@ -189,7 +189,7 @@ index ad44849fba2e..7ecccccbd358 100644 #endif #ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change; -@@ -1387,6 +1389,7 @@ extern struct pid *cad_pid; +@@ -1395,6 +1397,7 @@ extern struct pid *cad_pid; /* * Per process flags */ @@ -198,10 +198,10 @@ 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 020972fed117..4a7471606e53 100644 +index 38a603f62b7b..6e02188386a7 100644 --- a/init/main.c +++ b/init/main.c -@@ -561,6 +561,7 @@ asmlinkage __visible void __init start_kernel(void) +@@ -560,6 +560,7 @@ asmlinkage __visible void __init start_kernel(void) setup_command_line(command_line); setup_nr_cpu_ids(); setup_per_cpu_areas(); @@ -807,10 +807,10 @@ index 1d3a482246cc..fd89f8ab85ac 100644 .thread_fn = run_ksoftirqd, .thread_comm = "ksoftirqd/%u", diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index c217af74dddf..6482945f8ae8 100644 +index 012bc81879bf..2b0ddd50e879 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -891,14 +891,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) +@@ -895,14 +895,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) return false; if (unlikely(local_softirq_pending() && cpu_online(cpu))) { @@ -827,5 +827,5 @@ index c217af74dddf..6482945f8ae8 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0123-net-core-use-local_bh_disable-in-netif_rx_ni.patch b/kernel/patches-4.19.x-rt/0123-net-core-use-local_bh_disable-in-netif_rx_ni.patch index b2d2bc23f..4459a09ba 100644 --- a/kernel/patches-4.19.x-rt/0123-net-core-use-local_bh_disable-in-netif_rx_ni.patch +++ b/kernel/patches-4.19.x-rt/0123-net-core-use-local_bh_disable-in-netif_rx_ni.patch @@ -1,7 +1,7 @@ -From 05b2969dc9be8c70c6bac548cf956a1d14d905f5 Mon Sep 17 00:00:00 2001 +From afeabb59361466c6e88b4e95603508d7375f4aeb Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 16 Jun 2017 19:03:16 +0200 -Subject: [PATCH 123/283] net/core: use local_bh_disable() in netif_rx_ni() +Subject: [PATCH 123/328] net/core: use local_bh_disable() in netif_rx_ni() In 2004 netif_rx_ni() gained a preempt_disable() section around netif_rx() and its do_softirq() + testing for it. The do_softirq() part @@ -18,10 +18,10 @@ 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 48c4dc728d1b..abaf8a73403b 100644 +index 45ff62d35a1f..b754adb14205 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4526,11 +4526,9 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -4529,11 +4529,9 @@ int netif_rx_ni(struct sk_buff *skb) trace_netif_rx_ni_entry(skb); @@ -36,5 +36,5 @@ index 48c4dc728d1b..abaf8a73403b 100644 return err; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0124-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch b/kernel/patches-4.19.x-rt/0124-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch index a52680294..8f3fd1aaf 100644 --- a/kernel/patches-4.19.x-rt/0124-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch +++ b/kernel/patches-4.19.x-rt/0124-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch @@ -1,7 +1,7 @@ -From c1e610ee580a46e958b904e4b2ec3c0d701e08d1 Mon Sep 17 00:00:00 2001 +From a6531b867486fabcd2c6edc5ee1148497582e2b1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 31 Jan 2012 13:01:27 +0100 -Subject: [PATCH 124/283] genirq: Allow disabling of softirq processing in irq +Subject: [PATCH 124/328] genirq: Allow disabling of softirq processing in irq thread context The processing of softirqs in irq thread context is a performance gain @@ -40,7 +40,7 @@ index 6c25b962ba89..99f8b7ace7c9 100644 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) diff --git a/include/linux/irq.h b/include/linux/irq.h -index c9bffda04a45..73d3146db74d 100644 +index 6ecaf056ab63..d2487df7ae89 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -69,6 +69,7 @@ enum irqchip_irq_state; @@ -68,10 +68,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 af2a8757abfb..69b4bfd4654c 100644 +index eadcbfbd434a..3858ac895777 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -978,7 +978,15 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) +@@ -1004,7 +1004,15 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) atomic_inc(&desc->threads_handled); irq_finalize_oneshot(desc, action); @@ -88,7 +88,7 @@ index af2a8757abfb..69b4bfd4654c 100644 return ret; } -@@ -1488,6 +1496,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) +@@ -1514,6 +1522,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) irqd_set(&desc->irq_data, IRQD_NO_BALANCING); } @@ -156,5 +156,5 @@ index fd89f8ab85ac..3e9333d148ad 100644 { return current->flags & PF_IN_SOFTIRQ; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0125-softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/kernel/patches-4.19.x-rt/0125-softirq-split-timer-softirqs-out-of-ksoftirqd.patch index 4ee3468c5..4d8232cf5 100644 --- a/kernel/patches-4.19.x-rt/0125-softirq-split-timer-softirqs-out-of-ksoftirqd.patch +++ b/kernel/patches-4.19.x-rt/0125-softirq-split-timer-softirqs-out-of-ksoftirqd.patch @@ -1,7 +1,7 @@ -From 9d4b8d35c23cd7cece2662fa17dea28d39f73e82 Mon Sep 17 00:00:00 2001 +From e106eea6c2a414edbf8c47e0df2db6ea5a462c7f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 16:34:17 +0100 -Subject: [PATCH 125/283] softirq: split timer softirqs out of ksoftirqd +Subject: [PATCH 125/328] softirq: split timer softirqs out of ksoftirqd 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 @@ -210,5 +210,5 @@ index 3e9333d148ad..fe4e59c80a08 100644 } early_initcall(spawn_ksoftirqd); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0126-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch b/kernel/patches-4.19.x-rt/0126-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch index 9dd004d34..609632ec2 100644 --- a/kernel/patches-4.19.x-rt/0126-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch +++ b/kernel/patches-4.19.x-rt/0126-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch @@ -1,7 +1,7 @@ -From 75bef693f46a9a3fd05cda70554c004df275c92b Mon Sep 17 00:00:00 2001 +From aa3841d4115d3530ea77a590bbd13940881f5d37 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 18 Feb 2019 13:19:59 +0100 -Subject: [PATCH 126/283] softirq: Avoid "local_softirq_pending" messages if +Subject: [PATCH 126/328] softirq: Avoid "local_softirq_pending" messages if ksoftirqd is blocked If the ksoftirqd thread has a softirq pending and is blocked on the @@ -107,5 +107,5 @@ index fe4e59c80a08..1920985eeb09 100644 if (warnpending) { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0127-softirq-Avoid-local_softirq_pending-messages-if-task.patch b/kernel/patches-4.19.x-rt/0127-softirq-Avoid-local_softirq_pending-messages-if-task.patch index 35daafaf5..0abe02ab0 100644 --- a/kernel/patches-4.19.x-rt/0127-softirq-Avoid-local_softirq_pending-messages-if-task.patch +++ b/kernel/patches-4.19.x-rt/0127-softirq-Avoid-local_softirq_pending-messages-if-task.patch @@ -1,7 +1,7 @@ -From fffcebd7dd6c2220fd06db35bffa957b6d4f3de1 Mon Sep 17 00:00:00 2001 +From cbcc7f169a523a3b55877cb01d10cd2e96654d3a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 19 Feb 2019 16:49:29 +0100 -Subject: [PATCH 127/283] softirq: Avoid "local_softirq_pending" messages if +Subject: [PATCH 127/328] softirq: Avoid "local_softirq_pending" messages if task is in cpu_chill() If the softirq thread enters cpu_chill() then ->state is UNINTERRUPTIBLE @@ -36,5 +36,5 @@ index 1920985eeb09..27a4bb2303d0 100644 *pending &= ~(tsk->softirqs_raised); ret = true; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0128-rtmutex-trylock-is-okay-on-RT.patch b/kernel/patches-4.19.x-rt/0128-rtmutex-trylock-is-okay-on-RT.patch index 010d8d4c2..535093120 100644 --- a/kernel/patches-4.19.x-rt/0128-rtmutex-trylock-is-okay-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0128-rtmutex-trylock-is-okay-on-RT.patch @@ -1,7 +1,7 @@ -From e35f309a9eb6078f3d09d042b9ebcff7612d9398 Mon Sep 17 00:00:00 2001 +From 0666dfeb48e54032c73ac843af0c02be5353c0dc Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 2 Dec 2015 11:34:07 +0100 -Subject: [PATCH 128/283] rtmutex: trylock is okay on -RT +Subject: [PATCH 128/328] rtmutex: trylock is okay on -RT 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 @@ -29,5 +29,5 @@ index 9562aaa2afdc..72abe7c121fa 100644 ret = rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0129-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/kernel/patches-4.19.x-rt/0129-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index 9930df52f..7c2ccde1e 100644 --- a/kernel/patches-4.19.x-rt/0129-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/kernel/patches-4.19.x-rt/0129-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,7 +1,7 @@ -From 2755280eb692ac3db15304cb7874d039103cf43f Mon Sep 17 00:00:00 2001 +From 8b0d3978951a7ad39608fdcbfd291e6ba717f86a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 15 Sep 2016 10:51:27 +0200 -Subject: [PATCH 129/283] fs/nfs: turn rmdir_sem into a semaphore +Subject: [PATCH 129/328] fs/nfs: turn rmdir_sem into a semaphore 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 @@ -21,10 +21,10 @@ Signed-off-by: Sebastian Andrzej Siewior 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c -index 8bfaa658b2c1..62afe8ca1e36 100644 +index 4ae726e70d87..c60b20884c45 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c -@@ -1786,7 +1786,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) +@@ -1836,7 +1836,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) trace_nfs_rmdir_enter(dir, dentry); if (d_really_is_positive(dentry)) { @@ -36,7 +36,7 @@ index 8bfaa658b2c1..62afe8ca1e36 100644 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); /* Ensure the VFS deletes this inode */ switch (error) { -@@ -1796,7 +1800,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) +@@ -1846,7 +1850,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) case -ENOENT: nfs_dentry_handle_enoent(dentry); } @@ -49,10 +49,10 @@ index 8bfaa658b2c1..62afe8ca1e36 100644 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); trace_nfs_rmdir_exit(dir, dentry, error); diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c -index b65aee481d13..110ee6f78c31 100644 +index e4cd3a2fe698..6f22c8d65760 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c -@@ -2103,7 +2103,11 @@ static void init_once(void *foo) +@@ -2104,7 +2104,11 @@ static void init_once(void *foo) atomic_long_set(&nfsi->nrequests, 0); atomic_long_set(&nfsi->commit_info.ncommit, 0); atomic_set(&nfsi->commit_info.rpcs_out, 0); @@ -146,5 +146,5 @@ index a0831e9d19c9..94b6fefd90b0 100644 #if IS_ENABLED(CONFIG_NFS_V4) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0130-rtmutex-Handle-the-various-new-futex-race-conditions.patch b/kernel/patches-4.19.x-rt/0130-rtmutex-Handle-the-various-new-futex-race-conditions.patch index ec47d6173..9216f5233 100644 --- a/kernel/patches-4.19.x-rt/0130-rtmutex-Handle-the-various-new-futex-race-conditions.patch +++ b/kernel/patches-4.19.x-rt/0130-rtmutex-Handle-the-various-new-futex-race-conditions.patch @@ -1,7 +1,7 @@ -From 7130157f0703b4fe45ca427befd9ef0a7f88612f Mon Sep 17 00:00:00 2001 +From 1ed0026aa6e48c934e7c081a04d36fe44b9b7fa1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 10 Jun 2011 11:04:15 +0200 -Subject: [PATCH 130/283] rtmutex: Handle the various new futex race conditions +Subject: [PATCH 130/328] rtmutex: Handle the various new futex race conditions RT opens a few new interesting race conditions in the rtmutex/futex combo due to futex hash bucket lock being a 'sleeping' spinlock and @@ -15,10 +15,10 @@ Signed-off-by: Thomas Gleixner 3 files changed, 94 insertions(+), 21 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c -index ccf933ac2997..b2a90c66d8f4 100644 +index 23e1f8a478e8..5ec49f862c53 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2146,6 +2146,16 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, +@@ -2149,6 +2149,16 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, requeue_pi_wake_futex(this, &key2, hb2); drop_count++; continue; @@ -35,7 +35,7 @@ index ccf933ac2997..b2a90c66d8f4 100644 } else if (ret) { /* * rt_mutex_start_proxy_lock() detected a -@@ -3224,7 +3234,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3227,7 +3237,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; @@ -44,7 +44,7 @@ index ccf933ac2997..b2a90c66d8f4 100644 union futex_key key2 = FUTEX_KEY_INIT; struct futex_q q = futex_q_init; int res, ret; -@@ -3282,20 +3292,55 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3285,20 +3295,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); @@ -111,7 +111,7 @@ index ccf933ac2997..b2a90c66d8f4 100644 /* Check if the requeue code acquired the second futex for us. */ if (!q.rt_waiter) { -@@ -3304,7 +3349,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3307,7 +3352,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)) { @@ -121,7 +121,7 @@ index ccf933ac2997..b2a90c66d8f4 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; -@@ -3315,7 +3361,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3318,7 +3364,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); @@ -130,7 +130,7 @@ index ccf933ac2997..b2a90c66d8f4 100644 } } else { struct rt_mutex *pi_mutex; -@@ -3329,7 +3375,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3332,7 +3378,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); @@ -250,5 +250,5 @@ index d1d62f942be2..f4b6596d224a 100644 extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0131-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch b/kernel/patches-4.19.x-rt/0131-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch index f480389e8..e05c4a63a 100644 --- a/kernel/patches-4.19.x-rt/0131-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch +++ b/kernel/patches-4.19.x-rt/0131-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch @@ -1,7 +1,7 @@ -From 7e148d447a1c2abcfba79f0d7cefeeb24350ca70 Mon Sep 17 00:00:00 2001 +From 73f0f3253d80c3fc291c3198becd7054215494e3 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 131/283] futex: Fix bug on when a requeued RT task times out +Subject: [PATCH 131/328] futex: Fix bug on when a requeued RT task times out Requeue with timeout causes a bug with PREEMPT_RT_FULL. @@ -116,5 +116,5 @@ index f4b6596d224a..461527f3f7af 100644 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 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0132-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/kernel/patches-4.19.x-rt/0132-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index dc1800a22..68d5f3634 100644 --- a/kernel/patches-4.19.x-rt/0132-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/kernel/patches-4.19.x-rt/0132-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch @@ -1,7 +1,7 @@ -From aee00b9108ae7ac1108f577b3bbdfd0b34709904 Mon Sep 17 00:00:00 2001 +From d85ad9d88f2afd388a77f8652da86554c45e9bc2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 1 Mar 2013 11:17:42 +0100 -Subject: [PATCH 132/283] futex: Ensure lock/unlock symetry versus pi_lock and +Subject: [PATCH 132/328] futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock In exit_pi_state_list() we have the following locking construct: @@ -31,10 +31,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 2 insertions(+) diff --git a/kernel/futex.c b/kernel/futex.c -index b2a90c66d8f4..4d6501d689b5 100644 +index 5ec49f862c53..60be4530c767 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -918,7 +918,9 @@ void exit_pi_state_list(struct task_struct *curr) +@@ -921,7 +921,9 @@ 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); @@ -45,5 +45,5 @@ index b2a90c66d8f4..4d6501d689b5 100644 continue; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0133-pid.h-include-atomic.h.patch b/kernel/patches-4.19.x-rt/0133-pid.h-include-atomic.h.patch index e222dd0f4..95f4ff63f 100644 --- a/kernel/patches-4.19.x-rt/0133-pid.h-include-atomic.h.patch +++ b/kernel/patches-4.19.x-rt/0133-pid.h-include-atomic.h.patch @@ -1,7 +1,7 @@ -From 6a4de7464f4d9165d37b0649a2b3e15f4cb64385 Mon Sep 17 00:00:00 2001 +From 7706f24354f883b341ed0ed1535167264b7e2315 Mon Sep 17 00:00:00 2001 From: Grygorii Strashko Date: Tue, 21 Jul 2015 19:43:56 +0300 -Subject: [PATCH 133/283] pid.h: include atomic.h +Subject: [PATCH 133/328] pid.h: include atomic.h This patch fixes build error: CC kernel/pid_namespace.o @@ -38,5 +38,5 @@ index 14a9a39da9c7..a9026a5da196 100644 enum pid_type { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0134-arm-include-definition-for-cpumask_t.patch b/kernel/patches-4.19.x-rt/0134-arm-include-definition-for-cpumask_t.patch index d4b3db7a7..a873b5904 100644 --- a/kernel/patches-4.19.x-rt/0134-arm-include-definition-for-cpumask_t.patch +++ b/kernel/patches-4.19.x-rt/0134-arm-include-definition-for-cpumask_t.patch @@ -1,7 +1,7 @@ -From 7a6eaa6b88680cbb1309983cc198a08c1bccacfa Mon Sep 17 00:00:00 2001 +From b7f97d2d6bca4bbc87c6aaaac3847a6bb96d8221 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Dec 2016 17:28:33 +0100 -Subject: [PATCH 134/283] arm: include definition for cpumask_t +Subject: [PATCH 134/328] arm: include definition for cpumask_t This definition gets pulled in by other files. With the (later) split of RCU and spinlock.h it won't compile anymore. @@ -26,5 +26,5 @@ index 46d41140df27..c421b5b81946 100644 struct pt_regs; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0135-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/kernel/patches-4.19.x-rt/0135-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index ee1cbc73f..35fcb47c7 100644 --- a/kernel/patches-4.19.x-rt/0135-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/kernel/patches-4.19.x-rt/0135-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch @@ -1,7 +1,7 @@ -From 9043ba063f09071ec009efc5a340864f46b5d660 Mon Sep 17 00:00:00 2001 +From df43e09336267ae6fd3e9e0f754a1c13bc90dabc Mon Sep 17 00:00:00 2001 From: "Wolfgang M. Reimer" Date: Tue, 21 Jul 2015 16:20:07 +0200 -Subject: [PATCH 135/283] locking: locktorture: Do NOT include rwlock.h +Subject: [PATCH 135/328] locking: locktorture: Do NOT include rwlock.h directly Including rwlock.h directly will cause kernel builds to fail @@ -29,5 +29,5 @@ index 7d0b0ed74404..a81e6ef33a04 100644 #include #include -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0136-rtmutex-Add-rtmutex_lock_killable.patch b/kernel/patches-4.19.x-rt/0136-rtmutex-Add-rtmutex_lock_killable.patch index ccbe33ea7..e20855bbf 100644 --- a/kernel/patches-4.19.x-rt/0136-rtmutex-Add-rtmutex_lock_killable.patch +++ b/kernel/patches-4.19.x-rt/0136-rtmutex-Add-rtmutex_lock_killable.patch @@ -1,7 +1,7 @@ -From 471f3ddc1d39e94a3bb7b3de877630a7ba33e9ed Mon Sep 17 00:00:00 2001 +From 8d29fec3b1d6060351dadfed4d8e4555ee42ada2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 9 Jun 2011 11:43:52 +0200 -Subject: [PATCH 136/283] rtmutex: Add rtmutex_lock_killable() +Subject: [PATCH 136/328] rtmutex: Add rtmutex_lock_killable() Add "killable" type to rtmutex. We need this since rtmutex are used as "normal" mutexes which do use this type. @@ -55,5 +55,5 @@ index 1c3f56d3d9b6..a4b2af7718f8 100644 * rt_mutex_timed_lock - lock a rt_mutex interruptible * the timeout structure is provided -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0137-rtmutex-Make-lock_killable-work.patch b/kernel/patches-4.19.x-rt/0137-rtmutex-Make-lock_killable-work.patch index af3b5d82e..05b43f8e6 100644 --- a/kernel/patches-4.19.x-rt/0137-rtmutex-Make-lock_killable-work.patch +++ b/kernel/patches-4.19.x-rt/0137-rtmutex-Make-lock_killable-work.patch @@ -1,7 +1,7 @@ -From f8590dc009d4339ab04d322fbc87a267824eb97f Mon Sep 17 00:00:00 2001 +From 3543c69b949257b8409b0ebb45b2e369afcbeb9b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 1 Apr 2017 12:50:59 +0200 -Subject: [PATCH 137/283] rtmutex: Make lock_killable work +Subject: [PATCH 137/328] rtmutex: Make lock_killable work Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. @@ -46,5 +46,5 @@ index a4b2af7718f8..f058bb976212 100644 raw_spin_unlock_irq(&lock->wait_lock); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0138-spinlock-Split-the-lock-types-header.patch b/kernel/patches-4.19.x-rt/0138-spinlock-Split-the-lock-types-header.patch index ee0e92654..faf1e5bb7 100644 --- a/kernel/patches-4.19.x-rt/0138-spinlock-Split-the-lock-types-header.patch +++ b/kernel/patches-4.19.x-rt/0138-spinlock-Split-the-lock-types-header.patch @@ -1,7 +1,7 @@ -From 2211e897694e1560a1b5b5e552c2321e131dacc3 Mon Sep 17 00:00:00 2001 +From 144cea745b056040b555dc8819e31a8ae76714c2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 19:34:01 +0200 -Subject: [PATCH 138/283] spinlock: Split the lock types header +Subject: [PATCH 138/328] spinlock: Split the lock types header 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 @@ -216,5 +216,5 @@ index 000000000000..822bf64a61d3 + +#endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0139-rtmutex-Avoid-include-hell.patch b/kernel/patches-4.19.x-rt/0139-rtmutex-Avoid-include-hell.patch index 4f304dae9..50f0e3b66 100644 --- a/kernel/patches-4.19.x-rt/0139-rtmutex-Avoid-include-hell.patch +++ b/kernel/patches-4.19.x-rt/0139-rtmutex-Avoid-include-hell.patch @@ -1,7 +1,7 @@ -From eac9084f86148510c6c67ed209d33fcb15fb8b94 Mon Sep 17 00:00:00 2001 +From 20ec86befc19cae2065e4b8e3dcda396081489eb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 20:06:39 +0200 -Subject: [PATCH 139/283] rtmutex: Avoid include hell +Subject: [PATCH 139/328] rtmutex: Avoid include hell Include only the required raw types. This avoids pulling in the complete spinlock header which in turn requires rtmutex.h at some point. @@ -25,5 +25,5 @@ index 81ece6a8291a..a355289b1fa1 100644 extern int max_lock_depth; /* for sysctl */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0140-rbtree-don-t-include-the-rcu-header.patch b/kernel/patches-4.19.x-rt/0140-rbtree-don-t-include-the-rcu-header.patch index 3b10ccc02..70ebaf519 100644 --- a/kernel/patches-4.19.x-rt/0140-rbtree-don-t-include-the-rcu-header.patch +++ b/kernel/patches-4.19.x-rt/0140-rbtree-don-t-include-the-rcu-header.patch @@ -1,7 +1,7 @@ -From ac40e3b4806fe59befb8c9387e7bb317a560cd9a Mon Sep 17 00:00:00 2001 +From 0c9090c07884c6d1e32a8def9f3c7fa5e889f4e3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 26 Feb 2019 16:56:02 +0100 -Subject: [PATCH 140/283] rbtree: don't include the rcu header +Subject: [PATCH 140/328] rbtree: don't include the rcu header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -103,7 +103,7 @@ index 000000000000..7066962a4379 + +#endif diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h -index 87eafcb3312f..b73715c3c3c2 100644 +index 027c58cdbb6e..e6733d7911e9 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -42,6 +42,7 @@ @@ -170,5 +170,5 @@ index 87eafcb3312f..b73715c3c3c2 100644 * rcu_swap_protected() - swap an RCU and a regular pointer * @rcu_ptr: RCU pointer -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0141-rtmutex-Provide-rt_mutex_slowlock_locked.patch b/kernel/patches-4.19.x-rt/0141-rtmutex-Provide-rt_mutex_slowlock_locked.patch index e3456f637..9b3afb728 100644 --- a/kernel/patches-4.19.x-rt/0141-rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/kernel/patches-4.19.x-rt/0141-rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,7 +1,7 @@ -From 701e93b4c6964c05cec92d9611c50dc83a6b6b9b Mon Sep 17 00:00:00 2001 +From 3340a41255c128e25956abc1370f0e5d1b702dda Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:14:22 +0200 -Subject: [PATCH 141/283] rtmutex: Provide rt_mutex_slowlock_locked() +Subject: [PATCH 141/328] rtmutex: Provide rt_mutex_slowlock_locked() This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. @@ -140,5 +140,5 @@ index 461527f3f7af..cb9815f0c766 100644 #ifdef CONFIG_DEBUG_RT_MUTEXES # include "rtmutex-debug.h" -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0142-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/kernel/patches-4.19.x-rt/0142-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index 4c2db5da6..85a1d1d01 100644 --- a/kernel/patches-4.19.x-rt/0142-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/kernel/patches-4.19.x-rt/0142-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch @@ -1,7 +1,7 @@ -From 8bd2090cb448193446dee9a6a7fb661e89263f46 Mon Sep 17 00:00:00 2001 +From e6cb2f5352cc7339044142820ecdc55d45f97ce5 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:36:39 +0200 -Subject: [PATCH 142/283] rtmutex: export lockdep-less version of rt_mutex's +Subject: [PATCH 142/328] rtmutex: export lockdep-less version of rt_mutex's lock, trylock and unlock Required for lock implementation ontop of rtmutex. @@ -148,5 +148,5 @@ index cb9815f0c766..5955ad2aa2a8 100644 struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0143-rtmutex-add-sleeping-lock-implementation.patch b/kernel/patches-4.19.x-rt/0143-rtmutex-add-sleeping-lock-implementation.patch index 72f929a28..e5e418450 100644 --- a/kernel/patches-4.19.x-rt/0143-rtmutex-add-sleeping-lock-implementation.patch +++ b/kernel/patches-4.19.x-rt/0143-rtmutex-add-sleeping-lock-implementation.patch @@ -1,7 +1,7 @@ -From 966d9bcd54442c2ae5dd15f89a908539d6ad7137 Mon Sep 17 00:00:00 2001 +From 4972c101326c6e36a9f541deeab9b56e3bef9932 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:11:19 +0200 -Subject: [PATCH 143/283] rtmutex: add sleeping lock implementation +Subject: [PATCH 143/328] rtmutex: add sleeping lock implementation Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior @@ -22,10 +22,10 @@ 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 3d83ebb302cf..d81a153df451 100644 +index f6f94e54ab96..78f30d553037 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h -@@ -259,6 +259,9 @@ extern int _cond_resched(void); +@@ -260,6 +260,9 @@ extern int _cond_resched(void); */ # define might_sleep() \ do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) @@ -35,7 +35,7 @@ index 3d83ebb302cf..d81a153df451 100644 # define sched_annotate_sleep() (current->task_state_change = 0) #else static inline void ___might_sleep(const char *file, int line, -@@ -266,6 +269,7 @@ extern int _cond_resched(void); +@@ -267,6 +270,7 @@ extern int _cond_resched(void); static inline void __might_sleep(const char *file, int line, int preempt_offset) { } # define might_sleep() do { might_resched(); } while (0) @@ -102,7 +102,7 @@ index a355289b1fa1..138bd1e183e0 100644 * rt_mutex_is_locked - is the mutex locked * @lock: the mutex to be queried diff --git a/include/linux/sched.h b/include/linux/sched.h -index 7ecccccbd358..1797fd3c8cbb 100644 +index f4ff928e6be3..527d04f9163e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -134,6 +134,9 @@ struct task_group; @@ -395,10 +395,10 @@ index 000000000000..3e3d8c5f7a9a + +#endif diff --git a/kernel/fork.c b/kernel/fork.c -index 247b08eb66c8..96297e71019c 100644 +index 29b54a64daf5..ecec0f8bef7e 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) +@@ -900,6 +900,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) tsk->splice_pipe = NULL; tsk->task_frag.page = NULL; tsk->wake_q.next = NULL; @@ -407,10 +407,10 @@ index 247b08eb66c8..96297e71019c 100644 account_kernel_stack(tsk, 1); diff --git a/kernel/futex.c b/kernel/futex.c -index 4d6501d689b5..fe90164aa6ec 100644 +index 60be4530c767..4c448dddce3c 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -1476,6 +1476,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ +@@ -1479,6 +1479,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); @@ -418,7 +418,7 @@ index 4d6501d689b5..fe90164aa6ec 100644 int ret = 0; new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); -@@ -1535,13 +1536,13 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ +@@ -1538,13 +1539,13 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ pi_state->owner = new_owner; raw_spin_unlock(&new_owner->pi_lock); @@ -435,7 +435,7 @@ index 4d6501d689b5..fe90164aa6ec 100644 return ret; } -@@ -2870,7 +2871,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2873,7 +2874,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, goto no_block; } @@ -444,7 +444,7 @@ index 4d6501d689b5..fe90164aa6ec 100644 /* * On PREEMPT_RT_FULL, when hb->lock becomes an rt_mutex, we must not -@@ -3263,7 +3264,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3266,7 +3267,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. */ @@ -1143,7 +1143,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 a8e9283f018c..868d3395c3cf 100644 +index 42b42ebf52bc..6a0ccaea2b42 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) @@ -1203,5 +1203,5 @@ index a8e9283f018c..868d3395c3cf 100644 } } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0144-rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/kernel/patches-4.19.x-rt/0144-rtmutex-add-mutex-implementation-based-on-rtmutex.patch index 5f384c3db..0bb0f434e 100644 --- a/kernel/patches-4.19.x-rt/0144-rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/kernel/patches-4.19.x-rt/0144-rtmutex-add-mutex-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ -From b589ab9fd5ba3e54255590659660a6c0beecdc4b Mon Sep 17 00:00:00 2001 +From ac391538d1f4dff13baf839ada70bb001c1462dd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:17:03 +0200 -Subject: [PATCH 144/283] rtmutex: add mutex implementation based on rtmutex +Subject: [PATCH 144/328] rtmutex: add mutex implementation based on rtmutex Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior @@ -378,5 +378,5 @@ index 000000000000..4f81595c0f52 +} +EXPORT_SYMBOL(atomic_dec_and_mutex_lock); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0145-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/kernel/patches-4.19.x-rt/0145-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index d0cba75dc..6bbf8cd7a 100644 --- a/kernel/patches-4.19.x-rt/0145-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/kernel/patches-4.19.x-rt/0145-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ -From 5b491c8328f76502a2285229fd224ec7116dfed7 Mon Sep 17 00:00:00 2001 +From b0c41a7abe90071ea550299c767852ba0d55a41f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:28:34 +0200 -Subject: [PATCH 145/283] rtmutex: add rwsem implementation based on rtmutex +Subject: [PATCH 145/328] rtmutex: add rwsem implementation based on rtmutex 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 @@ -422,5 +422,5 @@ index 000000000000..7d3c5cf3d23d + __up_write_unlock(sem, WRITER_BIAS - 1, flags); +} -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0146-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/kernel/patches-4.19.x-rt/0146-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index ee0656e98..e3f55f58c 100644 --- a/kernel/patches-4.19.x-rt/0146-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/kernel/patches-4.19.x-rt/0146-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ -From 0ac4d3a8d1b2e6effaea2997c80bb3583d3f6a12 Mon Sep 17 00:00:00 2001 +From c4d9a03dadd2e41e7670cbd53f91f7c08e3a3ce6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:18:06 +0200 -Subject: [PATCH 146/283] rtmutex: add rwlock implementation based on rtmutex +Subject: [PATCH 146/328] rtmutex: add rwlock implementation based on rtmutex The implementation is bias-based, similar to the rwsem implementation. @@ -577,5 +577,5 @@ index 000000000000..aebb7ce25bc6 +} +EXPORT_SYMBOL(__rt_rwlock_init); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0147-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch b/kernel/patches-4.19.x-rt/0147-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch index da6363262..f6afe52b7 100644 --- a/kernel/patches-4.19.x-rt/0147-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch +++ b/kernel/patches-4.19.x-rt/0147-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch @@ -1,7 +1,7 @@ -From fa17e8511d2f284ca4d1bebe5744ec1e41ce1803 Mon Sep 17 00:00:00 2001 +From 997abbcc33dcad79e5670265b72051ddc3cfdce7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 11 Jan 2019 21:16:31 +0100 -Subject: [PATCH 147/283] rtmutex/rwlock: preserve state like a sleeping lock +Subject: [PATCH 147/328] rtmutex/rwlock: preserve state like a sleeping lock 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 @@ -28,5 +28,5 @@ index aebb7ce25bc6..8f90afe111ce 100644 /* * The slowlock() above is guaranteed to return with the rtmutex is -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0148-rtmutex-wire-up-RT-s-locking.patch b/kernel/patches-4.19.x-rt/0148-rtmutex-wire-up-RT-s-locking.patch index 0a08b39fe..38bea50eb 100644 --- a/kernel/patches-4.19.x-rt/0148-rtmutex-wire-up-RT-s-locking.patch +++ b/kernel/patches-4.19.x-rt/0148-rtmutex-wire-up-RT-s-locking.patch @@ -1,7 +1,7 @@ -From c3de22b64c9e40a638fd521cbfb87285e475d2ee Mon Sep 17 00:00:00 2001 +From c55bc0df82ccf91b888e73d888a1afb8c8cbc581 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:31:14 +0200 -Subject: [PATCH 148/283] rtmutex: wire up RT's locking +Subject: [PATCH 148/328] rtmutex: wire up RT's locking Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior @@ -232,7 +232,7 @@ index 936f3d14dd6b..e89b70f474af 100644 void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c -index 9aa0fccd5d43..76d0b40d9193 100644 +index 03595c29c566..d63df281b495 100644 --- a/kernel/locking/spinlock_debug.c +++ b/kernel/locking/spinlock_debug.c @@ -31,6 +31,7 @@ void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, @@ -266,5 +266,5 @@ index 9aa0fccd5d43..76d0b40d9193 100644 + +#endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0149-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/kernel/patches-4.19.x-rt/0149-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index 16d561761..95fe7b208 100644 --- a/kernel/patches-4.19.x-rt/0149-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/kernel/patches-4.19.x-rt/0149-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,7 +1,7 @@ -From a0132c114d821b81d4e4104b797f76f0dd8fbcba Mon Sep 17 00:00:00 2001 +From 01d5bbd35ae2a2b3350c42e526b0199fb3836e48 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 17:34:38 +0200 -Subject: [PATCH 149/283] rtmutex: add ww_mutex addon for mutex-rt +Subject: [PATCH 149/328] rtmutex: add ww_mutex addon for mutex-rt Signed-off-by: Sebastian Andrzej Siewior --- @@ -440,5 +440,5 @@ index 7d3c5cf3d23d..660e22caf709 100644 * The slowlock() above is guaranteed to return with the rtmutex (for * ret = 0) is now held, so there can't be a writer active. Increment -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0150-kconfig-Add-PREEMPT_RT_FULL.patch b/kernel/patches-4.19.x-rt/0150-kconfig-Add-PREEMPT_RT_FULL.patch index 2707268ae..d72ec241f 100644 --- a/kernel/patches-4.19.x-rt/0150-kconfig-Add-PREEMPT_RT_FULL.patch +++ b/kernel/patches-4.19.x-rt/0150-kconfig-Add-PREEMPT_RT_FULL.patch @@ -1,7 +1,7 @@ -From b0a0152ae5fe9de88c2b10c9e213ab1d10459876 Mon Sep 17 00:00:00 2001 +From c924e85c609186a184aecf090ef2251090f84d6b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 14:58:57 +0200 -Subject: [PATCH 150/283] kconfig: Add PREEMPT_RT_FULL +Subject: [PATCH 150/328] kconfig: Add PREEMPT_RT_FULL Introduce the final symbol for PREEMPT_RT_FULL. @@ -64,5 +64,5 @@ index 87f1fc9801d7..f67b15236936 100755 # Truncate to maximum length -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0151-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/kernel/patches-4.19.x-rt/0151-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index f6eb3d2f7..25bf2e083 100644 --- a/kernel/patches-4.19.x-rt/0151-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/kernel/patches-4.19.x-rt/0151-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch @@ -1,7 +1,7 @@ -From bb6f7fcdf67a3a410b786714d43f24dde243ff4e Mon Sep 17 00:00:00 2001 +From a0a7e75d70aae3240d9a6514b4fcfa1d7e1c9c1b Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Mon, 13 Nov 2017 12:56:53 -0500 -Subject: [PATCH 151/283] locking/rt-mutex: fix deadlock in device mapper / +Subject: [PATCH 151/328] locking/rt-mutex: fix deadlock in device mapper / block-IO When some block device driver creates a bio and submits it to another @@ -76,5 +76,5 @@ index 1f2dc2dfe2e7..b38c3a92dce8 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0152-locking-rt-mutex-Flush-block-plug-on-__down_read.patch b/kernel/patches-4.19.x-rt/0152-locking-rt-mutex-Flush-block-plug-on-__down_read.patch index f5263e55c..d063c72cf 100644 --- a/kernel/patches-4.19.x-rt/0152-locking-rt-mutex-Flush-block-plug-on-__down_read.patch +++ b/kernel/patches-4.19.x-rt/0152-locking-rt-mutex-Flush-block-plug-on-__down_read.patch @@ -1,7 +1,7 @@ -From 8b1428c9761e45fabdb70309947582526e3bbfbc Mon Sep 17 00:00:00 2001 +From ea61ac000de8f214ddfdf1ac240ea9776c84c5db Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Fri, 4 Jan 2019 15:33:21 -0500 -Subject: [PATCH 152/283] locking/rt-mutex: Flush block plug on __down_read() +Subject: [PATCH 152/328] locking/rt-mutex: Flush block plug on __down_read() __down_read() bypasses the rtmutex frontend to call rt_mutex_slowlock_locked() directly, and thus it needs to call @@ -41,5 +41,5 @@ index 660e22caf709..f518495bd6cc 100644 might_sleep(); raw_spin_lock_irq(&m->wait_lock); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0153-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/kernel/patches-4.19.x-rt/0153-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index b0676e749..dc0f91983 100644 --- a/kernel/patches-4.19.x-rt/0153-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/kernel/patches-4.19.x-rt/0153-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch @@ -1,7 +1,7 @@ -From 232cc4794d35bf36a49924022ebd18edb13c8a5d Mon Sep 17 00:00:00 2001 +From a6f0c5a56834d5fe16591a7fe6e5586f35ca6a00 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 16 Nov 2017 16:48:48 +0100 -Subject: [PATCH 153/283] locking/rtmutex: re-init the wait_lock in +Subject: [PATCH 153/328] locking/rtmutex: re-init the wait_lock in rt_mutex_init_proxy_locked() We could provide a key-class for the lockdep (and fixup all callers) or @@ -34,5 +34,5 @@ index b38c3a92dce8..94788662b2f2 100644 rt_mutex_set_owner(lock, proxy_owner); } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0154-ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/kernel/patches-4.19.x-rt/0154-ptrace-fix-ptrace-vs-tasklist_lock-race.patch index b53db8336..b2b9b70d7 100644 --- a/kernel/patches-4.19.x-rt/0154-ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/kernel/patches-4.19.x-rt/0154-ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,7 +1,7 @@ -From b031672801c6d24d255cc3d458e9a546899c919b Mon Sep 17 00:00:00 2001 +From e5ddc20b573d59f3760489cedf7080c8634ae241 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 18:21:04 +0200 -Subject: [PATCH 154/283] ptrace: fix ptrace vs tasklist_lock race +Subject: [PATCH 154/328] ptrace: fix ptrace vs tasklist_lock race As explained by Alexander Fyodorov : @@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior 3 files changed, 68 insertions(+), 7 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h -index 1797fd3c8cbb..25e9a40f9576 100644 +index 527d04f9163e..dd47fd913997 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -101,12 +101,8 @@ struct task_group; @@ -46,7 +46,7 @@ index 1797fd3c8cbb..25e9a40f9576 100644 #define task_contributes_to_load(task) ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ (task->flags & PF_FROZEN) == 0 && \ (task->state & TASK_NOLOAD) == 0) -@@ -1709,6 +1705,51 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) +@@ -1717,6 +1713,51 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } @@ -99,7 +99,7 @@ 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 fed682a01a75..ace2839323de 100644 +index b93eb4eaf7ac..a38b304fb9fd 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -174,7 +174,14 @@ static bool ptrace_freeze_traced(struct task_struct *task) @@ -119,7 +119,7 @@ index fed682a01a75..ace2839323de 100644 } spin_unlock_irq(&task->sighand->siglock); diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 868d3395c3cf..b2149a7ed3cd 100644 +index 6a0ccaea2b42..6bab30347081 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, @@ -161,5 +161,5 @@ index 868d3395c3cf..b2149a7ed3cd 100644 task_rq_unlock(rq, p, &rf); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0155-rtmutex-annotate-sleeping-lock-context.patch b/kernel/patches-4.19.x-rt/0155-rtmutex-annotate-sleeping-lock-context.patch index 880e32281..6734daffe 100644 --- a/kernel/patches-4.19.x-rt/0155-rtmutex-annotate-sleeping-lock-context.patch +++ b/kernel/patches-4.19.x-rt/0155-rtmutex-annotate-sleeping-lock-context.patch @@ -1,7 +1,7 @@ -From f9ae4924361c91598ce03771aaa5f99c4bfa8100 Mon Sep 17 00:00:00 2001 +From f030909005b15efe1f934a507d10971242608d81 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:25:13 +0200 -Subject: [PATCH 155/283] rtmutex: annotate sleeping lock context +Subject: [PATCH 155/328] rtmutex: annotate sleeping lock context 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 @@ -53,7 +53,7 @@ index 27c3176d88d2..9eafc34898b4 100644 #define migrate_disable() barrier() #define migrate_enable() barrier() diff --git a/include/linux/sched.h b/include/linux/sched.h -index 25e9a40f9576..8f0bb5f6d39e 100644 +index dd47fd913997..682cf84a7e1b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -673,6 +673,15 @@ struct task_struct { @@ -72,7 +72,7 @@ index 25e9a40f9576..8f0bb5f6d39e 100644 #endif #ifdef CONFIG_PREEMPT_RCU -@@ -1802,6 +1811,23 @@ static __always_inline bool need_resched(void) +@@ -1810,6 +1819,23 @@ static __always_inline bool need_resched(void) return unlikely(tif_need_resched()); } @@ -230,7 +230,7 @@ index 8f90afe111ce..c3b91205161c 100644 EXPORT_SYMBOL(rt_write_unlock); diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h -index a97c20ea9bce..564e3927e7b0 100644 +index 5f6de49dc78e..35f3552b7463 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -337,9 +337,13 @@ static void rcu_preempt_note_context_switch(bool preempt) @@ -249,10 +249,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 b2149a7ed3cd..ce1cb23cb78f 100644 +index 6bab30347081..d49580cb0eb2 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7316,4 +7316,49 @@ void migrate_enable(void) +@@ -7354,4 +7354,49 @@ void migrate_enable(void) preempt_enable(); } EXPORT_SYMBOL(migrate_enable); @@ -303,5 +303,5 @@ index b2149a7ed3cd..ce1cb23cb78f 100644 +EXPORT_SYMBOL(migrate_enable); #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0156-sched-migrate_disable-fallback-to-preempt_disable-in.patch b/kernel/patches-4.19.x-rt/0156-sched-migrate_disable-fallback-to-preempt_disable-in.patch index 11f21453d..706d2e736 100644 --- a/kernel/patches-4.19.x-rt/0156-sched-migrate_disable-fallback-to-preempt_disable-in.patch +++ b/kernel/patches-4.19.x-rt/0156-sched-migrate_disable-fallback-to-preempt_disable-in.patch @@ -1,7 +1,7 @@ -From 55652e517f87d321623cda451d7bfbcdc55528d9 Mon Sep 17 00:00:00 2001 +From 517e8491cd9ecd425b48019a9303e744ed3200b6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 5 Jul 2018 14:44:51 +0200 -Subject: [PATCH 156/283] sched/migrate_disable: fallback to preempt_disable() +Subject: [PATCH 156/328] sched/migrate_disable: fallback to preempt_disable() instead barrier() On SMP + !RT migrate_disable() is still around. It is not part of spin_lock() @@ -70,7 +70,7 @@ index 9eafc34898b4..ed8413e7140f 100644 { return 0; diff --git a/include/linux/sched.h b/include/linux/sched.h -index 8f0bb5f6d39e..a023e1ba5d8f 100644 +index 682cf84a7e1b..a38a2c2a8fe4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -667,7 +667,7 @@ struct task_struct { @@ -93,7 +93,7 @@ index 8f0bb5f6d39e..a023e1ba5d8f 100644 # endif #endif diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index ce1cb23cb78f..36f791ff52bc 100644 +index d49580cb0eb2..3b2664e691de 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 @@ -114,7 +114,7 @@ index ce1cb23cb78f..36f791ff52bc 100644 if (__migrate_disabled(p)) { lockdep_assert_held(&p->pi_lock); -@@ -1144,7 +1144,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, +@@ -1145,7 +1145,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, if (cpumask_test_cpu(task_cpu(p), new_mask) || __migrate_disabled(p)) goto out; @@ -123,7 +123,7 @@ index ce1cb23cb78f..36f791ff52bc 100644 if (__migrate_disabled(p)) { p->migrate_disable_update = 1; goto out; -@@ -7172,7 +7172,7 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7210,7 +7210,7 @@ const u32 sched_prio_to_wmult[40] = { #undef CREATE_TRACE_POINTS @@ -132,7 +132,7 @@ index ce1cb23cb78f..36f791ff52bc 100644 static inline void update_nr_migratory(struct task_struct *p, long delta) -@@ -7320,45 +7320,44 @@ EXPORT_SYMBOL(migrate_enable); +@@ -7358,45 +7358,44 @@ EXPORT_SYMBOL(migrate_enable); #elif !defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) void migrate_disable(void) { @@ -199,5 +199,5 @@ index 5027158d3908..dd6c364d6f01 100644 #endif P(nr_cpus_allowed); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0157-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/kernel/patches-4.19.x-rt/0157-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index a8c78c3e1..3a4441ed3 100644 --- a/kernel/patches-4.19.x-rt/0157-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/kernel/patches-4.19.x-rt/0157-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -1,7 +1,7 @@ -From 86ad5f1aff0d9992886c176a2f136ef494754c55 Mon Sep 17 00:00:00 2001 +From f4b5fe79d518718706341e443c11b7c5fd0f7bd4 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 17:40:42 +0200 -Subject: [PATCH 157/283] locking: don't check for __LINUX_SPINLOCK_TYPES_H on +Subject: [PATCH 157/328] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT archs Upstream uses arch_spinlock_t within spinlock_t and requests that @@ -177,5 +177,5 @@ index c09b6407ae1b..b0243ba07fb7 100644 * include/linux/spinlock_types_up.h - spinlock type definitions for UP * -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0158-rcu-Frob-softirq-test.patch b/kernel/patches-4.19.x-rt/0158-rcu-Frob-softirq-test.patch index b106a28c7..c7ea51819 100644 --- a/kernel/patches-4.19.x-rt/0158-rcu-Frob-softirq-test.patch +++ b/kernel/patches-4.19.x-rt/0158-rcu-Frob-softirq-test.patch @@ -1,7 +1,7 @@ -From 3b403e90bb2186f5908b365157b777ed870de348 Mon Sep 17 00:00:00 2001 +From 2e1b076839800d30698ad2fdfad982acb9acaac9 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Sat, 13 Aug 2011 00:23:17 +0200 -Subject: [PATCH 158/283] rcu: Frob softirq test +Subject: [PATCH 158/328] rcu: Frob softirq test With RT_FULL we get the below wreckage: @@ -155,7 +155,7 @@ Signed-off-by: Peter Zijlstra 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h -index 564e3927e7b0..429a2f144e19 100644 +index 35f3552b7463..e9ce51e19e87 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -524,7 +524,7 @@ static void rcu_read_unlock_special(struct task_struct *t) @@ -168,5 +168,5 @@ index 564e3927e7b0..429a2f144e19 100644 "rcu_read_unlock() from irq or softirq with blocking in critical section!!!\n"); pr_alert("->rcu_read_unlock_special: %#x (b: %d, enq: %d nq: %d)\n", -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0159-rcu-Merge-RCU-bh-into-RCU-preempt.patch b/kernel/patches-4.19.x-rt/0159-rcu-Merge-RCU-bh-into-RCU-preempt.patch index bd0e76d6c..c7562225e 100644 --- a/kernel/patches-4.19.x-rt/0159-rcu-Merge-RCU-bh-into-RCU-preempt.patch +++ b/kernel/patches-4.19.x-rt/0159-rcu-Merge-RCU-bh-into-RCU-preempt.patch @@ -1,7 +1,7 @@ -From 324e697209ed33e734f64df4cf0ddf60658de5ff Mon Sep 17 00:00:00 2001 +From 4e202b7ae394bcf87490c85f7edf3c528a9e93ed Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 5 Oct 2011 11:59:38 -0700 -Subject: [PATCH 159/283] rcu: Merge RCU-bh into RCU-preempt +Subject: [PATCH 159/328] rcu: Merge RCU-bh into RCU-preempt The Linux kernel has long RCU-bh read-side critical sections that intolerably increase scheduling latency under mainline's RCU-bh rules, @@ -34,7 +34,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 b73715c3c3c2..241a4a9577a0 100644 +index e6733d7911e9..08d64e5713fc 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); @@ -346,5 +346,5 @@ index 81688a133552..6ffafb1b1584 100644 #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0160-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch b/kernel/patches-4.19.x-rt/0160-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch index 6e1b40bad..b90c3f3bb 100644 --- a/kernel/patches-4.19.x-rt/0160-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch +++ b/kernel/patches-4.19.x-rt/0160-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch @@ -1,7 +1,7 @@ -From 00cbdab312799cf3648a917434e3178644f44f07 Mon Sep 17 00:00:00 2001 +From 2342184568653d14130d3ce56aec7fcf39e5bf5e Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Wed, 5 Oct 2011 11:45:18 -0700 -Subject: [PATCH 160/283] rcu: Make ksoftirqd do RCU quiescent states +Subject: [PATCH 160/328] rcu: Make ksoftirqd do RCU quiescent states Implementing RCU-bh in terms of RCU-preempt makes the system vulnerable to network-based denial-of-service attacks. This patch therefore @@ -64,7 +64,7 @@ index 1456a3d97971..1a40e3d44cb8 100644 /* diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h -index 429a2f144e19..bee9bffeb0ce 100644 +index e9ce51e19e87..938e64c69d18 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -29,6 +29,7 @@ @@ -75,7 +75,7 @@ index 429a2f144e19..bee9bffeb0ce 100644 #include #include #include "../time/tick-internal.h" -@@ -1407,7 +1408,7 @@ static void rcu_prepare_kthreads(int cpu) +@@ -1408,7 +1409,7 @@ static void rcu_prepare_kthreads(int cpu) #endif /* #else #ifdef CONFIG_RCU_BOOST */ @@ -84,7 +84,7 @@ index 429a2f144e19..bee9bffeb0ce 100644 /* * Check to see if any future RCU-related work will need to be done -@@ -1423,7 +1424,9 @@ int rcu_needs_cpu(u64 basemono, u64 *nextevt) +@@ -1424,7 +1425,9 @@ int rcu_needs_cpu(u64 basemono, u64 *nextevt) *nextevt = KTIME_MAX; return rcu_cpu_has_callbacks(NULL); } @@ -94,7 +94,7 @@ index 429a2f144e19..bee9bffeb0ce 100644 /* * Because we do not have RCU_FAST_NO_HZ, don't bother cleaning up * after it. -@@ -1520,6 +1523,8 @@ static bool __maybe_unused rcu_try_advance_all_cbs(void) +@@ -1521,6 +1524,8 @@ static bool __maybe_unused rcu_try_advance_all_cbs(void) return cbs_ready; } @@ -103,7 +103,7 @@ index 429a2f144e19..bee9bffeb0ce 100644 /* * Allow the CPU to enter dyntick-idle mode unless it has callbacks ready * to invoke. If the CPU has callbacks, try to advance them. Tell the -@@ -1562,6 +1567,7 @@ int rcu_needs_cpu(u64 basemono, u64 *nextevt) +@@ -1563,6 +1568,7 @@ int rcu_needs_cpu(u64 basemono, u64 *nextevt) *nextevt = basemono + dj * TICK_NSEC; return 0; } @@ -112,5 +112,5 @@ index 429a2f144e19..bee9bffeb0ce 100644 /* * Prepare a CPU for idle from an RCU perspective. The first major task -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0161-rcu-Eliminate-softirq-processing-from-rcutree.patch b/kernel/patches-4.19.x-rt/0161-rcu-Eliminate-softirq-processing-from-rcutree.patch index 7e3aeb2c9..35cae149e 100644 --- a/kernel/patches-4.19.x-rt/0161-rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/kernel/patches-4.19.x-rt/0161-rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,7 +1,7 @@ -From e270d045cc4c717e9781c7e4f0d351b63e61858a Mon Sep 17 00:00:00 2001 +From 7f9bb7afbe82ac923286da26040cd1aea23359aa Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Mon, 4 Nov 2013 13:21:10 -0800 -Subject: [PATCH 161/283] rcu: Eliminate softirq processing from rcutree +Subject: [PATCH 161/328] rcu: Eliminate softirq processing from rcutree Running RCU out of softirq is a problem for some workloads that would like to manage RCU core processing independently of other softirq work, @@ -210,7 +210,7 @@ index fbbff7c21148..98257d20feb2 100644 static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, struct rcu_node *rnp); diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h -index bee9bffeb0ce..2e8737f1010f 100644 +index 938e64c69d18..56639c8ed550 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -24,42 +24,16 @@ @@ -256,7 +256,7 @@ index bee9bffeb0ce..2e8737f1010f 100644 #ifdef CONFIG_RCU_NOCB_CPU static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */ static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */ -@@ -1027,18 +1001,21 @@ dump_blkd_tasks(struct rcu_state *rsp, struct rcu_node *rnp, int ncheck) +@@ -1028,18 +1002,21 @@ dump_blkd_tasks(struct rcu_state *rsp, struct rcu_node *rnp, int ncheck) #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ @@ -286,7 +286,7 @@ index bee9bffeb0ce..2e8737f1010f 100644 /* * Carry out RCU priority boosting on the task indicated by ->exp_tasks * or ->boost_tasks, advancing the pointer to the next task in the -@@ -1176,23 +1153,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) +@@ -1177,23 +1154,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) } } @@ -310,7 +310,7 @@ index bee9bffeb0ce..2e8737f1010f 100644 /* * Is the current CPU running the RCU-callbacks kthread? * Caller must have preemption disabled. -@@ -1247,67 +1207,6 @@ static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, +@@ -1248,67 +1208,6 @@ static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, return 0; } @@ -378,7 +378,7 @@ index bee9bffeb0ce..2e8737f1010f 100644 /* * Set the per-rcu_node kthread's affinity to cover all CPUs that are * served by the rcu_node in question. The CPU hotplug lock is still -@@ -1338,26 +1237,12 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu) +@@ -1339,26 +1238,12 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu) free_cpumask_var(cm); } @@ -405,7 +405,7 @@ index bee9bffeb0ce..2e8737f1010f 100644 rcu_for_each_leaf_node(rcu_state_p, rnp) (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp); } -@@ -1380,11 +1265,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) +@@ -1381,11 +1266,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) raw_spin_unlock_irqrestore_rcu_node(rnp, flags); } @@ -418,5 +418,5 @@ index bee9bffeb0ce..2e8737f1010f 100644 { return false; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0162-srcu-use-cpu_online-instead-custom-check.patch b/kernel/patches-4.19.x-rt/0162-srcu-use-cpu_online-instead-custom-check.patch index 6b8da688b..cd6abf438 100644 --- a/kernel/patches-4.19.x-rt/0162-srcu-use-cpu_online-instead-custom-check.patch +++ b/kernel/patches-4.19.x-rt/0162-srcu-use-cpu_online-instead-custom-check.patch @@ -1,7 +1,7 @@ -From ceae4b480cbafa469d9bfb43e2916b8cd4092ec6 Mon Sep 17 00:00:00 2001 +From 720a2bda656758067e8cf4f33a33a4e3900133e0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 14:43:41 +0200 -Subject: [PATCH 162/283] srcu: use cpu_online() instead custom check +Subject: [PATCH 162/328] srcu: use cpu_online() instead custom check The current check via srcu_online is slightly racy because after looking at srcu_online there could be an interrupt that interrupted us long @@ -91,5 +91,5 @@ index ae716ca783bc..f162a4f54b05 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0163-srcu-replace-local_irqsave-with-a-locallock.patch b/kernel/patches-4.19.x-rt/0163-srcu-replace-local_irqsave-with-a-locallock.patch index 4aac514ba..aa3549aa6 100644 --- a/kernel/patches-4.19.x-rt/0163-srcu-replace-local_irqsave-with-a-locallock.patch +++ b/kernel/patches-4.19.x-rt/0163-srcu-replace-local_irqsave-with-a-locallock.patch @@ -1,7 +1,7 @@ -From c5179e3d05fb9c649a24846aec42fd142baaba46 Mon Sep 17 00:00:00 2001 +From 35f458b1ba68a97ce57a87ae2cf6947b271abad2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 18:37:12 +0200 -Subject: [PATCH 163/283] srcu: replace local_irqsave() with a locallock +Subject: [PATCH 163/328] srcu: replace local_irqsave() with a locallock There are two instances which disable interrupts in order to become a stable this_cpu_ptr() pointer. The restore part is coupled with @@ -72,5 +72,5 @@ index df0375453ba1..0f09a1a9e17c 100644 srcu_funnel_gp_start(sp, sdp, s, do_norm); else if (needexp) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0164-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/kernel/patches-4.19.x-rt/0164-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index a9f1a469e..1a10cb916 100644 --- a/kernel/patches-4.19.x-rt/0164-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/kernel/patches-4.19.x-rt/0164-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,7 +1,7 @@ -From 279a404efccb555b0b9cb897445eb06bab8efe14 Mon Sep 17 00:00:00 2001 +From 266bcdc7bf5bb5736cd2b6896166438f40cf815a Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Wed, 12 Oct 2016 11:21:14 -0500 -Subject: [PATCH 164/283] rcu: enable rcu_normal_after_boot by default for RT +Subject: [PATCH 164/328] rcu: enable rcu_normal_after_boot by default for RT The forcing of an expedited grace period is an expensive and very RT-application unfriendly operation, as it forcibly preempts all running @@ -32,5 +32,5 @@ index 6ffafb1b1584..16d8dba23329 100644 #endif /* #ifndef CONFIG_TINY_RCU */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0165-tty-serial-omap-Make-the-locking-RT-aware.patch b/kernel/patches-4.19.x-rt/0165-tty-serial-omap-Make-the-locking-RT-aware.patch index d379abb3b..b5b9d134d 100644 --- a/kernel/patches-4.19.x-rt/0165-tty-serial-omap-Make-the-locking-RT-aware.patch +++ b/kernel/patches-4.19.x-rt/0165-tty-serial-omap-Make-the-locking-RT-aware.patch @@ -1,7 +1,7 @@ -From e88697f5f31d546848145184386ec739cc7aabfd Mon Sep 17 00:00:00 2001 +From 3d60ca27280fe12e0b29927dad783e20bcc391df Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 28 Jul 2011 13:32:57 +0200 -Subject: [PATCH 165/283] tty/serial/omap: Make the locking RT aware +Subject: [PATCH 165/328] tty/serial/omap: Make the locking RT aware 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 @@ -44,5 +44,5 @@ index 6420ae581a80..0f4f41ed9ffa 100644 static int __init -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0166-tty-serial-pl011-Make-the-locking-work-on-RT.patch b/kernel/patches-4.19.x-rt/0166-tty-serial-pl011-Make-the-locking-work-on-RT.patch index 0afbc4c42..7e97a897f 100644 --- a/kernel/patches-4.19.x-rt/0166-tty-serial-pl011-Make-the-locking-work-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0166-tty-serial-pl011-Make-the-locking-work-on-RT.patch @@ -1,7 +1,7 @@ -From 5d5a72172d1b6447861b7359fb2fa8e4ea1e707c Mon Sep 17 00:00:00 2001 +From 8122f816435704dfd2fdd2ca02b8399ee22d626c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 8 Jan 2013 21:36:51 +0100 -Subject: [PATCH 166/283] tty/serial/pl011: Make the locking work on RT +Subject: [PATCH 166/328] tty/serial/pl011: Make the locking work on RT 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. @@ -12,10 +12,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index 89ade213a1a9..6be86f8c7e6a 100644 +index af21122dfade..183e8b731d6a 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2216,13 +2216,19 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) +@@ -2214,13 +2214,19 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) clk_enable(uap->clk); @@ -38,7 +38,7 @@ index 89ade213a1a9..6be86f8c7e6a 100644 /* * First save the CR then disable the interrupts -@@ -2248,8 +2254,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) +@@ -2246,8 +2252,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) pl011_write(old_cr, uap, REG_CR); if (locked) @@ -49,5 +49,5 @@ index 89ade213a1a9..6be86f8c7e6a 100644 clk_disable(uap->clk); } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0167-tty-serial-pl011-explicitly-initialize-the-flags-var.patch b/kernel/patches-4.19.x-rt/0167-tty-serial-pl011-explicitly-initialize-the-flags-var.patch index ebd5f2b2f..3a4c30965 100644 --- a/kernel/patches-4.19.x-rt/0167-tty-serial-pl011-explicitly-initialize-the-flags-var.patch +++ b/kernel/patches-4.19.x-rt/0167-tty-serial-pl011-explicitly-initialize-the-flags-var.patch @@ -1,7 +1,7 @@ -From 1d9fb6ef0391f5e2ee11e6ae76fbdad192da7f6a Mon Sep 17 00:00:00 2001 +From f5a9aefa5442ede43dbf4fa85d3673483e866d61 Mon Sep 17 00:00:00 2001 From: Kurt Kanzenbach Date: Mon, 24 Sep 2018 10:29:01 +0200 -Subject: [PATCH 167/283] tty: serial: pl011: explicitly initialize the flags +Subject: [PATCH 167/328] tty: serial: pl011: explicitly initialize the flags variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -27,10 +27,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index 6be86f8c7e6a..59b4ab7b50bf 100644 +index 183e8b731d6a..2cc6b24bc88d 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2211,7 +2211,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) +@@ -2209,7 +2209,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) { struct uart_amba_port *uap = amba_ports[co->index]; unsigned int old_cr = 0, new_cr; @@ -40,5 +40,5 @@ index 6be86f8c7e6a..59b4ab7b50bf 100644 clk_enable(uap->clk); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0168-rt-Improve-the-serial-console-PASS_LIMIT.patch b/kernel/patches-4.19.x-rt/0168-rt-Improve-the-serial-console-PASS_LIMIT.patch index b2525bc5d..7929d5245 100644 --- a/kernel/patches-4.19.x-rt/0168-rt-Improve-the-serial-console-PASS_LIMIT.patch +++ b/kernel/patches-4.19.x-rt/0168-rt-Improve-the-serial-console-PASS_LIMIT.patch @@ -1,7 +1,7 @@ -From 1e7abe5e3aee5c132a0d65d39713c6f4cb67be9c Mon Sep 17 00:00:00 2001 +From d8240c961e33c6da86bdbd96a67440a5d944c415 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 14 Dec 2011 13:05:54 +0100 -Subject: [PATCH 168/283] rt: Improve the serial console PASS_LIMIT +Subject: [PATCH 168/328] rt: Improve the serial console PASS_LIMIT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -20,7 +20,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index 8fe3d0ed229e..a2baac4c8b63 100644 +index 69aaee5d7fe1..cf88317a95fc 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -54,7 +54,16 @@ static struct uart_driver serial8250_reg; @@ -42,5 +42,5 @@ index 8fe3d0ed229e..a2baac4c8b63 100644 #include /* -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0169-tty-serial-8250-don-t-take-the-trylock-during-oops.patch b/kernel/patches-4.19.x-rt/0169-tty-serial-8250-don-t-take-the-trylock-during-oops.patch index d0f376b26..cc9b251f8 100644 --- a/kernel/patches-4.19.x-rt/0169-tty-serial-8250-don-t-take-the-trylock-during-oops.patch +++ b/kernel/patches-4.19.x-rt/0169-tty-serial-8250-don-t-take-the-trylock-during-oops.patch @@ -1,7 +1,7 @@ -From 872de798df0e839bfdfdaebdde0eae1b50de4614 Mon Sep 17 00:00:00 2001 +From 67a72f4debbad523744a56e90d284d809e830f82 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Apr 2016 16:55:02 +0200 -Subject: [PATCH 169/283] tty: serial: 8250: don't take the trylock during oops +Subject: [PATCH 169/328] tty: serial: 8250: don't take the trylock during oops 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 @@ -14,10 +14,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 e26d87b6ffc5..8d85448975d3 100644 +index aa4de6907f77..6b1d46c1df3b 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -3238,10 +3238,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, +@@ -3239,10 +3239,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, serial8250_rpm_get(up); @@ -30,5 +30,5 @@ index e26d87b6ffc5..8d85448975d3 100644 spin_lock_irqsave(&port->lock, flags); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0170-locking-percpu-rwsem-Remove-preempt_disable-variants.patch b/kernel/patches-4.19.x-rt/0170-locking-percpu-rwsem-Remove-preempt_disable-variants.patch index 4cf515f84..1844a901e 100644 --- a/kernel/patches-4.19.x-rt/0170-locking-percpu-rwsem-Remove-preempt_disable-variants.patch +++ b/kernel/patches-4.19.x-rt/0170-locking-percpu-rwsem-Remove-preempt_disable-variants.patch @@ -1,7 +1,7 @@ -From e1d3a8c231f929b0069ddc2dc3059bab193e9d00 Mon Sep 17 00:00:00 2001 +From fb0e4a895ad79687d4a90cf901ac9ce349f6818c Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Wed, 23 Nov 2016 16:29:32 +0100 -Subject: [PATCH 170/283] locking/percpu-rwsem: Remove preempt_disable variants +Subject: [PATCH 170/328] locking/percpu-rwsem: Remove preempt_disable variants Effective revert commit: @@ -17,7 +17,7 @@ Signed-off-by: Peter Zijlstra (Intel) 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/fs/locks.c b/fs/locks.c -index 2ecb4db8c840..8259b7c7b5d2 100644 +index 28270e74be34..552476d6f6bb 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -936,7 +936,7 @@ static int flock_lock_inode(struct inode *inode, struct file_lock *request) @@ -221,5 +221,5 @@ index 79b99d653e03..fb44e237316d 100644 extern void percpu_up_write(struct percpu_rw_semaphore *); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0171-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch b/kernel/patches-4.19.x-rt/0171-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch index 3a4c70164..2359beee2 100644 --- a/kernel/patches-4.19.x-rt/0171-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch +++ b/kernel/patches-4.19.x-rt/0171-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch @@ -1,7 +1,7 @@ -From 3fe311d6ea2109a5390bffc6870dafee03cab931 Mon Sep 17 00:00:00 2001 +From 9be3653b65220de706317fe352f73449254b0884 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Tue, 15 May 2012 13:53:56 +0800 -Subject: [PATCH 171/283] mm: Protect activate_mm() by +Subject: [PATCH 171/328] mm: Protect activate_mm() by preempt_[disable&enable]_rt() User preempt_*_rt instead of local_irq_*_rt or otherwise there will be @@ -37,7 +37,7 @@ Signed-off-by: Thomas Gleixner 2 files changed, 4 insertions(+) diff --git a/fs/exec.c b/fs/exec.c -index 433b1257694a..352c1a6fa6a9 100644 +index 561ea64829ec..0d95c6349fb1 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1028,12 +1028,14 @@ static int exec_mmap(struct mm_struct *mm) @@ -76,5 +76,5 @@ index 3e612ae748e9..d0ccc070979f 100644 #ifdef finish_arch_post_lock_switch finish_arch_post_lock_switch(); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0172-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch b/kernel/patches-4.19.x-rt/0172-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch index 9b4995bac..2a737d0ad 100644 --- a/kernel/patches-4.19.x-rt/0172-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch +++ b/kernel/patches-4.19.x-rt/0172-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch @@ -1,7 +1,7 @@ -From a82c4acdfe13556ab98571ef02f3a3eb9d29dd6e Mon Sep 17 00:00:00 2001 +From e78e0f017d742dada34166305b5b965bc26ddef0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 12:32:34 +0200 -Subject: [PATCH 172/283] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD +Subject: [PATCH 172/328] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD init Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed @@ -56,5 +56,5 @@ index 6e0022326afe..10225a9135fb 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0173-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/kernel/patches-4.19.x-rt/0173-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index e76d8a6fa..0f8802cb1 100644 --- a/kernel/patches-4.19.x-rt/0173-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/kernel/patches-4.19.x-rt/0173-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,7 +1,7 @@ -From 09acbcc860c548ba124fb4402beed59790f49218 Mon Sep 17 00:00:00 2001 +From 01e7eacd56ecebd6290b2fa1bf421cf2669b3916 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 20 Oct 2017 11:29:53 +0200 -Subject: [PATCH 173/283] fs/dcache: disable preemption on i_dir_seq's write +Subject: [PATCH 173/328] fs/dcache: disable preemption on i_dir_seq's write side i_dir_seq is an opencoded seqcounter. Based on the code it looks like we @@ -19,9 +19,8 @@ Signed-off-by: Sebastian Andrzej Siewior --- fs/dcache.c | 12 +++++++----- fs/inode.c | 2 +- - fs/libfs.c | 6 ++++-- include/linux/fs.h | 2 +- - 4 files changed, 13 insertions(+), 9 deletions(-) + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 10225a9135fb..dcde8ffe384c 100644 @@ -69,7 +68,7 @@ index 10225a9135fb..dcde8ffe384c 100644 rcu_read_unlock(); goto retry; diff --git a/fs/inode.c b/fs/inode.c -index 5c63693326bb..c3e17dcbb558 100644 +index 9c50521c9fe4..40114e8b6c7b 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -155,7 +155,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) @@ -81,40 +80,8 @@ index 5c63693326bb..c3e17dcbb558 100644 inode->i_rdev = 0; inode->dirtied_when = 0; -diff --git a/fs/libfs.c b/fs/libfs.c -index 0fb590d79f30..cd95874a1952 100644 ---- a/fs/libfs.c -+++ b/fs/libfs.c -@@ -90,7 +90,7 @@ static struct dentry *next_positive(struct dentry *parent, - struct list_head *from, - int count) - { -- unsigned *seq = &parent->d_inode->i_dir_seq, n; -+ unsigned *seq = &parent->d_inode->__i_dir_seq, n; - struct dentry *res; - struct list_head *p; - bool skipped; -@@ -123,8 +123,9 @@ static struct dentry *next_positive(struct dentry *parent, - static void move_cursor(struct dentry *cursor, struct list_head *after) - { - struct dentry *parent = cursor->d_parent; -- unsigned n, *seq = &parent->d_inode->i_dir_seq; -+ unsigned n, *seq = &parent->d_inode->__i_dir_seq; - spin_lock(&parent->d_lock); -+ preempt_disable_rt(); - for (;;) { - n = *seq; - if (!(n & 1) && cmpxchg(seq, n, n + 1) == n) -@@ -137,6 +138,7 @@ static void move_cursor(struct dentry *cursor, struct list_head *after) - else - list_add_tail(&cursor->d_child, &parent->d_subdirs); - smp_store_release(seq, n + 2); -+ preempt_enable_rt(); - spin_unlock(&parent->d_lock); - } - diff --git a/include/linux/fs.h b/include/linux/fs.h -index d4e1b43a53c3..72749feed0e3 100644 +index 92420009b9bc..9b2b707e9112 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -678,7 +678,7 @@ struct inode { @@ -127,5 +94,5 @@ index d4e1b43a53c3..72749feed0e3 100644 __u32 i_generation; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0174-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch b/kernel/patches-4.19.x-rt/0174-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch index 6b7bb5ee3..56925098d 100644 --- a/kernel/patches-4.19.x-rt/0174-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch +++ b/kernel/patches-4.19.x-rt/0174-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch @@ -1,7 +1,7 @@ -From d1843e5a615442fd804b363f5593ddbf58bc6688 Mon Sep 17 00:00:00 2001 +From 78a2f867f7f382fe3a1c20d4be00588e54d47242 Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Mon, 7 May 2018 08:58:57 -0500 -Subject: [PATCH 174/283] squashfs: make use of local lock in multi_cpu +Subject: [PATCH 174/328] squashfs: make use of local lock in multi_cpu decompressor Currently, the squashfs multi_cpu decompressor makes use of @@ -67,5 +67,5 @@ index 23a9c28ad8ea..6a73c4fa88e7 100644 if (res < 0) ERROR("%s decompression failed, data probably corrupt\n", -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0175-thermal-Defer-thermal-wakups-to-threads.patch b/kernel/patches-4.19.x-rt/0175-thermal-Defer-thermal-wakups-to-threads.patch index 6c2f61c3a..b0f35f596 100644 --- a/kernel/patches-4.19.x-rt/0175-thermal-Defer-thermal-wakups-to-threads.patch +++ b/kernel/patches-4.19.x-rt/0175-thermal-Defer-thermal-wakups-to-threads.patch @@ -1,7 +1,7 @@ -From 4f73daf6f6c5ecfca2198293c10701d2d777a451 Mon Sep 17 00:00:00 2001 +From 472de6450cf587e0ada3ba8fb8e2944c605981aa Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 17 Feb 2015 09:37:44 +0100 -Subject: [PATCH 175/283] thermal: Defer thermal wakups to threads +Subject: [PATCH 175/328] thermal: Defer thermal wakups to threads On RT the spin lock in pkg_temp_thermal_platfrom_thermal_notify will call schedule while we run in irq context. @@ -132,5 +132,5 @@ index 1ef937d799e4..a5991cbb408f 100644 module_exit(pkg_temp_thermal_exit) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0176-x86-fpu-Disable-preemption-around-local_bh_disable.patch b/kernel/patches-4.19.x-rt/0176-x86-fpu-Disable-preemption-around-local_bh_disable.patch index 48d8c3dde..71822734f 100644 --- a/kernel/patches-4.19.x-rt/0176-x86-fpu-Disable-preemption-around-local_bh_disable.patch +++ b/kernel/patches-4.19.x-rt/0176-x86-fpu-Disable-preemption-around-local_bh_disable.patch @@ -1,7 +1,7 @@ -From c3a958f7c3d63e98096d5c662e8346b5fc0fafec Mon Sep 17 00:00:00 2001 +From 50d08167a197542caf75d7b8885fc7b4cf32f3e5 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 11 Dec 2018 15:10:33 +0100 -Subject: [PATCH 176/283] x86/fpu: Disable preemption around local_bh_disable() +Subject: [PATCH 176/328] x86/fpu: Disable preemption around local_bh_disable() __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 @@ -33,5 +33,5 @@ index d99a8ee9e185..5e0274a94133 100644 return err; } else { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0177-fs-epoll-Do-not-disable-preemption-on-RT.patch b/kernel/patches-4.19.x-rt/0177-fs-epoll-Do-not-disable-preemption-on-RT.patch index ee6c29553..63a80d8fd 100644 --- a/kernel/patches-4.19.x-rt/0177-fs-epoll-Do-not-disable-preemption-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0177-fs-epoll-Do-not-disable-preemption-on-RT.patch @@ -1,7 +1,7 @@ -From 2bc1814482c92194daf20b98841321870709e4dd Mon Sep 17 00:00:00 2001 +From 55f9cf79b55c65f9e7858b99be1e12635c64a990 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 8 Jul 2011 16:35:35 +0200 -Subject: [PATCH 177/283] fs/epoll: Do not disable preemption on RT +Subject: [PATCH 177/328] fs/epoll: Do not disable preemption on RT 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 @@ -32,5 +32,5 @@ index 58f48ea0db23..a41120a34e6d 100644 #else -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0178-mm-vmalloc-Another-preempt-disable-region-which-suck.patch b/kernel/patches-4.19.x-rt/0178-mm-vmalloc-Another-preempt-disable-region-which-suck.patch index 002d0dcbb..e453d06bf 100644 --- a/kernel/patches-4.19.x-rt/0178-mm-vmalloc-Another-preempt-disable-region-which-suck.patch +++ b/kernel/patches-4.19.x-rt/0178-mm-vmalloc-Another-preempt-disable-region-which-suck.patch @@ -1,7 +1,7 @@ -From 974d73cf26c5d957984cd6078582894a25a0600a Mon Sep 17 00:00:00 2001 +From 32e65f9533004d40e52f6a101ac651c16392f178 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 12 Jul 2011 11:39:36 +0200 -Subject: [PATCH 178/283] mm/vmalloc: Another preempt disable region which +Subject: [PATCH 178/328] mm/vmalloc: Another preempt disable region which sucks Avoid the preempt disable version of get_cpu_var(). The inner-lock should @@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c -index a46ec261a44e..5c6939cc28b7 100644 +index d8e877365f9f..9b7cf993cada 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -852,7 +852,7 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask) @@ -68,5 +68,5 @@ index a46ec261a44e..5c6939cc28b7 100644 /* Allocate new block if nothing was found */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0179-block-mq-use-cpu_light.patch b/kernel/patches-4.19.x-rt/0179-block-mq-use-cpu_light.patch index 69c8bc6e4..64f2272d0 100644 --- a/kernel/patches-4.19.x-rt/0179-block-mq-use-cpu_light.patch +++ b/kernel/patches-4.19.x-rt/0179-block-mq-use-cpu_light.patch @@ -1,7 +1,7 @@ -From a8a7839dcded1152098641824de0792247d0af82 Mon Sep 17 00:00:00 2001 +From 736284010de7d42e40ecf1250dfb1f45e5a94d4e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 10:37:23 +0200 -Subject: [PATCH 179/283] block: mq: use cpu_light() +Subject: [PATCH 179/328] block: mq: use cpu_light() 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(). @@ -12,7 +12,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.h b/block/blk-mq.h -index 9497b47e2526..e55c8599b90b 100644 +index 5ad9251627f8..5a96c97991b6 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -113,12 +113,12 @@ static inline struct blk_mq_ctx *__blk_mq_get_ctx(struct request_queue *q, @@ -31,5 +31,5 @@ index 9497b47e2526..e55c8599b90b 100644 struct blk_mq_alloc_data { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0180-block-mq-do-not-invoke-preempt_disable.patch b/kernel/patches-4.19.x-rt/0180-block-mq-do-not-invoke-preempt_disable.patch index 293189a43..ca297c050 100644 --- a/kernel/patches-4.19.x-rt/0180-block-mq-do-not-invoke-preempt_disable.patch +++ b/kernel/patches-4.19.x-rt/0180-block-mq-do-not-invoke-preempt_disable.patch @@ -1,7 +1,7 @@ -From f981eb8d8253e9496a5551600aa89d6ac82f153d Mon Sep 17 00:00:00 2001 +From 76fb1c9c1652d4dec489aa1611a9071f1b42b5b0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 180/283] block/mq: do not invoke preempt_disable() +Subject: [PATCH 180/328] block/mq: do not invoke preempt_disable() preempt_disable() and get_cpu() don't play well together with the sleeping locks it tries to allocate later. @@ -13,7 +13,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 e3e7a88e03a6..b07332cab8ff 100644 +index 4aa3284874f6..376fb90de054 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -570,7 +570,7 @@ static void __blk_mq_complete_request(struct request *rq) @@ -34,7 +34,7 @@ index e3e7a88e03a6..b07332cab8ff 100644 } static void hctx_unlock(struct blk_mq_hw_ctx *hctx, int srcu_idx) -@@ -1368,14 +1368,14 @@ static void __blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async, +@@ -1371,14 +1371,14 @@ static void __blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async, return; if (!async && !(hctx->flags & BLK_MQ_F_BLOCKING)) { @@ -53,5 +53,5 @@ index e3e7a88e03a6..b07332cab8ff 100644 kblockd_mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), &hctx->run_work, -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0181-block-mq-don-t-complete-requests-via-IPI.patch b/kernel/patches-4.19.x-rt/0181-block-mq-don-t-complete-requests-via-IPI.patch index 59d1b5285..15cc19563 100644 --- a/kernel/patches-4.19.x-rt/0181-block-mq-don-t-complete-requests-via-IPI.patch +++ b/kernel/patches-4.19.x-rt/0181-block-mq-don-t-complete-requests-via-IPI.patch @@ -1,7 +1,7 @@ -From 806f56991b1c799b77919980a4331ebd857eca6e Mon Sep 17 00:00:00 2001 +From eb88fbf4264f3c4776aeeec310568e4bc79ced80 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 15:10:08 +0100 -Subject: [PATCH 181/283] block/mq: don't complete requests via IPI +Subject: [PATCH 181/328] block/mq: don't complete requests via IPI The IPI runs in hardirq context and there are sleeping locks. This patch moves the completion into a workqueue. @@ -15,7 +15,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 682bc561b77b..b6010a1c3aad 100644 +index ea33d6abdcfc..4860cd26cd5a 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) @@ -29,7 +29,7 @@ index 682bc561b77b..b6010a1c3aad 100644 rq->q = q; rq->__sector = (sector_t) -1; diff --git a/block/blk-mq.c b/block/blk-mq.c -index b07332cab8ff..a01b6aba61fa 100644 +index 376fb90de054..5808446e4758 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, @@ -87,10 +87,10 @@ index b07332cab8ff..a01b6aba61fa 100644 rq->q->softirq_done_fn(rq); } diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h -index 1da59c16f637..04c15b5ca76c 100644 +index 2885dce1ad49..8dbb9ecf9993 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h -@@ -249,7 +249,7 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) +@@ -256,7 +256,7 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) return unique_tag & BLK_MQ_UNIQUE_TAG_MASK; } @@ -100,7 +100,7 @@ index 1da59c16f637..04c15b5ca76c 100644 void blk_mq_start_request(struct request *rq); void blk_mq_end_request(struct request *rq, blk_status_t error); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h -index 6980014357d4..f93ae914abda 100644 +index 6e67aeb56928..111ab4209797 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -149,6 +149,9 @@ enum mq_rq_state { @@ -114,5 +114,5 @@ index 6980014357d4..f93ae914abda 100644 int cpu; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0182-md-raid5-Make-raid5_percpu-handling-RT-aware.patch b/kernel/patches-4.19.x-rt/0182-md-raid5-Make-raid5_percpu-handling-RT-aware.patch index 0751d3564..2847ecca8 100644 --- a/kernel/patches-4.19.x-rt/0182-md-raid5-Make-raid5_percpu-handling-RT-aware.patch +++ b/kernel/patches-4.19.x-rt/0182-md-raid5-Make-raid5_percpu-handling-RT-aware.patch @@ -1,7 +1,7 @@ -From 149113bd6da78fc421b65edab96f402b3fdfc0f8 Mon Sep 17 00:00:00 2001 +From 283bc898b7a8aeb35a5022147d72342a7b77170c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 6 Apr 2010 16:51:31 +0200 -Subject: [PATCH 182/283] md: raid5: Make raid5_percpu handling RT aware +Subject: [PATCH 182/328] md: raid5: Make raid5_percpu handling RT aware __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic @@ -19,7 +19,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 f237d6f30752..adec2947c3e1 100644 +index 01021382131b..379ce2f57512 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) @@ -43,7 +43,7 @@ index f237d6f30752..adec2947c3e1 100644 } static void free_stripe(struct kmem_cache *sc, struct stripe_head *sh) -@@ -6811,6 +6813,7 @@ static int raid456_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) +@@ -6815,6 +6817,7 @@ static int raid456_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) __func__, cpu); return -ENOMEM; } @@ -51,7 +51,7 @@ index f237d6f30752..adec2947c3e1 100644 return 0; } -@@ -6821,7 +6824,6 @@ static int raid5_alloc_percpu(struct r5conf *conf) +@@ -6825,7 +6828,6 @@ static int raid5_alloc_percpu(struct r5conf *conf) conf->percpu = alloc_percpu(struct raid5_percpu); if (!conf->percpu) return -ENOMEM; @@ -72,5 +72,5 @@ index 8474c224127b..a3bf907ab2af 100644 struct flex_array *scribble; /* space for constructing buffer * lists and performing address -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0183-rt-Introduce-cpu_chill.patch b/kernel/patches-4.19.x-rt/0183-rt-Introduce-cpu_chill.patch index 4a44280b7..74ced432d 100644 --- a/kernel/patches-4.19.x-rt/0183-rt-Introduce-cpu_chill.patch +++ b/kernel/patches-4.19.x-rt/0183-rt-Introduce-cpu_chill.patch @@ -1,7 +1,7 @@ -From e4e5f1cc93c38f1bc914494fc1a4a0c4388e42e1 Mon Sep 17 00:00:00 2001 +From e495449b207a0278e1ea08626dbea152b9cfa1ca Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 7 Mar 2012 20:51:03 +0100 -Subject: [PATCH 183/283] rt: Introduce cpu_chill() +Subject: [PATCH 183/328] rt: Introduce cpu_chill() Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() @@ -76,10 +76,10 @@ index b78bab4395d8..7c4bc414a504 100644 + #endif /* defined(_LINUX_DELAY_H) */ diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index cfa3599fa789..851b2134e77f 100644 +index b800efb64238..98a771065818 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1894,6 +1894,27 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, +@@ -1897,6 +1897,27 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, } #endif @@ -108,5 +108,5 @@ index cfa3599fa789..851b2134e77f 100644 * Functions related to boot-time initialization: */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0184-hrtimer-Don-t-lose-state-in-cpu_chill.patch b/kernel/patches-4.19.x-rt/0184-hrtimer-Don-t-lose-state-in-cpu_chill.patch index 62a4859ae..40e30280b 100644 --- a/kernel/patches-4.19.x-rt/0184-hrtimer-Don-t-lose-state-in-cpu_chill.patch +++ b/kernel/patches-4.19.x-rt/0184-hrtimer-Don-t-lose-state-in-cpu_chill.patch @@ -1,7 +1,7 @@ -From 33f5a28483e30eb660e9ebc75308de9618a279ff Mon Sep 17 00:00:00 2001 +From 85650b9854b0d27ec65285b4f60cc63bb100669f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 19 Feb 2019 16:59:15 +0100 -Subject: [PATCH 184/283] hrtimer: Don't lose state in cpu_chill() +Subject: [PATCH 184/328] hrtimer: Don't lose state in cpu_chill() 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 @@ -19,10 +19,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index 851b2134e77f..6f2736ec4b8e 100644 +index 98a771065818..21a454557c8a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1902,15 +1902,18 @@ void cpu_chill(void) +@@ -1905,15 +1905,18 @@ void cpu_chill(void) { ktime_t chill_time; unsigned int freeze_flag = current->flags & PF_NOFREEZE; @@ -43,5 +43,5 @@ index 851b2134e77f..6f2736ec4b8e 100644 EXPORT_SYMBOL(cpu_chill); #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0185-hrtimer-cpu_chill-save-task-state-in-saved_state.patch b/kernel/patches-4.19.x-rt/0185-hrtimer-cpu_chill-save-task-state-in-saved_state.patch index 74907e410..c121ec7ff 100644 --- a/kernel/patches-4.19.x-rt/0185-hrtimer-cpu_chill-save-task-state-in-saved_state.patch +++ b/kernel/patches-4.19.x-rt/0185-hrtimer-cpu_chill-save-task-state-in-saved_state.patch @@ -1,7 +1,7 @@ -From 65b275b3fee3444107af46dd38c427834861ea37 Mon Sep 17 00:00:00 2001 +From c5e6ba548ce7b077f2c912fa506401cccf68d85d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 26 Feb 2019 12:31:10 +0100 -Subject: [PATCH 185/283] hrtimer: cpu_chill(): save task state in +Subject: [PATCH 185/328] hrtimer: cpu_chill(): save task state in ->saved_state() In the previous change I saved the current task state on stack. This was @@ -20,10 +20,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index 6f2736ec4b8e..e1040b80362c 100644 +index 21a454557c8a..f16cbc98c47a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1900,20 +1900,28 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, +@@ -1903,20 +1903,28 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, */ void cpu_chill(void) { @@ -58,5 +58,5 @@ index 6f2736ec4b8e..e1040b80362c 100644 EXPORT_SYMBOL(cpu_chill); #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0186-block-blk-mq-move-blk_queue_usage_counter_release-in.patch b/kernel/patches-4.19.x-rt/0186-block-blk-mq-move-blk_queue_usage_counter_release-in.patch index bfd09496b..71d1dc862 100644 --- a/kernel/patches-4.19.x-rt/0186-block-blk-mq-move-blk_queue_usage_counter_release-in.patch +++ b/kernel/patches-4.19.x-rt/0186-block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -1,7 +1,7 @@ -From a0f3744dd80367c9d401ebb5764b426fa7634006 Mon Sep 17 00:00:00 2001 +From 57df777639aebaef79d278a5dfa3d749c5884099 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 13 Mar 2018 13:49:16 +0100 -Subject: [PATCH 186/283] block: blk-mq: move blk_queue_usage_counter_release() +Subject: [PATCH 186/328] block: blk-mq: move blk_queue_usage_counter_release() into process context | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 @@ -51,10 +51,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 b6010a1c3aad..38b1bd493165 100644 +index 4860cd26cd5a..13bf37156bb0 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -967,12 +967,21 @@ void blk_queue_exit(struct request_queue *q) +@@ -973,12 +973,21 @@ void blk_queue_exit(struct request_queue *q) percpu_ref_put(&q->q_usage_counter); } @@ -77,7 +77,7 @@ index b6010a1c3aad..38b1bd493165 100644 } static void blk_rq_timed_out_timer(struct timer_list *t) -@@ -1069,6 +1078,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id, +@@ -1075,6 +1084,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); @@ -85,7 +85,7 @@ index b6010a1c3aad..38b1bd493165 100644 /* * Init percpu_ref in atomic mode so that it's faster to shutdown. -@@ -3958,6 +3968,8 @@ int __init blk_dev_init(void) +@@ -3964,6 +3974,8 @@ int __init blk_dev_init(void) if (!kblockd_workqueue) panic("Failed to create kblockd\n"); @@ -95,7 +95,7 @@ index b6010a1c3aad..38b1bd493165 100644 sizeof(struct request), 0, SLAB_PANIC, NULL); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h -index f93ae914abda..940c794042ae 100644 +index 111ab4209797..2f3b2e5196eb 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -27,6 +27,7 @@ @@ -106,7 +106,7 @@ index f93ae914abda..940c794042ae 100644 struct module; struct scsi_ioctl_command; -@@ -649,6 +650,7 @@ struct request_queue { +@@ -655,6 +656,7 @@ struct request_queue { #endif struct rcu_head rcu_head; wait_queue_head_t mq_freeze_wq; @@ -115,5 +115,5 @@ index f93ae914abda..940c794042ae 100644 struct list_head all_q_node; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0187-block-Use-cpu_chill-for-retry-loops.patch b/kernel/patches-4.19.x-rt/0187-block-Use-cpu_chill-for-retry-loops.patch index 8e2b8ce9a..234d92d4f 100644 --- a/kernel/patches-4.19.x-rt/0187-block-Use-cpu_chill-for-retry-loops.patch +++ b/kernel/patches-4.19.x-rt/0187-block-Use-cpu_chill-for-retry-loops.patch @@ -1,7 +1,7 @@ -From 21b09ece0276ba2e189265b580648e8505039067 Mon Sep 17 00:00:00 2001 +From b86763e1cdbb47e8674463b0be6daf0c5c09cabf Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 20 Dec 2012 18:28:26 +0100 -Subject: [PATCH 187/283] block: Use cpu_chill() for retry loops +Subject: [PATCH 187/328] block: Use cpu_chill() for retry loops Retry loops on RT might loop forever when the modifying side was preempted. Steven also observed a live lock when there was a @@ -46,5 +46,5 @@ index 01580f88fcb3..98d87e52ccdc 100644 } } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0188-fs-dcache-Use-cpu_chill-in-trylock-loops.patch b/kernel/patches-4.19.x-rt/0188-fs-dcache-Use-cpu_chill-in-trylock-loops.patch index 37c4c1bed..6b8cb5440 100644 --- a/kernel/patches-4.19.x-rt/0188-fs-dcache-Use-cpu_chill-in-trylock-loops.patch +++ b/kernel/patches-4.19.x-rt/0188-fs-dcache-Use-cpu_chill-in-trylock-loops.patch @@ -1,7 +1,7 @@ -From 0a339e66574cbd8cf1cb2b146d2b960db46a2803 Mon Sep 17 00:00:00 2001 +From e4c2d46c06d5e1181e6ab26038689d1c112b9d0b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 7 Mar 2012 21:00:34 +0100 -Subject: [PATCH 188/283] fs: dcache: Use cpu_chill() in trylock loops +Subject: [PATCH 188/328] fs: dcache: Use cpu_chill() in trylock loops Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/autofs/expire.c b/fs/autofs/expire.c -index 28d9c2b1b3bb..354b7147cead 100644 +index 70e9afe589fb..1a6b88ad4fe0 100644 --- a/fs/autofs/expire.c +++ b/fs/autofs/expire.c @@ -8,6 +8,7 @@ @@ -61,5 +61,5 @@ index 1fce41ba3535..5dc970027e30 100644 * After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will * be set to match its requirements. So we must not load that until -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0189-net-Use-cpu_chill-instead-of-cpu_relax.patch b/kernel/patches-4.19.x-rt/0189-net-Use-cpu_chill-instead-of-cpu_relax.patch index 9235cffab..b65ea6ef4 100644 --- a/kernel/patches-4.19.x-rt/0189-net-Use-cpu_chill-instead-of-cpu_relax.patch +++ b/kernel/patches-4.19.x-rt/0189-net-Use-cpu_chill-instead-of-cpu_relax.patch @@ -1,7 +1,7 @@ -From 3e88f3c941795af8750994fd1a26f7031b691be6 Mon Sep 17 00:00:00 2001 +From cef4fa5aa7e55b664ae92cd88f7e09b2214c5d7f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 7 Mar 2012 21:10:04 +0100 -Subject: [PATCH 189/283] net: Use cpu_chill() instead of cpu_relax() +Subject: [PATCH 189/328] net: Use cpu_chill() instead of cpu_relax() Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system @@ -14,7 +14,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 93b5a4200585..47009dddb740 100644 +index ddf90e6fac51..65befa5ee0c3 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -63,6 +63,7 @@ @@ -25,7 +25,7 @@ index 93b5a4200585..47009dddb740 100644 #include #include #include -@@ -667,7 +668,7 @@ static void prb_retire_rx_blk_timer_expired(struct timer_list *t) +@@ -668,7 +669,7 @@ static void prb_retire_rx_blk_timer_expired(struct timer_list *t) if (BLOCK_NUM_PKTS(pbd)) { while (atomic_read(&pkc->blk_fill_in_prog)) { /* Waiting for skb_copy_bits to finish... */ @@ -34,7 +34,7 @@ index 93b5a4200585..47009dddb740 100644 } } -@@ -929,7 +930,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, +@@ -930,7 +931,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, if (!(status & TP_STATUS_BLK_TMO)) { while (atomic_read(&pkc->blk_fill_in_prog)) { /* Waiting for skb_copy_bits to finish... */ @@ -65,5 +65,5 @@ index 0b347f46b2f4..f395f06031bc 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0190-fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/kernel/patches-4.19.x-rt/0190-fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 2160b06cb..8dcbe6c54 100644 --- a/kernel/patches-4.19.x-rt/0190-fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/kernel/patches-4.19.x-rt/0190-fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,7 +1,7 @@ -From 4625df6903b8b9c8ebbcddea1660e7df3e4f9efa Mon Sep 17 00:00:00 2001 +From fc8e48cfb7705d33f133b8b927ec35a1c95af05d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 14:35:49 +0200 -Subject: [PATCH 190/283] fs/dcache: use swait_queue instead of waitqueue +Subject: [PATCH 190/328] fs/dcache: use swait_queue instead of waitqueue __d_lookup_done() invokes wake_up_all() while holding a hlist_bl_lock() which disables preemption. As a workaround convert it to swait. @@ -84,10 +84,10 @@ index dcde8ffe384c..b2a00f3ff7df 100644 hlist_bl_unlock(b); INIT_HLIST_NODE(&dentry->d_u.d_alias); diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c -index 82a13221775e..58324a93e3c0 100644 +index 6244345a5745..7ee10b7cc808 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c -@@ -1203,7 +1203,7 @@ static int fuse_direntplus_link(struct file *file, +@@ -1213,7 +1213,7 @@ static int fuse_direntplus_link(struct file *file, struct inode *dir = d_inode(parent); struct fuse_conn *fc; struct inode *inode; @@ -97,10 +97,10 @@ index 82a13221775e..58324a93e3c0 100644 if (!o->nodeid) { /* diff --git a/fs/namei.c b/fs/namei.c -index 914178cdbe94..2a8c41bc227f 100644 +index c00a7e1da4c0..742e7935f777 100644 --- a/fs/namei.c +++ b/fs/namei.c -@@ -1645,7 +1645,7 @@ static struct dentry *__lookup_slow(const struct qstr *name, +@@ -1646,7 +1646,7 @@ static struct dentry *__lookup_slow(const struct qstr *name, { struct dentry *dentry, *old; struct inode *inode = dir->d_inode; @@ -109,7 +109,7 @@ index 914178cdbe94..2a8c41bc227f 100644 /* Don't go there if it's already dead */ if (unlikely(IS_DEADDIR(inode))) -@@ -3135,7 +3135,7 @@ static int lookup_open(struct nameidata *nd, struct path *path, +@@ -3136,7 +3136,7 @@ static int lookup_open(struct nameidata *nd, struct path *path, struct dentry *dentry; int error, create_error = 0; umode_t mode = op->mode; @@ -119,10 +119,10 @@ index 914178cdbe94..2a8c41bc227f 100644 if (unlikely(IS_DEADDIR(dir_inode))) return -ENOENT; diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c -index 62afe8ca1e36..9818a5dfb472 100644 +index c60b20884c45..7e653c14c7ed 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c -@@ -445,7 +445,7 @@ static +@@ -457,7 +457,7 @@ static void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry) { struct qstr filename = QSTR_INIT(entry->name, entry->len); @@ -131,7 +131,7 @@ index 62afe8ca1e36..9818a5dfb472 100644 struct dentry *dentry; struct dentry *alias; struct inode *dir = d_inode(parent); -@@ -1459,7 +1459,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, +@@ -1516,7 +1516,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) { @@ -163,10 +163,10 @@ index ce9100b5604d..839bfa76f41e 100644 status = -EBUSY; spin_lock(&dentry->d_lock); diff --git a/fs/proc/base.c b/fs/proc/base.c -index f999e8bd3771..bf9476600c73 100644 +index 3b9b726b1a6c..a45d4d640f01 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, +@@ -1890,7 +1890,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, child = d_hash_and_lookup(dir, &qname); if (!child) { @@ -176,10 +176,10 @@ index f999e8bd3771..bf9476600c73 100644 if (IS_ERR(child)) goto end_instantiate; diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c -index 7325baa8f9d4..31f25ff3999f 100644 +index c95f32b83a94..75f500cb7e74 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, +@@ -681,7 +681,7 @@ static bool proc_sys_fill_cache(struct file *file, child = d_lookup(dir, &qname); if (!child) { @@ -211,7 +211,7 @@ index 0880baefd85f..8b4d6c8c1f7f 100644 extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); extern struct dentry * d_exact_alias(struct dentry *, struct inode *); diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h -index bd1c889a9ed9..1fc27eb1f021 100644 +index cab24a127feb..73b0d19ef0d9 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -1549,7 +1549,7 @@ struct nfs_unlinkdata { @@ -236,5 +236,5 @@ index c7cb30cdd1b7..119a56d7f739 100644 list_splice_init(&q->task_list, &tmp); while (!list_empty(&tmp)) { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0191-workqueue-Use-normal-rcu.patch b/kernel/patches-4.19.x-rt/0191-workqueue-Use-normal-rcu.patch index 9d06d188c..654072350 100644 --- a/kernel/patches-4.19.x-rt/0191-workqueue-Use-normal-rcu.patch +++ b/kernel/patches-4.19.x-rt/0191-workqueue-Use-normal-rcu.patch @@ -1,7 +1,7 @@ -From 4018ce6d082178ff8281c68418cb65803b58482e Mon Sep 17 00:00:00 2001 +From 10e5e4ecf5dab22ad4b607ba4222dce12d256c0e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 24 Jul 2013 15:26:54 +0200 -Subject: [PATCH 191/283] workqueue: Use normal rcu +Subject: [PATCH 191/328] workqueue: Use normal rcu 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 @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index cd8b61bded78..88d7db5e0105 100644 +index 493908464b9e..544007905706 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -127,7 +127,7 @@ enum { @@ -179,7 +179,7 @@ index cd8b61bded78..88d7db5e0105 100644 } /** -@@ -2855,14 +2859,14 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, +@@ -2861,14 +2865,14 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, might_sleep(); @@ -197,7 +197,7 @@ index cd8b61bded78..88d7db5e0105 100644 /* see the comment in try_to_grab_pending() with the same code */ pwq = get_work_pwq(work); if (pwq) { -@@ -2894,10 +2898,11 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, +@@ -2900,10 +2904,11 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, lock_map_acquire(&pwq->wq->lockdep_map); lock_map_release(&pwq->wq->lockdep_map); } @@ -210,7 +210,7 @@ index cd8b61bded78..88d7db5e0105 100644 return false; } -@@ -3344,7 +3349,7 @@ static void rcu_free_pool(struct rcu_head *rcu) +@@ -3350,7 +3355,7 @@ static void rcu_free_pool(struct rcu_head *rcu) * put_unbound_pool - put a worker_pool * @pool: worker_pool to put * @@ -219,7 +219,7 @@ index cd8b61bded78..88d7db5e0105 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(). -@@ -3398,8 +3403,8 @@ static void put_unbound_pool(struct worker_pool *pool) +@@ -3404,8 +3409,8 @@ static void put_unbound_pool(struct worker_pool *pool) del_timer_sync(&pool->idle_timer); del_timer_sync(&pool->mayday_timer); @@ -230,7 +230,7 @@ index cd8b61bded78..88d7db5e0105 100644 } /** -@@ -3506,14 +3511,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work) +@@ -3512,14 +3517,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work) put_unbound_pool(pool); mutex_unlock(&wq_pool_mutex); @@ -247,7 +247,7 @@ index cd8b61bded78..88d7db5e0105 100644 } /** -@@ -4198,7 +4203,7 @@ void destroy_workqueue(struct workqueue_struct *wq) +@@ -4219,7 +4224,7 @@ void destroy_workqueue(struct workqueue_struct *wq) * The base ref is never dropped on per-cpu pwqs. Directly * schedule RCU free. */ @@ -256,7 +256,7 @@ index cd8b61bded78..88d7db5e0105 100644 } else { /* * We're the sole accessor of @wq at this point. Directly -@@ -4308,7 +4313,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) +@@ -4329,7 +4334,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) struct pool_workqueue *pwq; bool ret; @@ -266,7 +266,7 @@ index cd8b61bded78..88d7db5e0105 100644 if (cpu == WORK_CPU_UNBOUND) cpu = smp_processor_id(); -@@ -4319,7 +4325,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) +@@ -4340,7 +4346,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); @@ -276,7 +276,7 @@ index cd8b61bded78..88d7db5e0105 100644 return ret; } -@@ -4345,15 +4352,15 @@ unsigned int work_busy(struct work_struct *work) +@@ -4366,15 +4373,15 @@ unsigned int work_busy(struct work_struct *work) if (work_pending(work)) ret |= WORK_BUSY_PENDING; @@ -296,7 +296,7 @@ index cd8b61bded78..88d7db5e0105 100644 return ret; } -@@ -4537,7 +4544,7 @@ void show_workqueue_state(void) +@@ -4559,7 +4566,7 @@ void show_workqueue_state(void) unsigned long flags; int pi; @@ -305,7 +305,7 @@ index cd8b61bded78..88d7db5e0105 100644 pr_info("Showing busy workqueues and worker pools:\n"); -@@ -4602,7 +4609,7 @@ void show_workqueue_state(void) +@@ -4624,7 +4631,7 @@ void show_workqueue_state(void) touch_nmi_watchdog(); } @@ -314,7 +314,7 @@ index cd8b61bded78..88d7db5e0105 100644 } /* used to show worker information through /proc/PID/{comm,stat,status} */ -@@ -4989,16 +4996,16 @@ bool freeze_workqueues_busy(void) +@@ -5011,16 +5018,16 @@ bool freeze_workqueues_busy(void) * nr_active is monotonically decreasing. It's safe * to peek without lock. */ @@ -334,7 +334,7 @@ index cd8b61bded78..88d7db5e0105 100644 } out_unlock: mutex_unlock(&wq_pool_mutex); -@@ -5193,7 +5200,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, +@@ -5215,7 +5222,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, const char *delim = ""; int node, written = 0; @@ -344,7 +344,7 @@ index cd8b61bded78..88d7db5e0105 100644 for_each_node(node) { written += scnprintf(buf + written, PAGE_SIZE - written, "%s%d:%d", delim, node, -@@ -5201,7 +5209,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, +@@ -5223,7 +5231,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, delim = " "; } written += scnprintf(buf + written, PAGE_SIZE - written, "\n"); @@ -355,5 +355,5 @@ index cd8b61bded78..88d7db5e0105 100644 return written; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0192-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch b/kernel/patches-4.19.x-rt/0192-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch index 4b0e4fb69..cbfdb0cc6 100644 --- a/kernel/patches-4.19.x-rt/0192-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch +++ b/kernel/patches-4.19.x-rt/0192-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch @@ -1,7 +1,7 @@ -From c6764ccb97710b9c7026328c5403d2fac671b693 Mon Sep 17 00:00:00 2001 +From 9c52df57d5e211043c5a5b6820933f14bdc83525 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:42:26 +0200 -Subject: [PATCH 192/283] workqueue: Use local irq lock instead of irq disable +Subject: [PATCH 192/328] workqueue: Use local irq lock instead of irq disable regions Use a local_irq_lock as a replacement for irq off regions. We keep the @@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index 88d7db5e0105..d168a5581c7f 100644 +index 544007905706..0efb8d25d940 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -49,6 +49,7 @@ @@ -149,7 +149,7 @@ index 88d7db5e0105..d168a5581c7f 100644 } /** -@@ -3002,7 +3017,7 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork) +@@ -3008,7 +3023,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); @@ -158,7 +158,7 @@ index 88d7db5e0105..d168a5581c7f 100644 /* * This allows canceling during early boot. We know that @work -@@ -3063,10 +3078,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); +@@ -3069,10 +3084,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); */ bool flush_delayed_work(struct delayed_work *dwork) { @@ -171,7 +171,7 @@ index 88d7db5e0105..d168a5581c7f 100644 return flush_work(&dwork->work); } EXPORT_SYMBOL(flush_delayed_work); -@@ -3104,7 +3119,7 @@ static bool __cancel_work(struct work_struct *work, bool is_dwork) +@@ -3110,7 +3125,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)); @@ -181,5 +181,5 @@ index 88d7db5e0105..d168a5581c7f 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0193-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch b/kernel/patches-4.19.x-rt/0193-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch index 68515d39d..0e782f22e 100644 --- a/kernel/patches-4.19.x-rt/0193-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch +++ b/kernel/patches-4.19.x-rt/0193-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch @@ -1,7 +1,7 @@ -From 95e529176f4d5f1da0194d25b6a7434f5dc66590 Mon Sep 17 00:00:00 2001 +From e86a6ec786f05699d6e5490129ae8e2ede3bbe5e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 1 Jul 2013 11:02:42 +0200 -Subject: [PATCH 193/283] workqueue: Prevent workqueue versus ata-piix livelock +Subject: [PATCH 193/328] workqueue: Prevent workqueue versus ata-piix livelock 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 @@ -113,7 +113,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 d168a5581c7f..0a11d2f64424 100644 +index 0efb8d25d940..34734cdb5cb6 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -50,6 +50,7 @@ @@ -134,5 +134,5 @@ index d168a5581c7f..0a11d2f64424 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0194-sched-Distangle-worker-accounting-from-rqlock.patch b/kernel/patches-4.19.x-rt/0194-sched-Distangle-worker-accounting-from-rqlock.patch index c9ed774e6..a2719a4ba 100644 --- a/kernel/patches-4.19.x-rt/0194-sched-Distangle-worker-accounting-from-rqlock.patch +++ b/kernel/patches-4.19.x-rt/0194-sched-Distangle-worker-accounting-from-rqlock.patch @@ -1,7 +1,7 @@ -From 2a67f032ed0f4dc51e3cfbba38a8b4bedbf3f9a0 Mon Sep 17 00:00:00 2001 +From 297b2be7a99ed420743272591f3bc082f5d0bd6f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 22 Jun 2011 19:47:03 +0200 -Subject: [PATCH 194/283] sched: Distangle worker accounting from rqlock +Subject: [PATCH 194/328] sched: Distangle worker accounting from rqlock 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 @@ -33,7 +33,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 36f791ff52bc..08052198031a 100644 +index 3b2664e691de..dcf2deedd3f8 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 @@ -104,7 +104,7 @@ index 36f791ff52bc..08052198031a 100644 /** * wake_up_process - Wake up a specific process * @p: The process to be woken up. -@@ -3520,21 +3466,6 @@ static void __sched notrace __schedule(bool preempt) +@@ -3561,21 +3507,6 @@ static void __sched notrace __schedule(bool preempt) atomic_inc(&rq->nr_iowait); delayacct_blkio_start(); } @@ -126,7 +126,7 @@ index 36f791ff52bc..08052198031a 100644 } switch_count = &prev->nvcsw; } -@@ -3594,6 +3525,20 @@ static inline void sched_submit_work(struct task_struct *tsk) +@@ -3635,6 +3566,20 @@ static inline void sched_submit_work(struct task_struct *tsk) { if (!tsk->state || tsk_is_pi_blocked(tsk)) return; @@ -147,7 +147,7 @@ index 36f791ff52bc..08052198031a 100644 /* * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. -@@ -3602,6 +3547,12 @@ static inline void sched_submit_work(struct task_struct *tsk) +@@ -3643,6 +3588,12 @@ static inline void sched_submit_work(struct task_struct *tsk) blk_schedule_flush_plug(tsk); } @@ -160,7 +160,7 @@ index 36f791ff52bc..08052198031a 100644 asmlinkage __visible void __sched schedule(void) { struct task_struct *tsk = current; -@@ -3612,6 +3563,7 @@ asmlinkage __visible void __sched schedule(void) +@@ -3653,6 +3604,7 @@ asmlinkage __visible void __sched schedule(void) __schedule(false); sched_preempt_enable_no_resched(); } while (need_resched()); @@ -169,7 +169,7 @@ index 36f791ff52bc..08052198031a 100644 EXPORT_SYMBOL(schedule); diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index 0a11d2f64424..aa39924bd3b5 100644 +index 34734cdb5cb6..045b82ca0eb5 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -843,43 +843,32 @@ static void wake_up_worker(struct worker_pool *pool) @@ -286,5 +286,5 @@ index 66fbb5a9e633..30cfed226b39 100644 #endif /* _KERNEL_WORKQUEUE_INTERNAL_H */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0195-debugobjects-Make-RT-aware.patch b/kernel/patches-4.19.x-rt/0195-debugobjects-Make-RT-aware.patch index 5302147cd..be336c18a 100644 --- a/kernel/patches-4.19.x-rt/0195-debugobjects-Make-RT-aware.patch +++ b/kernel/patches-4.19.x-rt/0195-debugobjects-Make-RT-aware.patch @@ -1,7 +1,7 @@ -From a51785a98d1a72ead35a11a9fc57eaaf37789736 Mon Sep 17 00:00:00 2001 +From 5240d73278022cb45b35b96e5c56752146bc1b17 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:41:35 +0200 -Subject: [PATCH 195/283] debugobjects: Make RT aware +Subject: [PATCH 195/328] debugobjects: Make RT aware Avoid filling the pool / allocating memory with irqs off(). @@ -27,5 +27,5 @@ index 14afeeb7d6ef..e28481c402ae 100644 db = get_bucket((unsigned long) addr); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0196-seqlock-Prevent-rt-starvation.patch b/kernel/patches-4.19.x-rt/0196-seqlock-Prevent-rt-starvation.patch index dff9fdc2d..77e61f57f 100644 --- a/kernel/patches-4.19.x-rt/0196-seqlock-Prevent-rt-starvation.patch +++ b/kernel/patches-4.19.x-rt/0196-seqlock-Prevent-rt-starvation.patch @@ -1,7 +1,7 @@ -From 57407205aa8a3eacf4fb95e6ae48e68850c42cf4 Mon Sep 17 00:00:00 2001 +From 8495d9ef448ef2ad328ed925e41605778ee51cd4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 22 Feb 2012 12:03:30 +0100 -Subject: [PATCH 196/283] seqlock: Prevent rt starvation +Subject: [PATCH 196/328] seqlock: Prevent rt starvation If a low prio writer gets preempted while holding the seqlock write locked, a high prio reader spins forever on RT. @@ -159,7 +159,7 @@ index bcf4cf26b8c8..689ed53016c7 100644 } diff --git a/include/net/neighbour.h b/include/net/neighbour.h -index beeeed126872..6dd1765e22ec 100644 +index 5ce035984a4d..1166fc17b757 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -451,7 +451,7 @@ static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) @@ -190,5 +190,5 @@ index beeeed126872..6dd1765e22ec 100644 { unsigned int seq; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0197-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/kernel/patches-4.19.x-rt/0197-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch index 32bbbb575..d14bc0114 100644 --- a/kernel/patches-4.19.x-rt/0197-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/kernel/patches-4.19.x-rt/0197-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,7 +1,7 @@ -From 69eb884bf0625cc689fe528f261b51906bf389d1 Mon Sep 17 00:00:00 2001 +From 2ca7937e235cfe226669eea396294adeee79c34e Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 18 Feb 2015 16:05:28 +0100 -Subject: [PATCH 197/283] sunrpc: Make svc_xprt_do_enqueue() use +Subject: [PATCH 197/328] sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 @@ -56,5 +56,5 @@ index 6cf0fd37cbf0..48c0a0b90946 100644 } EXPORT_SYMBOL_GPL(svc_xprt_do_enqueue); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0198-net-Use-skbufhead-with-raw-lock.patch b/kernel/patches-4.19.x-rt/0198-net-Use-skbufhead-with-raw-lock.patch index ce144a84a..f549f0a3a 100644 --- a/kernel/patches-4.19.x-rt/0198-net-Use-skbufhead-with-raw-lock.patch +++ b/kernel/patches-4.19.x-rt/0198-net-Use-skbufhead-with-raw-lock.patch @@ -1,7 +1,7 @@ -From 21c221625426b72acf5aad55261378a107daab99 Mon Sep 17 00:00:00 2001 +From ac577d42ef159cea2e3512a52c9dbc43de1c7c5d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 12 Jul 2011 15:38:34 +0200 -Subject: [PATCH 198/283] net: Use skbufhead with raw lock +Subject: [PATCH 198/328] net: Use skbufhead with raw lock 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 @@ -15,10 +15,10 @@ Signed-off-by: Thomas Gleixner 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 8c2fec0bcb26..384c63ecb9ae 100644 +index 84bbdcbb199a..b816eb0bc1c4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2973,6 +2973,7 @@ struct softnet_data { +@@ -2982,6 +2982,7 @@ struct softnet_data { unsigned int dropped; struct sk_buff_head input_pkt_queue; struct napi_struct backlog; @@ -27,7 +27,7 @@ index 8c2fec0bcb26..384c63ecb9ae 100644 }; diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index 28baccb1efd5..b4412944db54 100644 +index 25407c206e73..d4d7aea13cc6 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -287,6 +287,7 @@ struct sk_buff_head { @@ -38,7 +38,7 @@ index 28baccb1efd5..b4412944db54 100644 }; struct sk_buff; -@@ -1704,6 +1705,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) +@@ -1718,6 +1719,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) __skb_queue_head_init(list); } @@ -52,10 +52,10 @@ index 28baccb1efd5..b4412944db54 100644 struct lock_class_key *class) { diff --git a/net/core/dev.c b/net/core/dev.c -index abaf8a73403b..616429a4715c 100644 +index b754adb14205..985d1f703383 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) +@@ -218,14 +218,14 @@ static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex) static inline void rps_lock(struct softnet_data *sd) { #ifdef CONFIG_RPS @@ -72,7 +72,7 @@ index abaf8a73403b..616429a4715c 100644 #endif } -@@ -5260,7 +5260,7 @@ static void flush_backlog(struct work_struct *work) +@@ -5246,7 +5246,7 @@ static void flush_backlog(struct work_struct *work) skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->input_pkt_queue); @@ -81,7 +81,7 @@ index abaf8a73403b..616429a4715c 100644 input_queue_head_incr(sd); } } -@@ -5270,11 +5270,14 @@ static void flush_backlog(struct work_struct *work) +@@ -5256,11 +5256,14 @@ static void flush_backlog(struct work_struct *work) skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); @@ -97,7 +97,7 @@ index abaf8a73403b..616429a4715c 100644 } static void flush_all_backlogs(void) -@@ -5853,7 +5856,9 @@ static int process_backlog(struct napi_struct *napi, int quota) +@@ -5839,7 +5842,9 @@ static int process_backlog(struct napi_struct *napi, int quota) while (again) { struct sk_buff *skb; @@ -107,7 +107,7 @@ index abaf8a73403b..616429a4715c 100644 rcu_read_lock(); __netif_receive_skb(skb); rcu_read_unlock(); -@@ -5861,9 +5866,9 @@ static int process_backlog(struct napi_struct *napi, int quota) +@@ -5847,9 +5852,9 @@ static int process_backlog(struct napi_struct *napi, int quota) if (++work >= quota) return work; @@ -118,7 +118,7 @@ index abaf8a73403b..616429a4715c 100644 rps_lock(sd); if (skb_queue_empty(&sd->input_pkt_queue)) { /* -@@ -6328,13 +6333,21 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) +@@ -6314,13 +6319,21 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) unsigned long time_limit = jiffies + usecs_to_jiffies(netdev_budget_usecs); int budget = netdev_budget; @@ -140,7 +140,7 @@ index abaf8a73403b..616429a4715c 100644 for (;;) { struct napi_struct *n; -@@ -9323,10 +9336,13 @@ static int dev_cpu_dead(unsigned int oldcpu) +@@ -9504,10 +9517,13 @@ static int dev_cpu_dead(unsigned int oldcpu) netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -155,7 +155,7 @@ index abaf8a73403b..616429a4715c 100644 return 0; } -@@ -9635,8 +9651,9 @@ static int __init net_dev_init(void) +@@ -9818,8 +9834,9 @@ static int __init net_dev_init(void) INIT_WORK(flush, flush_backlog); @@ -168,5 +168,5 @@ index abaf8a73403b..616429a4715c 100644 skb_queue_head_init(&sd->xfrm_backlog); #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0199-net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/kernel/patches-4.19.x-rt/0199-net-move-xmit_recursion-to-per-task-variable-on-RT.patch index a52d46a7d..12449857a 100644 --- a/kernel/patches-4.19.x-rt/0199-net-move-xmit_recursion-to-per-task-variable-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0199-net-move-xmit_recursion-to-per-task-variable-on-RT.patch @@ -1,7 +1,7 @@ -From 2cb581744045c7aea758c05bbc5c84389753b1a5 Mon Sep 17 00:00:00 2001 +From 2b3882e6dc68a87b4b958396528cf0ccf1d9c5b4 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Jan 2016 15:55:02 +0100 -Subject: [PATCH 199/283] net: move xmit_recursion to per-task variable on -RT +Subject: [PATCH 199/328] net: move xmit_recursion to per-task variable on -RT A softirq on -RT can be preempted. That means one task is in __dev_queue_xmit(), gets preempted and another task may enter @@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior 4 files changed, 104 insertions(+), 15 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 384c63ecb9ae..b6a75296eb46 100644 +index b816eb0bc1c4..5de4b66e11fe 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -587,7 +587,11 @@ struct netdev_queue { @@ -39,7 +39,7 @@ index 384c63ecb9ae..b6a75296eb46 100644 /* * Time (in jiffies) of last Tx */ -@@ -2611,14 +2615,53 @@ void netdev_freemem(struct net_device *dev); +@@ -2620,14 +2624,53 @@ void netdev_freemem(struct net_device *dev); void synchronize_net(void); int init_dummy_netdev(struct net_device *dev); @@ -94,8 +94,8 @@ index 384c63ecb9ae..b6a75296eb46 100644 struct net_device *dev_get_by_index(struct net *net, int ifindex); struct net_device *__dev_get_by_index(struct net *net, int ifindex); struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); -@@ -3794,10 +3837,48 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) - return (1 << debug_value) - 1; +@@ -3805,10 +3848,48 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) + return (1U << debug_value) - 1; } +#ifdef CONFIG_PREEMPT_RT_FULL @@ -144,7 +144,7 @@ index 384c63ecb9ae..b6a75296eb46 100644 } static inline bool __netif_tx_acquire(struct netdev_queue *txq) -@@ -3814,32 +3895,32 @@ static inline void __netif_tx_release(struct netdev_queue *txq) +@@ -3825,32 +3906,32 @@ static inline void __netif_tx_release(struct netdev_queue *txq) static inline void __netif_tx_lock_bh(struct netdev_queue *txq) { spin_lock_bh(&txq->_xmit_lock); @@ -183,10 +183,10 @@ index 384c63ecb9ae..b6a75296eb46 100644 } diff --git a/include/linux/sched.h b/include/linux/sched.h -index a023e1ba5d8f..a9a5edfa9689 100644 +index a38a2c2a8fe4..756fed8f5994 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1208,6 +1208,9 @@ struct task_struct { +@@ -1216,6 +1216,9 @@ struct task_struct { #endif #ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change; @@ -197,10 +197,10 @@ index a023e1ba5d8f..a9a5edfa9689 100644 int pagefault_disabled; #ifdef CONFIG_MMU diff --git a/net/core/dev.c b/net/core/dev.c -index 616429a4715c..1a8677236939 100644 +index 985d1f703383..b5dc8a521fd2 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3537,8 +3537,10 @@ static void skb_update_prio(struct sk_buff *skb) +@@ -3538,8 +3538,10 @@ static void skb_update_prio(struct sk_buff *skb) #define skb_update_prio(skb) #endif @@ -211,7 +211,7 @@ index 616429a4715c..1a8677236939 100644 /** * dev_loopback_xmit - loop back @skb -@@ -3829,9 +3831,12 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) +@@ -3830,9 +3832,12 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) if (dev->flags & IFF_UP) { int cpu = smp_processor_id(); /* ok because BHs are off */ @@ -226,7 +226,7 @@ index 616429a4715c..1a8677236939 100644 goto recursion_alert; skb = validate_xmit_skb(skb, dev, &again); -@@ -3841,9 +3846,9 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) +@@ -3842,9 +3847,9 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) HARD_TX_LOCK(dev, txq, cpu); if (!netif_xmit_stopped(txq)) { @@ -238,7 +238,7 @@ index 616429a4715c..1a8677236939 100644 if (dev_xmit_complete(rc)) { HARD_TX_UNLOCK(dev, txq); goto out; -@@ -8388,7 +8393,7 @@ static void netdev_init_one_queue(struct net_device *dev, +@@ -8563,7 +8568,7 @@ static void netdev_init_one_queue(struct net_device *dev, /* Initialize queue lock */ spin_lock_init(&queue->_xmit_lock); netdev_set_xmit_lockdep_class(&queue->_xmit_lock, dev->type); @@ -248,7 +248,7 @@ index 616429a4715c..1a8677236939 100644 queue->dev = dev; #ifdef CONFIG_BQL diff --git a/net/core/filter.c b/net/core/filter.c -index 34ec9324737b..03925960fb5c 100644 +index 40b3af05c883..205cd1bb9bc2 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) @@ -260,9 +260,9 @@ index 34ec9324737b..03925960fb5c 100644 net_crit_ratelimited("bpf: recursion limit reached on datapath, buggy bpf program?\n"); kfree_skb(skb); return -ENETDOWN; -@@ -2008,9 +2008,9 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) - +@@ -2009,9 +2009,9 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) skb->dev = dev; + skb->tstamp = 0; - __this_cpu_inc(xmit_recursion); + xmit_rec_inc(); @@ -273,5 +273,5 @@ index 34ec9324737b..03925960fb5c 100644 return ret; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0200-net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/kernel/patches-4.19.x-rt/0200-net-provide-a-way-to-delegate-processing-a-softirq-t.patch index 0cdeeebf9..287880a49 100644 --- a/kernel/patches-4.19.x-rt/0200-net-provide-a-way-to-delegate-processing-a-softirq-t.patch +++ b/kernel/patches-4.19.x-rt/0200-net-provide-a-way-to-delegate-processing-a-softirq-t.patch @@ -1,7 +1,7 @@ -From 713b395adee9bc6d03ba74839407be41a05a6e89 Mon Sep 17 00:00:00 2001 +From 621f9c07474a04eaee9cbb799a037e462a5b692c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 15:39:05 +0100 -Subject: [PATCH 200/283] net: provide a way to delegate processing a softirq +Subject: [PATCH 200/328] net: provide a way to delegate processing a softirq to ksoftirqd If the NET_RX uses up all of his budget it moves the following NAPI @@ -71,10 +71,10 @@ index 27a4bb2303d0..25bcf2f2714b 100644 * This function must run with irqs disabled! */ diff --git a/net/core/dev.c b/net/core/dev.c -index 1a8677236939..0da36fb20153 100644 +index b5dc8a521fd2..ecdf7534ef13 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) +@@ -6368,7 +6368,7 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) list_splice_tail(&repoll, &list); list_splice(&list, &sd->poll_list); if (!list_empty(&sd->poll_list)) @@ -84,5 +84,5 @@ index 1a8677236939..0da36fb20153 100644 net_rps_action_and_irq_enable(sd); out: -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0201-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/kernel/patches-4.19.x-rt/0201-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index a6a4f97b3..8e912e6b6 100644 --- a/kernel/patches-4.19.x-rt/0201-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/kernel/patches-4.19.x-rt/0201-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,7 +1,7 @@ -From d81c8e92081b67d58e45585afb0020c6759e671e Mon Sep 17 00:00:00 2001 +From 136dfe4108059e637cdcc04f03dbca6637386429 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 30 Mar 2016 13:36:29 +0200 -Subject: [PATCH 201/283] net: dev: always take qdisc's busylock in +Subject: [PATCH 201/328] net: dev: always take qdisc's busylock in __dev_xmit_skb() The root-lock is dropped before dev_hard_start_xmit() is invoked and after @@ -21,10 +21,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 4 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c -index 0da36fb20153..305bf1240e8a 100644 +index ecdf7534ef13..6c6c1c6d534b 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, +@@ -3466,7 +3466,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, * This permits qdisc->running owner to get the lock more * often and dequeue packets faster. */ @@ -37,5 +37,5 @@ index 0da36fb20153..305bf1240e8a 100644 spin_lock(&q->busylock); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0202-net-Qdisc-use-a-seqlock-instead-seqcount.patch b/kernel/patches-4.19.x-rt/0202-net-Qdisc-use-a-seqlock-instead-seqcount.patch index f9ca70cdb..455f35f1d 100644 --- a/kernel/patches-4.19.x-rt/0202-net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/kernel/patches-4.19.x-rt/0202-net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,7 +1,7 @@ -From f0d7dcb8d6664bb3c716c75710d0a37f3ed3d107 Mon Sep 17 00:00:00 2001 +From 41d62c0f01ed3d5b94cee9c89dba5a3ba0947e42 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 17:36:35 +0200 -Subject: [PATCH 202/283] net/Qdisc: use a seqlock instead seqcount +Subject: [PATCH 202/328] net/Qdisc: use a seqlock instead seqcount 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 @@ -105,7 +105,7 @@ index 000000000000..a7034298a82a + +#endif diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h -index c44da48de7df..c85ac38f7fa9 100644 +index d737a6a2600b..2d35b952bf60 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -10,6 +10,7 @@ @@ -165,7 +165,7 @@ index c44da48de7df..c85ac38f7fa9 100644 if (qdisc->flags & TCQ_F_NOLOCK) spin_unlock(&qdisc->seqlock); } -@@ -453,7 +468,7 @@ static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc) +@@ -459,7 +474,7 @@ static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc) return qdisc_lock(root); } @@ -241,7 +241,7 @@ index e2fd8baec65f..8bab88738691 100644 struct gnet_stats_basic_cpu __percpu *cpu, struct gnet_stats_basic_packed *b) diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c -index be7cd140b2a3..5b8f90de0615 100644 +index 39e319d04bb8..fe99928aff78 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1166,7 +1166,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev, @@ -254,10 +254,10 @@ index be7cd140b2a3..5b8f90de0615 100644 err = -EOPNOTSUPP; if (sch->flags & TCQ_F_MQROOT) { diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c -index 31b9c2b415b4..b0cc57ff96e3 100644 +index 4ab20f1138fd..a9ed58ca3924 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -570,7 +570,11 @@ struct Qdisc noop_qdisc = { +@@ -575,7 +575,11 @@ struct Qdisc noop_qdisc = { .ops = &noop_qdisc_ops, .q.lock = __SPIN_LOCK_UNLOCKED(noop_qdisc.q.lock), .dev_queue = &noop_netdev_queue, @@ -267,9 +267,9 @@ index 31b9c2b415b4..b0cc57ff96e3 100644 .running = SEQCNT_ZERO(noop_qdisc.running), +#endif .busylock = __SPIN_LOCK_UNLOCKED(noop_qdisc.busylock), - }; - EXPORT_SYMBOL(noop_qdisc); -@@ -859,9 +863,17 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, + .gso_skb = { + .next = (struct sk_buff *)&noop_qdisc.gso_skb, +@@ -876,9 +880,17 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, lockdep_set_class(&sch->busylock, dev->qdisc_tx_busylock ?: &qdisc_tx_busylock); @@ -288,5 +288,5 @@ index 31b9c2b415b4..b0cc57ff96e3 100644 sch->ops = ops; sch->flags = ops->static_flags; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0203-net-add-back-the-missing-serialization-in-ip_send_un.patch b/kernel/patches-4.19.x-rt/0203-net-add-back-the-missing-serialization-in-ip_send_un.patch index 3fb438268..42748d105 100644 --- a/kernel/patches-4.19.x-rt/0203-net-add-back-the-missing-serialization-in-ip_send_un.patch +++ b/kernel/patches-4.19.x-rt/0203-net-add-back-the-missing-serialization-in-ip_send_un.patch @@ -1,7 +1,7 @@ -From 65c80c3225a3398c6f65566593d114a2a92baa6c Mon Sep 17 00:00:00 2001 +From 7ddcdec24f0b8d364eed41710f1a2a821979e5a1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:21:56 +0200 -Subject: [PATCH 203/283] net: add back the missing serialization in +Subject: [PATCH 203/328] net: add back the missing serialization in ip_send_unicast_reply() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -42,7 +42,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 b76cf96d5cfe..51358c73dada 100644 +index 6da393016c11..105e94ff1095 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -62,6 +62,7 @@ @@ -94,5 +94,5 @@ index b76cf96d5cfe..51358c73dada 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0204-net-add-a-lock-around-icmp_sk.patch b/kernel/patches-4.19.x-rt/0204-net-add-a-lock-around-icmp_sk.patch index 880f3a5b5..7d85d5f00 100644 --- a/kernel/patches-4.19.x-rt/0204-net-add-a-lock-around-icmp_sk.patch +++ b/kernel/patches-4.19.x-rt/0204-net-add-a-lock-around-icmp_sk.patch @@ -1,7 +1,7 @@ -From 46a531f02facc10cbd982f8de9c62e704d8f1815 Mon Sep 17 00:00:00 2001 +From abcb99faf244ae2e089bd1933e80f0d8216e00b8 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:54:09 +0200 -Subject: [PATCH 204/283] net: add a lock around icmp_sk() +Subject: [PATCH 204/328] net: add a lock around icmp_sk() 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 @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 8 insertions(+) diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c -index ad75c468ecfb..1770ff1638bc 100644 +index 4efa5e33513e..de67d595e298 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -77,6 +77,7 @@ @@ -60,5 +60,5 @@ index ad75c468ecfb..1770ff1638bc 100644 int sysctl_icmp_msgs_per_sec __read_mostly = 1000; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0205-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/kernel/patches-4.19.x-rt/0205-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index 57a2c9881..075981241 100644 --- a/kernel/patches-4.19.x-rt/0205-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/kernel/patches-4.19.x-rt/0205-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -1,7 +1,7 @@ -From 6b041ae87c727d10384398ec51f0003ef02cdc38 Mon Sep 17 00:00:00 2001 +From 6da7a2e74d33df8e51178520e3945133a97ee419 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Tue, 6 Dec 2016 17:50:30 -0500 -Subject: [PATCH 205/283] net: Have __napi_schedule_irqoff() disable interrupts +Subject: [PATCH 205/328] net: Have __napi_schedule_irqoff() disable interrupts on RT A customer hit a crash where the napi sd->poll_list became corrupted. @@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior 2 files changed, 14 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index b6a75296eb46..946875cae933 100644 +index 5de4b66e11fe..1d6bb0ab437f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -422,7 +422,19 @@ typedef enum rx_handler_result rx_handler_result_t; @@ -52,10 +52,10 @@ 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 305bf1240e8a..d86972449f63 100644 +index 6c6c1c6d534b..19e2cd0897b3 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5952,6 +5952,7 @@ bool napi_schedule_prep(struct napi_struct *n) +@@ -5938,6 +5938,7 @@ bool napi_schedule_prep(struct napi_struct *n) } EXPORT_SYMBOL(napi_schedule_prep); @@ -63,7 +63,7 @@ index 305bf1240e8a..d86972449f63 100644 /** * __napi_schedule_irqoff - schedule for receive * @n: entry to schedule -@@ -5963,6 +5964,7 @@ void __napi_schedule_irqoff(struct napi_struct *n) +@@ -5949,6 +5950,7 @@ void __napi_schedule_irqoff(struct napi_struct *n) ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); @@ -72,5 +72,5 @@ index 305bf1240e8a..d86972449f63 100644 bool napi_complete_done(struct napi_struct *n, int work_done) { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0206-irqwork-push-most-work-into-softirq-context.patch b/kernel/patches-4.19.x-rt/0206-irqwork-push-most-work-into-softirq-context.patch index 288ef3c60..ce2534331 100644 --- a/kernel/patches-4.19.x-rt/0206-irqwork-push-most-work-into-softirq-context.patch +++ b/kernel/patches-4.19.x-rt/0206-irqwork-push-most-work-into-softirq-context.patch @@ -1,7 +1,7 @@ -From b1507e25e704c438e660c5c1825ec806b158f556 Mon Sep 17 00:00:00 2001 +From 6151f6a5fa3c014525a6c18524e092f1e47fb1e1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 23 Jun 2015 15:32:51 +0200 -Subject: [PATCH 206/283] irqwork: push most work into softirq context +Subject: [PATCH 206/328] irqwork: push most work into softirq context 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. @@ -222,7 +222,7 @@ index f162a4f54b05..278fe66bfb70 100644 rdp->rcu_iw_gp_seq = rnp->gp_seq; irq_work_queue_on(&rdp->rcu_iw, rdp->cpu); diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c -index c0a751464971..6e95f1ca3e22 100644 +index 74b694392f2f..fb4d11bab6b7 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -279,6 +279,7 @@ static int init_rootdomain(struct root_domain *rd) @@ -234,10 +234,10 @@ index c0a751464971..6e95f1ca3e22 100644 init_dl_bw(&rd->dl_bw); diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index 6482945f8ae8..da4a3f8feb56 100644 +index 2b0ddd50e879..4d31ec98e968 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -232,6 +232,7 @@ static void nohz_full_kick_func(struct irq_work *work) +@@ -236,6 +236,7 @@ static void nohz_full_kick_func(struct irq_work *work) static DEFINE_PER_CPU(struct irq_work, nohz_full_kick_work) = { .func = nohz_full_kick_func, @@ -246,10 +246,10 @@ index 6482945f8ae8..da4a3f8feb56 100644 /* diff --git a/kernel/time/timer.c b/kernel/time/timer.c -index 696e7583137c..781483c76b17 100644 +index 3fab1c50bf1b..2fcd56aa6092 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -1733,6 +1733,8 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h) +@@ -1735,6 +1735,8 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h) { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); @@ -259,5 +259,5 @@ index 696e7583137c..781483c76b17 100644 if (IS_ENABLED(CONFIG_NO_HZ_COMMON)) __run_timers(this_cpu_ptr(&timer_bases[BASE_DEF])); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0207-printk-Make-rt-aware.patch b/kernel/patches-4.19.x-rt/0207-printk-Make-rt-aware.patch index 267a06997..559dd014c 100644 --- a/kernel/patches-4.19.x-rt/0207-printk-Make-rt-aware.patch +++ b/kernel/patches-4.19.x-rt/0207-printk-Make-rt-aware.patch @@ -1,7 +1,7 @@ -From fd90db4e8653f0ebf2a6959313658fcdaadec8fc Mon Sep 17 00:00:00 2001 +From e06507e6c3956ece840a3de1c8124c035609a1fb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 19 Sep 2012 14:50:37 +0200 -Subject: [PATCH 207/283] printk: Make rt aware +Subject: [PATCH 207/328] printk: Make rt aware Drop the lock before calling the console driver and do not disable interrupts while printing to a serial console. @@ -12,10 +12,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 6553508ff388..d983c509f74a 100644 +index f934baed564d..c927f89961a8 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1617,6 +1617,7 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) +@@ -1624,6 +1624,7 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) return do_syslog(type, buf, len, SYSLOG_FROM_READER); } @@ -23,7 +23,7 @@ index 6553508ff388..d983c509f74a 100644 /* * Special console_lock variants that help to reduce the risk of soft-lockups. * They allow to pass console_lock to another printk() call using a busy wait. -@@ -1757,6 +1758,15 @@ static int console_trylock_spinning(void) +@@ -1764,6 +1765,15 @@ static int console_trylock_spinning(void) return 1; } @@ -39,7 +39,7 @@ index 6553508ff388..d983c509f74a 100644 /* * Call the console drivers, asking them to write out * log_buf[start] to log_buf[end - 1]. -@@ -1772,6 +1782,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, +@@ -1779,6 +1789,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, if (!console_drivers) return; @@ -47,7 +47,7 @@ index 6553508ff388..d983c509f74a 100644 for_each_console(con) { if (exclusive_console && con != exclusive_console) continue; -@@ -1787,6 +1798,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, +@@ -1794,6 +1805,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, else con->write(con, text, len); } @@ -55,10 +55,10 @@ index 6553508ff388..d983c509f74a 100644 } int printk_delay_msec __read_mostly; -@@ -1978,20 +1990,30 @@ asmlinkage int vprintk_emit(int facility, int level, +@@ -1988,20 +2000,30 @@ asmlinkage int vprintk_emit(int facility, int level, /* If called from the scheduler, we can not call up(). */ - if (!in_sched) { + if (!in_sched && pending_output) { + int may_trylock = 1; + +#ifdef CONFIG_PREEMPT_RT_FULL @@ -88,8 +88,8 @@ index 6553508ff388..d983c509f74a 100644 + migrate_enable(); } - wake_up_klogd(); -@@ -2444,6 +2466,10 @@ void console_unlock(void) + if (pending_output) +@@ -2463,6 +2485,10 @@ void console_unlock(void) console_seq++; raw_spin_unlock(&logbuf_lock); @@ -100,7 +100,7 @@ index 6553508ff388..d983c509f74a 100644 /* * While actively printing out messages, if another printk() * were to occur on another CPU, it may wait for this one to -@@ -2462,6 +2488,7 @@ void console_unlock(void) +@@ -2481,6 +2507,7 @@ void console_unlock(void) } printk_safe_exit_irqrestore(flags); @@ -109,5 +109,5 @@ index 6553508ff388..d983c509f74a 100644 if (do_cond_resched) cond_resched(); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0208-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch b/kernel/patches-4.19.x-rt/0208-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch index e3b80d82d..860fe1678 100644 --- a/kernel/patches-4.19.x-rt/0208-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch +++ b/kernel/patches-4.19.x-rt/0208-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch @@ -1,7 +1,7 @@ -From af21e5c755447f232fe96ab7df9ecaf8df8a15a7 Mon Sep 17 00:00:00 2001 +From 0347ee41cebcbf76b3456e71c25eebd52611cdb9 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 19 May 2016 17:45:27 +0200 -Subject: [PATCH 208/283] kernel/printk: Don't try to print from IRQ/NMI region +Subject: [PATCH 208/328] kernel/printk: Don't try to print from IRQ/NMI region 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 @@ -15,10 +15,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 10 insertions(+) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index d983c509f74a..f15988a33860 100644 +index c927f89961a8..49ea374ba8ea 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1782,6 +1782,11 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, +@@ -1789,6 +1789,11 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, if (!console_drivers) return; @@ -30,7 +30,7 @@ index d983c509f74a..f15988a33860 100644 migrate_disable(); for_each_console(con) { if (exclusive_console && con != exclusive_console) -@@ -2540,6 +2545,11 @@ void console_unblank(void) +@@ -2555,6 +2560,11 @@ void console_unblank(void) { struct console *c; @@ -43,5 +43,5 @@ index d983c509f74a..f15988a33860 100644 * console_unblank can no longer be called in interrupt context unless * oops_in_progress is set to 1.. -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0209-printk-Drop-the-logbuf_lock-more-often.patch b/kernel/patches-4.19.x-rt/0209-printk-Drop-the-logbuf_lock-more-often.patch index d71d9c509..a7a3d978a 100644 --- a/kernel/patches-4.19.x-rt/0209-printk-Drop-the-logbuf_lock-more-often.patch +++ b/kernel/patches-4.19.x-rt/0209-printk-Drop-the-logbuf_lock-more-often.patch @@ -1,7 +1,7 @@ -From b0852ca451c4ab71a2ce94c00e267b8eb82e3ac2 Mon Sep 17 00:00:00 2001 +From defb111e7019c8c65c85ce7a673ffe3d4b4a1338 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Mar 2013 19:01:05 +0100 -Subject: [PATCH 209/283] printk: Drop the logbuf_lock more often +Subject: [PATCH 209/328] printk: Drop the logbuf_lock more often 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. @@ -12,10 +12,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 28 insertions(+) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index f15988a33860..a43d07d4e043 100644 +index 49ea374ba8ea..acef3657a316 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1420,12 +1420,23 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1427,12 +1427,23 @@ static int syslog_print_all(char __user *buf, int size, bool clear) u64 next_seq; u64 seq; u32 idx; @@ -39,7 +39,7 @@ index f15988a33860..a43d07d4e043 100644 /* * Find first record that fits, including all following records, * into the user-provided buffer for this dump. -@@ -1438,6 +1449,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1445,6 +1456,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) len += msg_print_text(msg, true, NULL, 0); idx = log_next(idx); seq++; @@ -54,7 +54,7 @@ index f15988a33860..a43d07d4e043 100644 } /* move first record forward until length fits into the buffer */ -@@ -1449,6 +1468,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1456,6 +1475,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) len -= msg_print_text(msg, true, NULL, 0); idx = log_next(idx); seq++; @@ -69,7 +69,7 @@ index f15988a33860..a43d07d4e043 100644 } /* last message fitting into this dump */ -@@ -1486,6 +1513,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1493,6 +1520,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) clear_seq = log_next_seq; clear_idx = log_next_idx; } @@ -78,5 +78,5 @@ index f15988a33860..a43d07d4e043 100644 kfree(text); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0210-ARM-enable-irq-in-translation-section-permission-fau.patch b/kernel/patches-4.19.x-rt/0210-ARM-enable-irq-in-translation-section-permission-fau.patch index cbaad861e..061ba569c 100644 --- a/kernel/patches-4.19.x-rt/0210-ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/kernel/patches-4.19.x-rt/0210-ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,7 +1,7 @@ -From d3668df4d5096d46b33e7f75444dcecf362dfb81 Mon Sep 17 00:00:00 2001 +From b991f2d263f639e8c4aa1a70ff0d979e6245a5b2 Mon Sep 17 00:00:00 2001 From: "Yadi.hu" Date: Wed, 10 Dec 2014 10:32:09 +0800 -Subject: [PATCH 210/283] ARM: enable irq in translation/section permission +Subject: [PATCH 210/328] ARM: enable irq in translation/section permission fault handlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 6 insertions(+) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c -index 3232afb6fdc0..3bec1f73a9aa 100644 +index a9ee0d9dc740..20b0e146de98 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -439,6 +439,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, @@ -91,5 +91,5 @@ index 3232afb6fdc0..3bec1f73a9aa 100644 return 0; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0211-genirq-update-irq_set_irqchip_state-documentation.patch b/kernel/patches-4.19.x-rt/0211-genirq-update-irq_set_irqchip_state-documentation.patch index a2e96110b..58654cf15 100644 --- a/kernel/patches-4.19.x-rt/0211-genirq-update-irq_set_irqchip_state-documentation.patch +++ b/kernel/patches-4.19.x-rt/0211-genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,7 +1,7 @@ -From a44a97a7d302fab9e3435afc7023d3ebff277efd Mon Sep 17 00:00:00 2001 +From 4324fc16ee37a4f6f8e0e6fc46cdaa6e16a5747a Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:00 -0600 -Subject: [PATCH 211/283] genirq: update irq_set_irqchip_state documentation +Subject: [PATCH 211/328] genirq: update irq_set_irqchip_state documentation On -rt kernels, the use of migrate_disable()/migrate_enable() is sufficient to guarantee a task isn't moved to another CPU. Update the @@ -14,10 +14,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 69b4bfd4654c..aafe2256bd39 100644 +index 3858ac895777..5701774a6d71 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -2282,7 +2282,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); +@@ -2330,7 +2330,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); * This call sets the internal irqchip state of an interrupt, * depending on the value of @which. * @@ -27,5 +27,5 @@ index 69b4bfd4654c..aafe2256bd39 100644 */ int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0212-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/kernel/patches-4.19.x-rt/0212-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index b18408b3d..e76e48639 100644 --- a/kernel/patches-4.19.x-rt/0212-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/kernel/patches-4.19.x-rt/0212-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,7 +1,7 @@ -From a3a039471f58abf91d2007ede9a7e308c834b456 Mon Sep 17 00:00:00 2001 +From 25e170a4bdc1953a46e60f3551c0ffd1f2b7b3aa Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:01 -0600 -Subject: [PATCH 212/283] KVM: arm/arm64: downgrade preempt_disable()d region +Subject: [PATCH 212/328] KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating @@ -23,10 +23,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 02bac8abd206..d36802fe2825 100644 +index d982650deb33..efe2d6c0201c 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c -@@ -712,7 +712,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) +@@ -723,7 +723,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. */ @@ -35,7 +35,7 @@ index 02bac8abd206..d36802fe2825 100644 kvm_pmu_flush_hwstate(vcpu); -@@ -761,7 +761,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) +@@ -772,7 +772,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(); @@ -44,7 +44,7 @@ index 02bac8abd206..d36802fe2825 100644 continue; } -@@ -839,7 +839,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) +@@ -850,7 +850,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); @@ -54,5 +54,5 @@ index 02bac8abd206..d36802fe2825 100644 ret = handle_exit(vcpu, run, ret); } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch b/kernel/patches-4.19.x-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch index b2ba0e9e1..1c10ffe5b 100644 --- a/kernel/patches-4.19.x-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +++ b/kernel/patches-4.19.x-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch @@ -1,7 +1,7 @@ -From d42064d787982281635b029761c83a285c877f51 Mon Sep 17 00:00:00 2001 +From 033bb93a0515b9df4593fbfcf93ea5ede830532c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 25 Jul 2018 14:02:38 +0200 -Subject: [PATCH 213/283] arm64: fpsimd: use preemp_disable in addition to +Subject: [PATCH 213/328] arm64: fpsimd: use preemp_disable in addition to local_bh_disable() In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c -index 58c53bc96928..71252cd8b594 100644 +index 14fdbaa6ee3a..7d572175682a 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -159,6 +159,16 @@ static void sve_free(struct task_struct *task) @@ -38,7 +38,7 @@ index 58c53bc96928..71252cd8b594 100644 /* * TIF_SVE controls whether a task can use SVE without trapping while * in userspace, and also the way a task's FPSIMD/SVE state is stored -@@ -547,6 +557,7 @@ int sve_set_vector_length(struct task_struct *task, +@@ -549,6 +559,7 @@ int sve_set_vector_length(struct task_struct *task, * non-SVE thread. */ if (task == current) { @@ -46,7 +46,7 @@ index 58c53bc96928..71252cd8b594 100644 local_bh_disable(); fpsimd_save(); -@@ -557,8 +568,10 @@ int sve_set_vector_length(struct task_struct *task, +@@ -559,8 +570,10 @@ int sve_set_vector_length(struct task_struct *task, if (test_and_clear_tsk_thread_flag(task, TIF_SVE)) sve_to_fpsimd(task); @@ -58,7 +58,7 @@ index 58c53bc96928..71252cd8b594 100644 /* * Force reallocation of task SVE state to the correct size -@@ -813,6 +826,7 @@ asmlinkage void do_sve_acc(unsigned int esr, struct pt_regs *regs) +@@ -815,6 +828,7 @@ asmlinkage void do_sve_acc(unsigned int esr, struct pt_regs *regs) sve_alloc(current); @@ -66,7 +66,7 @@ index 58c53bc96928..71252cd8b594 100644 local_bh_disable(); fpsimd_save(); -@@ -826,6 +840,7 @@ asmlinkage void do_sve_acc(unsigned int esr, struct pt_regs *regs) +@@ -828,6 +842,7 @@ asmlinkage void do_sve_acc(unsigned int esr, struct pt_regs *regs) WARN_ON(1); /* SVE access shouldn't have trapped */ local_bh_enable(); @@ -74,7 +74,7 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -892,10 +907,12 @@ void fpsimd_thread_switch(struct task_struct *next) +@@ -894,10 +909,12 @@ void fpsimd_thread_switch(struct task_struct *next) void fpsimd_flush_thread(void) { int vl, supported_vl; @@ -87,7 +87,7 @@ index 58c53bc96928..71252cd8b594 100644 local_bh_disable(); memset(¤t->thread.uw.fpsimd_state, 0, -@@ -904,7 +921,7 @@ void fpsimd_flush_thread(void) +@@ -906,7 +923,7 @@ void fpsimd_flush_thread(void) if (system_supports_sve()) { clear_thread_flag(TIF_SVE); @@ -96,7 +96,7 @@ index 58c53bc96928..71252cd8b594 100644 /* * Reset the task vector length as required. -@@ -940,6 +957,8 @@ void fpsimd_flush_thread(void) +@@ -942,6 +959,8 @@ void fpsimd_flush_thread(void) set_thread_flag(TIF_FOREIGN_FPSTATE); local_bh_enable(); @@ -105,7 +105,7 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -951,9 +970,11 @@ void fpsimd_preserve_current_state(void) +@@ -953,9 +972,11 @@ void fpsimd_preserve_current_state(void) if (!system_supports_fpsimd()) return; @@ -117,15 +117,15 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -1011,6 +1032,7 @@ void fpsimd_restore_current_state(void) - if (!system_supports_fpsimd()) +@@ -1026,6 +1047,7 @@ void fpsimd_restore_current_state(void) return; + } + preempt_disable(); local_bh_disable(); if (test_and_clear_thread_flag(TIF_FOREIGN_FPSTATE)) { -@@ -1019,6 +1041,7 @@ void fpsimd_restore_current_state(void) +@@ -1034,6 +1056,7 @@ void fpsimd_restore_current_state(void) } local_bh_enable(); @@ -133,15 +133,15 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -1031,6 +1054,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state) - if (!system_supports_fpsimd()) +@@ -1046,6 +1069,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state) + if (WARN_ON(!system_supports_fpsimd())) return; + preempt_disable(); local_bh_disable(); current->thread.uw.fpsimd_state = *state; -@@ -1043,6 +1067,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state) +@@ -1058,6 +1082,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state) clear_thread_flag(TIF_FOREIGN_FPSTATE); local_bh_enable(); @@ -149,7 +149,7 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -1088,6 +1113,7 @@ void kernel_neon_begin(void) +@@ -1104,6 +1129,7 @@ void kernel_neon_begin(void) BUG_ON(!may_use_simd()); @@ -157,7 +157,7 @@ index 58c53bc96928..71252cd8b594 100644 local_bh_disable(); __this_cpu_write(kernel_neon_busy, true); -@@ -1101,6 +1127,7 @@ void kernel_neon_begin(void) +@@ -1117,6 +1143,7 @@ void kernel_neon_begin(void) preempt_disable(); local_bh_enable(); @@ -166,5 +166,5 @@ index 58c53bc96928..71252cd8b594 100644 EXPORT_SYMBOL(kernel_neon_begin); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0214-kgdb-serial-Short-term-workaround.patch b/kernel/patches-4.19.x-rt/0214-kgdb-serial-Short-term-workaround.patch index c34300aef..3b8d25fcf 100644 --- a/kernel/patches-4.19.x-rt/0214-kgdb-serial-Short-term-workaround.patch +++ b/kernel/patches-4.19.x-rt/0214-kgdb-serial-Short-term-workaround.patch @@ -1,7 +1,7 @@ -From afa7e85db981a95a467d06226214ecfb0bbca27b Mon Sep 17 00:00:00 2001 +From c5d74bf61d048136c3ebff3f2d803d4eba474db7 Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Thu, 28 Jul 2011 12:42:23 -0500 -Subject: [PATCH 214/283] kgdb/serial: Short term workaround +Subject: [PATCH 214/328] kgdb/serial: Short term workaround On 07/27/2011 04:37 PM, Thomas Gleixner wrote: > - KGDB (not yet disabled) is reportedly unusable on -rt right now due @@ -24,7 +24,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 8d85448975d3..ebc98ce465b8 100644 +index 6b1d46c1df3b..cd49a76be52a 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -31,6 +31,7 @@ @@ -35,7 +35,7 @@ index 8d85448975d3..ebc98ce465b8 100644 #include #include #include -@@ -3240,6 +3241,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, +@@ -3241,6 +3242,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, if (port->sysrq || oops_in_progress) locked = 0; @@ -81,5 +81,5 @@ index 6a4b41484afe..197cb422f6e1 100644 return r; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0215-sysfs-Add-sys-kernel-realtime-entry.patch b/kernel/patches-4.19.x-rt/0215-sysfs-Add-sys-kernel-realtime-entry.patch index 5e41fdaed..c2ee02050 100644 --- a/kernel/patches-4.19.x-rt/0215-sysfs-Add-sys-kernel-realtime-entry.patch +++ b/kernel/patches-4.19.x-rt/0215-sysfs-Add-sys-kernel-realtime-entry.patch @@ -1,7 +1,7 @@ -From 012396ccc66ac609679e12d1bf475300918d4e31 Mon Sep 17 00:00:00 2001 +From f69088aeda4b17cc974e451f18f7f10d999a6f57 Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Sat, 30 Jul 2011 21:55:53 -0500 -Subject: [PATCH 215/283] sysfs: Add /sys/kernel/realtime entry +Subject: [PATCH 215/328] sysfs: Add /sys/kernel/realtime entry Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. @@ -49,5 +49,5 @@ index 46ba853656f6..9a23632b6294 100644 NULL }; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0216-mm-rt-kmap_atomic-scheduling.patch b/kernel/patches-4.19.x-rt/0216-mm-rt-kmap_atomic-scheduling.patch index efd3c358e..a5ee1563b 100644 --- a/kernel/patches-4.19.x-rt/0216-mm-rt-kmap_atomic-scheduling.patch +++ b/kernel/patches-4.19.x-rt/0216-mm-rt-kmap_atomic-scheduling.patch @@ -1,7 +1,7 @@ -From 7852dee63089f616ea97bbbc5137c7312fab3ea8 Mon Sep 17 00:00:00 2001 +From 5f53510a53551468cacc7dc39a067e4890082c6a Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 28 Jul 2011 10:43:51 +0200 -Subject: [PATCH 216/283] mm, rt: kmap_atomic scheduling +Subject: [PATCH 216/328] mm, rt: kmap_atomic scheduling In fact, with migrate_disable() existing one could play games with kmap_atomic. You could save/restore the kmap_atomic slots on context @@ -247,7 +247,7 @@ index 0690679832d4..1ac89e4718bf 100644 } diff --git a/include/linux/sched.h b/include/linux/sched.h -index a9a5edfa9689..76e6cdafb992 100644 +index 756fed8f5994..dc668524ccff 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -28,6 +28,7 @@ @@ -258,7 +258,7 @@ index a9a5edfa9689..76e6cdafb992 100644 /* task_struct member predeclarations (sorted alphabetically): */ struct audit_context; -@@ -1206,6 +1207,12 @@ struct task_struct { +@@ -1214,6 +1215,12 @@ struct task_struct { int softirq_nestcnt; unsigned int softirqs_raised; #endif @@ -320,5 +320,5 @@ index 59db3223a5d6..22aa3ddbd87b 100644 unsigned int nr_free_highpages (void) { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0217-x86-highmem-Add-a-already-used-pte-check.patch b/kernel/patches-4.19.x-rt/0217-x86-highmem-Add-a-already-used-pte-check.patch index d76ac7112..424232e40 100644 --- a/kernel/patches-4.19.x-rt/0217-x86-highmem-Add-a-already-used-pte-check.patch +++ b/kernel/patches-4.19.x-rt/0217-x86-highmem-Add-a-already-used-pte-check.patch @@ -1,7 +1,7 @@ -From 26d14743e5183f7a37bf0a4489428926868186de Mon Sep 17 00:00:00 2001 +From 4f31bac9ada3535606eaa6e9031a6a9e747afc5b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 17:09:55 +0100 -Subject: [PATCH 217/283] x86/highmem: Add a "already used pte" check +Subject: [PATCH 217/328] x86/highmem: Add a "already used pte" check This is a copy from kmap_atomic_prot(). @@ -24,5 +24,5 @@ index d5a48210d0f6..c0ec8d430c02 100644 current->kmap_pte[type] = pte; #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0218-arm-highmem-Flush-tlb-on-unmap.patch b/kernel/patches-4.19.x-rt/0218-arm-highmem-Flush-tlb-on-unmap.patch index f5a4dfdc8..c4dfcaf1b 100644 --- a/kernel/patches-4.19.x-rt/0218-arm-highmem-Flush-tlb-on-unmap.patch +++ b/kernel/patches-4.19.x-rt/0218-arm-highmem-Flush-tlb-on-unmap.patch @@ -1,7 +1,7 @@ -From 2335fd68385693465319a8ed36dc816837cc2d13 Mon Sep 17 00:00:00 2001 +From c0391198894b60a1860f751474ac15e89392d396 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 21:37:27 +0100 -Subject: [PATCH 218/283] arm/highmem: Flush tlb on unmap +Subject: [PATCH 218/328] arm/highmem: Flush tlb on unmap 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 @@ -29,5 +29,5 @@ index d02f8187b1cc..eb4b225d28c9 100644 } else if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) { /* this address was obtained through kmap_high_get() */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0219-arm-Enable-highmem-for-rt.patch b/kernel/patches-4.19.x-rt/0219-arm-Enable-highmem-for-rt.patch index 0dd0851ac..cd32ff1c4 100644 --- a/kernel/patches-4.19.x-rt/0219-arm-Enable-highmem-for-rt.patch +++ b/kernel/patches-4.19.x-rt/0219-arm-Enable-highmem-for-rt.patch @@ -1,7 +1,7 @@ -From dbd3e75fbbecfbb79a264b7c2b8f092d4671dfaa Mon Sep 17 00:00:00 2001 +From 9f06896a55a5320c0037ed6d57ccc188f39b46d9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 13 Feb 2013 11:03:11 +0100 -Subject: [PATCH 219/283] arm: Enable highmem for rt +Subject: [PATCH 219/328] arm: Enable highmem for rt fixup highmem for ARM. @@ -179,5 +179,5 @@ index 1ac89e4718bf..eaa2ef9bc10e 100644 #include -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0220-scsi-fcoe-Make-RT-aware.patch b/kernel/patches-4.19.x-rt/0220-scsi-fcoe-Make-RT-aware.patch index ca63e607b..32d953b83 100644 --- a/kernel/patches-4.19.x-rt/0220-scsi-fcoe-Make-RT-aware.patch +++ b/kernel/patches-4.19.x-rt/0220-scsi-fcoe-Make-RT-aware.patch @@ -1,7 +1,7 @@ -From e8f1bc60d8f9bb78f3671441af7f6dea46c576a9 Mon Sep 17 00:00:00 2001 +From 340c12c894a65dfd465a251f6f7f795746c803a0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 12 Nov 2011 14:00:48 +0100 -Subject: [PATCH 220/283] scsi/fcoe: Make RT aware. +Subject: [PATCH 220/328] scsi/fcoe: Make RT aware. Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. @@ -72,7 +72,7 @@ index 6768b2e8148a..c20f51af6bdf 100644 } diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c -index 7dc4ffa24430..4946df66a5ab 100644 +index 24cbd0a2cc69..ccf60801fe9d 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c @@ -838,7 +838,7 @@ static unsigned long fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip) @@ -94,7 +94,7 @@ index 7dc4ffa24430..4946df66a5ab 100644 list_for_each_entry_safe(fcf, next, &del_list, list) { /* Removes fcf from current list */ diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c -index 42bcf7f3a0f9..2ce045d6860c 100644 +index 6ba257cbc6d9..d2398a19f84c 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -833,10 +833,10 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, @@ -111,5 +111,5 @@ index 42bcf7f3a0f9..2ce045d6860c 100644 /* peek cache of free slot */ if (pool->left != FC_XID_UNKNOWN) { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0221-x86-crypto-Reduce-preempt-disabled-regions.patch b/kernel/patches-4.19.x-rt/0221-x86-crypto-Reduce-preempt-disabled-regions.patch index cfbcc16a4..383f2ae4e 100644 --- a/kernel/patches-4.19.x-rt/0221-x86-crypto-Reduce-preempt-disabled-regions.patch +++ b/kernel/patches-4.19.x-rt/0221-x86-crypto-Reduce-preempt-disabled-regions.patch @@ -1,7 +1,7 @@ -From db7f78bb12a8de39b10bf4c414283150adf48dad Mon Sep 17 00:00:00 2001 +From 9fcdeeff46696ee50f5a524dd11bc61aad38cfc1 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 14 Nov 2011 18:19:27 +0100 -Subject: [PATCH 221/283] x86: crypto: Reduce preempt disabled regions +Subject: [PATCH 221/328] x86: crypto: Reduce preempt disabled regions Restrict the preempt disabled regions to the actual floating point operations and enable preemption for the administrative actions. @@ -113,5 +113,5 @@ index 917f25e4d0a8..58d8c03fc32d 100644 return err; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0222-crypto-Reduce-preempt-disabled-regions-more-algos.patch b/kernel/patches-4.19.x-rt/0222-crypto-Reduce-preempt-disabled-regions-more-algos.patch index 3374d9502..bd809109f 100644 --- a/kernel/patches-4.19.x-rt/0222-crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/kernel/patches-4.19.x-rt/0222-crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,7 +1,7 @@ -From a9bad506610e589f70cb9bcd40a91ae40a6fcd96 Mon Sep 17 00:00:00 2001 +From 6cb63cbf25a36339685aae48f066fc80cbf5cd7f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 21 Feb 2014 17:24:04 +0100 -Subject: [PATCH 222/283] crypto: Reduce preempt disabled regions, more algos +Subject: [PATCH 222/328] crypto: Reduce preempt disabled regions, more algos Don Estabrook reported | kernel: WARNING: CPU: 2 PID: 858 at kernel/sched/core.c:2428 migrate_disable+0xed/0x100() @@ -258,5 +258,5 @@ index a78ef99a9981..dac489a1c4da 100644 } EXPORT_SYMBOL_GPL(glue_xts_req_128bit); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0223-crypto-limit-more-FPU-enabled-sections.patch b/kernel/patches-4.19.x-rt/0223-crypto-limit-more-FPU-enabled-sections.patch index 2210b6895..3071bfa9d 100644 --- a/kernel/patches-4.19.x-rt/0223-crypto-limit-more-FPU-enabled-sections.patch +++ b/kernel/patches-4.19.x-rt/0223-crypto-limit-more-FPU-enabled-sections.patch @@ -1,7 +1,7 @@ -From 76870a6a1befc6db5eb65682cb8190cf093d49a5 Mon Sep 17 00:00:00 2001 +From c69a6e5b35d956f1788a112244952e84fc27296a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 30 Nov 2017 13:40:10 +0100 -Subject: [PATCH 223/283] crypto: limit more FPU-enabled sections +Subject: [PATCH 223/328] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -103,5 +103,5 @@ index 2e5003fef51a..768c53767bb2 100644 * Save the FPU state (mark it for reload if necessary): * -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0224-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch b/kernel/patches-4.19.x-rt/0224-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch index 0040e3fbd..4caace242 100644 --- a/kernel/patches-4.19.x-rt/0224-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch +++ b/kernel/patches-4.19.x-rt/0224-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch @@ -1,7 +1,7 @@ -From bb65fe43a0177184808e0426548a3e11bcd894e4 Mon Sep 17 00:00:00 2001 +From 08367a7b181f94abaeb6bb4c827db639c56e8ea6 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 11 Jul 2018 17:14:47 +0200 -Subject: [PATCH 224/283] crypto: scompress - serialize RT percpu scratch +Subject: [PATCH 224/328] crypto: scompress - serialize RT percpu scratch buffer access with a local lock | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974 @@ -78,5 +78,5 @@ index 968bbcf65c94..c2f0077e0801 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0225-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch b/kernel/patches-4.19.x-rt/0225-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch index be74d77be..8178995cb 100644 --- a/kernel/patches-4.19.x-rt/0225-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +++ b/kernel/patches-4.19.x-rt/0225-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch @@ -1,7 +1,7 @@ -From 46ee243833b0300b7f72e77268030fba7d083f36 Mon Sep 17 00:00:00 2001 +From 850e714cfa9823eea1841d36cb29b28434d6ac2d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 18:52:00 +0200 -Subject: [PATCH 225/283] crypto: cryptd - add a lock instead +Subject: [PATCH 225/328] crypto: cryptd - add a lock instead preempt_disable/local_bh_disable cryptd has a per-CPU lock which protected with local_bh_disable() and @@ -80,5 +80,5 @@ index e0c8e907b086..e079f9a70201 100644 if (!req) return; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch b/kernel/patches-4.19.x-rt/0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch index 0d2e2fdad..3b6048164 100644 --- a/kernel/patches-4.19.x-rt/0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch +++ b/kernel/patches-4.19.x-rt/0226-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch @@ -1,7 +1,7 @@ -From f05daa36cd3745fd6096f84b064ecd32d32ba72c Mon Sep 17 00:00:00 2001 +From faa87d948486f3da759dc841ad7e5d983e94691a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 226/283] panic: skip get_random_bytes for RT_FULL in +Subject: [PATCH 226/328] panic: skip get_random_bytes for RT_FULL in init_oops_id Disable on -RT. If this is invoked from irq-context we will have problems @@ -13,10 +13,10 @@ Signed-off-by: Thomas Gleixner 1 file changed, 2 insertions(+) diff --git a/kernel/panic.c b/kernel/panic.c -index 6a6df23acd1a..8f0a896e8428 100644 +index 8138a676fb7d..fa114be5c30f 100644 --- a/kernel/panic.c +++ b/kernel/panic.c -@@ -479,9 +479,11 @@ static u64 oops_id; +@@ -480,9 +480,11 @@ static u64 oops_id; static int init_oops_id(void) { @@ -29,5 +29,5 @@ index 6a6df23acd1a..8f0a896e8428 100644 return 0; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0227-x86-stackprotector-Avoid-random-pool-on-rt.patch b/kernel/patches-4.19.x-rt/0227-x86-stackprotector-Avoid-random-pool-on-rt.patch index b9142c9e6..7265281ae 100644 --- a/kernel/patches-4.19.x-rt/0227-x86-stackprotector-Avoid-random-pool-on-rt.patch +++ b/kernel/patches-4.19.x-rt/0227-x86-stackprotector-Avoid-random-pool-on-rt.patch @@ -1,7 +1,7 @@ -From 7ca9435f9f9b0a1c4f286bfc916aaa6894d5b1ab Mon Sep 17 00:00:00 2001 +From fdddc5f9de75c797965fbb4c41826941313f97e3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 16 Dec 2010 14:25:18 +0100 -Subject: [PATCH 227/283] x86: stackprotector: Avoid random pool on rt +Subject: [PATCH 227/328] x86: stackprotector: Avoid random pool on rt CPU bringup calls into the random pool to initialize the stack canary. During boot that works nicely even on RT as the might sleep @@ -46,5 +46,5 @@ index 8ec97a62c245..7bc85841fc56 100644 canary += tsc + (tsc << 32UL); canary &= CANARY_MASK; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0228-random-Make-it-work-on-rt.patch b/kernel/patches-4.19.x-rt/0228-random-Make-it-work-on-rt.patch index f35533390..e95dd890b 100644 --- a/kernel/patches-4.19.x-rt/0228-random-Make-it-work-on-rt.patch +++ b/kernel/patches-4.19.x-rt/0228-random-Make-it-work-on-rt.patch @@ -1,7 +1,7 @@ -From d7138138dbb45015e20668ec13215dc198c4c4d9 Mon Sep 17 00:00:00 2001 +From 5f480f8b688aa96212f301664644d53b0d3a3e95 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 21 Aug 2012 20:38:50 +0200 -Subject: [PATCH 228/283] random: Make it work on rt +Subject: [PATCH 228/328] random: Make it work on rt Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq @@ -20,7 +20,7 @@ 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 0a84b7f468ad..75ae2d9e8720 100644 +index 28b110cd3977..d15dd08a92e2 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1232,28 +1232,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs) @@ -58,7 +58,7 @@ index 0a84b7f468ad..75ae2d9e8720 100644 fast_mix(fast_pool); add_interrupt_bench(cycles); diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c -index 8e923e70e594..e77716a62351 100644 +index 12bc9fa21111..278f03f50147 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, @@ -145,10 +145,10 @@ index 38554bc35375..06a80bbf78af 100644 if (!noirqdebug) note_interrupt(desc, retval); diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index aafe2256bd39..7f4041357d2f 100644 +index 5701774a6d71..ce86341a9e19 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -1084,6 +1084,12 @@ static int irq_thread(void *data) +@@ -1110,6 +1110,12 @@ static int irq_thread(void *data) if (action_ret == IRQ_WAKE_THREAD) irq_wake_secondary(desc, action); @@ -162,5 +162,5 @@ index aafe2256bd39..7f4041357d2f 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0229-cpu-hotplug-Implement-CPU-pinning.patch b/kernel/patches-4.19.x-rt/0229-cpu-hotplug-Implement-CPU-pinning.patch index d01c71b56..65f3311ee 100644 --- a/kernel/patches-4.19.x-rt/0229-cpu-hotplug-Implement-CPU-pinning.patch +++ b/kernel/patches-4.19.x-rt/0229-cpu-hotplug-Implement-CPU-pinning.patch @@ -1,7 +1,7 @@ -From 8d14b62a0aef3f8f55641157c07a65df44f4cdda Mon Sep 17 00:00:00 2001 +From cdd389d22cc7f273f3d955eeacc80bda55db5bb8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 19 Jul 2017 17:31:20 +0200 -Subject: [PATCH 229/283] cpu/hotplug: Implement CPU pinning +Subject: [PATCH 229/328] cpu/hotplug: Implement CPU pinning Signed-off-by: Thomas Gleixner --- @@ -10,7 +10,7 @@ Signed-off-by: Thomas Gleixner 2 files changed, 39 insertions(+) diff --git a/include/linux/sched.h b/include/linux/sched.h -index 76e6cdafb992..0445d5c7ced0 100644 +index dc668524ccff..fc9300d0787d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -671,6 +671,7 @@ struct task_struct { @@ -22,7 +22,7 @@ index 76e6cdafb992..0445d5c7ced0 100644 int migrate_disable_atomic; # endif diff --git a/kernel/cpu.c b/kernel/cpu.c -index 9001e1779325..89b56880314d 100644 +index 328d7bf67d2f..e005e64ae30f 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -75,6 +75,11 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { @@ -112,5 +112,5 @@ index 9001e1779325..89b56880314d 100644 irq_unlock_sparse(); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0230-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch b/kernel/patches-4.19.x-rt/0230-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch index ca7ed6f37..a2627e6b0 100644 --- a/kernel/patches-4.19.x-rt/0230-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch +++ b/kernel/patches-4.19.x-rt/0230-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch @@ -1,7 +1,7 @@ -From 3ee298788bec1452e68227e1737ea65b196f5986 Mon Sep 17 00:00:00 2001 +From 9c0e36957da69450658952d7d76b7fe79d8e52ac Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 19 Aug 2018 08:28:35 +0200 -Subject: [PATCH 230/283] sched: Allow pinned user tasks to be awakened to the +Subject: [PATCH 230/328] sched: Allow pinned user tasks to be awakened to the CPU they pinned Since commit 7af443ee16976 ("sched/core: Require cpu_active() in @@ -21,7 +21,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 08052198031a..33e81e7be168 100644 +index dcf2deedd3f8..6ef0dcea94d7 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) @@ -34,5 +34,5 @@ index 08052198031a..33e81e7be168 100644 return cpu_active(cpu); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0231-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/kernel/patches-4.19.x-rt/0231-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index 3cb74c789..4df93059f 100644 --- a/kernel/patches-4.19.x-rt/0231-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/kernel/patches-4.19.x-rt/0231-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch @@ -1,7 +1,7 @@ -From 6068c578a8d9cb4f49e39b4ae7f0fd7e60c7d0b6 Mon Sep 17 00:00:00 2001 +From 678bc8b1f66cac6073d0272788cb512333ae36a2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 18:31:00 +0200 -Subject: [PATCH 231/283] hotplug: duct-tape RT-rwlock usage for non-RT +Subject: [PATCH 231/328] hotplug: duct-tape RT-rwlock usage for non-RT 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 @@ -13,7 +13,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 89b56880314d..0523f2f0f4a2 100644 +index e005e64ae30f..948fbcc4d63c 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -75,7 +75,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { @@ -97,5 +97,5 @@ index 89b56880314d..0523f2f0f4a2 100644 irq_unlock_sparse(); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0232-net-Remove-preemption-disabling-in-netif_rx.patch b/kernel/patches-4.19.x-rt/0232-net-Remove-preemption-disabling-in-netif_rx.patch index b48c57307..897e2087c 100644 --- a/kernel/patches-4.19.x-rt/0232-net-Remove-preemption-disabling-in-netif_rx.patch +++ b/kernel/patches-4.19.x-rt/0232-net-Remove-preemption-disabling-in-netif_rx.patch @@ -1,7 +1,7 @@ -From 6cb14a01753bb2d287133787ca0f71e692eb74a5 Mon Sep 17 00:00:00 2001 +From e55d9a3613381070dbd9c5e107501fb3c8b87b0b Mon Sep 17 00:00:00 2001 From: Priyanka Jain Date: Thu, 17 May 2012 09:35:11 +0530 -Subject: [PATCH 232/283] net: Remove preemption disabling in netif_rx() +Subject: [PATCH 232/328] net: Remove preemption disabling in netif_rx() 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by @@ -35,10 +35,10 @@ 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 d86972449f63..cdf356fe054c 100644 +index 19e2cd0897b3..935156f1c5d4 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4484,7 +4484,7 @@ static int netif_rx_internal(struct sk_buff *skb) +@@ -4487,7 +4487,7 @@ static int netif_rx_internal(struct sk_buff *skb) struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu; @@ -47,7 +47,7 @@ index d86972449f63..cdf356fe054c 100644 rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); -@@ -4494,14 +4494,14 @@ static int netif_rx_internal(struct sk_buff *skb) +@@ -4497,14 +4497,14 @@ static int netif_rx_internal(struct sk_buff *skb) ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); @@ -66,5 +66,5 @@ index d86972449f63..cdf356fe054c 100644 return ret; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0233-net-Another-local_irq_disable-kmalloc-headache.patch b/kernel/patches-4.19.x-rt/0233-net-Another-local_irq_disable-kmalloc-headache.patch index 15885e6ab..73385fbe8 100644 --- a/kernel/patches-4.19.x-rt/0233-net-Another-local_irq_disable-kmalloc-headache.patch +++ b/kernel/patches-4.19.x-rt/0233-net-Another-local_irq_disable-kmalloc-headache.patch @@ -1,7 +1,7 @@ -From d96d2893a46a35127c07a99df70a4c2b4bcde7c9 Mon Sep 17 00:00:00 2001 +From 8e642bd4b1957e712c99588e4b172ffb6ea77cad Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 26 Sep 2012 16:21:08 +0200 -Subject: [PATCH 233/283] net: Another local_irq_disable/kmalloc headache +Subject: [PATCH 233/328] net: Another local_irq_disable/kmalloc headache Replace it by a local lock. Though that's pretty inefficient :( @@ -11,7 +11,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 9b9f696281a9..9ce072fb662e 100644 +index 0629ca89ab74..6ca7cb2b4364 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -63,6 +63,7 @@ @@ -60,5 +60,5 @@ index 9b9f696281a9..9ce072fb662e 100644 if (unlikely(!data)) return NULL; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0234-net-core-protect-users-of-napi_alloc_cache-against-r.patch b/kernel/patches-4.19.x-rt/0234-net-core-protect-users-of-napi_alloc_cache-against-r.patch index 80233cc0b..e75e3438e 100644 --- a/kernel/patches-4.19.x-rt/0234-net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/kernel/patches-4.19.x-rt/0234-net-core-protect-users-of-napi_alloc_cache-against-r.patch @@ -1,7 +1,7 @@ -From a3b202fa9f0aec800acb97c47a90c7c0ca27283f Mon Sep 17 00:00:00 2001 +From ad95e785998d05c5e60430c272511a05a2cf65ca Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 15 Jan 2016 16:33:34 +0100 -Subject: [PATCH 234/283] net/core: protect users of napi_alloc_cache against +Subject: [PATCH 234/328] net/core: protect users of napi_alloc_cache against reentrance On -RT the code running in BH can not be moved to another CPU so CPU @@ -17,7 +17,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 9ce072fb662e..15375d68b006 100644 +index 6ca7cb2b4364..c5c0d2095873 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -332,6 +332,7 @@ struct napi_alloc_cache { @@ -114,5 +114,5 @@ index 9ce072fb662e..15375d68b006 100644 void __kfree_skb_defer(struct sk_buff *skb) { -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0235-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch b/kernel/patches-4.19.x-rt/0235-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch index e06b4bb2c..21b9ea373 100644 --- a/kernel/patches-4.19.x-rt/0235-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch +++ b/kernel/patches-4.19.x-rt/0235-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch @@ -1,7 +1,7 @@ -From 0e06ddd7109d337dafee0134e5e07c2a2ca1b4fb Mon Sep 17 00:00:00 2001 +From 36ec80a84528a6adb376007baf97560835f37d79 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 28 Oct 2012 11:18:08 +0100 -Subject: [PATCH 235/283] net: netfilter: Serialize xt_write_recseq sections on +Subject: [PATCH 235/328] net: netfilter: Serialize xt_write_recseq sections on RT The netfilter code relies only on the implicit semantics of @@ -79,5 +79,5 @@ index 93aaec3a54ec..b364cf8e5776 100644 EXPORT_SYMBOL_GPL(nf_ipv6_ops); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0236-net-Add-a-mutex-around-devnet_rename_seq.patch b/kernel/patches-4.19.x-rt/0236-net-Add-a-mutex-around-devnet_rename_seq.patch index f1afa84c3..da9132c03 100644 --- a/kernel/patches-4.19.x-rt/0236-net-Add-a-mutex-around-devnet_rename_seq.patch +++ b/kernel/patches-4.19.x-rt/0236-net-Add-a-mutex-around-devnet_rename_seq.patch @@ -1,7 +1,7 @@ -From c9f595c704d979c0123fa62e3ef3a6254b32f2da Mon Sep 17 00:00:00 2001 +From b93f55390ad8ab8d74d16b0d67fcfdbf8be92dae Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Mar 2013 18:06:20 +0100 -Subject: [PATCH 236/283] net: Add a mutex around devnet_rename_seq +Subject: [PATCH 236/328] net: Add a mutex around devnet_rename_seq On RT write_seqcount_begin() disables preemption and device_rename() allocates memory with GFP_KERNEL and grabs later the sysfs_mutex @@ -21,10 +21,10 @@ 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 cdf356fe054c..63b3058dd172 100644 +index 935156f1c5d4..dbd9bdffafff 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -195,6 +195,7 @@ static unsigned int napi_gen_id = NR_CPUS; +@@ -196,6 +196,7 @@ static unsigned int napi_gen_id = NR_CPUS; static DEFINE_READ_MOSTLY_HASHTABLE(napi_hash, 8); static seqcount_t devnet_rename_seq; @@ -32,7 +32,7 @@ index cdf356fe054c..63b3058dd172 100644 static inline void dev_base_seq_inc(struct net *net) { -@@ -920,7 +921,8 @@ int netdev_get_name(struct net *net, char *name, int ifindex) +@@ -921,7 +922,8 @@ int netdev_get_name(struct net *net, char *name, int ifindex) strcpy(name, dev->name); rcu_read_unlock(); if (read_seqcount_retry(&devnet_rename_seq, seq)) { @@ -42,7 +42,7 @@ index cdf356fe054c..63b3058dd172 100644 goto retry; } -@@ -1197,20 +1199,17 @@ int dev_change_name(struct net_device *dev, const char *newname) +@@ -1198,20 +1200,17 @@ int dev_change_name(struct net_device *dev, const char *newname) likely(!(dev->priv_flags & IFF_LIVE_RENAME_OK))) return -EBUSY; @@ -69,7 +69,7 @@ index cdf356fe054c..63b3058dd172 100644 if (oldname[0] && !strchr(oldname, '%')) netdev_info(dev, "renamed from %s\n", oldname); -@@ -1223,11 +1222,12 @@ int dev_change_name(struct net_device *dev, const char *newname) +@@ -1224,11 +1223,12 @@ int dev_change_name(struct net_device *dev, const char *newname) if (ret) { memcpy(dev->name, oldname, IFNAMSIZ); dev->name_assign_type = old_assign_type; @@ -85,7 +85,7 @@ index cdf356fe054c..63b3058dd172 100644 netdev_adjacent_rename_links(dev, oldname); -@@ -1248,7 +1248,8 @@ int dev_change_name(struct net_device *dev, const char *newname) +@@ -1249,7 +1249,8 @@ int dev_change_name(struct net_device *dev, const char *newname) /* err >= 0 after dev_alloc_name() or stores the first errno */ if (err >= 0) { err = ret; @@ -95,7 +95,7 @@ index cdf356fe054c..63b3058dd172 100644 memcpy(dev->name, oldname, IFNAMSIZ); memcpy(oldname, newname, IFNAMSIZ); dev->name_assign_type = old_assign_type; -@@ -1261,6 +1262,11 @@ int dev_change_name(struct net_device *dev, const char *newname) +@@ -1262,6 +1263,11 @@ int dev_change_name(struct net_device *dev, const char *newname) } return err; @@ -108,5 +108,5 @@ index cdf356fe054c..63b3058dd172 100644 /** -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0237-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch b/kernel/patches-4.19.x-rt/0237-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch index 5f239b53e..1884f8346 100644 --- a/kernel/patches-4.19.x-rt/0237-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch +++ b/kernel/patches-4.19.x-rt/0237-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch @@ -1,7 +1,7 @@ -From 817d0f6091be31075e77cb513f97d3087a692e82 Mon Sep 17 00:00:00 2001 +From 144e32e34a0d8338cf7a1ae7cf884ed905481732 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Mon, 16 Apr 2012 15:01:56 +0800 -Subject: [PATCH 237/283] lockdep: selftest: Only do hardirq context test for +Subject: [PATCH 237/328] lockdep: selftest: Only do hardirq context test for raw spinlock On -rt there is no softirq context any more and rwlock is sleepable, @@ -57,5 +57,5 @@ index 1e1bbf171eca..5cdf3809905e 100644 ww_tests(); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0238-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/kernel/patches-4.19.x-rt/0238-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index 4be342e38..4fea24aa5 100644 --- a/kernel/patches-4.19.x-rt/0238-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/kernel/patches-4.19.x-rt/0238-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,7 +1,7 @@ -From 26b50852450a192a47d4baaaeb4911d5fa54789a Mon Sep 17 00:00:00 2001 +From f2f9a4e47d0dc6f3817bba4c178048da4763b0c6 Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Wed, 28 Jan 2015 13:08:45 -0600 -Subject: [PATCH 238/283] lockdep: selftest: fix warnings due to missing +Subject: [PATCH 238/328] lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals "lockdep: Selftest: Only do hardirq context test for raw spinlock" @@ -144,5 +144,5 @@ index 5cdf3809905e..32db9532ddd4 100644 * read-lock / write-lock recursion that is unsafe. */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0239-sched-Add-support-for-lazy-preemption.patch b/kernel/patches-4.19.x-rt/0239-sched-Add-support-for-lazy-preemption.patch index 690294b7e..fb962c703 100644 --- a/kernel/patches-4.19.x-rt/0239-sched-Add-support-for-lazy-preemption.patch +++ b/kernel/patches-4.19.x-rt/0239-sched-Add-support-for-lazy-preemption.patch @@ -1,7 +1,7 @@ -From 8cc7d52a64f1f62c24514589af91171961b4b31a Mon Sep 17 00:00:00 2001 +From b4aa63613da31452e5bf88d2a20f1349070b9c9e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 26 Oct 2012 18:50:54 +0100 -Subject: [PATCH 239/283] sched: Add support for lazy preemption +Subject: [PATCH 239/328] sched: Add support for lazy preemption It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -143,10 +143,10 @@ index ed8413e7140f..9c74a019bf57 100644 } while (0) diff --git a/include/linux/sched.h b/include/linux/sched.h -index 0445d5c7ced0..dd95bd64504e 100644 +index fc9300d0787d..a8ebd49c4f96 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1725,6 +1725,44 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) +@@ -1733,6 +1733,44 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } @@ -215,7 +215,7 @@ index 8d8821b3689a..d3fcab20d2a3 100644 #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES static inline int arch_within_stack_frames(const void * const stack, diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h -index 0403d9696944..c20237c5ab66 100644 +index 1cc4d2da954c..72864a11cec0 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -64,6 +64,7 @@ struct trace_entry { @@ -244,7 +244,7 @@ index 907d72b3ba95..306567f72a3e 100644 prompt "Preemption Model" default PREEMPT_NONE diff --git a/kernel/cpu.c b/kernel/cpu.c -index 0523f2f0f4a2..3857a0afdfbf 100644 +index 948fbcc4d63c..1541189f417b 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -304,11 +304,13 @@ void pin_current_cpu(void) @@ -262,7 +262,7 @@ index 0523f2f0f4a2..3857a0afdfbf 100644 __read_rt_unlock(cpuhp_pin); goto again; diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 33e81e7be168..7831756f2097 100644 +index 6ef0dcea94d7..a17c765d3fcb 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -493,6 +493,48 @@ void resched_curr(struct rq *rq) @@ -324,7 +324,7 @@ index 33e81e7be168..7831756f2097 100644 #ifdef CONFIG_SMP plist_node_init(&p->pushable_tasks, MAX_PRIO); RB_CLEAR_NODE(&p->pushable_dl_tasks); -@@ -3472,6 +3517,7 @@ static void __sched notrace __schedule(bool preempt) +@@ -3513,6 +3558,7 @@ static void __sched notrace __schedule(bool preempt) next = pick_next_task(rq, prev, &rf); clear_tsk_need_resched(prev); @@ -332,7 +332,7 @@ index 33e81e7be168..7831756f2097 100644 clear_preempt_need_resched(); if (likely(prev != next)) { -@@ -3652,6 +3698,30 @@ static void __sched notrace preempt_schedule_common(void) +@@ -3693,6 +3739,30 @@ static void __sched notrace preempt_schedule_common(void) } while (need_resched()); } @@ -363,7 +363,7 @@ index 33e81e7be168..7831756f2097 100644 #ifdef CONFIG_PREEMPT /* * this is the entry point to schedule() from in-kernel preemption -@@ -3666,7 +3736,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) +@@ -3707,7 +3777,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) */ if (likely(!preemptible())) return; @@ -373,7 +373,7 @@ index 33e81e7be168..7831756f2097 100644 preempt_schedule_common(); } NOKPROBE_SYMBOL(preempt_schedule); -@@ -3693,6 +3764,9 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) +@@ -3734,6 +3805,9 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) if (likely(!preemptible())) return; @@ -383,7 +383,7 @@ index 33e81e7be168..7831756f2097 100644 do { /* * Because the function tracer can trace preempt_count_sub() -@@ -5461,7 +5535,9 @@ void init_idle(struct task_struct *idle, int cpu) +@@ -5503,7 +5577,9 @@ void init_idle(struct task_struct *idle, int cpu) /* Set the preempt count _outside_ the spinlocks! */ init_idle_preempt_count(idle, cpu); @@ -394,7 +394,7 @@ index 33e81e7be168..7831756f2097 100644 /* * The idle tasks have their own, simple scheduling class: */ -@@ -7190,6 +7266,7 @@ void migrate_disable(void) +@@ -7228,6 +7304,7 @@ void migrate_disable(void) } preempt_disable(); @@ -402,7 +402,7 @@ index 33e81e7be168..7831756f2097 100644 pin_current_cpu(); migrate_disable_update_cpus_allowed(p); -@@ -7257,6 +7334,7 @@ void migrate_enable(void) +@@ -7295,6 +7372,7 @@ void migrate_enable(void) arg.dest_cpu = dest_cpu; unpin_current_cpu(); @@ -410,7 +410,7 @@ index 33e81e7be168..7831756f2097 100644 preempt_enable(); stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); tlb_migrate_finish(p->mm); -@@ -7265,6 +7343,7 @@ void migrate_enable(void) +@@ -7303,6 +7381,7 @@ void migrate_enable(void) } } unpin_current_cpu(); @@ -419,10 +419,10 @@ index 33e81e7be168..7831756f2097 100644 } EXPORT_SYMBOL(migrate_enable); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 0048a32a3b4d..2cca09d59019 100644 +index 27f9f9a785c1..77d991e9ba23 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4021,7 +4021,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) +@@ -4091,7 +4091,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) { @@ -431,7 +431,7 @@ index 0048a32a3b4d..2cca09d59019 100644 /* * The current task ran long enough, ensure it doesn't get * re-elected due to buddy favours. -@@ -4045,7 +4045,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) +@@ -4115,7 +4115,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) return; if (delta > ideal_runtime) @@ -440,7 +440,7 @@ index 0048a32a3b4d..2cca09d59019 100644 } static void -@@ -4187,7 +4187,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) +@@ -4257,7 +4257,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) * validating it and just reschedule. */ if (queued) { @@ -449,7 +449,7 @@ index 0048a32a3b4d..2cca09d59019 100644 return; } /* -@@ -4371,7 +4371,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) +@@ -4391,7 +4391,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)) @@ -458,7 +458,7 @@ index 0048a32a3b4d..2cca09d59019 100644 } static __always_inline -@@ -5067,7 +5067,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) +@@ -5091,7 +5091,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) if (delta < 0) { if (rq->curr == p) @@ -467,7 +467,7 @@ index 0048a32a3b4d..2cca09d59019 100644 return; } hrtick_start(rq, delta); -@@ -6643,7 +6643,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ +@@ -6684,7 +6684,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ return; preempt: @@ -476,7 +476,7 @@ index 0048a32a3b4d..2cca09d59019 100644 /* * Only set the backward buddy when the current task is still * on the rq. This can happen when a wakeup gets interleaved -@@ -9734,7 +9734,7 @@ static void task_fork_fair(struct task_struct *p) +@@ -9785,7 +9785,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); @@ -485,7 +485,7 @@ index 0048a32a3b4d..2cca09d59019 100644 } se->vruntime -= cfs_rq->min_vruntime; -@@ -9758,7 +9758,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) +@@ -9809,7 +9809,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) */ if (rq->curr == p) { if (p->prio > oldprio) @@ -509,10 +509,10 @@ index 68de18405857..12a12be6770b 100644 /* diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index 49ae30da28ee..f7c1c262457f 100644 +index c79e32488940..c90574112bca 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); +@@ -1634,6 +1634,15 @@ extern void reweight_task(struct task_struct *p, int prio); extern void resched_curr(struct rq *rq); extern void resched_cpu(int cpu); @@ -529,7 +529,7 @@ index 49ae30da28ee..f7c1c262457f 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 496c5d358010..da619e974a11 100644 +index 5eccf1c201db..d13b58073bce 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2137,6 +2137,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, @@ -601,7 +601,7 @@ index 496c5d358010..da619e974a11 100644 } diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h -index d11d7bfc3fa5..6eba8c96f4bc 100644 +index ee0c6a313ed1..5986f494e2b0 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -127,6 +127,7 @@ struct kretprobe_trace_entry_head { @@ -666,5 +666,5 @@ index 46c96744f09d..3f78b0afb729 100644 trace_seq_printf(s, "%x", entry->migrate_disable); else -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0240-ftrace-Fix-trace-header-alignment.patch b/kernel/patches-4.19.x-rt/0240-ftrace-Fix-trace-header-alignment.patch index fbe4aa414..d8d63398e 100644 --- a/kernel/patches-4.19.x-rt/0240-ftrace-Fix-trace-header-alignment.patch +++ b/kernel/patches-4.19.x-rt/0240-ftrace-Fix-trace-header-alignment.patch @@ -1,7 +1,7 @@ -From 03fa817c57795a125667feb747f1c683b3c456c1 Mon Sep 17 00:00:00 2001 +From 9f97e04e5ea92015801bab08af99228bbe2f4085 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 16 Oct 2016 05:08:30 +0200 -Subject: [PATCH 240/283] ftrace: Fix trace header alignment +Subject: [PATCH 240/328] ftrace: Fix trace header alignment Line up helper arrows to the right column. @@ -14,7 +14,7 @@ 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 da619e974a11..f82da65109eb 100644 +index d13b58073bce..99dde9db6e3e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -3351,17 +3351,17 @@ get_total_entries(struct trace_buffer *buf, @@ -47,5 +47,5 @@ index da619e974a11..f82da65109eb 100644 static void print_event_info(struct trace_buffer *buf, struct seq_file *m) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0241-x86-Support-for-lazy-preemption.patch b/kernel/patches-4.19.x-rt/0241-x86-Support-for-lazy-preemption.patch index 0285148d6..2ba0e721c 100644 --- a/kernel/patches-4.19.x-rt/0241-x86-Support-for-lazy-preemption.patch +++ b/kernel/patches-4.19.x-rt/0241-x86-Support-for-lazy-preemption.patch @@ -1,7 +1,7 @@ -From fb20d310604701fc1f1d53bf74f792f58a83812f Mon Sep 17 00:00:00 2001 +From 963f0a5965bbcac189d89f4501cdd7a26bd823df Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 1 Nov 2012 11:03:47 +0100 -Subject: [PATCH 241/283] x86: Support for lazy preemption +Subject: [PATCH 241/328] x86: Support for lazy preemption Implement the x86 pieces for lazy preempt. @@ -17,7 +17,7 @@ Signed-off-by: Thomas Gleixner 7 files changed, 79 insertions(+), 3 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 1b05ae86bdde..736e369e141b 100644 +index f22e787329cf..a56f57f95993 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -180,6 +180,7 @@ config X86 @@ -51,10 +51,10 @@ index 91676b0d2d4c..3b5e41d9b29d 100644 #ifdef ARCH_RT_DELAYS_SIGNAL_SEND diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S -index b5c2b1091b18..83d43eb2f556 100644 +index d07432062ee6..d44f446a0e74 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S -@@ -766,8 +766,25 @@ END(ret_from_exception) +@@ -750,8 +750,25 @@ END(ret_from_exception) ENTRY(resume_kernel) DISABLE_INTERRUPTS(CLBR_ANY) .Lneed_resched: @@ -81,10 +81,10 @@ index b5c2b1091b18..83d43eb2f556 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 7b29f2c10d01..23dda6f4a69f 100644 +index 7ffd83c57ef2..663a99f6320f 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -708,7 +708,23 @@ retint_kernel: +@@ -732,7 +732,23 @@ retint_kernel: btl $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f 0: cmpl $0, PER_CPU_VAR(__preempt_count) @@ -235,5 +235,5 @@ index 01de31db300d..ce1c5b9fbd8c 100644 /* TLB state for the entry code */ OFFSET(TLB_STATE_user_pcid_flush_mask, tlb_state, user_pcid_flush_mask); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0242-x86-lazy-preempt-properly-check-against-preempt-mask.patch b/kernel/patches-4.19.x-rt/0242-x86-lazy-preempt-properly-check-against-preempt-mask.patch index 9f4ffdcfe..30d56c7eb 100644 --- a/kernel/patches-4.19.x-rt/0242-x86-lazy-preempt-properly-check-against-preempt-mask.patch +++ b/kernel/patches-4.19.x-rt/0242-x86-lazy-preempt-properly-check-against-preempt-mask.patch @@ -1,7 +1,7 @@ -From e9b59157aa2e702f58d3f7c6f1d6fbcef65dc75b Mon Sep 17 00:00:00 2001 +From 9e04eb54c312d0436d51e83306de05517b13d458 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 18 Feb 2019 16:57:09 +0100 -Subject: [PATCH 242/283] x86: lazy-preempt: properly check against +Subject: [PATCH 242/328] x86: lazy-preempt: properly check against preempt-mask should_resched() should check against preempt_offset after unmasking the @@ -28,5 +28,5 @@ index 22992c837795..f66708779274 100644 if (current_thread_info()->preempt_lazy_count) return false; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0243-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch b/kernel/patches-4.19.x-rt/0243-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch index 0388118a5..62239f187 100644 --- a/kernel/patches-4.19.x-rt/0243-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch +++ b/kernel/patches-4.19.x-rt/0243-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch @@ -1,7 +1,7 @@ -From fb5b75a4b989c8e039eb585a99ee0c41ae05664b Mon Sep 17 00:00:00 2001 +From 95f51ccaa646d290d44e1c6a6fece8cebcce7f82 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 26 Feb 2019 14:53:49 +0100 -Subject: [PATCH 243/283] x86: lazy-preempt: use proper return label on +Subject: [PATCH 243/328] x86: lazy-preempt: use proper return label on 32bit-x86 The lazy-preempt uses the wrong return label in case preemption isn't @@ -16,10 +16,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 83d43eb2f556..0b25d2efdb87 100644 +index d44f446a0e74..56398b07211b 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S -@@ -775,15 +775,15 @@ ENTRY(resume_kernel) +@@ -759,15 +759,15 @@ ENTRY(resume_kernel) # atleast preempt count == 0 ? cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count) @@ -40,5 +40,5 @@ index 83d43eb2f556..0b25d2efdb87 100644 testl $X86_EFLAGS_IF, PT_EFLAGS(%esp) # interrupts off (exception path) ? jz restore_all_kernel -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0244-arm-Add-support-for-lazy-preemption.patch b/kernel/patches-4.19.x-rt/0244-arm-Add-support-for-lazy-preemption.patch index c4a32b1bd..06cea2ecf 100644 --- a/kernel/patches-4.19.x-rt/0244-arm-Add-support-for-lazy-preemption.patch +++ b/kernel/patches-4.19.x-rt/0244-arm-Add-support-for-lazy-preemption.patch @@ -1,7 +1,7 @@ -From f83f8291ac518e18c94e68d86fe1639ba7b25a2f Mon Sep 17 00:00:00 2001 +From 36713bb8882eef3bd06bc3de88d56fcaa0d968c8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 31 Oct 2012 12:04:11 +0100 -Subject: [PATCH 244/283] arm: Add support for lazy preemption +Subject: [PATCH 244/328] arm: Add support for lazy preemption Implement the arm pieces for lazy preempt. @@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner 6 files changed, 33 insertions(+), 8 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index e122dd212ab3..9413ad933336 100644 +index bd9d180db5c7..9945e699e0a4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -90,6 +90,7 @@ config ARM @@ -121,7 +121,7 @@ index e85a3af9ddeb..cc67c0a3ae7b 100644 __und_fault: diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S -index 746565a876dc..156e3ba4b319 100644 +index 0465d65d23de..47675830ed30 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -56,7 +56,9 @@ __ret_fast_syscall: @@ -163,5 +163,5 @@ index b908382b69ff..339fbc281cf1 100644 } else { if (unlikely(!user_mode(regs))) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0245-powerpc-Add-support-for-lazy-preemption.patch b/kernel/patches-4.19.x-rt/0245-powerpc-Add-support-for-lazy-preemption.patch index 566ddf36f..adfa8e185 100644 --- a/kernel/patches-4.19.x-rt/0245-powerpc-Add-support-for-lazy-preemption.patch +++ b/kernel/patches-4.19.x-rt/0245-powerpc-Add-support-for-lazy-preemption.patch @@ -1,7 +1,7 @@ -From 47a223b448c07e6c574e14e44d912dcd27ca4803 Mon Sep 17 00:00:00 2001 +From e02242904650a778f562757a77e406336000d790 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 1 Nov 2012 10:14:11 +0100 -Subject: [PATCH 245/283] powerpc: Add support for lazy preemption +Subject: [PATCH 245/328] powerpc: Add support for lazy preemption Implement the powerpc pieces for lazy preempt. @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner 5 files changed, 33 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig -index 1563820a37e8..d4835f8cfcf2 100644 +index 1b332f69dd36..c8c2230c8aff 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -216,6 +216,7 @@ config PPC @@ -76,7 +76,7 @@ index 3c0002044bc9..ce316076bc52 100644 /* Bits in local_flags */ /* Don't move TLF_NAPPING without adjusting the code in entry_32.S */ diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c -index 89cf15566c4e..1870c87fb22a 100644 +index 50400f213bbf..1bb82c5dc1d9 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c @@ -156,6 +156,7 @@ int main(void) @@ -140,7 +140,7 @@ index 26b3f853cbf6..3783f3ef17a4 100644 andi. r0,r9,_TIF_USER_WORK_MASK beq restore_user diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S -index 7a46e0e57a36..7671fa5da9fa 100644 +index 58b50967b3e5..ef02e41d5d96 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S @@ -176,7 +176,7 @@ system_call: /* label this so stack traces look sane */ @@ -152,7 +152,7 @@ index 7a46e0e57a36..7671fa5da9fa 100644 beq 15f addi r11,r11,8 /* use 32-bit syscall entries */ clrldi r3,r3,32 -@@ -768,7 +768,7 @@ _GLOBAL(ret_from_except_lite) +@@ -774,7 +774,7 @@ _GLOBAL(ret_from_except_lite) bl restore_math b restore #endif @@ -161,7 +161,7 @@ index 7a46e0e57a36..7671fa5da9fa 100644 beq 2f bl restore_interrupts SCHEDULE_USER -@@ -830,10 +830,18 @@ resume_kernel: +@@ -836,10 +836,18 @@ resume_kernel: #ifdef CONFIG_PREEMPT /* Check if we need to preempt */ @@ -181,7 +181,7 @@ index 7a46e0e57a36..7671fa5da9fa 100644 cmpwi cr0,r8,0 bne restore ld r0,SOFTE(r1) -@@ -850,7 +858,7 @@ resume_kernel: +@@ -856,7 +864,7 @@ resume_kernel: /* Re-test flags and eventually loop */ CURRENT_THREAD_INFO(r9, r1) ld r4,TI_FLAGS(r9) @@ -191,5 +191,5 @@ index 7a46e0e57a36..7671fa5da9fa 100644 /* -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0246-arch-arm64-Add-lazy-preempt-support.patch b/kernel/patches-4.19.x-rt/0246-arch-arm64-Add-lazy-preempt-support.patch index 5936c5834..6200783b8 100644 --- a/kernel/patches-4.19.x-rt/0246-arch-arm64-Add-lazy-preempt-support.patch +++ b/kernel/patches-4.19.x-rt/0246-arch-arm64-Add-lazy-preempt-support.patch @@ -1,7 +1,7 @@ -From 283e7db367d829d84c78b83eb0099bc009fadcb4 Mon Sep 17 00:00:00 2001 +From c5e73ec6d12a2a6a7b3da8b83afdd210570489c7 Mon Sep 17 00:00:00 2001 From: Anders Roxell Date: Thu, 14 May 2015 17:52:17 +0200 -Subject: [PATCH 246/283] arch/arm64: Add lazy preempt support +Subject: [PATCH 246/328] arch/arm64: Add lazy preempt support arm64 is missing support for PREEMPT_RT. The main feature which is lacking is support for lazy preemption. The arch-specific entry code, @@ -20,10 +20,10 @@ Signed-off-by: Anders Roxell 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 8790a29d0af4..4a4db69c5e9a 100644 +index 51fe21f5d078..9bf5be2d6024 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -140,6 +140,7 @@ config ARM64 +@@ -141,6 +141,7 @@ config ARM64 select HAVE_PERF_EVENTS select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP @@ -83,7 +83,7 @@ index 92fba851ce53..844c71bc865b 100644 #ifdef CONFIG_ARM64_SW_TTBR0_PAN DEFINE(TSK_TI_TTBR0, offsetof(struct task_struct, thread_info.ttbr0)); diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S -index 8556876c9109..d30ca1b304cd 100644 +index 5f800384cb9a..b582580c8c4c 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -623,11 +623,16 @@ el1_irq: @@ -128,5 +128,5 @@ index 5dcc942906db..4fec251fe147 100644 local_daif_restore(DAIF_PROCCTX_NOIRQ); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0247-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/kernel/patches-4.19.x-rt/0247-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index 02b47a5e4..0ab146922 100644 --- a/kernel/patches-4.19.x-rt/0247-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/kernel/patches-4.19.x-rt/0247-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -1,7 +1,7 @@ -From cb13c6a753442e63d2b8097a890892bdd36305f1 Mon Sep 17 00:00:00 2001 +From 8d0546a63b1afa99131c556d9f273f8865eaf480 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 16 Oct 2016 05:11:54 +0200 -Subject: [PATCH 247/283] connector/cn_proc: Protect send_msg() with a local +Subject: [PATCH 247/328] connector/cn_proc: Protect send_msg() with a local lock on RT |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 @@ -69,5 +69,5 @@ index ad48fd52cb53..c5264b3ee0b0 100644 void proc_fork_connector(struct task_struct *task) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0248-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/kernel/patches-4.19.x-rt/0248-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index 17492cbbb..7c3c4801a 100644 --- a/kernel/patches-4.19.x-rt/0248-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/kernel/patches-4.19.x-rt/0248-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -1,7 +1,7 @@ -From 0a9138797894a06ad63067de77df6b2dcd97b61e Mon Sep 17 00:00:00 2001 +From 50ea98cbb28042ef353cdb79d52d70d051d45c50 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Thu, 31 Mar 2016 04:08:28 +0200 -Subject: [PATCH 248/283] drivers/block/zram: Replace bit spinlocks with +Subject: [PATCH 248/328] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt They're nondeterministic, and lead to ___might_sleep() splats in -rt. @@ -15,7 +15,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 70cbd0ee1b07..42de45ebfb43 100644 +index 76abe40bfa83..d6cf9508b80d 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; @@ -67,7 +67,7 @@ index 70cbd0ee1b07..42de45ebfb43 100644 static inline bool init_done(struct zram *zram) { -@@ -901,6 +936,8 @@ static DEVICE_ATTR_RO(io_stat); +@@ -902,6 +937,8 @@ static DEVICE_ATTR_RO(io_stat); static DEVICE_ATTR_RO(mm_stat); static DEVICE_ATTR_RO(debug_stat); @@ -76,7 +76,7 @@ index 70cbd0ee1b07..42de45ebfb43 100644 static void zram_meta_free(struct zram *zram, u64 disksize) { size_t num_pages = disksize >> PAGE_SHIFT; -@@ -931,6 +968,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) +@@ -932,6 +969,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); @@ -99,5 +99,5 @@ index d1095dfdffa8..144e91061df8 100644 ktime_t ac_time; #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0249-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/kernel/patches-4.19.x-rt/0249-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index 4c15e6790..716da21c6 100644 --- a/kernel/patches-4.19.x-rt/0249-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/kernel/patches-4.19.x-rt/0249-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -1,7 +1,7 @@ -From 3af8e8733e58687a2fe72ce5b8d47e458d09a9b5 Mon Sep 17 00:00:00 2001 +From 88b91a35eb7f80af3482c12cfcb4ceebca3a88d8 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Thu, 20 Oct 2016 11:15:22 +0200 -Subject: [PATCH 249/283] drivers/zram: Don't disable preemption in +Subject: [PATCH 249/328] drivers/zram: Don't disable preemption in zcomp_stream_get/put() In v4.7, the driver switched to percpu compression streams, disabling @@ -66,10 +66,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 42de45ebfb43..ffa3e9d67571 100644 +index d6cf9508b80d..71520199226a 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c -@@ -1027,6 +1027,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, +@@ -1028,6 +1028,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, unsigned long handle; unsigned int size; void *src, *dst; @@ -77,7 +77,7 @@ index 42de45ebfb43..ffa3e9d67571 100644 if (zram_wb_enabled(zram)) { zram_slot_lock(zram, index); -@@ -1061,6 +1062,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, +@@ -1062,6 +1063,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, size = zram_get_obj_size(zram, index); @@ -85,7 +85,7 @@ index 42de45ebfb43..ffa3e9d67571 100644 src = zs_map_object(zram->mem_pool, handle, ZS_MM_RO); if (size == PAGE_SIZE) { dst = kmap_atomic(page); -@@ -1068,14 +1070,13 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, +@@ -1069,14 +1071,13 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, kunmap_atomic(dst); ret = 0; } else { @@ -102,5 +102,5 @@ index 42de45ebfb43..ffa3e9d67571 100644 /* Should NEVER happen. Return bio error if it does. */ -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0250-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch b/kernel/patches-4.19.x-rt/0250-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch index 04659577d..172df52d8 100644 --- a/kernel/patches-4.19.x-rt/0250-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +++ b/kernel/patches-4.19.x-rt/0250-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch @@ -1,7 +1,7 @@ -From 50839b1e639f5c139278123e369ebdb5066c325e Mon Sep 17 00:00:00 2001 +From 4423c47dc0bff765fc58fb223ef9d4cd3b23c634 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 23 Aug 2017 11:57:29 +0200 -Subject: [PATCH 250/283] drivers/zram: fix zcomp_stream_get() +Subject: [PATCH 250/328] drivers/zram: fix zcomp_stream_get() smp_processor_id() use in preemptible code Use get_local_ptr() instead this_cpu_ptr() to avoid a warning regarding @@ -39,5 +39,5 @@ index dd65a27ae2cc..eece02262000 100644 int zcomp_compress(struct zcomp_strm *zstrm, -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0251-tpm_tis-fix-stall-after-iowrite-s.patch b/kernel/patches-4.19.x-rt/0251-tpm_tis-fix-stall-after-iowrite-s.patch index 5bfb509ec..352a39f62 100644 --- a/kernel/patches-4.19.x-rt/0251-tpm_tis-fix-stall-after-iowrite-s.patch +++ b/kernel/patches-4.19.x-rt/0251-tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,7 +1,7 @@ -From fb66fc28332e7786f93815228991067bf2b7feff Mon Sep 17 00:00:00 2001 +From fb812057ed5c5dbdbdd983f9d261dcce58bc7376 Mon Sep 17 00:00:00 2001 From: Haris Okanovic Date: Tue, 15 Aug 2017 15:13:08 -0500 -Subject: [PATCH 251/283] tpm_tis: fix stall after iowrite*()s +Subject: [PATCH 251/328] tpm_tis: fix stall after iowrite*()s ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. @@ -79,5 +79,5 @@ index f08949a5f678..9fefcfcae593 100644 return 0; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0252-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch b/kernel/patches-4.19.x-rt/0252-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch index aa72800d6..276e7186a 100644 --- a/kernel/patches-4.19.x-rt/0252-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0252-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch @@ -1,7 +1,7 @@ -From 4ebb1f9be0a95dc2c8bb4b0b1d465d5c395f49a6 Mon Sep 17 00:00:00 2001 +From e0da41ef4940b26cb433c9598a4940e2476d3dbe Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 -Subject: [PATCH 252/283] watchdog: prevent deferral of watchdogd wakeup on RT +Subject: [PATCH 252/328] watchdog: prevent deferral of watchdogd wakeup on RT When PREEMPT_RT_FULL is enabled, all hrtimer expiry functions are deferred for execution into the context of ktimersoftd unless otherwise @@ -36,10 +36,10 @@ Signed-off-by: Sebastian Andrzej Siewior 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c -index ffbdc4642ea5..84f75b5045f6 100644 +index e64aa88e99da..11ba2c3b187f 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c -@@ -147,7 +147,7 @@ static inline void watchdog_update_worker(struct watchdog_device *wdd) +@@ -145,7 +145,7 @@ static inline void watchdog_update_worker(struct watchdog_device *wdd) ktime_t t = watchdog_next_keepalive(wdd); if (t > 0) @@ -48,7 +48,7 @@ index ffbdc4642ea5..84f75b5045f6 100644 } else { hrtimer_cancel(&wd_data->timer); } -@@ -166,7 +166,7 @@ static int __watchdog_ping(struct watchdog_device *wdd) +@@ -164,7 +164,7 @@ static int __watchdog_ping(struct watchdog_device *wdd) if (ktime_after(earliest_keepalive, now)) { hrtimer_start(&wd_data->timer, ktime_sub(earliest_keepalive, now), @@ -57,7 +57,7 @@ index ffbdc4642ea5..84f75b5045f6 100644 return 0; } -@@ -945,7 +945,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd, dev_t devno) +@@ -947,7 +947,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd) return -ENODEV; kthread_init_work(&wd_data->work, watchdog_ping_work); @@ -66,9 +66,9 @@ index ffbdc4642ea5..84f75b5045f6 100644 wd_data->timer.function = watchdog_timer_expired; if (wdd->id == 0) { -@@ -992,7 +992,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd, dev_t devno) +@@ -1004,7 +1004,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd) __module_get(wdd->ops->owner); - kref_get(&wd_data->kref); + get_device(&wd_data->dev); if (handle_boot_enabled) - hrtimer_start(&wd_data->timer, 0, HRTIMER_MODE_REL); + hrtimer_start(&wd_data->timer, 0, HRTIMER_MODE_REL_HARD); @@ -76,5 +76,5 @@ index ffbdc4642ea5..84f75b5045f6 100644 pr_info("watchdog%d running and kernel based pre-userspace handler disabled\n", wdd->id); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0253-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch b/kernel/patches-4.19.x-rt/0253-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch index 4128040c4..264e44f6b 100644 --- a/kernel/patches-4.19.x-rt/0253-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch +++ b/kernel/patches-4.19.x-rt/0253-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch @@ -1,7 +1,7 @@ -From 40e35f1fee95ea4707c63bde3f25068e2cc24cc5 Mon Sep 17 00:00:00 2001 +From e3f6a9293311449cca5306673eae21802410ed18 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sat, 27 Feb 2016 08:09:11 +0100 -Subject: [PATCH 253/283] drm,radeon,i915: Use preempt_disable/enable_rt() +Subject: [PATCH 253/328] drm,radeon,i915: Use preempt_disable/enable_rt() where recommended DRM folks identified the spots, so use them. @@ -36,10 +36,10 @@ 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 d8e2d7b3b836..072b831aaf4f 100644 +index 7d1e14f0140a..bcc3456749d6 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, +@@ -1815,6 +1815,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, struct radeon_device *rdev = dev->dev_private; /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ @@ -47,7 +47,7 @@ index d8e2d7b3b836..072b831aaf4f 100644 /* Get optional system timestamp before query. */ if (stime) -@@ -1905,6 +1906,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, +@@ -1907,6 +1908,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, *etime = ktime_get(); /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ @@ -56,5 +56,5 @@ index d8e2d7b3b836..072b831aaf4f 100644 /* Decode into vertical and horizontal scanout position. */ *vpos = position & 0x1fff; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0254-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch b/kernel/patches-4.19.x-rt/0254-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch index ecbab1129..a418352b9 100644 --- a/kernel/patches-4.19.x-rt/0254-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch +++ b/kernel/patches-4.19.x-rt/0254-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch @@ -1,7 +1,7 @@ -From dc4f20a517dce3a46fc2bc46240fb2f9452ce1cd Mon Sep 17 00:00:00 2001 +From ae86e298bae75579cf4bc0009251aad847d4d4a2 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sat, 27 Feb 2016 09:01:42 +0100 -Subject: [PATCH 254/283] drm,i915: Use local_lock/unlock_irq() in +Subject: [PATCH 254/328] drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end() [ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918 @@ -123,5 +123,5 @@ index f7026e887fa9..07e4ddebdd80 100644 if (intel_vgpu_active(dev_priv)) return; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0255-drm-i915-disable-tracing-on-RT.patch b/kernel/patches-4.19.x-rt/0255-drm-i915-disable-tracing-on-RT.patch index 086bac476..ef806ed09 100644 --- a/kernel/patches-4.19.x-rt/0255-drm-i915-disable-tracing-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0255-drm-i915-disable-tracing-on-RT.patch @@ -1,7 +1,7 @@ -From d884bf96bfbde9a4c7e1435aa0745e52891ae9fa Mon Sep 17 00:00:00 2001 +From 3aed1fe6522f79b259e8106ff18e0c8324020675 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 09:52:20 +0100 -Subject: [PATCH 255/283] drm/i915: disable tracing on -RT +Subject: [PATCH 255/328] drm/i915: disable tracing on -RT Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 @@ -42,5 +42,5 @@ index b50c6b829715..cc54ec0ef75c 100644 #include #include -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0256-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch b/kernel/patches-4.19.x-rt/0256-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch index fc18a701b..d9e790b0e 100644 --- a/kernel/patches-4.19.x-rt/0256-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +++ b/kernel/patches-4.19.x-rt/0256-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch @@ -1,7 +1,7 @@ -From 59051415a63f69b8eb7e36f6e30119334967d711 Mon Sep 17 00:00:00 2001 +From 3d4557d91951a9964b97c806777b13cca8e11dee Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 19 Dec 2018 10:47:02 +0100 -Subject: [PATCH 256/283] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with +Subject: [PATCH 256/328] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACE The order of the header files is important. If this header file is @@ -28,5 +28,5 @@ index cc54ec0ef75c..33028d8f470e 100644 TP_PROTO(struct i915_request *rq), TP_ARGS(rq) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0257-cgroups-use-simple-wait-in-css_release.patch b/kernel/patches-4.19.x-rt/0257-cgroups-use-simple-wait-in-css_release.patch index 95791e6d3..e212d96b1 100644 --- a/kernel/patches-4.19.x-rt/0257-cgroups-use-simple-wait-in-css_release.patch +++ b/kernel/patches-4.19.x-rt/0257-cgroups-use-simple-wait-in-css_release.patch @@ -1,7 +1,7 @@ -From bd17886ee0bbb3d61ca16373b799a2e9f4f71fb3 Mon Sep 17 00:00:00 2001 +From 33ef8c81b2c33d47247da6b0b5d534c41dd7359a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 15:52:24 +0100 -Subject: [PATCH 257/283] cgroups: use simple wait in css_release() +Subject: [PATCH 257/328] cgroups: use simple wait in css_release() To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 @@ -34,7 +34,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 a6090154b2ab..46a706e2ba35 100644 +index a01ebb630abc..34fb541e90be 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -20,6 +20,7 @@ @@ -54,10 +54,10 @@ index a6090154b2ab..46a706e2ba35 100644 /* diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c -index 81441117f611..7b536796daf8 100644 +index 08bd40d90066..aceac97f78f4 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) +@@ -4667,10 +4667,10 @@ static void css_free_rwork_fn(struct work_struct *work) } } @@ -70,7 +70,7 @@ index 81441117f611..7b536796daf8 100644 struct cgroup_subsys *ss = css->ss; struct cgroup *cgrp = css->cgroup; -@@ -4693,8 +4693,8 @@ static void css_release(struct percpu_ref *ref) +@@ -4732,8 +4732,8 @@ static void css_release(struct percpu_ref *ref) struct cgroup_subsys_state *css = container_of(ref, struct cgroup_subsys_state, refcnt); @@ -81,7 +81,7 @@ index 81441117f611..7b536796daf8 100644 } static void init_and_link_css(struct cgroup_subsys_state *css, -@@ -5420,6 +5420,7 @@ static int __init cgroup_wq_init(void) +@@ -5459,6 +5459,7 @@ static int __init cgroup_wq_init(void) */ cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1); BUG_ON(!cgroup_destroy_wq); @@ -90,5 +90,5 @@ index 81441117f611..7b536796daf8 100644 } core_initcall(cgroup_wq_init); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0258-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/kernel/patches-4.19.x-rt/0258-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index 6a8c9c139..4ff73a31f 100644 --- a/kernel/patches-4.19.x-rt/0258-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/kernel/patches-4.19.x-rt/0258-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ -From ca3c9be1f8eb136f8c37c87c0eb8a528ebbbba72 Mon Sep 17 00:00:00 2001 +From 86e3ee73627056c1c97053b2201b942bfad09b26 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 8 Jan 2017 09:32:25 +0100 -Subject: [PATCH 258/283] cpuset: Convert callback_lock to raw_spinlock_t +Subject: [PATCH 258/328] cpuset: Convert callback_lock to raw_spinlock_t The two commits below add up to a cpuset might_sleep() splat for RT: @@ -288,5 +288,5 @@ index 7bb129c5b412..92575cb9b493 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0259-apparmor-use-a-locallock-instead-preempt_disable.patch b/kernel/patches-4.19.x-rt/0259-apparmor-use-a-locallock-instead-preempt_disable.patch index f9189410b..bdb3c4af7 100644 --- a/kernel/patches-4.19.x-rt/0259-apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/kernel/patches-4.19.x-rt/0259-apparmor-use-a-locallock-instead-preempt_disable.patch @@ -1,7 +1,7 @@ -From 304bb4fbcbaaf44ce6ea8b7605d79c64d72c47df Mon Sep 17 00:00:00 2001 +From 7d1cc83845fbfeae6cbe51a05849c8934e40bc56 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 11 Oct 2017 17:43:49 +0200 -Subject: [PATCH 259/283] apparmor: use a locallock instead preempt_disable() +Subject: [PATCH 259/328] apparmor: use a locallock instead preempt_disable() 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 @@ -67,7 +67,7 @@ index b6380c5f0097..12abfddb19c9 100644 #endif /* __AA_PATH_H */ diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c -index 8b8b70620bbe..8330ef57a784 100644 +index 730de4638b4e..edc911ff6a4d 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -45,7 +45,7 @@ @@ -80,5 +80,5 @@ index 8b8b70620bbe..8330ef57a784 100644 /* * LSM hook functions -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0260-workqueue-Prevent-deadlock-stall-on-RT.patch b/kernel/patches-4.19.x-rt/0260-workqueue-Prevent-deadlock-stall-on-RT.patch index f18d0c451..42dbae35e 100644 --- a/kernel/patches-4.19.x-rt/0260-workqueue-Prevent-deadlock-stall-on-RT.patch +++ b/kernel/patches-4.19.x-rt/0260-workqueue-Prevent-deadlock-stall-on-RT.patch @@ -1,7 +1,7 @@ -From 9d56ef1ce2d305509eb734d96c2bd1799ef7314f Mon Sep 17 00:00:00 2001 +From 3a793fb8d0b6d6f02988068bdba2a88b42d6c9c7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 27 Jun 2014 16:24:52 +0200 -Subject: [PATCH 260/283] workqueue: Prevent deadlock/stall on RT +Subject: [PATCH 260/328] workqueue: Prevent deadlock/stall on RT Austin reported a XFS deadlock/stall on RT where scheduled work gets never exececuted and tasks are waiting for each other for ever. @@ -42,10 +42,10 @@ Cc: Steven Rostedt 2 files changed, 51 insertions(+), 15 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 7831756f2097..91a9b2556fb0 100644 +index a17c765d3fcb..cfde725e1017 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3569,9 +3569,8 @@ void __noreturn do_task_dead(void) +@@ -3610,9 +3610,8 @@ void __noreturn do_task_dead(void) static inline void sched_submit_work(struct task_struct *tsk) { @@ -56,7 +56,7 @@ index 7831756f2097..91a9b2556fb0 100644 /* * If a worker went to sleep, notify and ask workqueue whether * it wants to wake up a task to maintain concurrency. -@@ -3585,6 +3584,9 @@ static inline void sched_submit_work(struct task_struct *tsk) +@@ -3626,6 +3625,9 @@ static inline void sched_submit_work(struct task_struct *tsk) preempt_enable_no_resched(); } @@ -67,7 +67,7 @@ index 7831756f2097..91a9b2556fb0 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 aa39924bd3b5..12137825bf5a 100644 +index 045b82ca0eb5..714d0cfe4d56 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -125,6 +125,11 @@ enum { @@ -202,5 +202,5 @@ index aa39924bd3b5..12137825bf5a 100644 wake_up_process(worker->task); } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0261-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/kernel/patches-4.19.x-rt/0261-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch index edfa51e74..361e2642b 100644 --- a/kernel/patches-4.19.x-rt/0261-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/kernel/patches-4.19.x-rt/0261-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,7 +1,7 @@ -From 0eec97926a2deb4ccc517f574a40578bddc19cd7 Mon Sep 17 00:00:00 2001 +From e35585fe22932e9eb9cf60dc1080b05935cc99ce Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:56 -0500 -Subject: [PATCH 261/283] signals: Allow rt tasks to cache one sigqueue struct +Subject: [PATCH 261/328] signals: Allow rt tasks to cache one sigqueue struct To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. @@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner 5 files changed, 70 insertions(+), 5 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h -index dd95bd64504e..c342fa06ab99 100644 +index a8ebd49c4f96..854a6cb456af 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -895,6 +895,8 @@ struct task_struct { @@ -29,7 +29,7 @@ index dd95bd64504e..c342fa06ab99 100644 sigset_t real_blocked; /* Restored if set_restore_sigmask() was used: */ diff --git a/include/linux/signal.h b/include/linux/signal.h -index e4d01469ed60..746dd5d28c54 100644 +index 0be5ce2375cb..6495fda18c2c 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -245,6 +245,7 @@ static inline void init_sigpending(struct sigpending *sig) @@ -41,7 +41,7 @@ index e4d01469ed60..746dd5d28c54 100644 /* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */ static inline int valid_signal(unsigned long sig) diff --git a/kernel/exit.c b/kernel/exit.c -index 5c0964dc805a..47d4161d1104 100644 +index 54c3269b8dda..c66f21193cf1 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -160,7 +160,7 @@ static void __exit_signal(struct task_struct *tsk) @@ -54,10 +54,10 @@ index 5c0964dc805a..47d4161d1104 100644 spin_unlock(&sighand->siglock); diff --git a/kernel/fork.c b/kernel/fork.c -index 96297e71019c..aa4905338ff4 100644 +index ecec0f8bef7e..234e0ca9a74b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1827,6 +1827,7 @@ static __latent_entropy struct task_struct *copy_process( +@@ -1832,6 +1832,7 @@ static __latent_entropy struct task_struct *copy_process( spin_lock_init(&p->alloc_lock); init_sigpending(&p->pending); @@ -66,7 +66,7 @@ index 96297e71019c..aa4905338ff4 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 56edb0580a3a..ac32b4f41d24 100644 +index d5e764bb2444..b3b037f63c8a 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -19,6 +19,7 @@ @@ -77,7 +77,7 @@ index 56edb0580a3a..ac32b4f41d24 100644 #include #include #include -@@ -388,13 +389,30 @@ void task_join_group_stop(struct task_struct *task) +@@ -397,13 +398,30 @@ void task_join_group_stop(struct task_struct *task) } } @@ -109,7 +109,7 @@ index 56edb0580a3a..ac32b4f41d24 100644 { struct sigqueue *q = NULL; struct user_struct *user; -@@ -411,7 +429,10 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi +@@ -420,7 +438,10 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi if (override_rlimit || atomic_read(&user->sigpending) <= task_rlimit(t, RLIMIT_SIGPENDING)) { @@ -121,7 +121,7 @@ index 56edb0580a3a..ac32b4f41d24 100644 } else { print_dropped_signal(sig); } -@@ -428,6 +449,13 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi +@@ -437,6 +458,13 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi return q; } @@ -135,7 +135,7 @@ index 56edb0580a3a..ac32b4f41d24 100644 static void __sigqueue_free(struct sigqueue *q) { if (q->flags & SIGQUEUE_PREALLOC) -@@ -437,6 +465,21 @@ static void __sigqueue_free(struct sigqueue *q) +@@ -446,6 +474,21 @@ static void __sigqueue_free(struct sigqueue *q) kmem_cache_free(sigqueue_cachep, q); } @@ -157,7 +157,7 @@ index 56edb0580a3a..ac32b4f41d24 100644 void flush_sigqueue(struct sigpending *queue) { struct sigqueue *q; -@@ -449,6 +492,21 @@ void flush_sigqueue(struct sigpending *queue) +@@ -458,6 +501,21 @@ void flush_sigqueue(struct sigpending *queue) } } @@ -179,7 +179,7 @@ index 56edb0580a3a..ac32b4f41d24 100644 /* * Flush all pending signals for this kthread. */ -@@ -572,7 +630,7 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info, +@@ -581,7 +639,7 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info, (info->si_code == SI_TIMER) && (info->si_sys_private); @@ -188,7 +188,7 @@ index 56edb0580a3a..ac32b4f41d24 100644 } else { /* * Ok, it wasn't in the queue. This must be -@@ -609,6 +667,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) +@@ -618,6 +676,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) bool resched_timer = false; int signr; @@ -197,7 +197,7 @@ index 56edb0580a3a..ac32b4f41d24 100644 /* We only dequeue private signals from ourselves, we don't let * signalfd steal them */ -@@ -1747,7 +1807,8 @@ EXPORT_SYMBOL(kill_pid); +@@ -1756,7 +1816,8 @@ EXPORT_SYMBOL(kill_pid); */ struct sigqueue *sigqueue_alloc(void) { @@ -208,5 +208,5 @@ index 56edb0580a3a..ac32b4f41d24 100644 if (q) q->flags |= SIGQUEUE_PREALLOC; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0262-Add-localversion-for-RT-release.patch b/kernel/patches-4.19.x-rt/0262-Add-localversion-for-RT-release.patch index 3aa0c0dfa..d61aab33a 100644 --- a/kernel/patches-4.19.x-rt/0262-Add-localversion-for-RT-release.patch +++ b/kernel/patches-4.19.x-rt/0262-Add-localversion-for-RT-release.patch @@ -1,7 +1,7 @@ -From 1d605947258bfd1a27d7d2d155e7466da763ffd2 Mon Sep 17 00:00:00 2001 +From ae23509557da3f7ee876249340937db31d277915 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 8 Jul 2011 20:25:16 +0200 -Subject: [PATCH 262/283] Add localversion for -RT release +Subject: [PATCH 262/328] Add localversion for -RT release Signed-off-by: Thomas Gleixner --- @@ -17,5 +17,5 @@ index 000000000000..1199ebade17b @@ -0,0 +1 @@ +-rt16 -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0263-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch b/kernel/patches-4.19.x-rt/0263-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch index d4ac1aca9..d87500536 100644 --- a/kernel/patches-4.19.x-rt/0263-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch +++ b/kernel/patches-4.19.x-rt/0263-powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch @@ -1,7 +1,7 @@ -From e3dd55f0a687316bb52bce0835070079b26a21a2 Mon Sep 17 00:00:00 2001 +From b84964140e4a5f15b5710e2ddd99a6560411542d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 26 Mar 2019 18:31:54 +0100 -Subject: [PATCH 263/283] powerpc/pseries/iommu: Use a locallock instead +Subject: [PATCH 263/328] powerpc/pseries/iommu: Use a locallock instead local_irq_save() The locallock protects the per-CPU variable tce_page. The function @@ -18,7 +18,7 @@ Signed-off-by: Steven Rostedt (VMware) 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c -index 06f02960b439..d80d919c78d3 100644 +index b1a08cb760e0..8ef818ad83ec 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -38,6 +38,7 @@ @@ -29,7 +29,7 @@ index 06f02960b439..d80d919c78d3 100644 #include #include #include -@@ -212,6 +213,7 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum, +@@ -212,6 +213,7 @@ static int tce_build_pSeriesLP(unsigned long liobn, long tcenum, long tceshift, } static DEFINE_PER_CPU(__be64 *, tce_page); @@ -37,7 +37,7 @@ index 06f02960b439..d80d919c78d3 100644 static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages, unsigned long uaddr, -@@ -232,7 +234,8 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, +@@ -233,7 +235,8 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, direction, attrs); } @@ -47,16 +47,16 @@ index 06f02960b439..d80d919c78d3 100644 tcep = __this_cpu_read(tce_page); -@@ -243,7 +246,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, +@@ -244,7 +247,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, tcep = (__be64 *)__get_free_page(GFP_ATOMIC); /* If allocation fails, fall back to the loop implementation */ if (!tcep) { - local_irq_restore(flags); + local_unlock_irqrestore(tcp_page_lock, flags); - return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr, - direction, attrs); - } -@@ -277,7 +280,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + return tce_build_pSeriesLP(tbl->it_index, tcenum, + tbl->it_page_shift, + npages, uaddr, direction, attrs); +@@ -279,7 +282,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, tcenum += limit; } while (npages > 0 && !rc); @@ -65,9 +65,9 @@ index 06f02960b439..d80d919c78d3 100644 if (unlikely(rc == H_NOT_ENOUGH_RESOURCES)) { ret = (int)rc; -@@ -435,13 +438,14 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, - u64 rc = 0; - long l, limit; +@@ -450,13 +453,14 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, + DMA_BIDIRECTIONAL, 0); + } - local_irq_disable(); /* to protect tcep and the page behind it */ + /* to protect tcep and the page behind it */ @@ -82,7 +82,7 @@ index 06f02960b439..d80d919c78d3 100644 return -ENOMEM; } __this_cpu_write(tce_page, tcep); -@@ -487,7 +491,7 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, +@@ -502,7 +506,7 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, /* error cleanup: caller will clear whole range */ @@ -92,5 +92,5 @@ index 06f02960b439..d80d919c78d3 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0264-powerpc-reshuffle-TIF-bits.patch b/kernel/patches-4.19.x-rt/0264-powerpc-reshuffle-TIF-bits.patch index 3ad108b51..1becf6a00 100644 --- a/kernel/patches-4.19.x-rt/0264-powerpc-reshuffle-TIF-bits.patch +++ b/kernel/patches-4.19.x-rt/0264-powerpc-reshuffle-TIF-bits.patch @@ -1,7 +1,7 @@ -From 76ccb7ba434581a4fa6338c0451f3f0752582520 Mon Sep 17 00:00:00 2001 +From a42bc60446357a00c18c446a7600b5b7fd090069 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 22 Mar 2019 17:15:58 +0100 -Subject: [PATCH 264/283] powerpc: reshuffle TIF bits +Subject: [PATCH 264/328] powerpc: reshuffle TIF bits Powerpc32/64 does not compile because TIF_SYSCALL_TRACE's bit is higher than 15 and the assembly instructions don't expect that. @@ -102,7 +102,7 @@ index 3783f3ef17a4..44bcf1585bd1 100644 3: lwarx r8,0,r12 andc r8,r8,r11 diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S -index 7671fa5da9fa..fe713d014220 100644 +index ef02e41d5d96..229cdb04e9b0 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S @@ -250,7 +250,9 @@ system_call_exit: @@ -147,5 +147,5 @@ index 7671fa5da9fa..fe713d014220 100644 3: ldarx r10,0,r12 andc r10,r10,r11 -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0265-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch b/kernel/patches-4.19.x-rt/0265-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch index 80ce4386c..76797d5c7 100644 --- a/kernel/patches-4.19.x-rt/0265-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch +++ b/kernel/patches-4.19.x-rt/0265-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ -From f264ec0373b575d16c232921fab39a5d7a6a3c21 Mon Sep 17 00:00:00 2001 +From ee919711fd01ec12c0d389243a78631d57c83e60 Mon Sep 17 00:00:00 2001 From: Julien Grall Date: Wed, 13 Mar 2019 11:40:34 +0000 -Subject: [PATCH 265/283] tty/sysrq: Convert show_lock to raw_spinlock_t +Subject: [PATCH 265/328] tty/sysrq: Convert show_lock to raw_spinlock_t Systems which don't provide arch_trigger_cpumask_backtrace() will invoke showacpu() from a smp_call_function() function which is invoked @@ -58,5 +58,5 @@ index 06ed20dd01ba..627517ad55bf 100644 static void sysrq_showregs_othercpus(struct work_struct *dummy) -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0266-drm-i915-Don-t-disable-interrupts-independently-of-t.patch b/kernel/patches-4.19.x-rt/0266-drm-i915-Don-t-disable-interrupts-independently-of-t.patch index d2e814f1c..6cbccedb3 100644 --- a/kernel/patches-4.19.x-rt/0266-drm-i915-Don-t-disable-interrupts-independently-of-t.patch +++ b/kernel/patches-4.19.x-rt/0266-drm-i915-Don-t-disable-interrupts-independently-of-t.patch @@ -1,7 +1,7 @@ -From da8db6d203d29fd33215f60a1948967f2fe76386 Mon Sep 17 00:00:00 2001 +From ed7f01fba8a5fbc0d32f5bab0fa3fca250530999 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 10 Apr 2019 11:01:37 +0200 -Subject: [PATCH 266/283] drm/i915: Don't disable interrupts independently of +Subject: [PATCH 266/328] drm/i915: Don't disable interrupts independently of the lock The locks (timeline->lock and rq->lock) need to be taken with disabled @@ -46,5 +46,5 @@ index 5c2c93cbab12..7124510b9131 100644 /* * The backing object for the context is done after switching to the -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0267-sched-completion-Fix-a-lockup-in-wait_for_completion.patch b/kernel/patches-4.19.x-rt/0267-sched-completion-Fix-a-lockup-in-wait_for_completion.patch index bf01908fd..8efca1790 100644 --- a/kernel/patches-4.19.x-rt/0267-sched-completion-Fix-a-lockup-in-wait_for_completion.patch +++ b/kernel/patches-4.19.x-rt/0267-sched-completion-Fix-a-lockup-in-wait_for_completion.patch @@ -1,7 +1,7 @@ -From 2de445a925a0c92865a6308ce0e1587ebc250ccb Mon Sep 17 00:00:00 2001 +From 62aaf2e45d6bc981cec8335fd58bfe5216343cce Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Thu, 9 May 2019 14:33:20 -0500 -Subject: [PATCH 267/283] sched/completion: Fix a lockup in +Subject: [PATCH 267/328] sched/completion: Fix a lockup in wait_for_completion() Consider following race: @@ -64,5 +64,5 @@ index 755a58084978..49c14137988e 100644 raw_spin_unlock_irq(&x->wait.lock); timeout = action(timeout); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0268-kthread-add-a-global-worker-thread.patch b/kernel/patches-4.19.x-rt/0268-kthread-add-a-global-worker-thread.patch index b85c615f7..a0053e1ef 100644 --- a/kernel/patches-4.19.x-rt/0268-kthread-add-a-global-worker-thread.patch +++ b/kernel/patches-4.19.x-rt/0268-kthread-add-a-global-worker-thread.patch @@ -1,7 +1,7 @@ -From 59fa1a99358d2859eff36b2531fed5a219437ad5 Mon Sep 17 00:00:00 2001 +From e63273e590c9d2a348ac876a3e0a86fe0053be88 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. +Subject: [PATCH 268/328] kthread: add a global worker thread. [ Upstream commit 0532e87d9d44795221aa921ba7024bde689cc894 ] @@ -28,7 +28,7 @@ Signed-off-by: Steven Rostedt (VMware) create mode 100644 include/linux/kthread-cgroup.h diff --git a/drivers/block/loop.c b/drivers/block/loop.c -index f1e63eb7cbca..aa76c816dbb4 100644 +index 9cd231a27328..351ea22ffb56 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -70,7 +70,7 @@ @@ -41,7 +41,7 @@ index f1e63eb7cbca..aa76c816dbb4 100644 #include #include diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c -index fdcf3076681b..b56619418cea 100644 +index 185bbdce62b1..63b10236eb05 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -22,6 +22,7 @@ @@ -131,10 +131,10 @@ index ad292898f7f2..7cf56eb54103 100644 + #endif /* _LINUX_KTHREAD_H */ diff --git a/init/main.c b/init/main.c -index 4a7471606e53..b0e95351c22c 100644 +index 6e02188386a7..e514dd93de76 100644 --- a/init/main.c +++ b/init/main.c -@@ -1130,6 +1130,7 @@ static noinline void __init kernel_init_freeable(void) +@@ -1129,6 +1129,7 @@ static noinline void __init kernel_init_freeable(void) smp_prepare_cpus(setup_max_cpus); workqueue_init(); @@ -175,5 +175,5 @@ index 5641b55783a6..9db017761a1f 100644 /** * kthread_associate_blkcg - associate blkcg to current kthread -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0269-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch b/kernel/patches-4.19.x-rt/0269-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch index 043743e3c..6bb75889c 100644 --- a/kernel/patches-4.19.x-rt/0269-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/kernel/patches-4.19.x-rt/0269-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,7 +1,7 @@ -From 1c00699faf9b42d9e365cb0a9c4f701c72089d90 Mon Sep 17 00:00:00 2001 +From ea09ce2ccce72c0a8abbd8c5971aee290b24b222 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 +Subject: [PATCH 269/328] genirq: Do not invoke the affinity callback via a workqueue on RT [ Upstream commit 2122adbe011cdc0eb62ad62494e181005b23c76a ] @@ -49,10 +49,10 @@ index 72333899f043..a9321f6429f2 100644 struct work_struct work; #endif diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index 7f4041357d2f..381305c48a0a 100644 +index ce86341a9e19..d5539e04e00a 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, +@@ -287,7 +287,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 @@ -61,7 +61,7 @@ index 7f4041357d2f..381305c48a0a 100644 #else schedule_work(&desc->affinity_notify->work); #endif -@@ -326,21 +326,11 @@ static void _irq_affinity_notify(struct irq_affinity_notify *notify) +@@ -352,21 +352,11 @@ static void _irq_affinity_notify(struct irq_affinity_notify *notify) } #ifdef CONFIG_PREEMPT_RT_BASE @@ -85,7 +85,7 @@ index 7f4041357d2f..381305c48a0a 100644 _irq_affinity_notify(notify); } -@@ -383,8 +373,7 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) +@@ -409,8 +399,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 @@ -96,5 +96,5 @@ index 7f4041357d2f..381305c48a0a 100644 INIT_WORK(¬ify->work, irq_affinity_notify); #endif -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0270-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch b/kernel/patches-4.19.x-rt/0270-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch index 1596952d6..d43786d84 100644 --- a/kernel/patches-4.19.x-rt/0270-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch +++ b/kernel/patches-4.19.x-rt/0270-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch @@ -1,7 +1,7 @@ -From 1f38c3b121feba50524996f2cceb92eb47269e52 Mon Sep 17 00:00:00 2001 +From 2c123db44d2e5daa7c6012fa43715d99706c84a5 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 +Subject: [PATCH 270/328] genirq: Handle missing work_struct in irq_set_affinity_notifier() [ Upstream commit bbc4d2a7d6ff54ba923640d9a42c7bef7185fe98 ] @@ -21,10 +21,10 @@ Signed-off-by: Steven Rostedt (VMware) 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index 381305c48a0a..b2736d7d863b 100644 +index d5539e04e00a..290cd520dba1 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) +@@ -411,8 +411,9 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) raw_spin_unlock_irqrestore(&desc->lock, flags); if (old_notify) { @@ -37,5 +37,5 @@ index 381305c48a0a..b2736d7d863b 100644 #endif kref_put(&old_notify->kref, old_notify->release); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0271-arm-imx6-cpuidle-Use-raw_spinlock_t.patch b/kernel/patches-4.19.x-rt/0271-arm-imx6-cpuidle-Use-raw_spinlock_t.patch index d94e029f6..72ee5b6ab 100644 --- a/kernel/patches-4.19.x-rt/0271-arm-imx6-cpuidle-Use-raw_spinlock_t.patch +++ b/kernel/patches-4.19.x-rt/0271-arm-imx6-cpuidle-Use-raw_spinlock_t.patch @@ -1,7 +1,7 @@ -From 17d57bbeda05b3bfe93276333b7b1db0958796d7 Mon Sep 17 00:00:00 2001 +From 0db2daea3de433d6d516bde0bd855fc8be716a8c 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 +Subject: [PATCH 271/328] arm: imx6: cpuidle: Use raw_spinlock_t [ Upstream commit 40d0332ec8312e9c090f0a5414d9c90e12b13611 ] @@ -47,5 +47,5 @@ index 326e870d7123..d9ac80aa1eb0 100644 return index; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0272-rcu-Don-t-allow-to-change-rcu_normal_after_boot-on-R.patch b/kernel/patches-4.19.x-rt/0272-rcu-Don-t-allow-to-change-rcu_normal_after_boot-on-R.patch index 6128541cd..44845ad98 100644 --- a/kernel/patches-4.19.x-rt/0272-rcu-Don-t-allow-to-change-rcu_normal_after_boot-on-R.patch +++ b/kernel/patches-4.19.x-rt/0272-rcu-Don-t-allow-to-change-rcu_normal_after_boot-on-R.patch @@ -1,7 +1,7 @@ -From 8f756e565320c9c32ed9f5e964f03f939dd38379 Mon Sep 17 00:00:00 2001 +From 63e76d2c0af10f033768782de397bb94afd9c20b 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 +Subject: [PATCH 272/328] rcu: Don't allow to change rcu_normal_after_boot on RT [ Upstream commit c6c058c10577815a2491ce661876cff00a4c3b15 ] @@ -31,5 +31,5 @@ index 16d8dba23329..ed75addd3ccd 100644 #ifdef CONFIG_DEBUG_LOCK_ALLOC -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0273-pci-switchtec-fix-stream_open.cocci-warnings.patch b/kernel/patches-4.19.x-rt/0273-pci-switchtec-fix-stream_open.cocci-warnings.patch index 9e618c1d1..0fd7ddeea 100644 --- a/kernel/patches-4.19.x-rt/0273-pci-switchtec-fix-stream_open.cocci-warnings.patch +++ b/kernel/patches-4.19.x-rt/0273-pci-switchtec-fix-stream_open.cocci-warnings.patch @@ -1,7 +1,7 @@ -From 652a25fea4d424e12f2f3ad7bcf5e30f6a6efa3d Mon Sep 17 00:00:00 2001 +From 57434065eaa488e6dc4ab73d2e0915a3e6bc3992 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 +Subject: [PATCH 273/328] pci/switchtec: fix stream_open.cocci warnings [ Upstream commit 9462c69e29307adc95c289f50839d5d683973891 ] @@ -22,10 +22,10 @@ Signed-off-by: Steven Rostedt (VMware) 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 +index a8df847bedee..25d1f96cddc1 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) +@@ -356,7 +356,7 @@ static int switchtec_dev_open(struct inode *inode, struct file *filp) return PTR_ERR(stuser); filp->private_data = stuser; @@ -35,5 +35,5 @@ index 77d4fb86d05b..ea70bc0b06e9 100644 dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0274-sched-core-Drop-a-preempt_disable_rt-statement.patch b/kernel/patches-4.19.x-rt/0274-sched-core-Drop-a-preempt_disable_rt-statement.patch index bc1b97ccc..adc7f7378 100644 --- a/kernel/patches-4.19.x-rt/0274-sched-core-Drop-a-preempt_disable_rt-statement.patch +++ b/kernel/patches-4.19.x-rt/0274-sched-core-Drop-a-preempt_disable_rt-statement.patch @@ -1,7 +1,7 @@ -From 13885eb4d49323964f1067b3f1b9f6503f07e29e Mon Sep 17 00:00:00 2001 +From c373cd893601a19b54d0926c87daa939d6953f47 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 +Subject: [PATCH 274/328] sched/core: Drop a preempt_disable_rt() statement [ Upstream commit 761126efdcbe3fa3e99c9079fa0ad6eca2f251f2 ] @@ -15,7 +15,7 @@ Signed-off-by: Steven Rostedt (VMware) 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 91a9b2556fb0..1b2503b87473 100644 +index cfde725e1017..678c2c4de4f5 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -558,14 +558,11 @@ void resched_cpu(int cpu) @@ -45,5 +45,5 @@ index 91a9b2556fb0..1b2503b87473 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0275-timers-Redo-the-notification-of-canceling-timers-on-.patch b/kernel/patches-4.19.x-rt/0275-timers-Redo-the-notification-of-canceling-timers-on-.patch index 060f08b89..656572f32 100644 --- a/kernel/patches-4.19.x-rt/0275-timers-Redo-the-notification-of-canceling-timers-on-.patch +++ b/kernel/patches-4.19.x-rt/0275-timers-Redo-the-notification-of-canceling-timers-on-.patch @@ -1,7 +1,7 @@ -From dc0135054565b6bea6821540271adc3643f1098c Mon Sep 17 00:00:00 2001 +From b624498d8a6db63e6d6390bbd5f560f37929a500 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 +Subject: [PATCH 275/328] timers: Redo the notification of canceling timers on -RT [ Upstream commit c71273154c2ad12e13333aada340ff30e826a11b ] @@ -57,7 +57,7 @@ index 82d0f52414a6..f845093466be 100644 /* diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h -index 2bdb047c7656..6c4c38186c99 100644 +index 082147c07831..aee31b1f0cc3 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -22,7 +22,6 @@ @@ -113,7 +113,7 @@ index 2bdb047c7656..6c4c38186c99 100644 /* 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) +@@ -481,7 +474,7 @@ static inline bool hrtimer_is_queued(struct hrtimer *timer) * Helper function to check, whether the timer is running the callback * function */ @@ -135,10 +135,10 @@ index 0571b498db73..3e6c91bdf2ef 100644 /* diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c -index 966708e8ce14..efa1e433974b 100644 +index a465564367ec..dcf0204264f1 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c -@@ -436,7 +436,7 @@ int alarm_cancel(struct alarm *alarm) +@@ -438,7 +438,7 @@ int alarm_cancel(struct alarm *alarm) int ret = alarm_try_to_cancel(alarm); if (ret >= 0) return ret; @@ -148,7 +148,7 @@ index 966708e8ce14..efa1e433974b 100644 } EXPORT_SYMBOL_GPL(alarm_cancel); diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index e1040b80362c..4534e7871c8c 100644 +index f16cbc98c47a..ed5d8d51ca91 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) @@ -190,7 +190,7 @@ index e1040b80362c..4534e7871c8c 100644 /* * enqueue_hrtimer - internal function to (re)start a timer * -@@ -1224,7 +1207,7 @@ int hrtimer_cancel(struct hrtimer *timer) +@@ -1227,7 +1210,7 @@ int hrtimer_cancel(struct hrtimer *timer) if (ret >= 0) return ret; @@ -199,7 +199,7 @@ index e1040b80362c..4534e7871c8c 100644 } } EXPORT_SYMBOL_GPL(hrtimer_cancel); -@@ -1528,6 +1511,7 @@ static __latent_entropy void hrtimer_run_softirq(struct softirq_action *h) +@@ -1531,6 +1514,7 @@ static __latent_entropy void hrtimer_run_softirq(struct softirq_action *h) unsigned long flags; ktime_t now; @@ -207,7 +207,7 @@ index e1040b80362c..4534e7871c8c 100644 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) +@@ -1540,7 +1524,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); @@ -216,7 +216,7 @@ index e1040b80362c..4534e7871c8c 100644 } #ifdef CONFIG_HIGH_RES_TIMERS -@@ -1947,9 +1931,7 @@ int hrtimers_prepare_cpu(unsigned int cpu) +@@ -1950,9 +1934,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; @@ -241,10 +241,10 @@ index 55b0e58368bf..a5ff222df4c7 100644 } 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 +index 8d95e8de98b2..765e700962ab 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, +@@ -792,6 +792,7 @@ check_timers_list(struct list_head *timers, return t->expires; t->firing = 1; @@ -252,7 +252,7 @@ index baeeaef3b721..59ceedbb03f0 100644 list_move_tail(&t->entry, firing); } -@@ -1134,6 +1135,20 @@ static inline int fastpath_timer_check(struct task_struct *tsk) +@@ -1138,6 +1139,20 @@ static inline int fastpath_timer_check(struct task_struct *tsk) return 0; } @@ -273,7 +273,7 @@ index baeeaef3b721..59ceedbb03f0 100644 /* * 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) +@@ -1148,6 +1163,7 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) LIST_HEAD(firing); struct k_itimer *timer, *next; unsigned long flags; @@ -281,7 +281,7 @@ index baeeaef3b721..59ceedbb03f0 100644 /* * 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) +@@ -1156,6 +1172,9 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) if (!fastpath_timer_check(tsk)) return; @@ -291,7 +291,7 @@ index baeeaef3b721..59ceedbb03f0 100644 if (!lock_task_sighand(tsk, &flags)) return; /* -@@ -1186,6 +1205,7 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) +@@ -1190,6 +1209,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; @@ -299,7 +299,7 @@ index baeeaef3b721..59ceedbb03f0 100644 /* * 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) +@@ -1199,6 +1219,7 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) cpu_timer_fire(timer); spin_unlock(&timer->it_lock); } @@ -307,7 +307,7 @@ index baeeaef3b721..59ceedbb03f0 100644 } #ifdef CONFIG_PREEMPT_RT_BASE -@@ -1460,6 +1481,8 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags, +@@ -1466,6 +1487,8 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags, spin_unlock_irq(&timer.it_lock); while (error == TIMER_RETRY) { @@ -460,7 +460,7 @@ index ddb21145211a..725bd230a8db 100644 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 +index 2fcd56aa6092..1c67aab34ff5 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -44,7 +44,6 @@ @@ -616,7 +616,7 @@ index 781483c76b17..d6289d8df06b 100644 raw_spin_lock_irq(&base->lock); } } -@@ -1696,6 +1693,7 @@ static inline void __run_timers(struct timer_base *base) +@@ -1698,6 +1695,7 @@ static inline void __run_timers(struct timer_base *base) if (!time_after_eq(jiffies, base->clk)) return; @@ -624,7 +624,7 @@ index 781483c76b17..d6289d8df06b 100644 raw_spin_lock_irq(&base->lock); /* -@@ -1723,7 +1721,7 @@ static inline void __run_timers(struct timer_base *base) +@@ -1725,7 +1723,7 @@ static inline void __run_timers(struct timer_base *base) expire_timers(base, heads + levels); } raw_spin_unlock_irq(&base->lock); @@ -633,7 +633,7 @@ index 781483c76b17..d6289d8df06b 100644 } /* -@@ -1970,9 +1968,7 @@ static void __init init_timer_cpu(int cpu) +@@ -1972,9 +1970,7 @@ static void __init init_timer_cpu(int cpu) base->cpu = cpu; raw_spin_lock_init(&base->lock); base->clk = jiffies; @@ -645,5 +645,5 @@ index 781483c76b17..d6289d8df06b 100644 } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0276-Revert-futex-Ensure-lock-unlock-symetry-versus-pi_lo.patch b/kernel/patches-4.19.x-rt/0276-Revert-futex-Ensure-lock-unlock-symetry-versus-pi_lo.patch index 59c0d7a58..43fd36ab9 100644 --- a/kernel/patches-4.19.x-rt/0276-Revert-futex-Ensure-lock-unlock-symetry-versus-pi_lo.patch +++ b/kernel/patches-4.19.x-rt/0276-Revert-futex-Ensure-lock-unlock-symetry-versus-pi_lo.patch @@ -1,7 +1,7 @@ -From d6630ac9f4bcf1f8fd51923ea266c42e87f9d312 Mon Sep 17 00:00:00 2001 +From b53286215979d7a0944e4d1e7483b8ef3b91d1d4 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 +Subject: [PATCH 276/328] Revert "futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock" [ Upstream commit 6a773b70cf105b46298ed3b44e77c102ce31d9ec ] @@ -16,10 +16,10 @@ Signed-off-by: Steven Rostedt (VMware) 1 file changed, 2 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c -index fe90164aa6ec..a58af833bb77 100644 +index 4c448dddce3c..38f53b95e370 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -918,9 +918,7 @@ void exit_pi_state_list(struct task_struct *curr) +@@ -921,9 +921,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); @@ -30,5 +30,5 @@ index fe90164aa6ec..a58af833bb77 100644 continue; } -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0277-Revert-futex-Fix-bug-on-when-a-requeued-RT-task-time.patch b/kernel/patches-4.19.x-rt/0277-Revert-futex-Fix-bug-on-when-a-requeued-RT-task-time.patch index 4f965f5e8..847fab77f 100644 --- a/kernel/patches-4.19.x-rt/0277-Revert-futex-Fix-bug-on-when-a-requeued-RT-task-time.patch +++ b/kernel/patches-4.19.x-rt/0277-Revert-futex-Fix-bug-on-when-a-requeued-RT-task-time.patch @@ -1,7 +1,7 @@ -From 9848e5129d0d928c27247ab10835cdfb2948bd60 Mon Sep 17 00:00:00 2001 +From 72c47093b9b237534280c6953d3cc0c635a96d3c 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 +Subject: [PATCH 277/328] Revert "futex: Fix bug on when a requeued RT task times out" [ Upstream commit f1a170cb3289a48df26cae3c60d77608f7a988bb ] @@ -78,5 +78,5 @@ index 546aaf058b9e..a501f3b47081 100644 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 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0278-Revert-rtmutex-Handle-the-various-new-futex-race-con.patch b/kernel/patches-4.19.x-rt/0278-Revert-rtmutex-Handle-the-various-new-futex-race-con.patch index aa56b4e9a..d7565c9d4 100644 --- a/kernel/patches-4.19.x-rt/0278-Revert-rtmutex-Handle-the-various-new-futex-race-con.patch +++ b/kernel/patches-4.19.x-rt/0278-Revert-rtmutex-Handle-the-various-new-futex-race-con.patch @@ -1,7 +1,7 @@ -From 0c3cb70fa05bdcb4ff249079bab804e098149371 Mon Sep 17 00:00:00 2001 +From a5fc42329ec8c08a961d8bc3f1a6d565ec867bcc 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 +Subject: [PATCH 278/328] Revert "rtmutex: Handle the various new futex race conditions" [ Upstream commit 9e0265c21af4d6388d47dcd5ce20f76ec3a2e468 ] @@ -18,10 +18,10 @@ Signed-off-by: Steven Rostedt (VMware) 3 files changed, 21 insertions(+), 94 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c -index a58af833bb77..1d9423914bf4 100644 +index 38f53b95e370..6ee55df4f3de 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2147,16 +2147,6 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, +@@ -2150,16 +2150,6 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, requeue_pi_wake_futex(this, &key2, hb2); drop_count++; continue; @@ -38,7 +38,7 @@ index a58af833bb77..1d9423914bf4 100644 } 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, +@@ -3238,7 +3228,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; @@ -47,7 +47,7 @@ index a58af833bb77..1d9423914bf4 100644 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, +@@ -3296,55 +3286,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); @@ -114,7 +114,7 @@ index a58af833bb77..1d9423914bf4 100644 /* 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, +@@ -3353,8 +3308,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)) { @@ -124,7 +124,7 @@ index a58af833bb77..1d9423914bf4 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; -@@ -3362,7 +3316,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3365,7 +3319,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); @@ -133,7 +133,7 @@ index a58af833bb77..1d9423914bf4 100644 } } else { struct rt_mutex *pi_mutex; -@@ -3376,8 +3330,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3379,8 +3333,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); @@ -253,5 +253,5 @@ index a501f3b47081..758dc43872e5 100644 extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0279-Revert-futex-workaround-migrate_disable-enable-in-di.patch b/kernel/patches-4.19.x-rt/0279-Revert-futex-workaround-migrate_disable-enable-in-di.patch index b88a6e49c..43d32b361 100644 --- a/kernel/patches-4.19.x-rt/0279-Revert-futex-workaround-migrate_disable-enable-in-di.patch +++ b/kernel/patches-4.19.x-rt/0279-Revert-futex-workaround-migrate_disable-enable-in-di.patch @@ -1,7 +1,7 @@ -From a4c6efd8adfd48a378c579bb7bc2c1a3162ced7f Mon Sep 17 00:00:00 2001 +From af703381dea29f442e4b3a7c4d8998379034f59a 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 +Subject: [PATCH 279/328] Revert "futex: workaround migrate_disable/enable in different context" [ Upstream commit a71221d81cc4873891ae44f3aa02df596079b786 ] @@ -16,10 +16,10 @@ Signed-off-by: Steven Rostedt (VMware) 1 file changed, 19 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c -index 1d9423914bf4..54ffc25183ed 100644 +index 6ee55df4f3de..f636dcc706ec 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2875,14 +2875,6 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, +@@ -2878,14 +2878,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); @@ -34,7 +34,7 @@ index 1d9423914bf4..54ffc25183ed 100644 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, +@@ -2894,7 +2886,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); @@ -42,7 +42,7 @@ index 1d9423914bf4..54ffc25183ed 100644 if (ret) { if (ret == 1) -@@ -3040,21 +3031,11 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) +@@ -3043,21 +3034,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); @@ -65,5 +65,5 @@ index 1d9423914bf4..54ffc25183ed 100644 /* -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0280-futex-Make-the-futex_hash_bucket-lock-raw.patch b/kernel/patches-4.19.x-rt/0280-futex-Make-the-futex_hash_bucket-lock-raw.patch index 779b1e191..694760499 100644 --- a/kernel/patches-4.19.x-rt/0280-futex-Make-the-futex_hash_bucket-lock-raw.patch +++ b/kernel/patches-4.19.x-rt/0280-futex-Make-the-futex_hash_bucket-lock-raw.patch @@ -1,7 +1,7 @@ -From b3425a889b12c0166d2eb44b8eaab8af20a73a22 Mon Sep 17 00:00:00 2001 +From 44953b81eb56f8bf4910a8d447d7e3695c25370e 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 +Subject: [PATCH 280/328] futex: Make the futex_hash_bucket lock raw [ Upstream commit f646521aadedab78801c9befe193e2e8a0c99298 ] @@ -22,10 +22,10 @@ Signed-off-by: Steven Rostedt (VMware) 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c -index 54ffc25183ed..b02d9969330b 100644 +index f636dcc706ec..a9d9283605e5 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -240,7 +240,7 @@ struct futex_q { +@@ -243,7 +243,7 @@ struct futex_q { struct plist_node list; struct task_struct *task; @@ -34,7 +34,7 @@ index 54ffc25183ed..b02d9969330b 100644 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 = { +@@ -264,7 +264,7 @@ static const struct futex_q futex_q_init = { */ struct futex_hash_bucket { atomic_t waiters; @@ -43,7 +43,7 @@ index 54ffc25183ed..b02d9969330b 100644 struct plist_head chain; } ____cacheline_aligned_in_smp; -@@ -908,7 +908,7 @@ void exit_pi_state_list(struct task_struct *curr) +@@ -911,7 +911,7 @@ void exit_pi_state_list(struct task_struct *curr) } raw_spin_unlock_irq(&curr->pi_lock); @@ -52,7 +52,7 @@ index 54ffc25183ed..b02d9969330b 100644 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) +@@ -921,7 +921,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); @@ -61,7 +61,7 @@ index 54ffc25183ed..b02d9969330b 100644 put_pi_state(pi_state); continue; } -@@ -930,7 +930,7 @@ void exit_pi_state_list(struct task_struct *curr) +@@ -933,7 +933,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); @@ -70,7 +70,7 @@ index 54ffc25183ed..b02d9969330b 100644 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) +@@ -1427,7 +1427,7 @@ static void __unqueue_futex(struct futex_q *q) { struct futex_hash_bucket *hb; @@ -79,7 +79,7 @@ index 54ffc25183ed..b02d9969330b 100644 || WARN_ON(plist_node_empty(&q->list))) return; -@@ -1552,21 +1552,21 @@ static inline void +@@ -1555,21 +1555,21 @@ static inline void double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2) { if (hb1 <= hb2) { @@ -107,7 +107,7 @@ index 54ffc25183ed..b02d9969330b 100644 } /* -@@ -1594,7 +1594,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) +@@ -1597,7 +1597,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) if (!hb_waiters_pending(hb)) goto out_put_key; @@ -116,7 +116,7 @@ index 54ffc25183ed..b02d9969330b 100644 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) +@@ -1616,7 +1616,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) } } @@ -125,7 +125,7 @@ index 54ffc25183ed..b02d9969330b 100644 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) +@@ -2221,7 +2221,7 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q) q->lock_ptr = &hb->lock; @@ -134,7 +134,7 @@ index 54ffc25183ed..b02d9969330b 100644 return hb; } -@@ -2226,7 +2226,7 @@ static inline void +@@ -2229,7 +2229,7 @@ static inline void queue_unlock(struct futex_hash_bucket *hb) __releases(&hb->lock) { @@ -143,7 +143,7 @@ index 54ffc25183ed..b02d9969330b 100644 hb_waiters_dec(hb); } -@@ -2265,7 +2265,7 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) +@@ -2268,7 +2268,7 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) __releases(&hb->lock) { __queue_me(q, hb); @@ -152,7 +152,7 @@ index 54ffc25183ed..b02d9969330b 100644 } /** -@@ -2281,41 +2281,41 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) +@@ -2284,41 +2284,41 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) */ static int unqueue_me(struct futex_q *q) { @@ -205,7 +205,7 @@ index 54ffc25183ed..b02d9969330b 100644 ret = 1; } -@@ -2337,7 +2337,7 @@ static void unqueue_me_pi(struct futex_q *q) +@@ -2340,7 +2340,7 @@ static void unqueue_me_pi(struct futex_q *q) put_pi_state(q->pi_state); q->pi_state = NULL; @@ -214,7 +214,7 @@ index 54ffc25183ed..b02d9969330b 100644 } 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, +@@ -2473,7 +2473,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); @@ -223,7 +223,7 @@ index 54ffc25183ed..b02d9969330b 100644 switch (err) { case -EFAULT: -@@ -2488,7 +2488,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, +@@ -2491,7 +2491,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, break; } @@ -232,7 +232,7 @@ index 54ffc25183ed..b02d9969330b 100644 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, +@@ -2587,7 +2587,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 @@ -241,7 +241,7 @@ index 54ffc25183ed..b02d9969330b 100644 * 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, +@@ -2878,7 +2878,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); @@ -250,7 +250,7 @@ index 54ffc25183ed..b02d9969330b 100644 /* * __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, +@@ -2899,7 +2899,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: @@ -259,7 +259,7 @@ index 54ffc25183ed..b02d9969330b 100644 /* * 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) +@@ -3000,7 +3000,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) return ret; hb = hash_futex(&key); @@ -268,7 +268,7 @@ index 54ffc25183ed..b02d9969330b 100644 /* * 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) +@@ -3034,7 +3034,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); @@ -277,7 +277,7 @@ index 54ffc25183ed..b02d9969330b 100644 /* 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) +@@ -3073,7 +3073,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) * owner. */ if ((ret = cmpxchg_futex_value_locked(&curval, uaddr, uval, 0))) { @@ -286,7 +286,7 @@ index 54ffc25183ed..b02d9969330b 100644 switch (ret) { case -EFAULT: goto pi_faulted; -@@ -3090,7 +3090,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) +@@ -3093,7 +3093,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) ret = (curval == uval) ? 0 : -EAGAIN; out_unlock: @@ -295,7 +295,7 @@ index 54ffc25183ed..b02d9969330b 100644 out_putkey: put_futex_key(&key); return ret; -@@ -3264,9 +3264,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3267,9 +3267,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); @@ -307,7 +307,7 @@ index 54ffc25183ed..b02d9969330b 100644 if (ret) goto out_put_keys; -@@ -3286,7 +3286,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3289,7 +3289,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)) { @@ -316,7 +316,7 @@ index 54ffc25183ed..b02d9969330b 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; -@@ -3297,7 +3297,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3300,7 +3300,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); @@ -325,7 +325,7 @@ index 54ffc25183ed..b02d9969330b 100644 } } else { struct rt_mutex *pi_mutex; -@@ -3311,7 +3311,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -3314,7 +3314,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); @@ -334,7 +334,7 @@ index 54ffc25183ed..b02d9969330b 100644 if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) ret = 0; -@@ -3748,7 +3748,7 @@ static int __init futex_init(void) +@@ -3981,7 +3981,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); @@ -344,5 +344,5 @@ index 54ffc25183ed..b02d9969330b 100644 return 0; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0281-futex-Delay-deallocation-of-pi_state.patch b/kernel/patches-4.19.x-rt/0281-futex-Delay-deallocation-of-pi_state.patch index 11811e0fe..e9362854c 100644 --- a/kernel/patches-4.19.x-rt/0281-futex-Delay-deallocation-of-pi_state.patch +++ b/kernel/patches-4.19.x-rt/0281-futex-Delay-deallocation-of-pi_state.patch @@ -1,7 +1,7 @@ -From 640583a34e7d86efdc8dc382f0567af929cd2c94 Mon Sep 17 00:00:00 2001 +From b4da585eac644bd89c26ced3290b61d735d50481 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 +Subject: [PATCH 281/328] futex: Delay deallocation of pi_state [ Upstream commit d7c7cf8cb68b7df17e6e50be1f25f35d83e686c7 ] @@ -17,10 +17,10 @@ Signed-off-by: Steven Rostedt (VMware) 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c -index b02d9969330b..688b6fcb79cb 100644 +index a9d9283605e5..0b8cff8d9162 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -822,13 +822,13 @@ static void get_pi_state(struct futex_pi_state *pi_state) +@@ -825,13 +825,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. */ @@ -37,7 +37,7 @@ index b02d9969330b..688b6fcb79cb 100644 /* * 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) +@@ -851,9 +851,7 @@ static void put_pi_state(struct futex_pi_state *pi_state) raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); } @@ -48,7 +48,7 @@ index b02d9969330b..688b6fcb79cb 100644 /* * 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) +@@ -862,6 +860,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; @@ -79,7 +79,7 @@ index b02d9969330b..688b6fcb79cb 100644 } } -@@ -875,6 +897,7 @@ void exit_pi_state_list(struct task_struct *curr) +@@ -878,6 +900,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; @@ -87,7 +87,7 @@ index b02d9969330b..688b6fcb79cb 100644 if (!futex_cmpxchg_enabled) return; -@@ -919,7 +942,7 @@ void exit_pi_state_list(struct task_struct *curr) +@@ -922,7 +945,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); @@ -96,7 +96,7 @@ index b02d9969330b..688b6fcb79cb 100644 continue; } -@@ -938,6 +961,8 @@ void exit_pi_state_list(struct task_struct *curr) +@@ -941,6 +964,8 @@ void exit_pi_state_list(struct task_struct *curr) raw_spin_lock_irq(&curr->pi_lock); } raw_spin_unlock_irq(&curr->pi_lock); @@ -105,7 +105,7 @@ index b02d9969330b..688b6fcb79cb 100644 } #endif -@@ -1920,6 +1945,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, +@@ -1923,6 +1948,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); @@ -113,7 +113,7 @@ index b02d9969330b..688b6fcb79cb 100644 if (nr_wake < 0 || nr_requeue < 0) return -EINVAL; -@@ -2157,7 +2183,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, +@@ -2160,7 +2186,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, * object. */ this->pi_state = NULL; @@ -122,7 +122,7 @@ index b02d9969330b..688b6fcb79cb 100644 /* * 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, +@@ -2177,7 +2203,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. */ @@ -131,7 +131,7 @@ index b02d9969330b..688b6fcb79cb 100644 out_unlock: double_unlock_hb(hb1, hb2); -@@ -2195,6 +2221,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, +@@ -2198,6 +2224,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, out_put_key1: put_futex_key(&key1); out: @@ -139,7 +139,7 @@ index b02d9969330b..688b6fcb79cb 100644 return ret ? ret : task_count; } -@@ -2331,13 +2358,16 @@ static int unqueue_me(struct futex_q *q) +@@ -2334,13 +2361,16 @@ static int unqueue_me(struct futex_q *q) static void unqueue_me_pi(struct futex_q *q) __releases(q->lock_ptr) { @@ -157,7 +157,7 @@ index b02d9969330b..688b6fcb79cb 100644 } 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, +@@ -3289,6 +3319,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)) { @@ -166,7 +166,7 @@ index b02d9969330b..688b6fcb79cb 100644 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, +@@ -3299,8 +3331,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. */ @@ -178,5 +178,5 @@ index b02d9969330b..688b6fcb79cb 100644 } else { struct rt_mutex *pi_mutex; -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0282-mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch b/kernel/patches-4.19.x-rt/0282-mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch index 33b99e3ef..96613b458 100644 --- a/kernel/patches-4.19.x-rt/0282-mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch +++ b/kernel/patches-4.19.x-rt/0282-mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch @@ -1,7 +1,7 @@ -From 6c3c5543f7820dca5be5c020721d30a34374ccf9 Mon Sep 17 00:00:00 2001 +From 4ae018a1f3fabfd075da5e5e1c764d47df47c191 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 +Subject: [PATCH 282/328] mm/zswap: Do not disable preemption in zswap_frontswap_store() [ Upstream commit 4e4cf4be79635e67144632d9135286381acbc95a ] @@ -122,5 +122,5 @@ index cd91fd9d96b8..420225d3ff0b 100644 freepage: zswap_entry_cache_free(entry); -- -2.20.1 +2.25.1 diff --git a/kernel/patches-4.19.x-rt/0283-revert-aio.patch b/kernel/patches-4.19.x-rt/0283-revert-aio.patch new file mode 100644 index 000000000..c0666290e --- /dev/null +++ b/kernel/patches-4.19.x-rt/0283-revert-aio.patch @@ -0,0 +1,70 @@ +From ab2dc29034ff92024537b768305a45a2d4b138fb Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Fri, 20 Sep 2019 17:50:53 -0400 +Subject: [PATCH 283/328] revert-aio + +revert: fs/aio: simple simple work + +Signed-off-by: Steven Rostedt (VMware) +--- + fs/aio.c | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) + +diff --git a/fs/aio.c b/fs/aio.c +index 93f8cf7fdeab..b5fbf2061868 100644 +--- a/fs/aio.c ++++ b/fs/aio.c +@@ -42,7 +42,6 @@ + #include + #include + #include +-#include + + #include + #include +@@ -122,7 +121,6 @@ struct kioctx { + long nr_pages; + + struct rcu_work free_rwork; /* see free_ioctx() */ +- struct swork_event free_swork; /* see free_ioctx() */ + + /* + * signals when all in-flight requests are done +@@ -267,7 +265,6 @@ static int __init aio_setup(void) + .mount = aio_mount, + .kill_sb = kill_anon_super, + }; +- BUG_ON(swork_get()); + aio_mnt = kern_mount(&aio_fs); + if (IS_ERR(aio_mnt)) + panic("Failed to create aio fs mount."); +@@ -609,9 +606,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. + */ +-static void free_ioctx_users_work(struct swork_event *sev) ++static void free_ioctx_users(struct percpu_ref *ref) + { +- struct kioctx *ctx = container_of(sev, struct kioctx, free_swork); ++ struct kioctx *ctx = container_of(ref, struct kioctx, users); + struct aio_kiocb *req; + + spin_lock_irq(&ctx->ctx_lock); +@@ -629,14 +626,6 @@ static void free_ioctx_users_work(struct swork_event *sev) + percpu_ref_put(&ctx->reqs); + } + +-static void free_ioctx_users(struct percpu_ref *ref) +-{ +- struct kioctx *ctx = container_of(ref, struct kioctx, users); +- +- INIT_SWORK(&ctx->free_swork, free_ioctx_users_work); +- swork_queue(&ctx->free_swork); +-} +- + static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) + { + unsigned i, new_nr; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0284-fs-aio-simple-simple-work.patch b/kernel/patches-4.19.x-rt/0284-fs-aio-simple-simple-work.patch new file mode 100644 index 000000000..9ba1a068a --- /dev/null +++ b/kernel/patches-4.19.x-rt/0284-fs-aio-simple-simple-work.patch @@ -0,0 +1,75 @@ +From 81433e7d902d1cc6192315d52f22c51ab06a2e63 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 16 Feb 2015 18:49:10 +0100 +Subject: [PATCH 284/328] fs/aio: simple simple work + +[ Upstream commit 1a142116f6435ef070ecebb66d2d599507c10601 ] + +|BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:768 +|in_atomic(): 1, irqs_disabled(): 0, pid: 26, name: rcuos/2 +|2 locks held by rcuos/2/26: +| #0: (rcu_callback){.+.+..}, at: [] rcu_nocb_kthread+0x1e2/0x380 +| #1: (rcu_read_lock_sched){.+.+..}, at: [] percpu_ref_kill_rcu+0xa6/0x1c0 +|Preemption disabled at:[] rcu_nocb_kthread+0x263/0x380 +|Call Trace: +| [] dump_stack+0x4e/0x9c +| [] __might_sleep+0xfb/0x170 +| [] rt_spin_lock+0x24/0x70 +| [] free_ioctx_users+0x30/0x130 +| [] percpu_ref_kill_rcu+0x1b4/0x1c0 +| [] rcu_nocb_kthread+0x263/0x380 +| [] kthread+0xd6/0xf0 +| [] ret_from_fork+0x7c/0xb0 + +replace this preempt_disable() friendly swork. + +Reported-By: Mike Galbraith +Suggested-by: Benjamin LaHaise +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + fs/aio.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/fs/aio.c b/fs/aio.c +index b5fbf2061868..a92119e05869 100644 +--- a/fs/aio.c ++++ b/fs/aio.c +@@ -121,6 +121,7 @@ struct kioctx { + long nr_pages; + + struct rcu_work free_rwork; /* see free_ioctx() */ ++ struct kthread_work free_kwork; /* see free_ioctx() */ + + /* + * signals when all in-flight requests are done +@@ -606,9 +607,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. + */ +-static void free_ioctx_users(struct percpu_ref *ref) ++static void free_ioctx_users_work(struct kthread_work *work) + { +- struct kioctx *ctx = container_of(ref, struct kioctx, users); ++ struct kioctx *ctx = container_of(work, struct kioctx, free_kwork); + struct aio_kiocb *req; + + spin_lock_irq(&ctx->ctx_lock); +@@ -626,6 +627,14 @@ static void free_ioctx_users(struct percpu_ref *ref) + percpu_ref_put(&ctx->reqs); + } + ++static void free_ioctx_users(struct percpu_ref *ref) ++{ ++ struct kioctx *ctx = container_of(ref, struct kioctx, users); ++ ++ kthread_init_work(&ctx->free_kwork, free_ioctx_users_work); ++ kthread_schedule_work(&ctx->free_kwork); ++} ++ + static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) + { + unsigned i, new_nr; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0285-revert-thermal.patch b/kernel/patches-4.19.x-rt/0285-revert-thermal.patch new file mode 100644 index 000000000..42dcce5ec --- /dev/null +++ b/kernel/patches-4.19.x-rt/0285-revert-thermal.patch @@ -0,0 +1,119 @@ +From c02161642bb7a1a67a5deeca8370d86f1901a30c Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Fri, 20 Sep 2019 17:50:53 -0400 +Subject: [PATCH 285/328] revert-thermal + +Revert: thermal: Defer thermal wakups to threads + +Signed-off-by: Steven Rostedt (VMware) +--- + drivers/thermal/x86_pkg_temp_thermal.c | 52 ++------------------------ + 1 file changed, 3 insertions(+), 49 deletions(-) + +diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c +index a5991cbb408f..1ef937d799e4 100644 +--- a/drivers/thermal/x86_pkg_temp_thermal.c ++++ b/drivers/thermal/x86_pkg_temp_thermal.c +@@ -29,7 +29,6 @@ + #include + #include + #include +-#include + #include + #include + +@@ -330,7 +329,7 @@ static void pkg_thermal_schedule_work(int cpu, struct delayed_work *work) + schedule_delayed_work_on(cpu, work, ms); + } + +-static void pkg_thermal_notify_work(struct swork_event *event) ++static int pkg_thermal_notify(u64 msr_val) + { + int cpu = smp_processor_id(); + struct pkg_device *pkgdev; +@@ -349,47 +348,9 @@ static void pkg_thermal_notify_work(struct swork_event *event) + } + + spin_unlock_irqrestore(&pkg_temp_lock, flags); +-} +- +-#ifdef CONFIG_PREEMPT_RT_FULL +-static struct swork_event notify_work; +- +-static int pkg_thermal_notify_work_init(void) +-{ +- int err; +- +- err = swork_get(); +- if (err) +- return err; +- +- INIT_SWORK(¬ify_work, pkg_thermal_notify_work); + return 0; + } + +-static void pkg_thermal_notify_work_cleanup(void) +-{ +- swork_put(); +-} +- +-static int pkg_thermal_notify(u64 msr_val) +-{ +- swork_queue(¬ify_work); +- return 0; +-} +- +-#else /* !CONFIG_PREEMPT_RT_FULL */ +- +-static int pkg_thermal_notify_work_init(void) { return 0; } +- +-static void pkg_thermal_notify_work_cleanup(void) { } +- +-static int pkg_thermal_notify(u64 msr_val) +-{ +- pkg_thermal_notify_work(NULL); +- return 0; +-} +-#endif /* CONFIG_PREEMPT_RT_FULL */ +- + static int pkg_temp_thermal_device_add(unsigned int cpu) + { + int pkgid = topology_logical_package_id(cpu); +@@ -554,16 +515,11 @@ static int __init pkg_temp_thermal_init(void) + if (!x86_match_cpu(pkg_temp_thermal_ids)) + return -ENODEV; + +- if (!pkg_thermal_notify_work_init()) +- return -ENODEV; +- + max_packages = topology_max_packages(); + packages = kcalloc(max_packages, sizeof(struct pkg_device *), + GFP_KERNEL); +- if (!packages) { +- ret = -ENOMEM; +- goto err; +- } ++ if (!packages) ++ return -ENOMEM; + + ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "thermal/x86_pkg:online", + pkg_thermal_cpu_online, pkg_thermal_cpu_offline); +@@ -581,7 +537,6 @@ static int __init pkg_temp_thermal_init(void) + return 0; + + err: +- pkg_thermal_notify_work_cleanup(); + kfree(packages); + return ret; + } +@@ -595,7 +550,6 @@ static void __exit pkg_temp_thermal_exit(void) + cpuhp_remove_state(pkg_thermal_hp_state); + debugfs_remove_recursive(debugfs); + kfree(packages); +- pkg_thermal_notify_work_cleanup(); + } + module_exit(pkg_temp_thermal_exit) + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0286-thermal-Defer-thermal-wakups-to-threads.patch b/kernel/patches-4.19.x-rt/0286-thermal-Defer-thermal-wakups-to-threads.patch new file mode 100644 index 000000000..9a74d9dcb --- /dev/null +++ b/kernel/patches-4.19.x-rt/0286-thermal-Defer-thermal-wakups-to-threads.patch @@ -0,0 +1,97 @@ +From 6ce01aa7368b545641a370a0dde81ac0d4c5ba41 Mon Sep 17 00:00:00 2001 +From: Daniel Wagner +Date: Tue, 17 Feb 2015 09:37:44 +0100 +Subject: [PATCH 286/328] thermal: Defer thermal wakups to threads + +[ Upstream commit ad2408dc248fe58536eef5b2b5734d8f9d3a280b ] + +On RT the spin lock in pkg_temp_thermal_platfrom_thermal_notify will +call schedule while we run in irq context. + +[] dump_stack+0x4e/0x8f +[] __schedule_bug+0xa6/0xb4 +[] __schedule+0x5b4/0x700 +[] schedule+0x2a/0x90 +[] rt_spin_lock_slowlock+0xe5/0x2d0 +[] rt_spin_lock+0x25/0x30 +[] pkg_temp_thermal_platform_thermal_notify+0x45/0x134 [x86_pkg_temp_thermal] +[] ? therm_throt_process+0x1b/0x160 +[] intel_thermal_interrupt+0x211/0x250 +[] smp_thermal_interrupt+0x21/0x40 +[] thermal_interrupt+0x6d/0x80 + +Let's defer the work to a kthread. + +Signed-off-by: Daniel Wagner +Signed-off-by: Steven Rostedt (VMware) +[bigeasy: reoder init/denit position. TODO: flush swork on exit] +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/thermal/x86_pkg_temp_thermal.c | 28 +++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c +index 1ef937d799e4..82f21fd4afb0 100644 +--- a/drivers/thermal/x86_pkg_temp_thermal.c ++++ b/drivers/thermal/x86_pkg_temp_thermal.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -329,7 +330,7 @@ static void pkg_thermal_schedule_work(int cpu, struct delayed_work *work) + schedule_delayed_work_on(cpu, work, ms); + } + +-static int pkg_thermal_notify(u64 msr_val) ++static void pkg_thermal_notify_work(struct kthread_work *work) + { + int cpu = smp_processor_id(); + struct pkg_device *pkgdev; +@@ -348,8 +349,32 @@ static int pkg_thermal_notify(u64 msr_val) + } + + spin_unlock_irqrestore(&pkg_temp_lock, flags); ++} ++ ++#ifdef CONFIG_PREEMPT_RT_FULL ++static DEFINE_KTHREAD_WORK(notify_work, pkg_thermal_notify_work); ++ ++static int pkg_thermal_notify(u64 msr_val) ++{ ++ kthread_schedule_work(¬ify_work); ++ return 0; ++} ++ ++static void pkg_thermal_notify_flush(void) ++{ ++ kthread_flush_work(¬ify_work); ++} ++ ++#else /* !CONFIG_PREEMPT_RT_FULL */ ++ ++static void pkg_thermal_notify_flush(void) { } ++ ++static int pkg_thermal_notify(u64 msr_val) ++{ ++ pkg_thermal_notify_work(NULL); + return 0; + } ++#endif /* CONFIG_PREEMPT_RT_FULL */ + + static int pkg_temp_thermal_device_add(unsigned int cpu) + { +@@ -548,6 +573,7 @@ static void __exit pkg_temp_thermal_exit(void) + platform_thermal_package_rate_control = NULL; + + cpuhp_remove_state(pkg_thermal_hp_state); ++ pkg_thermal_notify_flush(); + debugfs_remove_recursive(debugfs); + kfree(packages); + } +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0287-revert-block.patch b/kernel/patches-4.19.x-rt/0287-revert-block.patch new file mode 100644 index 000000000..ffc6fe9ed --- /dev/null +++ b/kernel/patches-4.19.x-rt/0287-revert-block.patch @@ -0,0 +1,82 @@ +From ffad188bfa63fa513c05850bf64eebe5e519c14d Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Fri, 20 Sep 2019 17:50:54 -0400 +Subject: [PATCH 287/328] revert-block + +Revert swork version of: block: blk-mq: move blk_queue_usage_counter_release() into process context + +In order to switch to upstream, we need to revert the swork code. + +Signed-off-by: Steven Rostedt (VMware) +--- + block/blk-core.c | 14 +------------- + include/linux/blkdev.h | 2 -- + 2 files changed, 1 insertion(+), 15 deletions(-) + +diff --git a/block/blk-core.c b/block/blk-core.c +index 13bf37156bb0..4860cd26cd5a 100644 +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -973,21 +973,12 @@ void blk_queue_exit(struct request_queue *q) + percpu_ref_put(&q->q_usage_counter); + } + +-static void blk_queue_usage_counter_release_swork(struct swork_event *sev) +-{ +- struct request_queue *q = +- container_of(sev, struct request_queue, mq_pcpu_wake); +- +- wake_up_all(&q->mq_freeze_wq); +-} +- + static void blk_queue_usage_counter_release(struct percpu_ref *ref) + { + struct request_queue *q = + container_of(ref, struct request_queue, q_usage_counter); + +- if (wq_has_sleeper(&q->mq_freeze_wq)) +- swork_queue(&q->mq_pcpu_wake); ++ wake_up_all(&q->mq_freeze_wq); + } + + static void blk_rq_timed_out_timer(struct timer_list *t) +@@ -1084,7 +1075,6 @@ 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); +- INIT_SWORK(&q->mq_pcpu_wake, blk_queue_usage_counter_release_swork); + + /* + * Init percpu_ref in atomic mode so that it's faster to shutdown. +@@ -3974,8 +3964,6 @@ int __init blk_dev_init(void) + if (!kblockd_workqueue) + panic("Failed to create kblockd\n"); + +- BUG_ON(swork_get()); +- + request_cachep = kmem_cache_create("blkdev_requests", + sizeof(struct request), 0, SLAB_PANIC, NULL); + +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index 2f3b2e5196eb..111ab4209797 100644 +--- a/include/linux/blkdev.h ++++ b/include/linux/blkdev.h +@@ -27,7 +27,6 @@ + #include + #include + #include +-#include + + struct module; + struct scsi_ioctl_command; +@@ -656,7 +655,6 @@ struct request_queue { + #endif + struct rcu_head rcu_head; + wait_queue_head_t mq_freeze_wq; +- struct swork_event mq_pcpu_wake; + struct percpu_ref q_usage_counter; + struct list_head all_q_node; + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0288-block-blk-mq-move-blk_queue_usage_counter_release-in.patch b/kernel/patches-4.19.x-rt/0288-block-blk-mq-move-blk_queue_usage_counter_release-in.patch new file mode 100644 index 000000000..2ac9055bb --- /dev/null +++ b/kernel/patches-4.19.x-rt/0288-block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -0,0 +1,113 @@ +From 2793f1c2fe23bf8db5eb818139db6bdc8c0d0ff3 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Tue, 13 Mar 2018 13:49:16 +0100 +Subject: [PATCH 288/328] block: blk-mq: move blk_queue_usage_counter_release() + into process context + +[ Upstream commit 61c928ecf4fe200bda9b49a0813b5ba0f43995b5 ] + +| 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 +| 5 locks held by kworker/u257:6/255: +| #0: ("events_unbound"){.+.+.+}, at: [] process_one_work+0x171/0x5e0 +| #1: ((&entry->work)){+.+.+.}, at: [] process_one_work+0x171/0x5e0 +| #2: (&shost->scan_mutex){+.+.+.}, at: [] __scsi_add_device+0xa3/0x130 [scsi_mod] +| #3: (&set->tag_list_lock){+.+...}, at: [] blk_mq_init_queue+0x96a/0xa50 +| #4: (rcu_read_lock_sched){......}, at: [] percpu_ref_kill_and_confirm+0x1d/0x120 +| Preemption disabled at:[] blk_mq_freeze_queue_start+0x56/0x70 +| +| CPU: 2 PID: 255 Comm: kworker/u257:6 Not tainted 3.18.7-rt0+ #1 +| Workqueue: events_unbound async_run_entry_fn +| 0000000000000003 ffff8800bc29f998 ffffffff815b3a12 0000000000000000 +| 0000000000000000 ffff8800bc29f9b8 ffffffff8109aa16 ffff8800bc29fa28 +| ffff8800bc5d1bc8 ffff8800bc29f9e8 ffffffff815b8dd4 ffff880000000000 +| Call Trace: +| [] dump_stack+0x4f/0x7c +| [] __might_sleep+0x116/0x190 +| [] rt_spin_lock+0x24/0x60 +| [] __wake_up+0x29/0x60 +| [] blk_mq_usage_counter_release+0x1e/0x20 +| [] percpu_ref_kill_and_confirm+0x106/0x120 +| [] blk_mq_freeze_queue_start+0x56/0x70 +| [] blk_mq_update_tag_set_depth+0x40/0xd0 +| [] blk_mq_init_queue+0x98c/0xa50 +| [] scsi_mq_alloc_queue+0x20/0x60 [scsi_mod] +| [] scsi_alloc_sdev+0x2f5/0x370 [scsi_mod] +| [] scsi_probe_and_add_lun+0x9e4/0xdd0 [scsi_mod] +| [] __scsi_add_device+0x126/0x130 [scsi_mod] +| [] ata_scsi_scan_host+0xaf/0x200 [libata] +| [] async_port_probe+0x46/0x60 [libata] +| [] async_run_entry_fn+0x3b/0xf0 +| [] process_one_work+0x201/0x5e0 + +percpu_ref_kill_and_confirm() invokes blk_mq_usage_counter_release() in +a rcu-sched region. swait based wake queue can't be used due to +wake_up_all() usage and disabled interrupts in !RT configs (as reported +by Corey Minyard). +The wq_has_sleeper() check has been suggested by Peter Zijlstra. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + block/blk-core.c | 12 +++++++++++- + include/linux/blkdev.h | 2 ++ + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/block/blk-core.c b/block/blk-core.c +index 4860cd26cd5a..7d709465876e 100644 +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -973,12 +973,21 @@ void blk_queue_exit(struct request_queue *q) + percpu_ref_put(&q->q_usage_counter); + } + ++static void blk_queue_usage_counter_release_wrk(struct kthread_work *work) ++{ ++ struct request_queue *q = ++ container_of(work, struct request_queue, mq_pcpu_wake); ++ ++ wake_up_all(&q->mq_freeze_wq); ++} ++ + static void blk_queue_usage_counter_release(struct percpu_ref *ref) + { + struct request_queue *q = + container_of(ref, struct request_queue, q_usage_counter); + +- wake_up_all(&q->mq_freeze_wq); ++ if (wq_has_sleeper(&q->mq_freeze_wq)) ++ kthread_schedule_work(&q->mq_pcpu_wake); + } + + static void blk_rq_timed_out_timer(struct timer_list *t) +@@ -1075,6 +1084,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); ++ kthread_init_work(&q->mq_pcpu_wake, blk_queue_usage_counter_release_wrk); + + /* + * Init percpu_ref in atomic mode so that it's faster to shutdown. +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index 111ab4209797..981103415cd8 100644 +--- a/include/linux/blkdev.h ++++ b/include/linux/blkdev.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -655,6 +656,7 @@ struct request_queue { + #endif + struct rcu_head rcu_head; + wait_queue_head_t mq_freeze_wq; ++ struct kthread_work mq_pcpu_wake; + struct percpu_ref q_usage_counter; + struct list_head all_q_node; + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0289-workqueue-rework.patch b/kernel/patches-4.19.x-rt/0289-workqueue-rework.patch new file mode 100644 index 000000000..e2b03a7b2 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0289-workqueue-rework.patch @@ -0,0 +1,1568 @@ +From 30d6766aa0a5077a70137d4bb9b044aa73fe9f7e Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 29 May 2019 18:52:27 +0200 +Subject: [PATCH 289/328] workqueue: rework + +[ Upstream commit d15a862f24df983458533aebd6fa207ecdd1095a ] + +This is an all-in change of the workqueue rework. +The worker_pool.lock is made to raw_spinlock_t. With this change we can +schedule workitems from preempt-disable sections and sections with disabled +interrupts. This change allows to remove all kthread_.* workarounds we used to +have. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + block/blk-core.c | 6 +- + drivers/block/loop.c | 2 +- + drivers/spi/spi-rockchip.c | 1 - + drivers/thermal/x86_pkg_temp_thermal.c | 28 +-- + fs/aio.c | 10 +- + include/linux/blk-cgroup.h | 2 +- + include/linux/blkdev.h | 2 +- + include/linux/interrupt.h | 5 - + include/linux/kthread-cgroup.h | 17 -- + include/linux/kthread.h | 15 +- + include/linux/swait.h | 14 ++ + include/linux/workqueue.h | 4 - + init/main.c | 1 - + kernel/irq/manage.c | 36 +-- + kernel/kthread.c | 14 -- + kernel/sched/core.c | 1 + + kernel/time/hrtimer.c | 24 -- + kernel/workqueue.c | 304 +++++++++++-------------- + 18 files changed, 166 insertions(+), 320 deletions(-) + delete mode 100644 include/linux/kthread-cgroup.h + +diff --git a/block/blk-core.c b/block/blk-core.c +index 7d709465876e..752c9e754509 100644 +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -973,7 +973,7 @@ void blk_queue_exit(struct request_queue *q) + percpu_ref_put(&q->q_usage_counter); + } + +-static void blk_queue_usage_counter_release_wrk(struct kthread_work *work) ++static void blk_queue_usage_counter_release_wrk(struct work_struct *work) + { + struct request_queue *q = + container_of(work, struct request_queue, mq_pcpu_wake); +@@ -987,7 +987,7 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref) + container_of(ref, struct request_queue, q_usage_counter); + + if (wq_has_sleeper(&q->mq_freeze_wq)) +- kthread_schedule_work(&q->mq_pcpu_wake); ++ schedule_work(&q->mq_pcpu_wake); + } + + static void blk_rq_timed_out_timer(struct timer_list *t) +@@ -1084,7 +1084,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); +- kthread_init_work(&q->mq_pcpu_wake, blk_queue_usage_counter_release_wrk); ++ INIT_WORK(&q->mq_pcpu_wake, blk_queue_usage_counter_release_wrk); + + /* + * Init percpu_ref in atomic mode so that it's faster to shutdown. +diff --git a/drivers/block/loop.c b/drivers/block/loop.c +index 351ea22ffb56..9cd231a27328 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 63b10236eb05..185bbdce62b1 100644 +--- a/drivers/spi/spi-rockchip.c ++++ b/drivers/spi/spi-rockchip.c +@@ -22,7 +22,6 @@ + #include + #include + #include +-#include + + #define DRIVER_NAME "rockchip-spi" + +diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c +index 82f21fd4afb0..1ef937d799e4 100644 +--- a/drivers/thermal/x86_pkg_temp_thermal.c ++++ b/drivers/thermal/x86_pkg_temp_thermal.c +@@ -29,7 +29,6 @@ + #include + #include + #include +-#include + #include + #include + +@@ -330,7 +329,7 @@ static void pkg_thermal_schedule_work(int cpu, struct delayed_work *work) + schedule_delayed_work_on(cpu, work, ms); + } + +-static void pkg_thermal_notify_work(struct kthread_work *work) ++static int pkg_thermal_notify(u64 msr_val) + { + int cpu = smp_processor_id(); + struct pkg_device *pkgdev; +@@ -349,32 +348,8 @@ static void pkg_thermal_notify_work(struct kthread_work *work) + } + + spin_unlock_irqrestore(&pkg_temp_lock, flags); +-} +- +-#ifdef CONFIG_PREEMPT_RT_FULL +-static DEFINE_KTHREAD_WORK(notify_work, pkg_thermal_notify_work); +- +-static int pkg_thermal_notify(u64 msr_val) +-{ +- kthread_schedule_work(¬ify_work); +- return 0; +-} +- +-static void pkg_thermal_notify_flush(void) +-{ +- kthread_flush_work(¬ify_work); +-} +- +-#else /* !CONFIG_PREEMPT_RT_FULL */ +- +-static void pkg_thermal_notify_flush(void) { } +- +-static int pkg_thermal_notify(u64 msr_val) +-{ +- pkg_thermal_notify_work(NULL); + return 0; + } +-#endif /* CONFIG_PREEMPT_RT_FULL */ + + static int pkg_temp_thermal_device_add(unsigned int cpu) + { +@@ -573,7 +548,6 @@ static void __exit pkg_temp_thermal_exit(void) + platform_thermal_package_rate_control = NULL; + + cpuhp_remove_state(pkg_thermal_hp_state); +- pkg_thermal_notify_flush(); + debugfs_remove_recursive(debugfs); + kfree(packages); + } +diff --git a/fs/aio.c b/fs/aio.c +index a92119e05869..37e75bb0c406 100644 +--- a/fs/aio.c ++++ b/fs/aio.c +@@ -121,7 +121,7 @@ struct kioctx { + long nr_pages; + + struct rcu_work free_rwork; /* see free_ioctx() */ +- struct kthread_work free_kwork; /* see free_ioctx() */ ++ struct work_struct free_work; /* see free_ioctx() */ + + /* + * signals when all in-flight requests are done +@@ -607,9 +607,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. + */ +-static void free_ioctx_users_work(struct kthread_work *work) ++static void free_ioctx_users_work(struct work_struct *work) + { +- struct kioctx *ctx = container_of(work, struct kioctx, free_kwork); ++ struct kioctx *ctx = container_of(work, struct kioctx, free_work); + struct aio_kiocb *req; + + spin_lock_irq(&ctx->ctx_lock); +@@ -631,8 +631,8 @@ static void free_ioctx_users(struct percpu_ref *ref) + { + struct kioctx *ctx = container_of(ref, struct kioctx, users); + +- kthread_init_work(&ctx->free_kwork, free_ioctx_users_work); +- kthread_schedule_work(&ctx->free_kwork); ++ INIT_WORK(&ctx->free_work, free_ioctx_users_work); ++ schedule_work(&ctx->free_work); + } + + static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) +diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h +index 0473efda4c65..da587e60fe86 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/blkdev.h b/include/linux/blkdev.h +index 981103415cd8..6a0bfa0a2c52 100644 +--- a/include/linux/blkdev.h ++++ b/include/linux/blkdev.h +@@ -656,7 +656,7 @@ struct request_queue { + #endif + struct rcu_head rcu_head; + wait_queue_head_t mq_freeze_wq; +- struct kthread_work mq_pcpu_wake; ++ struct work_struct mq_pcpu_wake; + struct percpu_ref q_usage_counter; + struct list_head all_q_node; + +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index a9321f6429f2..97d9ba26915e 100644 +--- a/include/linux/interrupt.h ++++ b/include/linux/interrupt.h +@@ -13,7 +13,6 @@ + #include + #include + #include +-#include + + #include + #include +@@ -239,11 +238,7 @@ extern void resume_device_irqs(void); + struct irq_affinity_notify { + unsigned int irq; + struct kref kref; +-#ifdef CONFIG_PREEMPT_RT_BASE +- struct kthread_work work; +-#else + struct work_struct work; +-#endif + void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); + void (*release)(struct kref *ref); + }; +diff --git a/include/linux/kthread-cgroup.h b/include/linux/kthread-cgroup.h +deleted file mode 100644 +index 53d34bca9d72..000000000000 +--- a/include/linux/kthread-cgroup.h ++++ /dev/null +@@ -1,17 +0,0 @@ +-/* 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 7cf56eb54103..6b8c064f0cbc 100644 +--- a/include/linux/kthread.h ++++ b/include/linux/kthread.h +@@ -4,6 +4,7 @@ + /* 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), +@@ -197,12 +198,14 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work); + + void kthread_destroy_worker(struct kthread_worker *worker); + +-extern struct kthread_worker kthread_global_worker; +-void kthread_init_global_worker(void); +- +-static inline bool kthread_schedule_work(struct kthread_work *work) ++#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 kthread_queue_work(&kthread_global_worker, work); ++ return NULL; + } +- ++#endif + #endif /* _LINUX_KTHREAD_H */ +diff --git a/include/linux/swait.h b/include/linux/swait.h +index f426a0661aa0..21ae66cd41d3 100644 +--- a/include/linux/swait.h ++++ b/include/linux/swait.h +@@ -299,4 +299,18 @@ do { \ + __ret; \ + }) + ++#define __swait_event_lock_irq(wq, condition, lock, cmd) \ ++ ___swait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, \ ++ raw_spin_unlock_irq(&lock); \ ++ cmd; \ ++ schedule(); \ ++ raw_spin_lock_irq(&lock)) ++ ++#define swait_event_lock_irq(wq_head, condition, lock) \ ++ do { \ ++ if (condition) \ ++ break; \ ++ __swait_event_lock_irq(wq_head, condition, lock, ); \ ++ } while (0) ++ + #endif /* _LINUX_SWAIT_H */ +diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h +index 60d673e15632..546aa73fba6a 100644 +--- a/include/linux/workqueue.h ++++ b/include/linux/workqueue.h +@@ -455,10 +455,6 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, + + extern void destroy_workqueue(struct workqueue_struct *wq); + +-struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask); +-void free_workqueue_attrs(struct workqueue_attrs *attrs); +-int apply_workqueue_attrs(struct workqueue_struct *wq, +- const struct workqueue_attrs *attrs); + int workqueue_set_unbound_cpumask(cpumask_var_t cpumask); + + extern bool queue_work_on(int cpu, struct workqueue_struct *wq, +diff --git a/init/main.c b/init/main.c +index e514dd93de76..6e02188386a7 100644 +--- a/init/main.c ++++ b/init/main.c +@@ -1129,7 +1129,6 @@ 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/irq/manage.c b/kernel/irq/manage.c +index 290cd520dba1..82b3728685ca 100644 +--- a/kernel/irq/manage.c ++++ b/kernel/irq/manage.c +@@ -285,12 +285,7 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, + + if (desc->affinity_notify) { + kref_get(&desc->affinity_notify->kref); +- +-#ifdef CONFIG_PREEMPT_RT_BASE +- kthread_schedule_work(&desc->affinity_notify->work); +-#else + schedule_work(&desc->affinity_notify->work); +-#endif + } + irqd_set(data, IRQD_AFFINITY_SET); + +@@ -328,8 +323,10 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) + } + EXPORT_SYMBOL_GPL(irq_set_affinity_hint); + +-static void _irq_affinity_notify(struct irq_affinity_notify *notify) ++static void irq_affinity_notify(struct work_struct *work) + { ++ struct irq_affinity_notify *notify = ++ container_of(work, struct irq_affinity_notify, work); + struct irq_desc *desc = irq_to_desc(notify->irq); + cpumask_var_t cpumask; + unsigned long flags; +@@ -351,25 +348,6 @@ static void _irq_affinity_notify(struct irq_affinity_notify *notify) + kref_put(¬ify->kref, notify->release); + } + +-#ifdef CONFIG_PREEMPT_RT_BASE +- +-static void irq_affinity_notify(struct kthread_work *work) +-{ +- struct irq_affinity_notify *notify = +- container_of(work, struct irq_affinity_notify, work); +- _irq_affinity_notify(notify); +-} +- +-#else +- +-static void irq_affinity_notify(struct work_struct *work) +-{ +- struct irq_affinity_notify *notify = +- container_of(work, struct irq_affinity_notify, work); +- _irq_affinity_notify(notify); +-} +-#endif +- + /** + * irq_set_affinity_notifier - control notification of IRQ affinity changes + * @irq: Interrupt for which to enable/disable notification +@@ -398,11 +376,7 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) + if (notify) { + notify->irq = irq; + kref_init(¬ify->kref); +-#ifdef CONFIG_PREEMPT_RT_BASE +- kthread_init_work(¬ify->work, irq_affinity_notify); +-#else + INIT_WORK(¬ify->work, irq_affinity_notify); +-#endif + } + + raw_spin_lock_irqsave(&desc->lock, flags); +@@ -411,11 +385,7 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) + raw_spin_unlock_irqrestore(&desc->lock, flags); + + if (old_notify) { +-#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); + } + +diff --git a/kernel/kthread.c b/kernel/kthread.c +index 9db017761a1f..5641b55783a6 100644 +--- a/kernel/kthread.c ++++ b/kernel/kthread.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + + static DEFINE_SPINLOCK(kthread_create_lock); +@@ -1181,19 +1180,6 @@ 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 +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 678c2c4de4f5..a1c0123e7636 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -3607,6 +3607,7 @@ static inline void sched_submit_work(struct task_struct *tsk) + { + if (!tsk->state) + return; ++ + /* + * If a worker went to sleep, notify and ask workqueue whether + * it wants to wake up a task to maintain concurrency. +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index ed5d8d51ca91..94d97eae0a46 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -730,29 +730,6 @@ static void hrtimer_switch_to_hres(void) + retrigger_next_event(NULL); + } + +-#ifdef CONFIG_PREEMPT_RT_FULL +- +-static struct swork_event clock_set_delay_work; +- +-static void run_clock_set_delay(struct swork_event *event) +-{ +- clock_was_set(); +-} +- +-void clock_was_set_delayed(void) +-{ +- swork_queue(&clock_set_delay_work); +-} +- +-static __init int create_clock_set_delay_thread(void) +-{ +- WARN_ON(swork_get()); +- INIT_SWORK(&clock_set_delay_work, run_clock_set_delay); +- return 0; +-} +-early_initcall(create_clock_set_delay_thread); +-#else /* PREEMPT_RT_FULL */ +- + static void clock_was_set_work(struct work_struct *work) + { + clock_was_set(); +@@ -768,7 +745,6 @@ void clock_was_set_delayed(void) + { + schedule_work(&hrtimer_work); + } +-#endif + + #else + +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index 714d0cfe4d56..75f59299dd06 100644 +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -49,8 +49,6 @@ + #include + #include + #include +-#include +-#include + + #include "workqueue_internal.h" + +@@ -125,11 +123,6 @@ enum { + * cpu or grabbing pool->lock is enough for read access. If + * POOL_DISASSOCIATED is set, it's identical to L. + * +- * On RT we need the extra protection via rt_lock_idle_list() for +- * the list manipulations against read access from +- * wq_worker_sleeping(). All other places are nicely serialized via +- * pool->lock. +- * + * A: wq_pool_attach_mutex protected. + * + * PL: wq_pool_mutex protected. +@@ -151,7 +144,7 @@ enum { + /* struct worker is defined in workqueue_internal.h */ + + struct worker_pool { +- spinlock_t lock; /* the pool lock */ ++ raw_spinlock_t lock; /* the pool lock */ + int cpu; /* I: the associated cpu */ + int node; /* I: the associated node ID */ + int id; /* I: pool ID */ +@@ -304,8 +297,8 @@ static struct workqueue_attrs *wq_update_unbound_numa_attrs_buf; + + static DEFINE_MUTEX(wq_pool_mutex); /* protects pools and workqueues list */ + static DEFINE_MUTEX(wq_pool_attach_mutex); /* protects worker attach/detach */ +-static DEFINE_SPINLOCK(wq_mayday_lock); /* protects wq->maydays list */ +-static DECLARE_WAIT_QUEUE_HEAD(wq_manager_wait); /* wait for manager to go away */ ++static DEFINE_RAW_SPINLOCK(wq_mayday_lock); /* protects wq->maydays list */ ++static DECLARE_SWAIT_QUEUE_HEAD(wq_manager_wait); /* wait for manager to go away */ + + static LIST_HEAD(workqueues); /* PR: list of all workqueues */ + static bool workqueue_freezing; /* PL: have wqs started freezing? */ +@@ -357,8 +350,6 @@ EXPORT_SYMBOL_GPL(system_power_efficient_wq); + struct workqueue_struct *system_freezable_power_efficient_wq __read_mostly; + EXPORT_SYMBOL_GPL(system_freezable_power_efficient_wq); + +-static DEFINE_LOCAL_IRQ_LOCK(pendingb_lock); +- + static int worker_thread(void *__worker); + static void workqueue_sysfs_unregister(struct workqueue_struct *wq); + +@@ -435,31 +426,6 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); + if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \ + else + +-#ifdef CONFIG_PREEMPT_RT_BASE +-static inline void rt_lock_idle_list(struct worker_pool *pool) +-{ +- preempt_disable(); +-} +-static inline void rt_unlock_idle_list(struct worker_pool *pool) +-{ +- preempt_enable(); +-} +-static inline void sched_lock_idle_list(struct worker_pool *pool) { } +-static inline void sched_unlock_idle_list(struct worker_pool *pool) { } +-#else +-static inline void rt_lock_idle_list(struct worker_pool *pool) { } +-static inline void rt_unlock_idle_list(struct worker_pool *pool) { } +-static inline void sched_lock_idle_list(struct worker_pool *pool) +-{ +- spin_lock_irq(&pool->lock); +-} +-static inline void sched_unlock_idle_list(struct worker_pool *pool) +-{ +- spin_unlock_irq(&pool->lock); +-} +-#endif +- +- + #ifdef CONFIG_DEBUG_OBJECTS_WORK + + static struct debug_obj_descr work_debug_descr; +@@ -862,20 +828,14 @@ static struct worker *first_idle_worker(struct worker_pool *pool) + * Wake up the first idle worker of @pool. + * + * CONTEXT: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + */ + static void wake_up_worker(struct worker_pool *pool) + { +- struct worker *worker; +- +- rt_lock_idle_list(pool); +- +- worker = first_idle_worker(pool); ++ struct worker *worker = first_idle_worker(pool); + + if (likely(worker)) + wake_up_process(worker->task); +- +- rt_unlock_idle_list(pool); + } + + /** +@@ -904,7 +864,7 @@ void wq_worker_running(struct task_struct *task) + */ + void wq_worker_sleeping(struct task_struct *task) + { +- struct worker *worker = kthread_data(task); ++ struct worker *next, *worker = kthread_data(task); + struct worker_pool *pool; + + /* +@@ -921,18 +881,26 @@ void wq_worker_sleeping(struct task_struct *task) + return; + + worker->sleeping = 1; ++ raw_spin_lock_irq(&pool->lock); + + /* + * The counterpart of the following dec_and_test, implied mb, + * worklist not empty test sequence is in insert_work(). + * Please read comment there. ++ * ++ * NOT_RUNNING is clear. This means that we're bound to and ++ * running on the local cpu w/ rq lock held and preemption ++ * disabled, which in turn means that none else could be ++ * manipulating idle_list, so dereferencing idle_list without pool ++ * lock is safe. + */ + if (atomic_dec_and_test(&pool->nr_running) && + !list_empty(&pool->worklist)) { +- sched_lock_idle_list(pool); +- wake_up_worker(pool); +- sched_unlock_idle_list(pool); ++ next = first_idle_worker(pool); ++ if (next) ++ wake_up_process(next->task); + } ++ raw_spin_unlock_irq(&pool->lock); + } + + /** +@@ -943,7 +911,7 @@ void wq_worker_sleeping(struct task_struct *task) + * Set @flags in @worker->flags and adjust nr_running accordingly. + * + * CONTEXT: +- * spin_lock_irq(pool->lock) ++ * raw_spin_lock_irq(pool->lock) + */ + static inline void worker_set_flags(struct worker *worker, unsigned int flags) + { +@@ -968,7 +936,7 @@ static inline void worker_set_flags(struct worker *worker, unsigned int flags) + * Clear @flags in @worker->flags and adjust nr_running accordingly. + * + * CONTEXT: +- * spin_lock_irq(pool->lock) ++ * raw_spin_lock_irq(pool->lock) + */ + static inline void worker_clr_flags(struct worker *worker, unsigned int flags) + { +@@ -1016,7 +984,7 @@ static inline void worker_clr_flags(struct worker *worker, unsigned int flags) + * actually occurs, it should be easy to locate the culprit work function. + * + * CONTEXT: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + * + * Return: + * Pointer to worker which is executing @work if found, %NULL +@@ -1051,7 +1019,7 @@ static struct worker *find_worker_executing_work(struct worker_pool *pool, + * nested inside outer list_for_each_entry_safe(). + * + * CONTEXT: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + */ + static void move_linked_works(struct work_struct *work, struct list_head *head, + struct work_struct **nextp) +@@ -1129,11 +1097,9 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq) + * As both pwqs and pools are RCU protected, the + * following lock operations are safe. + */ +- rcu_read_lock(); +- local_spin_lock_irq(pendingb_lock, &pwq->pool->lock); ++ raw_spin_lock_irq(&pwq->pool->lock); + put_pwq(pwq); +- local_spin_unlock_irq(pendingb_lock, &pwq->pool->lock); +- rcu_read_unlock(); ++ raw_spin_unlock_irq(&pwq->pool->lock); + } + } + +@@ -1166,7 +1132,7 @@ static void pwq_activate_first_delayed(struct pool_workqueue *pwq) + * decrement nr_in_flight of its pwq and handle workqueue flushing. + * + * CONTEXT: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + */ + static void pwq_dec_nr_in_flight(struct pool_workqueue *pwq, int color) + { +@@ -1237,7 +1203,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, + struct worker_pool *pool; + struct pool_workqueue *pwq; + +- local_lock_irqsave(pendingb_lock, *flags); ++ local_irq_save(*flags); + + /* try to steal the timer if it exists */ + if (is_dwork) { +@@ -1265,7 +1231,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, + if (!pool) + goto fail; + +- spin_lock(&pool->lock); ++ raw_spin_lock(&pool->lock); + /* + * work->data is guaranteed to point to pwq only while the work + * item is queued on pwq->wq, and both updating work->data to point +@@ -1294,17 +1260,17 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, + /* work->data points to pwq iff queued, point to pool */ + set_work_pool_and_keep_pending(work, pool->id); + +- spin_unlock(&pool->lock); ++ raw_spin_unlock(&pool->lock); + rcu_read_unlock(); + return 1; + } +- spin_unlock(&pool->lock); ++ raw_spin_unlock(&pool->lock); + fail: + rcu_read_unlock(); +- local_unlock_irqrestore(pendingb_lock, *flags); ++ local_irq_restore(*flags); + if (work_is_canceling(work)) + return -ENOENT; +- cpu_chill(); ++ cpu_relax(); + return -EAGAIN; + } + +@@ -1319,7 +1285,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, + * work_struct flags. + * + * CONTEXT: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + */ + static void insert_work(struct pool_workqueue *pwq, struct work_struct *work, + struct list_head *head, unsigned int extra_flags) +@@ -1406,13 +1372,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, + * queued or lose PENDING. Grabbing PENDING and queueing should + * happen with IRQ disabled. + */ +-#ifndef CONFIG_PREEMPT_RT_FULL +- /* +- * nort: On RT the "interrupts-disabled" rule has been replaced with +- * pendingb_lock. +- */ + lockdep_assert_irqs_disabled(); +-#endif + + debug_work_activate(work); + +@@ -1440,7 +1400,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, + if (last_pool && last_pool != pwq->pool) { + struct worker *worker; + +- spin_lock(&last_pool->lock); ++ raw_spin_lock(&last_pool->lock); + + worker = find_worker_executing_work(last_pool, work); + +@@ -1448,11 +1408,11 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, + pwq = worker->current_pwq; + } else { + /* meh... not running there, queue here */ +- spin_unlock(&last_pool->lock); +- spin_lock(&pwq->pool->lock); ++ raw_spin_unlock(&last_pool->lock); ++ raw_spin_lock(&pwq->pool->lock); + } + } else { +- spin_lock(&pwq->pool->lock); ++ raw_spin_lock(&pwq->pool->lock); + } + + /* +@@ -1465,7 +1425,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, + */ + if (unlikely(!pwq->refcnt)) { + if (wq->flags & WQ_UNBOUND) { +- spin_unlock(&pwq->pool->lock); ++ raw_spin_unlock(&pwq->pool->lock); + cpu_relax(); + goto retry; + } +@@ -1497,7 +1457,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, + insert_work(pwq, work, worklist, work_flags); + + out: +- spin_unlock(&pwq->pool->lock); ++ raw_spin_unlock(&pwq->pool->lock); + rcu_read_unlock(); + } + +@@ -1518,14 +1478,14 @@ bool queue_work_on(int cpu, struct workqueue_struct *wq, + bool ret = false; + unsigned long flags; + +- local_lock_irqsave(pendingb_lock,flags); ++ local_irq_save(flags); + + if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))) { + __queue_work(cpu, wq, work); + ret = true; + } + +- local_unlock_irqrestore(pendingb_lock, flags); ++ local_irq_restore(flags); + return ret; + } + EXPORT_SYMBOL(queue_work_on); +@@ -1533,12 +1493,11 @@ EXPORT_SYMBOL(queue_work_on); + void delayed_work_timer_fn(struct timer_list *t) + { + struct delayed_work *dwork = from_timer(dwork, t, timer); ++ unsigned long flags; + +- /* XXX */ +- /* local_lock(pendingb_lock); */ +- /* should have been called from irqsafe timer with irq already off */ ++ local_irq_save(flags); + __queue_work(dwork->cpu, dwork->wq, &dwork->work); +- /* local_unlock(pendingb_lock); */ ++ local_irq_restore(flags); + } + EXPORT_SYMBOL(delayed_work_timer_fn); + +@@ -1593,14 +1552,14 @@ bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq, + unsigned long flags; + + /* read the comment in __queue_work() */ +- local_lock_irqsave(pendingb_lock, flags); ++ local_irq_save(flags); + + if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))) { + __queue_delayed_work(cpu, wq, dwork, delay); + ret = true; + } + +- local_unlock_irqrestore(pendingb_lock, flags); ++ local_irq_restore(flags); + return ret; + } + EXPORT_SYMBOL(queue_delayed_work_on); +@@ -1635,7 +1594,7 @@ bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq, + + if (likely(ret >= 0)) { + __queue_delayed_work(cpu, wq, dwork, delay); +- local_unlock_irqrestore(pendingb_lock, flags); ++ local_irq_restore(flags); + } + + /* -ENOENT from try_to_grab_pending() becomes %true */ +@@ -1646,12 +1605,11 @@ EXPORT_SYMBOL_GPL(mod_delayed_work_on); + static void rcu_work_rcufn(struct rcu_head *rcu) + { + struct rcu_work *rwork = container_of(rcu, struct rcu_work, rcu); +- unsigned long flags; + + /* read the comment in __queue_work() */ +- local_lock_irqsave(pendingb_lock, flags); ++ local_irq_disable(); + __queue_work(WORK_CPU_UNBOUND, rwork->wq, &rwork->work); +- local_unlock_irqrestore(pendingb_lock, flags); ++ local_irq_enable(); + } + + /** +@@ -1686,7 +1644,7 @@ EXPORT_SYMBOL(queue_rcu_work); + * necessary. + * + * LOCKING: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + */ + static void worker_enter_idle(struct worker *worker) + { +@@ -1703,9 +1661,7 @@ static void worker_enter_idle(struct worker *worker) + worker->last_active = jiffies; + + /* idle_list is LIFO */ +- rt_lock_idle_list(pool); + list_add(&worker->entry, &pool->idle_list); +- rt_unlock_idle_list(pool); + + if (too_many_workers(pool) && !timer_pending(&pool->idle_timer)) + mod_timer(&pool->idle_timer, jiffies + IDLE_WORKER_TIMEOUT); +@@ -1728,7 +1684,7 @@ static void worker_enter_idle(struct worker *worker) + * @worker is leaving idle state. Update stats. + * + * LOCKING: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + */ + static void worker_leave_idle(struct worker *worker) + { +@@ -1738,9 +1694,7 @@ static void worker_leave_idle(struct worker *worker) + return; + worker_clr_flags(worker, WORKER_IDLE); + pool->nr_idle--; +- rt_lock_idle_list(pool); + list_del_init(&worker->entry); +- rt_unlock_idle_list(pool); + } + + static struct worker *alloc_worker(int node) +@@ -1868,11 +1822,11 @@ static struct worker *create_worker(struct worker_pool *pool) + worker_attach_to_pool(worker, pool); + + /* start the newly created worker */ +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + worker->pool->nr_workers++; + worker_enter_idle(worker); + wake_up_process(worker->task); +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + + return worker; + +@@ -1891,7 +1845,7 @@ static struct worker *create_worker(struct worker_pool *pool) + * be idle. + * + * CONTEXT: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + */ + static void destroy_worker(struct worker *worker) + { +@@ -1908,9 +1862,7 @@ static void destroy_worker(struct worker *worker) + pool->nr_workers--; + pool->nr_idle--; + +- rt_lock_idle_list(pool); + list_del_init(&worker->entry); +- rt_unlock_idle_list(pool); + worker->flags |= WORKER_DIE; + wake_up_process(worker->task); + } +@@ -1919,7 +1871,7 @@ static void idle_worker_timeout(struct timer_list *t) + { + struct worker_pool *pool = from_timer(pool, t, idle_timer); + +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + + while (too_many_workers(pool)) { + struct worker *worker; +@@ -1937,7 +1889,7 @@ static void idle_worker_timeout(struct timer_list *t) + destroy_worker(worker); + } + +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + } + + static void send_mayday(struct work_struct *work) +@@ -1968,8 +1920,8 @@ static void pool_mayday_timeout(struct timer_list *t) + struct worker_pool *pool = from_timer(pool, t, mayday_timer); + struct work_struct *work; + +- spin_lock_irq(&pool->lock); +- spin_lock(&wq_mayday_lock); /* for wq->maydays */ ++ raw_spin_lock_irq(&pool->lock); ++ raw_spin_lock(&wq_mayday_lock); /* for wq->maydays */ + + if (need_to_create_worker(pool)) { + /* +@@ -1982,8 +1934,8 @@ static void pool_mayday_timeout(struct timer_list *t) + send_mayday(work); + } + +- spin_unlock(&wq_mayday_lock); +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock(&wq_mayday_lock); ++ raw_spin_unlock_irq(&pool->lock); + + mod_timer(&pool->mayday_timer, jiffies + MAYDAY_INTERVAL); + } +@@ -2002,7 +1954,7 @@ static void pool_mayday_timeout(struct timer_list *t) + * may_start_working() %true. + * + * LOCKING: +- * spin_lock_irq(pool->lock) which may be released and regrabbed ++ * raw_spin_lock_irq(pool->lock) which may be released and regrabbed + * multiple times. Does GFP_KERNEL allocations. Called only from + * manager. + */ +@@ -2011,7 +1963,7 @@ __releases(&pool->lock) + __acquires(&pool->lock) + { + restart: +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + + /* if we don't make progress in MAYDAY_INITIAL_TIMEOUT, call for help */ + mod_timer(&pool->mayday_timer, jiffies + MAYDAY_INITIAL_TIMEOUT); +@@ -2027,7 +1979,7 @@ __acquires(&pool->lock) + } + + del_timer_sync(&pool->mayday_timer); +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + /* + * This is necessary even after a new worker was just successfully + * created as @pool->lock was dropped and the new worker might have +@@ -2050,7 +2002,7 @@ __acquires(&pool->lock) + * and may_start_working() is true. + * + * CONTEXT: +- * spin_lock_irq(pool->lock) which may be released and regrabbed ++ * raw_spin_lock_irq(pool->lock) which may be released and regrabbed + * multiple times. Does GFP_KERNEL allocations. + * + * Return: +@@ -2073,7 +2025,7 @@ static bool manage_workers(struct worker *worker) + + pool->manager = NULL; + pool->flags &= ~POOL_MANAGER_ACTIVE; +- wake_up(&wq_manager_wait); ++ swake_up_one(&wq_manager_wait); + return true; + } + +@@ -2089,7 +2041,7 @@ static bool manage_workers(struct worker *worker) + * call this function to process a work. + * + * CONTEXT: +- * spin_lock_irq(pool->lock) which is released and regrabbed. ++ * raw_spin_lock_irq(pool->lock) which is released and regrabbed. + */ + static void process_one_work(struct worker *worker, struct work_struct *work) + __releases(&pool->lock) +@@ -2171,7 +2123,7 @@ __acquires(&pool->lock) + */ + set_work_pool_and_clear_pending(work, pool->id); + +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + + lock_map_acquire(&pwq->wq->lockdep_map); + lock_map_acquire(&lockdep_map); +@@ -2226,7 +2178,7 @@ __acquires(&pool->lock) + */ + cond_resched(); + +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + + /* clear cpu intensive status */ + if (unlikely(cpu_intensive)) +@@ -2249,7 +2201,7 @@ __acquires(&pool->lock) + * fetches a work from the top and executes it. + * + * CONTEXT: +- * spin_lock_irq(pool->lock) which may be released and regrabbed ++ * raw_spin_lock_irq(pool->lock) which may be released and regrabbed + * multiple times. + */ + static void process_scheduled_works(struct worker *worker) +@@ -2291,11 +2243,11 @@ static int worker_thread(void *__worker) + /* tell the scheduler that this is a workqueue worker */ + set_pf_worker(true); + woke_up: +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + + /* am I supposed to die? */ + if (unlikely(worker->flags & WORKER_DIE)) { +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + WARN_ON_ONCE(!list_empty(&worker->entry)); + set_pf_worker(false); + +@@ -2361,7 +2313,7 @@ static int worker_thread(void *__worker) + */ + worker_enter_idle(worker); + __set_current_state(TASK_IDLE); +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + schedule(); + goto woke_up; + } +@@ -2415,7 +2367,7 @@ static int rescuer_thread(void *__rescuer) + should_stop = kthread_should_stop(); + + /* see whether any pwq is asking for help */ +- spin_lock_irq(&wq_mayday_lock); ++ raw_spin_lock_irq(&wq_mayday_lock); + + while (!list_empty(&wq->maydays)) { + struct pool_workqueue *pwq = list_first_entry(&wq->maydays, +@@ -2427,11 +2379,11 @@ static int rescuer_thread(void *__rescuer) + __set_current_state(TASK_RUNNING); + list_del_init(&pwq->mayday_node); + +- spin_unlock_irq(&wq_mayday_lock); ++ raw_spin_unlock_irq(&wq_mayday_lock); + + worker_attach_to_pool(rescuer, pool); + +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + + /* + * Slurp in all works issued via this workqueue and +@@ -2460,7 +2412,7 @@ static int rescuer_thread(void *__rescuer) + * incur MAYDAY_INTERVAL delay inbetween. + */ + if (need_to_create_worker(pool)) { +- spin_lock(&wq_mayday_lock); ++ raw_spin_lock(&wq_mayday_lock); + /* + * Queue iff we aren't racing destruction + * and somebody else hasn't queued it already. +@@ -2469,7 +2421,7 @@ static int rescuer_thread(void *__rescuer) + get_pwq(pwq); + list_add_tail(&pwq->mayday_node, &wq->maydays); + } +- spin_unlock(&wq_mayday_lock); ++ raw_spin_unlock(&wq_mayday_lock); + } + } + +@@ -2487,14 +2439,14 @@ static int rescuer_thread(void *__rescuer) + if (need_more_worker(pool)) + wake_up_worker(pool); + +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + + worker_detach_from_pool(rescuer); + +- spin_lock_irq(&wq_mayday_lock); ++ raw_spin_lock_irq(&wq_mayday_lock); + } + +- spin_unlock_irq(&wq_mayday_lock); ++ raw_spin_unlock_irq(&wq_mayday_lock); + + if (should_stop) { + __set_current_state(TASK_RUNNING); +@@ -2574,7 +2526,7 @@ static void wq_barrier_func(struct work_struct *work) + * underneath us, so we can't reliably determine pwq from @target. + * + * CONTEXT: +- * spin_lock_irq(pool->lock). ++ * raw_spin_lock_irq(pool->lock). + */ + static void insert_wq_barrier(struct pool_workqueue *pwq, + struct wq_barrier *barr, +@@ -2661,7 +2613,7 @@ static bool flush_workqueue_prep_pwqs(struct workqueue_struct *wq, + for_each_pwq(pwq, wq) { + struct worker_pool *pool = pwq->pool; + +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + + if (flush_color >= 0) { + WARN_ON_ONCE(pwq->flush_color != -1); +@@ -2678,7 +2630,7 @@ static bool flush_workqueue_prep_pwqs(struct workqueue_struct *wq, + pwq->work_color = work_color; + } + +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + } + + if (flush_color >= 0 && atomic_dec_and_test(&wq->nr_pwqs_to_flush)) +@@ -2878,9 +2830,9 @@ void drain_workqueue(struct workqueue_struct *wq) + for_each_pwq(pwq, wq) { + bool drained; + +- spin_lock_irq(&pwq->pool->lock); ++ raw_spin_lock_irq(&pwq->pool->lock); + drained = !pwq->nr_active && list_empty(&pwq->delayed_works); +- spin_unlock_irq(&pwq->pool->lock); ++ raw_spin_unlock_irq(&pwq->pool->lock); + + if (drained) + continue; +@@ -2916,7 +2868,7 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, + return false; + } + +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + /* see the comment in try_to_grab_pending() with the same code */ + pwq = get_work_pwq(work); + if (pwq) { +@@ -2932,7 +2884,7 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, + check_flush_dependency(pwq->wq, work); + + insert_wq_barrier(pwq, barr, work, worker); +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + + /* + * Force a lock recursion deadlock when using flush_work() inside a +@@ -2951,7 +2903,7 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, + rcu_read_unlock(); + return true; + already_gone: +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + rcu_read_unlock(); + return false; + } +@@ -3052,7 +3004,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); +- local_unlock_irqrestore(pendingb_lock, flags); ++ local_irq_restore(flags); + + /* + * This allows canceling during early boot. We know that @work +@@ -3113,10 +3065,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); + */ + bool flush_delayed_work(struct delayed_work *dwork) + { +- local_lock_irq(pendingb_lock); ++ local_irq_disable(); + if (del_timer_sync(&dwork->timer)) + __queue_work(dwork->cpu, dwork->wq, &dwork->work); +- local_unlock_irq(pendingb_lock); ++ local_irq_enable(); + return flush_work(&dwork->work); + } + EXPORT_SYMBOL(flush_delayed_work); +@@ -3154,7 +3106,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)); +- local_unlock_irqrestore(pendingb_lock, flags); ++ local_irq_restore(flags); + return ret; + } + +@@ -3264,7 +3216,7 @@ EXPORT_SYMBOL_GPL(execute_in_process_context); + * + * Undo alloc_workqueue_attrs(). + */ +-void free_workqueue_attrs(struct workqueue_attrs *attrs) ++static void free_workqueue_attrs(struct workqueue_attrs *attrs) + { + if (attrs) { + free_cpumask_var(attrs->cpumask); +@@ -3274,21 +3226,20 @@ void free_workqueue_attrs(struct workqueue_attrs *attrs) + + /** + * alloc_workqueue_attrs - allocate a workqueue_attrs +- * @gfp_mask: allocation mask to use + * + * Allocate a new workqueue_attrs, initialize with default settings and + * return it. + * + * Return: The allocated new workqueue_attr on success. %NULL on failure. + */ +-struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask) ++static struct workqueue_attrs *alloc_workqueue_attrs(void) + { + struct workqueue_attrs *attrs; + +- attrs = kzalloc(sizeof(*attrs), gfp_mask); ++ attrs = kzalloc(sizeof(*attrs), GFP_KERNEL); + if (!attrs) + goto fail; +- if (!alloc_cpumask_var(&attrs->cpumask, gfp_mask)) ++ if (!alloc_cpumask_var(&attrs->cpumask, GFP_KERNEL)) + goto fail; + + cpumask_copy(attrs->cpumask, cpu_possible_mask); +@@ -3345,7 +3296,7 @@ static bool wqattrs_equal(const struct workqueue_attrs *a, + */ + static int init_worker_pool(struct worker_pool *pool) + { +- spin_lock_init(&pool->lock); ++ raw_spin_lock_init(&pool->lock); + pool->id = -1; + pool->cpu = -1; + pool->node = NUMA_NO_NODE; +@@ -3366,7 +3317,7 @@ static int init_worker_pool(struct worker_pool *pool) + pool->refcnt = 1; + + /* shouldn't fail above this point */ +- pool->attrs = alloc_workqueue_attrs(GFP_KERNEL); ++ pool->attrs = alloc_workqueue_attrs(); + if (!pool->attrs) + return -ENOMEM; + return 0; +@@ -3431,15 +3382,15 @@ static void put_unbound_pool(struct worker_pool *pool) + * @pool's workers from blocking on attach_mutex. We're the last + * manager and @pool gets freed with the flag set. + */ +- spin_lock_irq(&pool->lock); +- wait_event_lock_irq(wq_manager_wait, ++ raw_spin_lock_irq(&pool->lock); ++ swait_event_lock_irq(wq_manager_wait, + !(pool->flags & POOL_MANAGER_ACTIVE), pool->lock); + pool->flags |= POOL_MANAGER_ACTIVE; + + while ((worker = first_idle_worker(pool))) + destroy_worker(worker); + WARN_ON(pool->nr_workers || pool->nr_idle); +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + + mutex_lock(&wq_pool_attach_mutex); + if (!list_empty(&pool->workers)) +@@ -3593,7 +3544,7 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq) + return; + + /* this function can be called during early boot w/ irq disabled */ +- spin_lock_irqsave(&pwq->pool->lock, flags); ++ raw_spin_lock_irqsave(&pwq->pool->lock, flags); + + /* + * During [un]freezing, the caller is responsible for ensuring that +@@ -3616,7 +3567,7 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq) + pwq->max_active = 0; + } + +- spin_unlock_irqrestore(&pwq->pool->lock, flags); ++ raw_spin_unlock_irqrestore(&pwq->pool->lock, flags); + } + + /* initialize newly alloced @pwq which is associated with @wq and @pool */ +@@ -3789,8 +3740,8 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, + + ctx = kzalloc(struct_size(ctx, pwq_tbl, nr_node_ids), GFP_KERNEL); + +- new_attrs = alloc_workqueue_attrs(GFP_KERNEL); +- tmp_attrs = alloc_workqueue_attrs(GFP_KERNEL); ++ new_attrs = alloc_workqueue_attrs(); ++ tmp_attrs = alloc_workqueue_attrs(); + if (!ctx || !new_attrs || !tmp_attrs) + goto out_free; + +@@ -3926,7 +3877,7 @@ static int apply_workqueue_attrs_locked(struct workqueue_struct *wq, + * + * Return: 0 on success and -errno on failure. + */ +-int apply_workqueue_attrs(struct workqueue_struct *wq, ++static int apply_workqueue_attrs(struct workqueue_struct *wq, + const struct workqueue_attrs *attrs) + { + int ret; +@@ -3937,7 +3888,6 @@ int apply_workqueue_attrs(struct workqueue_struct *wq, + + return ret; + } +-EXPORT_SYMBOL_GPL(apply_workqueue_attrs); + + /** + * wq_update_unbound_numa - update NUMA affinity of a wq for CPU hot[un]plug +@@ -4015,9 +3965,9 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu, + + use_dfl_pwq: + mutex_lock(&wq->mutex); +- spin_lock_irq(&wq->dfl_pwq->pool->lock); ++ raw_spin_lock_irq(&wq->dfl_pwq->pool->lock); + get_pwq(wq->dfl_pwq); +- spin_unlock_irq(&wq->dfl_pwq->pool->lock); ++ raw_spin_unlock_irq(&wq->dfl_pwq->pool->lock); + old_pwq = numa_pwq_tbl_install(wq, node, wq->dfl_pwq); + out_unlock: + mutex_unlock(&wq->mutex); +@@ -4136,7 +4086,7 @@ struct workqueue_struct *__alloc_workqueue_key(const char *fmt, + return NULL; + + if (flags & WQ_UNBOUND) { +- wq->unbound_attrs = alloc_workqueue_attrs(GFP_KERNEL); ++ wq->unbound_attrs = alloc_workqueue_attrs(); + if (!wq->unbound_attrs) + goto err_free_wq; + } +@@ -4223,9 +4173,9 @@ void destroy_workqueue(struct workqueue_struct *wq) + struct worker *rescuer = wq->rescuer; + + /* this prevents new queueing */ +- spin_lock_irq(&wq_mayday_lock); ++ raw_spin_lock_irq(&wq_mayday_lock); + wq->rescuer = NULL; +- spin_unlock_irq(&wq_mayday_lock); ++ raw_spin_unlock_irq(&wq_mayday_lock); + + /* rescuer will empty maydays list before exiting */ + kthread_stop(rescuer->task); +@@ -4420,10 +4370,10 @@ unsigned int work_busy(struct work_struct *work) + rcu_read_lock(); + pool = get_work_pool(work); + if (pool) { +- spin_lock_irqsave(&pool->lock, flags); ++ raw_spin_lock_irqsave(&pool->lock, flags); + if (find_worker_executing_work(pool, work)) + ret |= WORK_BUSY_RUNNING; +- spin_unlock_irqrestore(&pool->lock, flags); ++ raw_spin_unlock_irqrestore(&pool->lock, flags); + } + rcu_read_unlock(); + +@@ -4630,10 +4580,10 @@ void show_workqueue_state(void) + pr_info("workqueue %s: flags=0x%x\n", wq->name, wq->flags); + + for_each_pwq(pwq, wq) { +- spin_lock_irqsave(&pwq->pool->lock, flags); ++ raw_spin_lock_irqsave(&pwq->pool->lock, flags); + if (pwq->nr_active || !list_empty(&pwq->delayed_works)) + show_pwq(pwq); +- spin_unlock_irqrestore(&pwq->pool->lock, flags); ++ raw_spin_unlock_irqrestore(&pwq->pool->lock, flags); + /* + * We could be printing a lot from atomic context, e.g. + * sysrq-t -> show_workqueue_state(). Avoid triggering +@@ -4647,7 +4597,7 @@ void show_workqueue_state(void) + struct worker *worker; + bool first = true; + +- spin_lock_irqsave(&pool->lock, flags); ++ raw_spin_lock_irqsave(&pool->lock, flags); + if (pool->nr_workers == pool->nr_idle) + goto next_pool; + +@@ -4666,7 +4616,7 @@ void show_workqueue_state(void) + } + pr_cont("\n"); + next_pool: +- spin_unlock_irqrestore(&pool->lock, flags); ++ raw_spin_unlock_irqrestore(&pool->lock, flags); + /* + * We could be printing a lot from atomic context, e.g. + * sysrq-t -> show_workqueue_state(). Avoid triggering +@@ -4696,7 +4646,7 @@ void wq_worker_comm(char *buf, size_t size, struct task_struct *task) + struct worker_pool *pool = worker->pool; + + if (pool) { +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + /* + * ->desc tracks information (wq name or + * set_worker_desc()) for the latest execution. If +@@ -4710,7 +4660,7 @@ void wq_worker_comm(char *buf, size_t size, struct task_struct *task) + scnprintf(buf + off, size - off, "-%s", + worker->desc); + } +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + } + } + +@@ -4741,7 +4691,7 @@ static void unbind_workers(int cpu) + + for_each_cpu_worker_pool(pool, cpu) { + mutex_lock(&wq_pool_attach_mutex); +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + + /* + * We've blocked all attach/detach operations. Make all workers +@@ -4755,7 +4705,7 @@ static void unbind_workers(int cpu) + + pool->flags |= POOL_DISASSOCIATED; + +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + mutex_unlock(&wq_pool_attach_mutex); + + /* +@@ -4781,9 +4731,9 @@ static void unbind_workers(int cpu) + * worker blocking could lead to lengthy stalls. Kick off + * unbound chain execution of currently pending work items. + */ +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + wake_up_worker(pool); +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + } + } + +@@ -4810,7 +4760,7 @@ static void rebind_workers(struct worker_pool *pool) + WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, + pool->attrs->cpumask) < 0); + +- spin_lock_irq(&pool->lock); ++ raw_spin_lock_irq(&pool->lock); + + pool->flags &= ~POOL_DISASSOCIATED; + +@@ -4849,7 +4799,7 @@ static void rebind_workers(struct worker_pool *pool) + WRITE_ONCE(worker->flags, worker_flags); + } + +- spin_unlock_irq(&pool->lock); ++ raw_spin_unlock_irq(&pool->lock); + } + + /** +@@ -5301,7 +5251,7 @@ static struct workqueue_attrs *wq_sysfs_prep_attrs(struct workqueue_struct *wq) + + lockdep_assert_held(&wq_pool_mutex); + +- attrs = alloc_workqueue_attrs(GFP_KERNEL); ++ attrs = alloc_workqueue_attrs(); + if (!attrs) + return NULL; + +@@ -5723,7 +5673,7 @@ static void __init wq_numa_init(void) + return; + } + +- wq_update_unbound_numa_attrs_buf = alloc_workqueue_attrs(GFP_KERNEL); ++ wq_update_unbound_numa_attrs_buf = alloc_workqueue_attrs(); + BUG_ON(!wq_update_unbound_numa_attrs_buf); + + /* +@@ -5798,7 +5748,7 @@ int __init workqueue_init_early(void) + for (i = 0; i < NR_STD_WORKER_POOLS; i++) { + struct workqueue_attrs *attrs; + +- BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); ++ BUG_ON(!(attrs = alloc_workqueue_attrs())); + attrs->nice = std_nice[i]; + unbound_std_wq_attrs[i] = attrs; + +@@ -5807,7 +5757,7 @@ int __init workqueue_init_early(void) + * guaranteed by max_active which is enforced by pwqs. + * Turn off NUMA so that dfl_pwq is used for all nodes. + */ +- BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); ++ BUG_ON(!(attrs = alloc_workqueue_attrs())); + attrs->nice = std_nice[i]; + attrs->no_numa = true; + ordered_wq_attrs[i] = attrs; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0290-i2c-exynos5-Remove-IRQF_ONESHOT.patch b/kernel/patches-4.19.x-rt/0290-i2c-exynos5-Remove-IRQF_ONESHOT.patch new file mode 100644 index 000000000..af6af06ca --- /dev/null +++ b/kernel/patches-4.19.x-rt/0290-i2c-exynos5-Remove-IRQF_ONESHOT.patch @@ -0,0 +1,47 @@ +From 7c3f8afe7bf7bfc55e4dd00b2cdc0471d7fa56b4 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Tue, 13 Aug 2019 12:30:12 +0200 +Subject: [PATCH 290/328] i2c: exynos5: Remove IRQF_ONESHOT + +[ Upstream commit 4b217df0ab3f7910c96e42091cc7d9f221d05f01 ] + +The drivers sets IRQF_ONESHOT and passes only a primary handler. The IRQ +is masked while the primary is handler is invoked independently of +IRQF_ONESHOT. +With IRQF_ONESHOT the core code will not force-thread the interrupt and +this is probably not intended. I *assume* that the original author copied +the IRQ registration from another driver which passed a primary and +secondary handler and removed the secondary handler but keeping the +ONESHOT flag. + +Remove IRQF_ONESHOT. + +Reported-by: Benjamin Rouxel +Tested-by: Benjamin Rouxel +Cc: Kukjin Kim +Cc: Krzysztof Kozlowski +Cc: linux-samsung-soc@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + drivers/i2c/busses/i2c-exynos5.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c +index c1ce2299a76e..5c57ecf4b79e 100644 +--- a/drivers/i2c/busses/i2c-exynos5.c ++++ b/drivers/i2c/busses/i2c-exynos5.c +@@ -800,9 +800,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev) + } + + ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq, +- IRQF_NO_SUSPEND | IRQF_ONESHOT, +- dev_name(&pdev->dev), i2c); +- ++ IRQF_NO_SUSPEND, dev_name(&pdev->dev), i2c); + if (ret != 0) { + dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", i2c->irq); + goto err_clk; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0291-i2c-hix5hd2-Remove-IRQF_ONESHOT.patch b/kernel/patches-4.19.x-rt/0291-i2c-hix5hd2-Remove-IRQF_ONESHOT.patch new file mode 100644 index 000000000..0874dda06 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0291-i2c-hix5hd2-Remove-IRQF_ONESHOT.patch @@ -0,0 +1,41 @@ +From d1b1f2e9ff0c025196d564544a0b808fdb73cc16 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Tue, 13 Aug 2019 12:30:37 +0200 +Subject: [PATCH 291/328] i2c: hix5hd2: Remove IRQF_ONESHOT + +[ Upstream commit e88b481f3f86f11e3243e0808a830e5ca5782a9d ] + +The drivers sets IRQF_ONESHOT and passes only a primary handler. The IRQ +is masked while the primary is handler is invoked independently of +IRQF_ONESHOT. +With IRQF_ONESHOT the core code will not force-thread the interrupt and +this is probably not intended. I *assume* that the original author copied +the IRQ registration from another driver which passed a primary and +secondary handler and removed the secondary handler but keeping the +ONESHOT flag. + +Remove IRQF_ONESHOT. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + drivers/i2c/busses/i2c-hix5hd2.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c +index 061a4bfb03f4..575aff50b19a 100644 +--- a/drivers/i2c/busses/i2c-hix5hd2.c ++++ b/drivers/i2c/busses/i2c-hix5hd2.c +@@ -449,8 +449,7 @@ static int hix5hd2_i2c_probe(struct platform_device *pdev) + hix5hd2_i2c_init(priv); + + ret = devm_request_irq(&pdev->dev, irq, hix5hd2_i2c_irq, +- IRQF_NO_SUSPEND | IRQF_ONESHOT, +- dev_name(&pdev->dev), priv); ++ IRQF_NO_SUSPEND, dev_name(&pdev->dev), priv); + if (ret != 0) { + dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", irq); + goto err_clk; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0292-sched-deadline-Ensure-inactive_timer-runs-in-hardirq.patch b/kernel/patches-4.19.x-rt/0292-sched-deadline-Ensure-inactive_timer-runs-in-hardirq.patch new file mode 100644 index 000000000..b4d0f07b6 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0292-sched-deadline-Ensure-inactive_timer-runs-in-hardirq.patch @@ -0,0 +1,49 @@ +From adb807c2fbd6d2f64515708367de2cae2b106925 Mon Sep 17 00:00:00 2001 +From: Juri Lelli +Date: Wed, 31 Jul 2019 12:37:15 +0200 +Subject: [PATCH 292/328] sched/deadline: Ensure inactive_timer runs in hardirq + context + +[ Upstream commit ba94e7aed7405c58251b1380e6e7d73aa8284b41 ] + +SCHED_DEADLINE inactive timer needs to run in hardirq context (as +dl_task_timer already does) on PREEMPT_RT + +Change the mode to HRTIMER_MODE_REL_HARD. + +[ tglx: Fixed up the start site, so mode debugging works ] + +Signed-off-by: Juri Lelli +Signed-off-by: Thomas Gleixner +Link: https://lkml.kernel.org/r/20190731103715.4047-1-juri.lelli@redhat.com +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/deadline.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c +index 974a8f9b615a..929167a1d991 100644 +--- a/kernel/sched/deadline.c ++++ b/kernel/sched/deadline.c +@@ -287,7 +287,7 @@ static void task_non_contending(struct task_struct *p) + + dl_se->dl_non_contending = 1; + get_task_struct(p); +- hrtimer_start(timer, ns_to_ktime(zerolag_time), HRTIMER_MODE_REL); ++ hrtimer_start(timer, ns_to_ktime(zerolag_time), HRTIMER_MODE_REL_HARD); + } + + static void task_contending(struct sched_dl_entity *dl_se, int flags) +@@ -1325,7 +1325,7 @@ void init_dl_inactive_task_timer(struct sched_dl_entity *dl_se) + { + struct hrtimer *timer = &dl_se->inactive_timer; + +- hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); ++ hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); + timer->function = inactive_task_timer; + } + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0293-thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch b/kernel/patches-4.19.x-rt/0293-thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch new file mode 100644 index 000000000..8c27d1548 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0293-thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch @@ -0,0 +1,119 @@ +From 40e46d2cf474897d209be74b3c6471dbdf4f2aea Mon Sep 17 00:00:00 2001 +From: Clark Williams +Date: Mon, 15 Jul 2019 15:25:00 -0500 +Subject: [PATCH 293/328] thermal/x86_pkg_temp: make pkg_temp_lock a raw + spinlock + +[ Upstream commit 8b03bb3ea7861b70b506199a69b1c8f81fe2d4d0 ] + +The spinlock pkg_temp_lock has the potential of being taken in atomic +context on v5.2-rt PREEMPT_RT. It's static and limited scope so +go ahead and make it a raw spinlock. + +Signed-off-by: Clark Williams +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + drivers/thermal/x86_pkg_temp_thermal.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c +index 1ef937d799e4..540becb78a0f 100644 +--- a/drivers/thermal/x86_pkg_temp_thermal.c ++++ b/drivers/thermal/x86_pkg_temp_thermal.c +@@ -75,7 +75,7 @@ static int max_packages __read_mostly; + /* Array of package pointers */ + static struct pkg_device **packages; + /* Serializes interrupt notification, work and hotplug */ +-static DEFINE_SPINLOCK(pkg_temp_lock); ++static DEFINE_RAW_SPINLOCK(pkg_temp_lock); + /* Protects zone operation in the work function against hotplug removal */ + static DEFINE_MUTEX(thermal_zone_mutex); + +@@ -291,12 +291,12 @@ static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work) + u64 msr_val, wr_val; + + mutex_lock(&thermal_zone_mutex); +- spin_lock_irq(&pkg_temp_lock); ++ raw_spin_lock_irq(&pkg_temp_lock); + ++pkg_work_cnt; + + pkgdev = pkg_temp_thermal_get_dev(cpu); + if (!pkgdev) { +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + mutex_unlock(&thermal_zone_mutex); + return; + } +@@ -310,7 +310,7 @@ static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work) + } + + enable_pkg_thres_interrupt(); +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + + /* + * If tzone is not NULL, then thermal_zone_mutex will prevent the +@@ -335,7 +335,7 @@ static int pkg_thermal_notify(u64 msr_val) + struct pkg_device *pkgdev; + unsigned long flags; + +- spin_lock_irqsave(&pkg_temp_lock, flags); ++ raw_spin_lock_irqsave(&pkg_temp_lock, flags); + ++pkg_interrupt_cnt; + + disable_pkg_thres_interrupt(); +@@ -347,7 +347,7 @@ static int pkg_thermal_notify(u64 msr_val) + pkg_thermal_schedule_work(pkgdev->cpu, &pkgdev->work); + } + +- spin_unlock_irqrestore(&pkg_temp_lock, flags); ++ raw_spin_unlock_irqrestore(&pkg_temp_lock, flags); + return 0; + } + +@@ -393,9 +393,9 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) + pkgdev->msr_pkg_therm_high); + + cpumask_set_cpu(cpu, &pkgdev->cpumask); +- spin_lock_irq(&pkg_temp_lock); ++ raw_spin_lock_irq(&pkg_temp_lock); + packages[pkgid] = pkgdev; +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + return 0; + } + +@@ -432,7 +432,7 @@ static int pkg_thermal_cpu_offline(unsigned int cpu) + } + + /* Protect against work and interrupts */ +- spin_lock_irq(&pkg_temp_lock); ++ raw_spin_lock_irq(&pkg_temp_lock); + + /* + * Check whether this cpu was the current target and store the new +@@ -464,9 +464,9 @@ static int pkg_thermal_cpu_offline(unsigned int cpu) + * To cancel the work we need to drop the lock, otherwise + * we might deadlock if the work needs to be flushed. + */ +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + cancel_delayed_work_sync(&pkgdev->work); +- spin_lock_irq(&pkg_temp_lock); ++ raw_spin_lock_irq(&pkg_temp_lock); + /* + * If this is not the last cpu in the package and the work + * did not run after we dropped the lock above, then we +@@ -477,7 +477,7 @@ static int pkg_thermal_cpu_offline(unsigned int cpu) + pkg_thermal_schedule_work(target, &pkgdev->work); + } + +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + + /* Final cleanup if this is the last cpu */ + if (lastcpu) +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0294-dma-buf-Use-seqlock_t-instread-disabling-preemption.patch b/kernel/patches-4.19.x-rt/0294-dma-buf-Use-seqlock_t-instread-disabling-preemption.patch new file mode 100644 index 000000000..acc133923 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0294-dma-buf-Use-seqlock_t-instread-disabling-preemption.patch @@ -0,0 +1,295 @@ +From fb3773dcd97159de33e77ec876a5ec0f3d70d576 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 14 Aug 2019 16:38:43 +0200 +Subject: [PATCH 294/328] dma-buf: Use seqlock_t instread disabling preemption + +[ Upstream commit 240610aa31094f51f299f06eb8dae8d4cd8d4500 ] + +"dma reservation" disables preemption while acquiring the write access +for "seqcount" and then may acquire a spinlock_t. + +Replace the seqcount with a seqlock_t which provides seqcount like +semantic and lock for writer. + +Link: https://lkml.kernel.org/r/f410b429-db86-f81c-7c67-f563fa808b62@free.fr +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + drivers/dma-buf/dma-buf.c | 8 ++-- + drivers/dma-buf/reservation.c | 43 +++++++------------ + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 +-- + drivers/gpu/drm/i915/i915_gem.c | 10 ++--- + include/linux/reservation.h | 4 +- + 5 files changed, 29 insertions(+), 42 deletions(-) + +diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c +index 69842145c223..4c3ef46e7149 100644 +--- a/drivers/dma-buf/dma-buf.c ++++ b/drivers/dma-buf/dma-buf.c +@@ -179,7 +179,7 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll) + return 0; + + retry: +- seq = read_seqcount_begin(&resv->seq); ++ seq = read_seqbegin(&resv->seq); + rcu_read_lock(); + + fobj = rcu_dereference(resv->fence); +@@ -188,7 +188,7 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll) + else + shared_count = 0; + fence_excl = rcu_dereference(resv->fence_excl); +- if (read_seqcount_retry(&resv->seq, seq)) { ++ if (read_seqretry(&resv->seq, seq)) { + rcu_read_unlock(); + goto retry; + } +@@ -1046,12 +1046,12 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused) + + robj = buf_obj->resv; + while (true) { +- seq = read_seqcount_begin(&robj->seq); ++ seq = read_seqbegin(&robj->seq); + rcu_read_lock(); + fobj = rcu_dereference(robj->fence); + shared_count = fobj ? fobj->shared_count : 0; + fence = rcu_dereference(robj->fence_excl); +- if (!read_seqcount_retry(&robj->seq, seq)) ++ if (!read_seqretry(&robj->seq, seq)) + break; + rcu_read_unlock(); + } +diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c +index 49ab09468ba1..f11d58492216 100644 +--- a/drivers/dma-buf/reservation.c ++++ b/drivers/dma-buf/reservation.c +@@ -109,8 +109,7 @@ reservation_object_add_shared_inplace(struct reservation_object *obj, + + dma_fence_get(fence); + +- preempt_disable(); +- write_seqcount_begin(&obj->seq); ++ write_seqlock(&obj->seq); + + for (i = 0; i < fobj->shared_count; ++i) { + struct dma_fence *old_fence; +@@ -121,8 +120,7 @@ reservation_object_add_shared_inplace(struct reservation_object *obj, + if (old_fence->context == fence->context) { + /* memory barrier is added by write_seqcount_begin */ + RCU_INIT_POINTER(fobj->shared[i], fence); +- write_seqcount_end(&obj->seq); +- preempt_enable(); ++ write_sequnlock(&obj->seq); + + dma_fence_put(old_fence); + return; +@@ -146,8 +144,7 @@ reservation_object_add_shared_inplace(struct reservation_object *obj, + fobj->shared_count++; + } + +- write_seqcount_end(&obj->seq); +- preempt_enable(); ++ write_sequnlock(&obj->seq); + + dma_fence_put(signaled); + } +@@ -191,15 +188,13 @@ reservation_object_add_shared_replace(struct reservation_object *obj, + fobj->shared_count++; + + done: +- preempt_disable(); +- write_seqcount_begin(&obj->seq); ++ write_seqlock(&obj->seq); + /* + * RCU_INIT_POINTER can be used here, + * seqcount provides the necessary barriers + */ + RCU_INIT_POINTER(obj->fence, fobj); +- write_seqcount_end(&obj->seq); +- preempt_enable(); ++ write_sequnlock(&obj->seq); + + if (!old) + return; +@@ -259,14 +254,11 @@ void reservation_object_add_excl_fence(struct reservation_object *obj, + if (fence) + dma_fence_get(fence); + +- preempt_disable(); +- write_seqcount_begin(&obj->seq); +- /* write_seqcount_begin provides the necessary memory barrier */ ++ write_seqlock(&obj->seq); + RCU_INIT_POINTER(obj->fence_excl, fence); + if (old) + old->shared_count = 0; +- write_seqcount_end(&obj->seq); +- preempt_enable(); ++ write_sequnlock(&obj->seq); + + /* inplace update, no shared fences */ + while (i--) +@@ -349,13 +341,10 @@ int reservation_object_copy_fences(struct reservation_object *dst, + src_list = reservation_object_get_list(dst); + old = reservation_object_get_excl(dst); + +- preempt_disable(); +- write_seqcount_begin(&dst->seq); +- /* write_seqcount_begin provides the necessary memory barrier */ ++ write_seqlock(&dst->seq); + RCU_INIT_POINTER(dst->fence_excl, new); + RCU_INIT_POINTER(dst->fence, dst_list); +- write_seqcount_end(&dst->seq); +- preempt_enable(); ++ write_sequnlock(&dst->seq); + + if (src_list) + kfree_rcu(src_list, rcu); +@@ -396,7 +385,7 @@ int reservation_object_get_fences_rcu(struct reservation_object *obj, + shared_count = i = 0; + + rcu_read_lock(); +- seq = read_seqcount_begin(&obj->seq); ++ seq = read_seqbegin(&obj->seq); + + fence_excl = rcu_dereference(obj->fence_excl); + if (fence_excl && !dma_fence_get_rcu(fence_excl)) +@@ -445,7 +434,7 @@ int reservation_object_get_fences_rcu(struct reservation_object *obj, + } + } + +- if (i != shared_count || read_seqcount_retry(&obj->seq, seq)) { ++ if (i != shared_count || read_seqretry(&obj->seq, seq)) { + while (i--) + dma_fence_put(shared[i]); + dma_fence_put(fence_excl); +@@ -494,7 +483,7 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj, + + retry: + shared_count = 0; +- seq = read_seqcount_begin(&obj->seq); ++ seq = read_seqbegin(&obj->seq); + rcu_read_lock(); + i = -1; + +@@ -541,7 +530,7 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj, + + rcu_read_unlock(); + if (fence) { +- if (read_seqcount_retry(&obj->seq, seq)) { ++ if (read_seqretry(&obj->seq, seq)) { + dma_fence_put(fence); + goto retry; + } +@@ -597,7 +586,7 @@ bool reservation_object_test_signaled_rcu(struct reservation_object *obj, + retry: + ret = true; + shared_count = 0; +- seq = read_seqcount_begin(&obj->seq); ++ seq = read_seqbegin(&obj->seq); + + if (test_all) { + unsigned i; +@@ -618,7 +607,7 @@ bool reservation_object_test_signaled_rcu(struct reservation_object *obj, + break; + } + +- if (read_seqcount_retry(&obj->seq, seq)) ++ if (read_seqretry(&obj->seq, seq)) + goto retry; + } + +@@ -631,7 +620,7 @@ bool reservation_object_test_signaled_rcu(struct reservation_object *obj, + if (ret < 0) + goto retry; + +- if (read_seqcount_retry(&obj->seq, seq)) ++ if (read_seqretry(&obj->seq, seq)) + goto retry; + } + } +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +index f92597c292fe..10c675850aac 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +@@ -261,11 +261,9 @@ static int amdgpu_amdkfd_remove_eviction_fence(struct amdgpu_bo *bo, + } + + /* Install the new fence list, seqcount provides the barriers */ +- preempt_disable(); +- write_seqcount_begin(&resv->seq); ++ write_seqlock(&resv->seq); + RCU_INIT_POINTER(resv->fence, new); +- write_seqcount_end(&resv->seq); +- preempt_enable(); ++ write_sequnlock(&resv->seq); + + /* Drop the references to the removed fences or move them to ef_list */ + for (i = j, k = 0; i < old->shared_count; ++i) { +diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c +index c7d05ac7af3c..d484e79316bf 100644 +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -516,7 +516,7 @@ i915_gem_object_wait_reservation(struct reservation_object *resv, + long timeout, + struct intel_rps_client *rps_client) + { +- unsigned int seq = __read_seqcount_begin(&resv->seq); ++ unsigned int seq = read_seqbegin(&resv->seq); + struct dma_fence *excl; + bool prune_fences = false; + +@@ -569,9 +569,9 @@ i915_gem_object_wait_reservation(struct reservation_object *resv, + * signaled and that the reservation object has not been changed (i.e. + * no new fences have been added). + */ +- if (prune_fences && !__read_seqcount_retry(&resv->seq, seq)) { ++ if (prune_fences && !read_seqretry(&resv->seq, seq)) { + if (reservation_object_trylock(resv)) { +- if (!__read_seqcount_retry(&resv->seq, seq)) ++ if (!read_seqretry(&resv->seq, seq)) + reservation_object_add_excl_fence(resv, NULL); + reservation_object_unlock(resv); + } +@@ -4615,7 +4615,7 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data, + * + */ + retry: +- seq = raw_read_seqcount(&obj->resv->seq); ++ seq = read_seqbegin(&obj->resv->seq); + + /* Translate the exclusive fence to the READ *and* WRITE engine */ + args->busy = busy_check_writer(rcu_dereference(obj->resv->fence_excl)); +@@ -4633,7 +4633,7 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data, + } + } + +- if (args->busy && read_seqcount_retry(&obj->resv->seq, seq)) ++ if (args->busy && read_seqretry(&obj->resv->seq, seq)) + goto retry; + + err = 0; +diff --git a/include/linux/reservation.h b/include/linux/reservation.h +index 02166e815afb..0b31df1af698 100644 +--- a/include/linux/reservation.h ++++ b/include/linux/reservation.h +@@ -72,7 +72,7 @@ struct reservation_object_list { + */ + struct reservation_object { + struct ww_mutex lock; +- seqcount_t seq; ++ seqlock_t seq; + + struct dma_fence __rcu *fence_excl; + struct reservation_object_list __rcu *fence; +@@ -92,7 +92,7 @@ reservation_object_init(struct reservation_object *obj) + { + ww_mutex_init(&obj->lock, &reservation_ww_class); + +- __seqcount_init(&obj->seq, reservation_seqcount_string, &reservation_seqcount_class); ++ seqlock_init(&obj->seq); + RCU_INIT_POINTER(obj->fence, NULL); + RCU_INIT_POINTER(obj->fence_excl, NULL); + obj->staged = NULL; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0295-KVM-arm-arm64-Let-the-timer-expire-in-hardirq-contex.patch b/kernel/patches-4.19.x-rt/0295-KVM-arm-arm64-Let-the-timer-expire-in-hardirq-contex.patch new file mode 100644 index 000000000..3beeb3965 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0295-KVM-arm-arm64-Let-the-timer-expire-in-hardirq-contex.patch @@ -0,0 +1,53 @@ +From 616f33b56d89956d43be1ee3a48873012a5e01f2 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Tue, 13 Aug 2019 14:29:41 +0200 +Subject: [PATCH 295/328] KVM: arm/arm64: Let the timer expire in hardirq + context on RT + +[ Upstream commit 719cc080c914045a6e35787bf4dc3ba91cfd3efb ] + +The timers are canceled from an preempt-notifier which is invoked with +disabled preemption which is not allowed on PREEMPT_RT. +The timer callback is short so in could be invoked in hard-IRQ context +on -RT. + +Let the timer expire on hard-IRQ context even on -RT. + +Signed-off-by: Thomas Gleixner +Acked-by: Marc Zyngier +Tested-by: Julien Grall +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + virt/kvm/arm/arch_timer.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c +index 17cecc96f735..217d39f40393 100644 +--- a/virt/kvm/arm/arch_timer.c ++++ b/virt/kvm/arm/arch_timer.c +@@ -67,7 +67,7 @@ static inline bool userspace_irqchip(struct kvm *kvm) + static void soft_timer_start(struct hrtimer *hrt, u64 ns) + { + hrtimer_start(hrt, ktime_add_ns(ktime_get(), ns), +- HRTIMER_MODE_ABS); ++ HRTIMER_MODE_ABS_HARD); + } + + static void soft_timer_cancel(struct hrtimer *hrt, struct work_struct *work) +@@ -638,10 +638,10 @@ void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) + vcpu_ptimer(vcpu)->cntvoff = 0; + + INIT_WORK(&timer->expired, kvm_timer_inject_irq_work); +- hrtimer_init(&timer->bg_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); ++ hrtimer_init(&timer->bg_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); + timer->bg_timer.function = kvm_bg_timer_expire; + +- hrtimer_init(&timer->phys_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); ++ hrtimer_init(&timer->phys_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); + timer->phys_timer.function = kvm_phys_timer_expire; + + vtimer->irq.irq = default_vtimer_irq.irq; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0296-x86-preempt-Check-preemption-level-before-looking-at.patch b/kernel/patches-4.19.x-rt/0296-x86-preempt-Check-preemption-level-before-looking-at.patch new file mode 100644 index 000000000..fa4c93c82 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0296-x86-preempt-Check-preemption-level-before-looking-at.patch @@ -0,0 +1,33 @@ +From 3ff694fd2d9a9eeb03196cbfbb4dd353a83d680e Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 14 Aug 2019 17:08:58 +0200 +Subject: [PATCH 296/328] x86: preempt: Check preemption level before looking + at lazy-preempt + +[ Upstream commit 19fc8557f2323c52b26561651ed4d51fc688a740 ] + +Before evaluating the lazy-preempt state it must be ensure that the +preempt-count is zero. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + arch/x86/include/asm/preempt.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h +index f66708779274..afa0e42ccdd1 100644 +--- a/arch/x86/include/asm/preempt.h ++++ b/arch/x86/include/asm/preempt.h +@@ -96,6 +96,8 @@ static __always_inline bool __preempt_count_dec_and_test(void) + if (____preempt_count_dec_and_test()) + return true; + #ifdef CONFIG_PREEMPT_LAZY ++ if (preempt_count()) ++ return false; + if (current_thread_info()->preempt_lazy_count) + return false; + return test_thread_flag(TIF_NEED_RESCHED_LAZY); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0297-hrtimer-Use-READ_ONCE-to-access-timer-base-in-hrimer.patch b/kernel/patches-4.19.x-rt/0297-hrtimer-Use-READ_ONCE-to-access-timer-base-in-hrimer.patch new file mode 100644 index 000000000..7ad84a97f --- /dev/null +++ b/kernel/patches-4.19.x-rt/0297-hrtimer-Use-READ_ONCE-to-access-timer-base-in-hrimer.patch @@ -0,0 +1,41 @@ +From 20fa662be972ae5c608f2e5c919aedc9bbdc8930 Mon Sep 17 00:00:00 2001 +From: Julien Grall +Date: Wed, 21 Aug 2019 10:24:07 +0100 +Subject: [PATCH 297/328] hrtimer: Use READ_ONCE to access timer->base in + hrimer_grab_expiry_lock() + +[ Upstream commit 2c8fdbe7ef0ad06c1a326886c5954e117b5657d6 ] + +The update to timer->base is protected by the base->cpu_base->lock(). +However, hrtimer_grab_expirty_lock() does not access it with the lock. + +So it would theorically be possible to have timer->base changed under +our feet. We need to prevent the compiler to refetch timer->base so the +check and the access is performed on the same base. + +Other access of timer->base are either done with a lock or protected +with READ_ONCE(). So use READ_ONCE() in hrtimer_grab_expirty_lock(). + +Signed-off-by: Julien Grall +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/time/hrtimer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 94d97eae0a46..d6026c170c2d 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -941,7 +941,7 @@ EXPORT_SYMBOL_GPL(hrtimer_forward); + + void hrtimer_grab_expiry_lock(const struct hrtimer *timer) + { +- struct hrtimer_clock_base *base = timer->base; ++ struct hrtimer_clock_base *base = READ_ONCE(timer->base); + + if (base && base->cpu_base) { + spin_lock(&base->cpu_base->softirq_expiry_lock); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0298-hrtimer-Don-t-grab-the-expiry-lock-for-non-soft-hrti.patch b/kernel/patches-4.19.x-rt/0298-hrtimer-Don-t-grab-the-expiry-lock-for-non-soft-hrti.patch new file mode 100644 index 000000000..ad396b51d --- /dev/null +++ b/kernel/patches-4.19.x-rt/0298-hrtimer-Don-t-grab-the-expiry-lock-for-non-soft-hrti.patch @@ -0,0 +1,40 @@ +From 3097c6c64c15f7942c9b280325c27db70de41d04 Mon Sep 17 00:00:00 2001 +From: Julien Grall +Date: Wed, 21 Aug 2019 10:24:08 +0100 +Subject: [PATCH 298/328] hrtimer: Don't grab the expiry lock for non-soft + hrtimer + +[ Upstream commit fd420354bea2f57c11f3de191dffdeea76531e76 ] + +Acquiring the lock in hrtimer_grab_expiry_lock() is designed for +sleeping-locks and should not be used with disabled interrupts. +hrtimer_cancel() may invoke hrtimer_grab_expiry_lock() also for locks +which expire in hard-IRQ context. + +Let hrtimer_cancel() invoke hrtimer_grab_expiry_lock() only for locks +which expire in softirq context. + +Signed-off-by: Julien Grall +Signed-off-by: Steven Rostedt (VMware) +[bigeasy: rewrite changelog] +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/time/hrtimer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index d6026c170c2d..49d20fe8570f 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -943,7 +943,7 @@ void hrtimer_grab_expiry_lock(const struct hrtimer *timer) + { + struct hrtimer_clock_base *base = READ_ONCE(timer->base); + +- if (base && base->cpu_base) { ++ if (timer->is_soft && base && base->cpu_base) { + spin_lock(&base->cpu_base->softirq_expiry_lock); + spin_unlock(&base->cpu_base->softirq_expiry_lock); + } +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0299-hrtimer-Prevent-using-hrtimer_grab_expiry_lock-on-mi.patch b/kernel/patches-4.19.x-rt/0299-hrtimer-Prevent-using-hrtimer_grab_expiry_lock-on-mi.patch new file mode 100644 index 000000000..10eb74f7b --- /dev/null +++ b/kernel/patches-4.19.x-rt/0299-hrtimer-Prevent-using-hrtimer_grab_expiry_lock-on-mi.patch @@ -0,0 +1,42 @@ +From 0167d3fb02b4f30f0f219f65726e5344ad871f9f Mon Sep 17 00:00:00 2001 +From: Julien Grall +Date: Wed, 21 Aug 2019 10:24:09 +0100 +Subject: [PATCH 299/328] hrtimer: Prevent using hrtimer_grab_expiry_lock() on + migration_base + +[ Upstream commit cef1b87f98823af923a386f3f69149acb212d4a1 ] + +As tglx puts it: +|If base == migration_base then there is no point to lock soft_expiry_lock +|simply because the timer is not executing the callback in soft irq context +|and the whole lock/unlock dance can be avoided. + +Furthermore, all the path leading to hrtimer_grab_expiry_lock() assumes +timer->base and timer->base->cpu_base are always non-NULL. So it is safe +to remove the NULL checks here. + +Signed-off-by: Julien Grall +Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1908211557420.2223@nanos.tec.linutronix.de +Signed-off-by: Steven Rostedt (VMware) +[bigeasy: rewrite changelog] +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/time/hrtimer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 49d20fe8570f..1a5167c68310 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -943,7 +943,7 @@ void hrtimer_grab_expiry_lock(const struct hrtimer *timer) + { + struct hrtimer_clock_base *base = READ_ONCE(timer->base); + +- if (timer->is_soft && base && base->cpu_base) { ++ if (timer->is_soft && base != &migration_base) { + spin_lock(&base->cpu_base->softirq_expiry_lock); + spin_unlock(&base->cpu_base->softirq_expiry_lock); + } +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0300-hrtimer-Add-a-missing-bracket-and-hide-migration_bas.patch b/kernel/patches-4.19.x-rt/0300-hrtimer-Add-a-missing-bracket-and-hide-migration_bas.patch new file mode 100644 index 000000000..1ff434942 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0300-hrtimer-Add-a-missing-bracket-and-hide-migration_bas.patch @@ -0,0 +1,74 @@ +From 6aecd0ba09e1dbf7afd6d646c65f732654892d29 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 4 Sep 2019 16:55:27 +0200 +Subject: [PATCH 300/328] hrtimer: Add a missing bracket and hide + `migration_base' on !SMP + +[ Upstream commit 47b6de0b7f22c28b40275aeede3993d807668c3b ] + +[ Upstream commit 5d2295f3a93b04986d069ebeaf5b07725f9096c1 ] + +The recent change to avoid taking the expiry lock when a timer is currently +migrated missed to add a bracket at the end of the if statement leading to +compile errors. Since that commit the variable `migration_base' is always +used but it is only available on SMP configuration thus leading to another +compile error. The changelog says "The timer base and base->cpu_base +cannot be NULL in the code path", so it is safe to limit this check to SMP +configurations only. + +Add the missing bracket to the if statement and hide `migration_base' +behind CONFIG_SMP bars. + +[ tglx: Mark the functions inline ... ] + +Fixes: 68b2c8c1e4210 ("hrtimer: Don't take expiry_lock when timer is currently migrated") +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Thomas Gleixner +Link: https://lkml.kernel.org/r/20190904145527.eah7z56ntwobqm6j@linutronix.de +Signed-off-by: Steven Rostedt (VMware) +[bigeasy: port back to RT] +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/time/hrtimer.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 1a5167c68310..e54a95de8b79 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -150,6 +150,11 @@ static struct hrtimer_cpu_base migration_cpu_base = { + + #define migration_base migration_cpu_base.clock_base[0] + ++static inline bool is_migration_base(struct hrtimer_clock_base *base) ++{ ++ return base == &migration_base; ++} ++ + /* + * We are using hashed locking: holding per_cpu(hrtimer_bases)[n].lock + * means that all timers which are tied to this base via timer->base are +@@ -274,6 +279,11 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, + + #else /* CONFIG_SMP */ + ++static inline bool is_migration_base(struct hrtimer_clock_base *base) ++{ ++ return false; ++} ++ + static inline struct hrtimer_clock_base * + lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) + { +@@ -943,7 +953,7 @@ void hrtimer_grab_expiry_lock(const struct hrtimer *timer) + { + struct hrtimer_clock_base *base = READ_ONCE(timer->base); + +- if (timer->is_soft && base != &migration_base) { ++ if (timer->is_soft && is_migration_base(base)) { + spin_lock(&base->cpu_base->softirq_expiry_lock); + spin_unlock(&base->cpu_base->softirq_expiry_lock); + } +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0301-posix-timers-Unlock-expiry-lock-in-the-early-return.patch b/kernel/patches-4.19.x-rt/0301-posix-timers-Unlock-expiry-lock-in-the-early-return.patch new file mode 100644 index 000000000..ba41b6956 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0301-posix-timers-Unlock-expiry-lock-in-the-early-return.patch @@ -0,0 +1,40 @@ +From ae0252a9cd108b1f72aa0d7ff0dfc9a888a05d81 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 16 Sep 2019 12:33:59 +0200 +Subject: [PATCH 301/328] posix-timers: Unlock expiry lock in the early return + +[ Upstream commit 356a2781375ec58521a9bc3f500488745990c242 ] + +Patch ("posix-timers: Add expiry lock") acquired a lock in +run_posix_cpu_timers() but didn't drop the lock in the early return. + +Unlock the lock in the early return path. + +Reported-by: kbuild test robot +Reported-by: Dan Carpenter +Reviewed-by: Thomas Gleixner +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/time/posix-cpu-timers.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c +index 765e700962ab..c9964dc3276b 100644 +--- a/kernel/time/posix-cpu-timers.c ++++ b/kernel/time/posix-cpu-timers.c +@@ -1175,8 +1175,10 @@ static void __run_posix_cpu_timers(struct task_struct *tsk) + expiry_lock = this_cpu_ptr(&cpu_timer_expiry_lock); + spin_lock(expiry_lock); + +- if (!lock_task_sighand(tsk, &flags)) ++ if (!lock_task_sighand(tsk, &flags)) { ++ spin_unlock(expiry_lock); + return; ++ } + /* + * Here we take off tsk->signal->cpu_timers[N] and + * tsk->cpu_timers[N] all the timers that are firing, and +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0302-sched-migrate_dis-enable-Use-sleeping_lock-to-annota.patch b/kernel/patches-4.19.x-rt/0302-sched-migrate_dis-enable-Use-sleeping_lock-to-annota.patch new file mode 100644 index 000000000..6ec8f390a --- /dev/null +++ b/kernel/patches-4.19.x-rt/0302-sched-migrate_dis-enable-Use-sleeping_lock-to-annota.patch @@ -0,0 +1,57 @@ +From 1e2e07b7ee887a2c15a4b686358602b5316d3002 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Tue, 24 Sep 2019 14:36:41 +0200 +Subject: [PATCH 302/328] =?UTF-8?q?sched:=20migrate=5Fdis/enable:=20Use=20?= + =?UTF-8?q?sleeping=5Flock=E2=80=A6()=20to=20annotate=20sleeping=20points?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit 4230dd3824c3e1785504e6f757ce79a4b55651fa ] + +Without this, rcu_note_context_switch() will complain if an RCU read lock +is held when migrate_enable() calls stop_one_cpu(). Likewise when +migrate_disable() calls pin_current_cpu() which calls __read_rt_lock() -- +which bypasses the part of the mutex code that calls sleeping_lock_inc(). + +Signed-off-by: Scott Wood +Signed-off-by: Steven Rostedt (VMware) +[bigeasy: use sleeping_lock_…() ] +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/cpu.c | 2 ++ + kernel/sched/core.c | 3 +++ + 2 files changed, 5 insertions(+) + +diff --git a/kernel/cpu.c b/kernel/cpu.c +index 1541189f417b..0d50ae262898 100644 +--- a/kernel/cpu.c ++++ b/kernel/cpu.c +@@ -307,7 +307,9 @@ void pin_current_cpu(void) + preempt_lazy_enable(); + preempt_enable(); + ++ sleeping_lock_inc(); + __read_rt_lock(cpuhp_pin); ++ sleeping_lock_dec(); + + preempt_disable(); + preempt_lazy_disable(); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index a1c0123e7636..3413b9ebef1f 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -7372,7 +7372,10 @@ void migrate_enable(void) + unpin_current_cpu(); + preempt_lazy_enable(); + preempt_enable(); ++ ++ sleeping_lock_inc(); + stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); ++ sleeping_lock_dec(); + tlb_migrate_finish(p->mm); + + return; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0303-sched-__set_cpus_allowed_ptr-Check-cpus_mask-not-cpu.patch b/kernel/patches-4.19.x-rt/0303-sched-__set_cpus_allowed_ptr-Check-cpus_mask-not-cpu.patch new file mode 100644 index 000000000..d7e9fa83c --- /dev/null +++ b/kernel/patches-4.19.x-rt/0303-sched-__set_cpus_allowed_ptr-Check-cpus_mask-not-cpu.patch @@ -0,0 +1,38 @@ +From ee49bec178fb001b6bc6d6db36cc4832f1c635c3 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Sat, 27 Jul 2019 00:56:32 -0500 +Subject: [PATCH 303/328] sched: __set_cpus_allowed_ptr: Check cpus_mask, not + cpus_ptr + +[ Upstream commit e5606fb7b042db634ed62b4dd733d62e050e468f ] + +This function is concerned with the long-term cpu mask, not the +transitory mask the task might have while migrate disabled. Before +this patch, if a task was migrate disabled at the time +__set_cpus_allowed_ptr() was called, and the new mask happened to be +equal to the cpu that the task was running on, then the mask update +would be lost. + +Signed-off-by: Scott Wood +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 3413b9ebef1f..d6bd8129a390 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -1157,7 +1157,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, + goto out; + } + +- if (cpumask_equal(p->cpus_ptr, new_mask)) ++ if (cpumask_equal(&p->cpus_mask, new_mask)) + goto out; + + dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0304-sched-Remove-dead-__migrate_disabled-check.patch b/kernel/patches-4.19.x-rt/0304-sched-Remove-dead-__migrate_disabled-check.patch new file mode 100644 index 000000000..72c8fe411 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0304-sched-Remove-dead-__migrate_disabled-check.patch @@ -0,0 +1,38 @@ +From 0f49b94879548ccd41d4518afa7cf6b88b578656 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Sat, 27 Jul 2019 00:56:33 -0500 +Subject: [PATCH 304/328] sched: Remove dead __migrate_disabled() check + +[ Upstream commit 14d9272d534ea91262e15db99443fc5995c7c016 ] + +This code was unreachable given the __migrate_disabled() branch +to "out" immediately beforehand. + +Signed-off-by: Scott Wood +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/core.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index d6bd8129a390..a29f33e776d0 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -1182,13 +1182,6 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, + if (cpumask_test_cpu(task_cpu(p), new_mask) || __migrate_disabled(p)) + goto out; + +-#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) +- if (__migrate_disabled(p)) { +- p->migrate_disable_update = 1; +- goto out; +- } +-#endif +- + if (task_running(rq, p) || p->state == TASK_WAKING) { + struct migration_arg arg = { p, dest_cpu }; + /* Need help from migration thread: drop lock and wait. */ +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0305-sched-migrate-disable-Protect-cpus_ptr-with-lock.patch b/kernel/patches-4.19.x-rt/0305-sched-migrate-disable-Protect-cpus_ptr-with-lock.patch new file mode 100644 index 000000000..bd6e22db7 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0305-sched-migrate-disable-Protect-cpus_ptr-with-lock.patch @@ -0,0 +1,46 @@ +From db5f1e12f85243ff54296bf28fa3cd8d0b01dac6 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Sat, 27 Jul 2019 00:56:34 -0500 +Subject: [PATCH 305/328] sched: migrate disable: Protect cpus_ptr with lock + +[ Upstream commit 27ee52a891ed2c7e2e2c8332ccae0de7c2674b09 ] + +Various places assume that cpus_ptr is protected by rq/pi locks, +so don't change it before grabbing those locks. + +Signed-off-by: Scott Wood +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/core.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index a29f33e776d0..d9a3f88508ee 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -7250,9 +7250,8 @@ migrate_disable_update_cpus_allowed(struct task_struct *p) + struct rq *rq; + struct rq_flags rf; + +- p->cpus_ptr = cpumask_of(smp_processor_id()); +- + rq = task_rq_lock(p, &rf); ++ p->cpus_ptr = cpumask_of(smp_processor_id()); + update_nr_migratory(p, -1); + p->nr_cpus_allowed = 1; + task_rq_unlock(rq, p, &rf); +@@ -7264,9 +7263,8 @@ migrate_enable_update_cpus_allowed(struct task_struct *p) + struct rq *rq; + struct rq_flags rf; + +- p->cpus_ptr = &p->cpus_mask; +- + rq = task_rq_lock(p, &rf); ++ p->cpus_ptr = &p->cpus_mask; + p->nr_cpus_allowed = cpumask_weight(&p->cpus_mask); + update_nr_migratory(p, 1); + task_rq_unlock(rq, p, &rf); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0306-lib-smp_processor_id-Don-t-use-cpumask_equal.patch b/kernel/patches-4.19.x-rt/0306-lib-smp_processor_id-Don-t-use-cpumask_equal.patch new file mode 100644 index 000000000..82c63b230 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0306-lib-smp_processor_id-Don-t-use-cpumask_equal.patch @@ -0,0 +1,44 @@ +From 053a5be342cf9ab6925975f8ce90e62bf13c81b1 Mon Sep 17 00:00:00 2001 +From: Waiman Long +Date: Thu, 3 Oct 2019 16:36:08 -0400 +Subject: [PATCH 306/328] lib/smp_processor_id: Don't use cpumask_equal() + +[ Upstream commit 659252061477862f45b79e1de169e6030f5c8918 ] + +The check_preemption_disabled() function uses cpumask_equal() to see +if the task is bounded to the current CPU only. cpumask_equal() calls +memcmp() to do the comparison. As x86 doesn't have __HAVE_ARCH_MEMCMP, +the slow memcmp() function in lib/string.c is used. + +On a RT kernel that call check_preemption_disabled() very frequently, +below is the perf-record output of a certain microbenchmark: + + 42.75% 2.45% testpmd [kernel.kallsyms] [k] check_preemption_disabled + 40.01% 39.97% testpmd [kernel.kallsyms] [k] memcmp + +We should avoid calling memcmp() in performance critical path. So the +cpumask_equal() call is now replaced with an equivalent simpler check. + +Signed-off-by: Waiman Long +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + lib/smp_processor_id.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c +index fb35c45b9421..b8a8a8db2d75 100644 +--- a/lib/smp_processor_id.c ++++ b/lib/smp_processor_id.c +@@ -22,7 +22,7 @@ notrace static unsigned int check_preemption_disabled(const char *what1, + * Kernel threads bound to a single CPU can safely use + * smp_processor_id(): + */ +- if (cpumask_equal(current->cpus_ptr, cpumask_of(this_cpu))) ++ if (current->nr_cpus_allowed == 1) + goto out; + + /* +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0307-futex-Make-the-futex_hash_bucket-spinlock_t-again-an.patch b/kernel/patches-4.19.x-rt/0307-futex-Make-the-futex_hash_bucket-spinlock_t-again-an.patch new file mode 100644 index 000000000..a3fdb041d --- /dev/null +++ b/kernel/patches-4.19.x-rt/0307-futex-Make-the-futex_hash_bucket-spinlock_t-again-an.patch @@ -0,0 +1,737 @@ +From 4e0a2787e8d6edaa2dcec8a204194283253d8247 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 7 Oct 2019 16:45:18 +0200 +Subject: [PATCH 307/328] futex: Make the futex_hash_bucket spinlock_t again + and bring back its old state + +[ Upstream commit 954ad80c23edfe71f4e8ce70b961eac884320c3a ] + +This is an all-in-one patch that reverts the patches: + futex: Make the futex_hash_bucket lock raw + futex: Delay deallocation of pi_state + +and adds back the old patches we had: + futex: workaround migrate_disable/enable in different context + rtmutex: Handle the various new futex race conditions + futex: Fix bug on when a requeued RT task times out + futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/futex.c | 230 ++++++++++++++++++-------------- + kernel/locking/rtmutex.c | 65 ++++++++- + kernel/locking/rtmutex_common.h | 3 + + 3 files changed, 194 insertions(+), 104 deletions(-) + +diff --git a/kernel/futex.c b/kernel/futex.c +index 0b8cff8d9162..e815cf542b82 100644 +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -243,7 +243,7 @@ struct futex_q { + struct plist_node list; + + struct task_struct *task; +- raw_spinlock_t *lock_ptr; ++ spinlock_t *lock_ptr; + union futex_key key; + struct futex_pi_state *pi_state; + struct rt_mutex_waiter *rt_waiter; +@@ -264,7 +264,7 @@ static const struct futex_q futex_q_init = { + */ + struct futex_hash_bucket { + atomic_t waiters; +- raw_spinlock_t lock; ++ spinlock_t lock; + struct plist_head chain; + } ____cacheline_aligned_in_smp; + +@@ -825,13 +825,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 struct futex_pi_state *__put_pi_state(struct futex_pi_state *pi_state) ++static void put_pi_state(struct futex_pi_state *pi_state) + { + if (!pi_state) +- return NULL; ++ return; + + if (!atomic_dec_and_test(&pi_state->refcount)) +- return NULL; ++ return; + + /* + * If pi_state->owner is NULL, the owner is most probably dying +@@ -851,7 +851,9 @@ static struct futex_pi_state *__put_pi_state(struct futex_pi_state *pi_state) + raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); + } + +- if (!current->pi_state_cache) { ++ if (current->pi_state_cache) { ++ kfree(pi_state); ++ } else { + /* + * pi_state->list is already empty. + * clear pi_state->owner. +@@ -860,30 +862,6 @@ static struct futex_pi_state *__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); + } + } + +@@ -900,7 +878,6 @@ 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; +@@ -934,7 +911,7 @@ void exit_pi_state_list(struct task_struct *curr) + } + raw_spin_unlock_irq(&curr->pi_lock); + +- raw_spin_lock(&hb->lock); ++ spin_lock(&hb->lock); + raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); + raw_spin_lock(&curr->pi_lock); + /* +@@ -944,8 +921,10 @@ 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(&hb->lock); +- put_pi_state_atomic(pi_state, &to_free); ++ raw_spin_unlock_irq(&curr->pi_lock); ++ spin_unlock(&hb->lock); ++ raw_spin_lock_irq(&curr->pi_lock); ++ put_pi_state(pi_state); + continue; + } + +@@ -956,7 +935,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); +- raw_spin_unlock(&hb->lock); ++ spin_unlock(&hb->lock); + + rt_mutex_futex_unlock(&pi_state->pi_mutex); + put_pi_state(pi_state); +@@ -964,8 +943,6 @@ 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 +@@ -1452,7 +1429,7 @@ static void __unqueue_futex(struct futex_q *q) + { + struct futex_hash_bucket *hb; + +- if (WARN_ON_SMP(!q->lock_ptr || !raw_spin_is_locked(q->lock_ptr)) ++ if (WARN_ON_SMP(!q->lock_ptr || !spin_is_locked(q->lock_ptr)) + || WARN_ON(plist_node_empty(&q->list))) + return; + +@@ -1580,21 +1557,21 @@ static inline void + double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2) + { + if (hb1 <= hb2) { +- raw_spin_lock(&hb1->lock); ++ spin_lock(&hb1->lock); + if (hb1 < hb2) +- raw_spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING); ++ spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING); + } else { /* hb1 > hb2 */ +- raw_spin_lock(&hb2->lock); +- raw_spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING); ++ spin_lock(&hb2->lock); ++ spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING); + } + } + + static inline void + double_unlock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2) + { +- raw_spin_unlock(&hb1->lock); ++ spin_unlock(&hb1->lock); + if (hb1 != hb2) +- raw_spin_unlock(&hb2->lock); ++ spin_unlock(&hb2->lock); + } + + /* +@@ -1622,7 +1599,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) + if (!hb_waiters_pending(hb)) + goto out_put_key; + +- raw_spin_lock(&hb->lock); ++ spin_lock(&hb->lock); + + plist_for_each_entry_safe(this, next, &hb->chain, list) { + if (match_futex (&this->key, &key)) { +@@ -1641,7 +1618,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) + } + } + +- raw_spin_unlock(&hb->lock); ++ spin_unlock(&hb->lock); + wake_up_q(&wake_q); + out_put_key: + put_futex_key(&key); +@@ -1948,7 +1925,6 @@ 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; +@@ -2176,6 +2152,16 @@ 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 +@@ -2186,7 +2172,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, + * object. + */ + this->pi_state = NULL; +- put_pi_state_atomic(pi_state, &to_free); ++ put_pi_state(pi_state); + /* + * We stop queueing more waiters and let user + * space deal with the mess. +@@ -2203,7 +2189,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_atomic(pi_state, &to_free); ++ put_pi_state(pi_state); + + out_unlock: + double_unlock_hb(hb1, hb2); +@@ -2224,7 +2210,6 @@ 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; + } + +@@ -2248,7 +2233,7 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q) + + q->lock_ptr = &hb->lock; + +- raw_spin_lock(&hb->lock); /* implies smp_mb(); (A) */ ++ spin_lock(&hb->lock); /* implies smp_mb(); (A) */ + return hb; + } + +@@ -2256,7 +2241,7 @@ static inline void + queue_unlock(struct futex_hash_bucket *hb) + __releases(&hb->lock) + { +- raw_spin_unlock(&hb->lock); ++ spin_unlock(&hb->lock); + hb_waiters_dec(hb); + } + +@@ -2295,7 +2280,7 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) + __releases(&hb->lock) + { + __queue_me(q, hb); +- raw_spin_unlock(&hb->lock); ++ spin_unlock(&hb->lock); + } + + /** +@@ -2311,41 +2296,41 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) + */ + static int unqueue_me(struct futex_q *q) + { +- raw_spinlock_t *lock_ptr; ++ 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 +- * raw_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 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) { +- raw_spin_lock(lock_ptr); ++ spin_lock(lock_ptr); + /* + * q->lock_ptr can change between reading it and +- * raw_spin_lock(), causing us to take the wrong lock. This ++ * 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 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, ++ * 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, + * however, change back to the original value. Therefore + * we can detect whether we acquired the correct lock. + */ + if (unlikely(lock_ptr != q->lock_ptr)) { +- raw_spin_unlock(lock_ptr); ++ spin_unlock(lock_ptr); + goto retry; + } + __unqueue_futex(q); + + BUG_ON(q->pi_state); + +- raw_spin_unlock(lock_ptr); ++ spin_unlock(lock_ptr); + ret = 1; + } + +@@ -2361,16 +2346,13 @@ 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); +- ps = __put_pi_state(q->pi_state); ++ put_pi_state(q->pi_state); + q->pi_state = NULL; + +- raw_spin_unlock(q->lock_ptr); +- kfree(ps); ++ spin_unlock(q->lock_ptr); + } + + static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, +@@ -2503,7 +2485,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); +- raw_spin_unlock(q->lock_ptr); ++ spin_unlock(q->lock_ptr); + + switch (err) { + case -EFAULT: +@@ -2521,7 +2503,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, + break; + } + +- raw_spin_lock(q->lock_ptr); ++ spin_lock(q->lock_ptr); + raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); + + /* +@@ -2617,7 +2599,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 raw_spin_unlock() upon completion, both serializing ++ * queue_me() calls spin_unlock() upon completion, both serializing + * access to the hash list and forcing another memory barrier. + */ + set_current_state(TASK_INTERRUPTIBLE); +@@ -2908,7 +2890,15 @@ 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); +- raw_spin_unlock(q.lock_ptr); ++ /* ++ * 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 + * such that futex_unlock_pi() is guaranteed to observe the waiter when +@@ -2916,6 +2906,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); ++ migrate_enable(); + + if (ret) { + if (ret == 1) +@@ -2929,7 +2920,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: +- raw_spin_lock(q.lock_ptr); ++ 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 +@@ -3030,7 +3021,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + return ret; + + hb = hash_futex(&key); +- raw_spin_lock(&hb->lock); ++ spin_lock(&hb->lock); + + /* + * Check waiters first. We do not trust user space values at +@@ -3064,10 +3055,19 @@ 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); +- raw_spin_unlock(&hb->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); + +@@ -3103,7 +3103,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + * owner. + */ + if ((ret = cmpxchg_futex_value_locked(&curval, uaddr, uval, 0))) { +- raw_spin_unlock(&hb->lock); ++ spin_unlock(&hb->lock); + switch (ret) { + case -EFAULT: + goto pi_faulted; +@@ -3123,7 +3123,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + ret = (curval == uval) ? 0 : -EAGAIN; + + out_unlock: +- raw_spin_unlock(&hb->lock); ++ spin_unlock(&hb->lock); + out_putkey: + put_futex_key(&key); + return ret; +@@ -3239,7 +3239,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; ++ struct futex_hash_bucket *hb, *hb2; + union futex_key key2 = FUTEX_KEY_INIT; + struct futex_q q = futex_q_init; + int res, ret; +@@ -3297,20 +3297,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); + +- raw_spin_lock(&hb->lock); +- ret = handle_early_requeue_pi_wakeup(hb, &q, &key2, to); +- raw_spin_unlock(&hb->lock); +- if (ret) +- goto out_put_keys; ++ /* ++ * 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; ++ } + + /* +- * 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. ++ * 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. + */ ++ hb2 = hash_futex(&key2); + + /* Check if the requeue code acquired the second futex for us. */ + if (!q.rt_waiter) { +@@ -3319,9 +3354,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); ++ spin_lock(&hb2->lock); ++ BUG_ON(&hb2->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; +@@ -3331,9 +3365,8 @@ 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. + */ +- ps_free = __put_pi_state(q.pi_state); +- raw_spin_unlock(q.lock_ptr); +- kfree(ps_free); ++ put_pi_state(q.pi_state); ++ spin_unlock(&hb2->lock); + } + } else { + struct rt_mutex *pi_mutex; +@@ -3347,7 +3380,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); + +- raw_spin_lock(q.lock_ptr); ++ spin_lock(&hb2->lock); ++ BUG_ON(&hb2->lock != q.lock_ptr); + if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) + ret = 0; + +@@ -4014,7 +4048,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); +- raw_spin_lock_init(&futex_queues[i].lock); ++ spin_lock_init(&futex_queues[i].lock); + } + + return 0; +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 44a33057a83a..2a9bf2443acc 100644 +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -142,6 +142,12 @@ 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 && ++ waiter != PI_REQUEUE_INPROGRESS; ++} ++ + /* + * We can speed up the acquire/release, if there's no debugging state to be + * set up. +@@ -415,7 +421,8 @@ int max_lock_depth = 1024; + + static inline struct rt_mutex *task_blocked_on_lock(struct task_struct *p) + { +- return p->pi_blocked_on ? p->pi_blocked_on->lock : NULL; ++ return rt_mutex_real_waiter(p->pi_blocked_on) ? ++ p->pi_blocked_on->lock : NULL; + } + + /* +@@ -551,7 +558,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 (!waiter) ++ if (!rt_mutex_real_waiter(waiter)) + goto out_unlock_pi; + + /* +@@ -1321,6 +1328,22 @@ 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; +@@ -1344,7 +1367,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + rt_mutex_enqueue_pi(owner, waiter); + + rt_mutex_adjust_prio(owner); +- if (owner->pi_blocked_on) ++ if (rt_mutex_real_waiter(owner->pi_blocked_on)) + chain_walk = 1; + } else if (rt_mutex_cond_detect_deadlock(waiter, chwalk)) { + chain_walk = 1; +@@ -1444,7 +1467,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; ++ struct rt_mutex *next_lock = NULL; + + lockdep_assert_held(&lock->wait_lock); + +@@ -1470,7 +1493,8 @@ static void remove_waiter(struct rt_mutex *lock, + rt_mutex_adjust_prio(owner); + + /* Store the lock on which owner is blocked or NULL */ +- next_lock = task_blocked_on_lock(owner); ++ if (rt_mutex_real_waiter(owner->pi_blocked_on)) ++ next_lock = task_blocked_on_lock(owner); + + raw_spin_unlock(&owner->pi_lock); + +@@ -1506,7 +1530,8 @@ void rt_mutex_adjust_pi(struct task_struct *task) + raw_spin_lock_irqsave(&task->pi_lock, flags); + + waiter = task->pi_blocked_on; +- if (!waiter || rt_mutex_waiter_equal(waiter, task_to_waiter(task))) { ++ if (!rt_mutex_real_waiter(waiter) || ++ rt_mutex_waiter_equal(waiter, task_to_waiter(task))) { + raw_spin_unlock_irqrestore(&task->pi_lock, flags); + return; + } +@@ -2325,6 +2350,34 @@ 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 758dc43872e5..546aaf058b9e 100644 +--- a/kernel/locking/rtmutex_common.h ++++ b/kernel/locking/rtmutex_common.h +@@ -132,6 +132,9 @@ 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, + struct task_struct *proxy_owner); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0308-locking-rtmutex-Clean-pi_blocked_on-in-the-error-cas.patch b/kernel/patches-4.19.x-rt/0308-locking-rtmutex-Clean-pi_blocked_on-in-the-error-cas.patch new file mode 100644 index 000000000..68126d7f0 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0308-locking-rtmutex-Clean-pi_blocked_on-in-the-error-cas.patch @@ -0,0 +1,101 @@ +From 7a083b11dea5905627872e0986c532a3e11716cf Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Mon, 30 Sep 2019 18:15:44 +0200 +Subject: [PATCH 308/328] locking/rtmutex: Clean ->pi_blocked_on in the error + case + +[ Upstream commit 0be4ea6e3ce693101be0fbd55a0cc7ce238ab2eb ] + +The function rt_mutex_wait_proxy_lock() cleans ->pi_blocked_on in case +of failure (timeout, signal). The same cleanup is required in +__rt_mutex_start_proxy_lock(). +In both the cases the tasks was interrupted by a signal or timeout while +acquiring the lock and after the interruption it longer blocks on the +lock. + +Fixes: 1a1fb985f2e2b ("futex: Handle early deadlock return correctly") +Signed-off-by: Peter Zijlstra (Intel) +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/locking/rtmutex.c | 43 +++++++++++++++++++++++----------------- + 1 file changed, 25 insertions(+), 18 deletions(-) + +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 2a9bf2443acc..63b3d6f306fa 100644 +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -2320,6 +2320,26 @@ void rt_mutex_proxy_unlock(struct rt_mutex *lock, + rt_mutex_set_owner(lock, NULL); + } + ++static void fixup_rt_mutex_blocked(struct rt_mutex *lock) ++{ ++ struct task_struct *tsk = current; ++ /* ++ * RT has a problem here when the wait got interrupted by a timeout ++ * or a signal. task->pi_blocked_on is still set. The task must ++ * acquire the hash bucket lock when returning from this function. ++ * ++ * If the hash bucket lock is contended then the ++ * BUG_ON(rt_mutex_real_waiter(task->pi_blocked_on)) in ++ * task_blocks_on_rt_mutex() will trigger. This can be avoided by ++ * clearing task->pi_blocked_on which removes the task from the ++ * boosting chain of the rtmutex. That's correct because the task ++ * is not longer blocked on it. ++ */ ++ raw_spin_lock(&tsk->pi_lock); ++ tsk->pi_blocked_on = NULL; ++ raw_spin_unlock(&tsk->pi_lock); ++} ++ + /** + * __rt_mutex_start_proxy_lock() - Start lock acquisition for another task + * @lock: the rt_mutex to take +@@ -2392,6 +2412,9 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, + ret = 0; + } + ++ if (ret) ++ fixup_rt_mutex_blocked(lock); ++ + debug_rt_mutex_print_deadlock(waiter); + + return ret; +@@ -2472,7 +2495,6 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, + struct hrtimer_sleeper *to, + struct rt_mutex_waiter *waiter) + { +- struct task_struct *tsk = current; + int ret; + + raw_spin_lock_irq(&lock->wait_lock); +@@ -2484,23 +2506,8 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, + * have to fix that up. + */ + fixup_rt_mutex_waiters(lock); +- /* +- * RT has a problem here when the wait got interrupted by a timeout +- * or a signal. task->pi_blocked_on is still set. The task must +- * acquire the hash bucket lock when returning from this function. +- * +- * If the hash bucket lock is contended then the +- * BUG_ON(rt_mutex_real_waiter(task->pi_blocked_on)) in +- * task_blocks_on_rt_mutex() will trigger. This can be avoided by +- * clearing task->pi_blocked_on which removes the task from the +- * boosting chain of the rtmutex. That's correct because the task +- * is not longer blocked on it. +- */ +- if (ret) { +- raw_spin_lock(&tsk->pi_lock); +- tsk->pi_blocked_on = NULL; +- raw_spin_unlock(&tsk->pi_lock); +- } ++ if (ret) ++ fixup_rt_mutex_blocked(lock); + + raw_spin_unlock_irq(&lock->wait_lock); + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0309-lib-ubsan-Don-t-seralize-UBSAN-report.patch b/kernel/patches-4.19.x-rt/0309-lib-ubsan-Don-t-seralize-UBSAN-report.patch new file mode 100644 index 000000000..d5e5d9a1d --- /dev/null +++ b/kernel/patches-4.19.x-rt/0309-lib-ubsan-Don-t-seralize-UBSAN-report.patch @@ -0,0 +1,307 @@ +From 63329ddc5674e1b5c0837ed4a5db590246ba0835 Mon Sep 17 00:00:00 2001 +From: Julien Grall +Date: Fri, 20 Sep 2019 11:08:35 +0100 +Subject: [PATCH 309/328] lib/ubsan: Don't seralize UBSAN report + +[ Upstream commit 4702c28ac777b27acb499cbd5e8e787ce1a7d82d ] + +At the moment, UBSAN report will be serialized using a spin_lock(). On +RT-systems, spinlocks are turned to rt_spin_lock and may sleep. This will +result to the following splat if the undefined behavior is in a context +that can sleep: + +| BUG: sleeping function called from invalid context at /src/linux/kernel/locking/rtmutex.c:968 +| in_atomic(): 1, irqs_disabled(): 128, pid: 3447, name: make +| 1 lock held by make/3447: +| #0: 000000009a966332 (&mm->mmap_sem){++++}, at: do_page_fault+0x140/0x4f8 +| Preemption disabled at: +| [] rt_mutex_futex_unlock+0x4c/0xb0 +| CPU: 3 PID: 3447 Comm: make Tainted: G W 5.2.14-rt7-01890-ge6e057589653 #911 +| Call trace: +| dump_backtrace+0x0/0x148 +| show_stack+0x14/0x20 +| dump_stack+0xbc/0x104 +| ___might_sleep+0x154/0x210 +| rt_spin_lock+0x68/0xa0 +| ubsan_prologue+0x30/0x68 +| handle_overflow+0x64/0xe0 +| __ubsan_handle_add_overflow+0x10/0x18 +| __lock_acquire+0x1c28/0x2a28 +| lock_acquire+0xf0/0x370 +| _raw_spin_lock_irqsave+0x58/0x78 +| rt_mutex_futex_unlock+0x4c/0xb0 +| rt_spin_unlock+0x28/0x70 +| get_page_from_freelist+0x428/0x2b60 +| __alloc_pages_nodemask+0x174/0x1708 +| alloc_pages_vma+0x1ac/0x238 +| __handle_mm_fault+0x4ac/0x10b0 +| handle_mm_fault+0x1d8/0x3b0 +| do_page_fault+0x1c8/0x4f8 +| do_translation_fault+0xb8/0xe0 +| do_mem_abort+0x3c/0x98 +| el0_da+0x20/0x24 + +The spin_lock() will protect against multiple CPUs to output a report +together, I guess to prevent them to be interleaved. However, they can +still interleave with other messages (and even splat from __migth_sleep). + +So the lock usefulness seems pretty limited. Rather than trying to +accomodate RT-system by switching to a raw_spin_lock(), the lock is now +completely dropped. + +Link: https://lkml.kernel.org/r/20190920100835.14999-1-julien.grall@arm.com +Reported-by: Andre Przywara +Signed-off-by: Julien Grall +Acked-by: Andrey Ryabinin +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + lib/ubsan.c | 64 +++++++++++++++++++---------------------------------- + 1 file changed, 23 insertions(+), 41 deletions(-) + +diff --git a/lib/ubsan.c b/lib/ubsan.c +index 1e9e2ab25539..5830cc9a2164 100644 +--- a/lib/ubsan.c ++++ b/lib/ubsan.c +@@ -143,25 +143,21 @@ static void val_to_string(char *str, size_t size, struct type_descriptor *type, + } + } + +-static DEFINE_SPINLOCK(report_lock); +- +-static void ubsan_prologue(struct source_location *location, +- unsigned long *flags) ++static void ubsan_prologue(struct source_location *location) + { + current->in_ubsan++; +- spin_lock_irqsave(&report_lock, *flags); + + pr_err("========================================" + "========================================\n"); + print_source_location("UBSAN: Undefined behaviour in", location); + } + +-static void ubsan_epilogue(unsigned long *flags) ++static void ubsan_epilogue(void) + { + dump_stack(); + pr_err("========================================" + "========================================\n"); +- spin_unlock_irqrestore(&report_lock, *flags); ++ + current->in_ubsan--; + } + +@@ -170,14 +166,13 @@ static void handle_overflow(struct overflow_data *data, void *lhs, + { + + struct type_descriptor *type = data->type; +- unsigned long flags; + char lhs_val_str[VALUE_LENGTH]; + char rhs_val_str[VALUE_LENGTH]; + + if (suppress_report(&data->location)) + return; + +- ubsan_prologue(&data->location, &flags); ++ ubsan_prologue(&data->location); + + val_to_string(lhs_val_str, sizeof(lhs_val_str), type, lhs); + val_to_string(rhs_val_str, sizeof(rhs_val_str), type, rhs); +@@ -189,7 +184,7 @@ static void handle_overflow(struct overflow_data *data, void *lhs, + rhs_val_str, + type->type_name); + +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + + void __ubsan_handle_add_overflow(struct overflow_data *data, +@@ -217,20 +212,19 @@ EXPORT_SYMBOL(__ubsan_handle_mul_overflow); + void __ubsan_handle_negate_overflow(struct overflow_data *data, + void *old_val) + { +- unsigned long flags; + char old_val_str[VALUE_LENGTH]; + + if (suppress_report(&data->location)) + return; + +- ubsan_prologue(&data->location, &flags); ++ ubsan_prologue(&data->location); + + val_to_string(old_val_str, sizeof(old_val_str), data->type, old_val); + + pr_err("negation of %s cannot be represented in type %s:\n", + old_val_str, data->type->type_name); + +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + EXPORT_SYMBOL(__ubsan_handle_negate_overflow); + +@@ -238,13 +232,12 @@ EXPORT_SYMBOL(__ubsan_handle_negate_overflow); + void __ubsan_handle_divrem_overflow(struct overflow_data *data, + void *lhs, void *rhs) + { +- unsigned long flags; + char rhs_val_str[VALUE_LENGTH]; + + if (suppress_report(&data->location)) + return; + +- ubsan_prologue(&data->location, &flags); ++ ubsan_prologue(&data->location); + + val_to_string(rhs_val_str, sizeof(rhs_val_str), data->type, rhs); + +@@ -254,58 +247,52 @@ void __ubsan_handle_divrem_overflow(struct overflow_data *data, + else + pr_err("division by zero\n"); + +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + EXPORT_SYMBOL(__ubsan_handle_divrem_overflow); + + static void handle_null_ptr_deref(struct type_mismatch_data_common *data) + { +- unsigned long flags; +- + if (suppress_report(data->location)) + return; + +- ubsan_prologue(data->location, &flags); ++ ubsan_prologue(data->location); + + pr_err("%s null pointer of type %s\n", + type_check_kinds[data->type_check_kind], + data->type->type_name); + +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + + static void handle_misaligned_access(struct type_mismatch_data_common *data, + unsigned long ptr) + { +- unsigned long flags; +- + if (suppress_report(data->location)) + return; + +- ubsan_prologue(data->location, &flags); ++ ubsan_prologue(data->location); + + pr_err("%s misaligned address %p for type %s\n", + type_check_kinds[data->type_check_kind], + (void *)ptr, data->type->type_name); + pr_err("which requires %ld byte alignment\n", data->alignment); + +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + + static void handle_object_size_mismatch(struct type_mismatch_data_common *data, + unsigned long ptr) + { +- unsigned long flags; +- + if (suppress_report(data->location)) + return; + +- ubsan_prologue(data->location, &flags); ++ ubsan_prologue(data->location); + pr_err("%s address %p with insufficient space\n", + type_check_kinds[data->type_check_kind], + (void *) ptr); + pr_err("for an object of type %s\n", data->type->type_name); +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + + static void ubsan_type_mismatch_common(struct type_mismatch_data_common *data, +@@ -369,25 +356,23 @@ EXPORT_SYMBOL(__ubsan_handle_vla_bound_not_positive); + + void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, void *index) + { +- unsigned long flags; + char index_str[VALUE_LENGTH]; + + if (suppress_report(&data->location)) + return; + +- ubsan_prologue(&data->location, &flags); ++ ubsan_prologue(&data->location); + + val_to_string(index_str, sizeof(index_str), data->index_type, index); + pr_err("index %s is out of range for type %s\n", index_str, + data->array_type->type_name); +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + EXPORT_SYMBOL(__ubsan_handle_out_of_bounds); + + void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data, + void *lhs, void *rhs) + { +- unsigned long flags; + struct type_descriptor *rhs_type = data->rhs_type; + struct type_descriptor *lhs_type = data->lhs_type; + char rhs_str[VALUE_LENGTH]; +@@ -396,7 +381,7 @@ void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data, + if (suppress_report(&data->location)) + return; + +- ubsan_prologue(&data->location, &flags); ++ ubsan_prologue(&data->location); + + val_to_string(rhs_str, sizeof(rhs_str), rhs_type, rhs); + val_to_string(lhs_str, sizeof(lhs_str), lhs_type, lhs); +@@ -419,18 +404,16 @@ void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data, + lhs_str, rhs_str, + lhs_type->type_name); + +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + EXPORT_SYMBOL(__ubsan_handle_shift_out_of_bounds); + + + void __ubsan_handle_builtin_unreachable(struct unreachable_data *data) + { +- unsigned long flags; +- +- ubsan_prologue(&data->location, &flags); ++ ubsan_prologue(&data->location); + pr_err("calling __builtin_unreachable()\n"); +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + panic("can't return from __builtin_unreachable()"); + } + EXPORT_SYMBOL(__ubsan_handle_builtin_unreachable); +@@ -438,19 +421,18 @@ EXPORT_SYMBOL(__ubsan_handle_builtin_unreachable); + void __ubsan_handle_load_invalid_value(struct invalid_value_data *data, + void *val) + { +- unsigned long flags; + char val_str[VALUE_LENGTH]; + + if (suppress_report(&data->location)) + return; + +- ubsan_prologue(&data->location, &flags); ++ ubsan_prologue(&data->location); + + val_to_string(val_str, sizeof(val_str), data->type, val); + + pr_err("load of value %s is not a valid value for type %s\n", + val_str, data->type->type_name); + +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + EXPORT_SYMBOL(__ubsan_handle_load_invalid_value); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0310-kmemleak-Change-the-lock-of-kmemleak_object-to-raw_s.patch b/kernel/patches-4.19.x-rt/0310-kmemleak-Change-the-lock-of-kmemleak_object-to-raw_s.patch new file mode 100644 index 000000000..73aee28b0 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0310-kmemleak-Change-the-lock-of-kmemleak_object-to-raw_s.patch @@ -0,0 +1,292 @@ +From fab900cc4385877aa0753a74950d86a8e88a9cec Mon Sep 17 00:00:00 2001 +From: Liu Haitao +Date: Fri, 27 Sep 2019 16:22:30 +0800 +Subject: [PATCH 310/328] kmemleak: Change the lock of kmemleak_object to + raw_spinlock_t + +[ Upstream commit 217847f57119b5fdd377bfa3d344613ddb98d9fc ] + +The commit ("kmemleak: Turn kmemleak_lock to raw spinlock on RT") +changed the kmemleak_lock to raw spinlock. However the +kmemleak_object->lock is held after the kmemleak_lock is held in +scan_block(). + +Make the object->lock a raw_spinlock_t. + +Cc: stable-rt@vger.kernel.org +Link: https://lkml.kernel.org/r/20190927082230.34152-1-yongxin.liu@windriver.com +Signed-off-by: Liu Haitao +Signed-off-by: Yongxin Liu +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + mm/kmemleak.c | 72 +++++++++++++++++++++++++-------------------------- + 1 file changed, 36 insertions(+), 36 deletions(-) + +diff --git a/mm/kmemleak.c b/mm/kmemleak.c +index 92ce99b15f2b..e5f5eeed338d 100644 +--- a/mm/kmemleak.c ++++ b/mm/kmemleak.c +@@ -147,7 +147,7 @@ struct kmemleak_scan_area { + * (use_count) and freed using the RCU mechanism. + */ + struct kmemleak_object { +- spinlock_t lock; ++ raw_spinlock_t lock; + unsigned int flags; /* object status flags */ + struct list_head object_list; + struct list_head gray_list; +@@ -561,7 +561,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, + INIT_LIST_HEAD(&object->object_list); + INIT_LIST_HEAD(&object->gray_list); + INIT_HLIST_HEAD(&object->area_list); +- spin_lock_init(&object->lock); ++ raw_spin_lock_init(&object->lock); + atomic_set(&object->use_count, 1); + object->flags = OBJECT_ALLOCATED; + object->pointer = ptr; +@@ -642,9 +642,9 @@ static void __delete_object(struct kmemleak_object *object) + * Locking here also ensures that the corresponding memory block + * cannot be freed when it is being scanned. + */ +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + object->flags &= ~OBJECT_ALLOCATED; +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + put_object(object); + } + +@@ -716,9 +716,9 @@ static void paint_it(struct kmemleak_object *object, int color) + { + unsigned long flags; + +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + __paint_it(object, color); +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + } + + static void paint_ptr(unsigned long ptr, int color) +@@ -778,7 +778,7 @@ static void add_scan_area(unsigned long ptr, size_t size, gfp_t gfp) + goto out; + } + +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + if (size == SIZE_MAX) { + size = object->pointer + object->size - ptr; + } else if (ptr + size > object->pointer + object->size) { +@@ -794,7 +794,7 @@ static void add_scan_area(unsigned long ptr, size_t size, gfp_t gfp) + + hlist_add_head(&area->node, &object->area_list); + out_unlock: +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + out: + put_object(object); + } +@@ -817,9 +817,9 @@ static void object_set_excess_ref(unsigned long ptr, unsigned long excess_ref) + return; + } + +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + object->excess_ref = excess_ref; +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + put_object(object); + } + +@@ -839,9 +839,9 @@ static void object_no_scan(unsigned long ptr) + return; + } + +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + object->flags |= OBJECT_NO_SCAN; +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + put_object(object); + } + +@@ -902,11 +902,11 @@ static void early_alloc(struct early_log *log) + log->min_count, GFP_ATOMIC); + if (!object) + goto out; +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + for (i = 0; i < log->trace_len; i++) + object->trace[i] = log->trace[i]; + object->trace_len = log->trace_len; +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + out: + rcu_read_unlock(); + } +@@ -1096,9 +1096,9 @@ void __ref kmemleak_update_trace(const void *ptr) + return; + } + +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + object->trace_len = __save_stack_trace(object->trace); +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + + put_object(object); + } +@@ -1344,7 +1344,7 @@ static void scan_block(void *_start, void *_end, + * previously acquired in scan_object(). These locks are + * enclosed by scan_mutex. + */ +- spin_lock_nested(&object->lock, SINGLE_DEPTH_NESTING); ++ raw_spin_lock_nested(&object->lock, SINGLE_DEPTH_NESTING); + /* only pass surplus references (object already gray) */ + if (color_gray(object)) { + excess_ref = object->excess_ref; +@@ -1353,7 +1353,7 @@ static void scan_block(void *_start, void *_end, + excess_ref = 0; + update_refs(object); + } +- spin_unlock(&object->lock); ++ raw_spin_unlock(&object->lock); + + if (excess_ref) { + object = lookup_object(excess_ref, 0); +@@ -1362,9 +1362,9 @@ static void scan_block(void *_start, void *_end, + if (object == scanned) + /* circular reference, ignore */ + continue; +- spin_lock_nested(&object->lock, SINGLE_DEPTH_NESTING); ++ raw_spin_lock_nested(&object->lock, SINGLE_DEPTH_NESTING); + update_refs(object); +- spin_unlock(&object->lock); ++ raw_spin_unlock(&object->lock); + } + } + raw_spin_unlock_irqrestore(&kmemleak_lock, flags); +@@ -1400,7 +1400,7 @@ static void scan_object(struct kmemleak_object *object) + * Once the object->lock is acquired, the corresponding memory block + * cannot be freed (the same lock is acquired in delete_object). + */ +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + if (object->flags & OBJECT_NO_SCAN) + goto out; + if (!(object->flags & OBJECT_ALLOCATED)) +@@ -1419,9 +1419,9 @@ static void scan_object(struct kmemleak_object *object) + if (start >= end) + break; + +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + cond_resched(); +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + } while (object->flags & OBJECT_ALLOCATED); + } else + hlist_for_each_entry(area, &object->area_list, node) +@@ -1429,7 +1429,7 @@ static void scan_object(struct kmemleak_object *object) + (void *)(area->start + area->size), + object); + out: +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + } + + /* +@@ -1482,7 +1482,7 @@ static void kmemleak_scan(void) + /* prepare the kmemleak_object's */ + rcu_read_lock(); + list_for_each_entry_rcu(object, &object_list, object_list) { +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + #ifdef DEBUG + /* + * With a few exceptions there should be a maximum of +@@ -1499,7 +1499,7 @@ static void kmemleak_scan(void) + if (color_gray(object) && get_object(object)) + list_add_tail(&object->gray_list, &gray_list); + +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + } + rcu_read_unlock(); + +@@ -1564,14 +1564,14 @@ static void kmemleak_scan(void) + */ + rcu_read_lock(); + list_for_each_entry_rcu(object, &object_list, object_list) { +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + if (color_white(object) && (object->flags & OBJECT_ALLOCATED) + && update_checksum(object) && get_object(object)) { + /* color it gray temporarily */ + object->count = object->min_count; + list_add_tail(&object->gray_list, &gray_list); + } +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + } + rcu_read_unlock(); + +@@ -1591,13 +1591,13 @@ static void kmemleak_scan(void) + */ + rcu_read_lock(); + list_for_each_entry_rcu(object, &object_list, object_list) { +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + if (unreferenced_object(object) && + !(object->flags & OBJECT_REPORTED)) { + object->flags |= OBJECT_REPORTED; + new_leaks++; + } +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + } + rcu_read_unlock(); + +@@ -1749,10 +1749,10 @@ static int kmemleak_seq_show(struct seq_file *seq, void *v) + struct kmemleak_object *object = v; + unsigned long flags; + +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + if ((object->flags & OBJECT_REPORTED) && unreferenced_object(object)) + print_unreferenced(seq, object); +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + return 0; + } + +@@ -1782,9 +1782,9 @@ static int dump_str_object_info(const char *str) + return -EINVAL; + } + +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + dump_object_info(object); +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + + put_object(object); + return 0; +@@ -1803,11 +1803,11 @@ static void kmemleak_clear(void) + + rcu_read_lock(); + list_for_each_entry_rcu(object, &object_list, object_list) { +- spin_lock_irqsave(&object->lock, flags); ++ raw_spin_lock_irqsave(&object->lock, flags); + if ((object->flags & OBJECT_REPORTED) && + unreferenced_object(object)) + __paint_it(object, KMEMLEAK_GREY); +- spin_unlock_irqrestore(&object->lock, flags); ++ raw_spin_unlock_irqrestore(&object->lock, flags); + } + rcu_read_unlock(); + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0311-sched-migrate_enable-Use-select_fallback_rq.patch b/kernel/patches-4.19.x-rt/0311-sched-migrate_enable-Use-select_fallback_rq.patch new file mode 100644 index 000000000..a67ae7c62 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0311-sched-migrate_enable-Use-select_fallback_rq.patch @@ -0,0 +1,65 @@ +From 84ff174f45e1a55c38d87b15d8d35cccc0bc9d93 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Sat, 12 Oct 2019 01:52:12 -0500 +Subject: [PATCH 311/328] sched: migrate_enable: Use select_fallback_rq() + +[ Upstream commit adfa969d4cfcc995a9d866020124e50f1827d2d1 ] + +migrate_enable() currently open-codes a variant of select_fallback_rq(). +However, it does not have the "No more Mr. Nice Guy" fallback and thus +it will pass an invalid CPU to the migration thread if cpus_mask only +contains a CPU that is !active. + +Signed-off-by: Scott Wood +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/core.c | 25 ++++++++++--------------- + 1 file changed, 10 insertions(+), 15 deletions(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index d9a3f88508ee..6fd3f7b4d7d8 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -7335,6 +7335,7 @@ void migrate_enable(void) + if (p->migrate_disable_update) { + struct rq *rq; + struct rq_flags rf; ++ int cpu = task_cpu(p); + + rq = task_rq_lock(p, &rf); + update_rq_clock(rq); +@@ -7344,21 +7345,15 @@ void migrate_enable(void) + + p->migrate_disable_update = 0; + +- WARN_ON(smp_processor_id() != task_cpu(p)); +- if (!cpumask_test_cpu(task_cpu(p), &p->cpus_mask)) { +- const struct cpumask *cpu_valid_mask = cpu_active_mask; +- struct migration_arg arg; +- unsigned int dest_cpu; +- +- if (p->flags & PF_KTHREAD) { +- /* +- * Kernel threads are allowed on online && !active CPUs +- */ +- cpu_valid_mask = cpu_online_mask; +- } +- dest_cpu = cpumask_any_and(cpu_valid_mask, &p->cpus_mask); +- arg.task = p; +- arg.dest_cpu = dest_cpu; ++ WARN_ON(smp_processor_id() != cpu); ++ if (!cpumask_test_cpu(cpu, &p->cpus_mask)) { ++ struct migration_arg arg = { p }; ++ struct rq_flags rf; ++ ++ rq = task_rq_lock(p, &rf); ++ update_rq_clock(rq); ++ arg.dest_cpu = select_fallback_rq(cpu, p); ++ task_rq_unlock(rq, p, &rf); + + unpin_current_cpu(); + preempt_lazy_enable(); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0312-sched-Lazy-migrate_disable-processing.patch b/kernel/patches-4.19.x-rt/0312-sched-Lazy-migrate_disable-processing.patch new file mode 100644 index 000000000..5d0099e77 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0312-sched-Lazy-migrate_disable-processing.patch @@ -0,0 +1,615 @@ +From 56caa7a47c76572041391ca1b27a68b637539aa3 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Sat, 12 Oct 2019 01:52:13 -0500 +Subject: [PATCH 312/328] sched: Lazy migrate_disable processing + +[ Upstream commit 425c5b38779a860062aa62219dc920d374b13c17 ] + +Avoid overhead on the majority of migrate disable/enable sequences by +only manipulating scheduler data (and grabbing the relevant locks) when +the task actually schedules while migrate-disabled. A kernel build +showed around a 10% reduction in system time (with CONFIG_NR_CPUS=512). + +Instead of cpuhp_pin_lock, CPU hotplug is handled by keeping a per-CPU +count of the number of pinned tasks (including tasks which have not +scheduled in the migrate-disabled section); takedown_cpu() will +wait until that reaches zero (confirmed by take_cpu_down() in stop +machine context to deal with races) before migrating tasks off of the +cpu. + +To simplify synchronization, updating cpus_mask is no longer deferred +until migrate_enable(). This lets us not have to worry about +migrate_enable() missing the update if it's on the fast path (didn't +schedule during the migrate disabled section). It also makes the code +a bit simpler and reduces deviation from mainline. + +While the main motivation for this is the performance benefit, lazy +migrate disable also eliminates the restriction on calling +migrate_disable() while atomic but leaving the atomic region prior to +calling migrate_enable() -- though this won't help with local_bh_disable() +(and thus rcutorture) unless something similar is done with the recently +added local_lock. + +Signed-off-by: Scott Wood +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + include/linux/cpu.h | 4 - + include/linux/sched.h | 11 +-- + init/init_task.c | 4 + + kernel/cpu.c | 103 +++++++++-------------- + kernel/sched/core.c | 182 +++++++++++++++++------------------------ + kernel/sched/sched.h | 4 + + lib/smp_processor_id.c | 3 + + 7 files changed, 129 insertions(+), 182 deletions(-) + +diff --git a/include/linux/cpu.h b/include/linux/cpu.h +index e67645924404..87347ccbba0c 100644 +--- a/include/linux/cpu.h ++++ b/include/linux/cpu.h +@@ -118,8 +118,6 @@ 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); +-extern void pin_current_cpu(void); +-extern void unpin_current_cpu(void); + + #else /* CONFIG_HOTPLUG_CPU */ + +@@ -131,8 +129,6 @@ 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) { } +-static inline void pin_current_cpu(void) { } +-static inline void unpin_current_cpu(void) { } + + #endif /* !CONFIG_HOTPLUG_CPU */ + +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 854a6cb456af..60ac271472aa 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -227,6 +227,8 @@ extern void io_schedule_finish(int token); + extern long io_schedule_timeout(long timeout); + extern void io_schedule(void); + ++int cpu_nr_pinned(int cpu); ++ + /** + * struct prev_cputime - snapshot of system and user cputime + * @utime: time spent in user mode +@@ -670,16 +672,13 @@ struct task_struct { + cpumask_t cpus_mask; + #if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) + int migrate_disable; +- int migrate_disable_update; +- int pinned_on_cpu; ++ bool migrate_disable_scheduled; + # ifdef CONFIG_SCHED_DEBUG +- int migrate_disable_atomic; ++ int pinned_on_cpu; + # endif +- + #elif !defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) + # ifdef CONFIG_SCHED_DEBUG + int migrate_disable; +- int migrate_disable_atomic; + # endif + #endif + #ifdef CONFIG_PREEMPT_RT_FULL +@@ -2058,4 +2057,6 @@ static inline void rseq_syscall(struct pt_regs *regs) + + #endif + ++extern struct task_struct *takedown_cpu_task; ++ + #endif +diff --git a/init/init_task.c b/init/init_task.c +index 9e3362748214..4e5af4616dbd 100644 +--- a/init/init_task.c ++++ b/init/init_task.c +@@ -80,6 +80,10 @@ struct task_struct init_task + .cpus_ptr = &init_task.cpus_mask, + .cpus_mask = CPU_MASK_ALL, + .nr_cpus_allowed= NR_CPUS, ++#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) && \ ++ defined(CONFIG_SCHED_DEBUG) ++ .pinned_on_cpu = -1, ++#endif + .mm = NULL, + .active_mm = &init_mm, + .restart_block = { +diff --git a/kernel/cpu.c b/kernel/cpu.c +index 0d50ae262898..2834eed32b55 100644 +--- a/kernel/cpu.c ++++ b/kernel/cpu.c +@@ -75,11 +75,6 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { + .fail = CPUHP_INVALID, + }; + +-#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PREEMPT_RT_FULL) +-static DEFINE_PER_CPU(struct rt_rw_lock, cpuhp_pin_lock) = \ +- __RWLOCK_RT_INITIALIZER(cpuhp_pin_lock); +-#endif +- + #if defined(CONFIG_LOCKDEP) && defined(CONFIG_SMP) + static struct lockdep_map cpuhp_state_up_map = + STATIC_LOCKDEP_MAP_INIT("cpuhp_state-up", &cpuhp_state_up_map); +@@ -286,57 +281,6 @@ static int cpu_hotplug_disabled; + + #ifdef CONFIG_HOTPLUG_CPU + +-/** +- * pin_current_cpu - Prevent the current cpu from being unplugged +- */ +-void pin_current_cpu(void) +-{ +-#ifdef CONFIG_PREEMPT_RT_FULL +- struct rt_rw_lock *cpuhp_pin; +- unsigned int cpu; +- int ret; +- +-again: +- cpuhp_pin = this_cpu_ptr(&cpuhp_pin_lock); +- ret = __read_rt_trylock(cpuhp_pin); +- if (ret) { +- current->pinned_on_cpu = smp_processor_id(); +- return; +- } +- cpu = smp_processor_id(); +- preempt_lazy_enable(); +- preempt_enable(); +- +- sleeping_lock_inc(); +- __read_rt_lock(cpuhp_pin); +- sleeping_lock_dec(); +- +- preempt_disable(); +- preempt_lazy_disable(); +- if (cpu != smp_processor_id()) { +- __read_rt_unlock(cpuhp_pin); +- goto again; +- } +- current->pinned_on_cpu = cpu; +-#endif +-} +- +-/** +- * unpin_current_cpu - Allow unplug of current cpu +- */ +-void unpin_current_cpu(void) +-{ +-#ifdef CONFIG_PREEMPT_RT_FULL +- struct rt_rw_lock *cpuhp_pin = this_cpu_ptr(&cpuhp_pin_lock); +- +- if (WARN_ON(current->pinned_on_cpu != smp_processor_id())) +- cpuhp_pin = per_cpu_ptr(&cpuhp_pin_lock, current->pinned_on_cpu); +- +- current->pinned_on_cpu = -1; +- __read_rt_unlock(cpuhp_pin); +-#endif +-} +- + DEFINE_STATIC_PERCPU_RWSEM(cpu_hotplug_lock); + + void cpus_read_lock(void) +@@ -865,6 +809,15 @@ static int take_cpu_down(void *_param) + int err, cpu = smp_processor_id(); + int ret; + ++#ifdef CONFIG_PREEMPT_RT_BASE ++ /* ++ * If any tasks disabled migration before we got here, ++ * go back and sleep again. ++ */ ++ if (cpu_nr_pinned(cpu)) ++ return -EAGAIN; ++#endif ++ + /* Ensure this CPU doesn't handle any more interrupts. */ + err = __cpu_disable(); + if (err < 0) +@@ -892,11 +845,10 @@ static int take_cpu_down(void *_param) + return 0; + } + ++struct task_struct *takedown_cpu_task; ++ + static int takedown_cpu(unsigned int cpu) + { +-#ifdef CONFIG_PREEMPT_RT_FULL +- struct rt_rw_lock *cpuhp_pin = per_cpu_ptr(&cpuhp_pin_lock, cpu); +-#endif + struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); + int err; + +@@ -909,17 +861,38 @@ static int takedown_cpu(unsigned int cpu) + */ + irq_lock_sparse(); + +-#ifdef CONFIG_PREEMPT_RT_FULL +- __write_rt_lock(cpuhp_pin); ++#ifdef CONFIG_PREEMPT_RT_BASE ++ WARN_ON_ONCE(takedown_cpu_task); ++ takedown_cpu_task = current; ++ ++again: ++ /* ++ * If a task pins this CPU after we pass this check, take_cpu_down ++ * will return -EAGAIN. ++ */ ++ for (;;) { ++ int nr_pinned; ++ ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ nr_pinned = cpu_nr_pinned(cpu); ++ if (nr_pinned == 0) ++ break; ++ schedule(); ++ } ++ set_current_state(TASK_RUNNING); + #endif + + /* + * So now all preempt/rcu users must observe !cpu_active(). + */ + err = stop_machine_cpuslocked(take_cpu_down, NULL, cpumask_of(cpu)); ++#ifdef CONFIG_PREEMPT_RT_BASE ++ if (err == -EAGAIN) ++ goto again; ++#endif + if (err) { +-#ifdef CONFIG_PREEMPT_RT_FULL +- __write_rt_unlock(cpuhp_pin); ++#ifdef CONFIG_PREEMPT_RT_BASE ++ takedown_cpu_task = NULL; + #endif + /* CPU refused to die */ + irq_unlock_sparse(); +@@ -939,8 +912,8 @@ static int takedown_cpu(unsigned int cpu) + wait_for_ap_thread(st, false); + BUG_ON(st->state != CPUHP_AP_IDLE_DEAD); + +-#ifdef CONFIG_PREEMPT_RT_FULL +- __write_rt_unlock(cpuhp_pin); ++#ifdef CONFIG_PREEMPT_RT_BASE ++ takedown_cpu_task = NULL; + #endif + /* Interrupts are moved away from the dying cpu, reenable alloc/free */ + irq_unlock_sparse(); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 6fd3f7b4d7d8..e97ac751aad2 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -1065,7 +1065,8 @@ static int migration_cpu_stop(void *data) + void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask) + { + cpumask_copy(&p->cpus_mask, new_mask); +- p->nr_cpus_allowed = cpumask_weight(new_mask); ++ if (p->cpus_ptr == &p->cpus_mask) ++ p->nr_cpus_allowed = cpumask_weight(new_mask); + } + + #if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) +@@ -1076,8 +1077,7 @@ int __migrate_disabled(struct task_struct *p) + EXPORT_SYMBOL_GPL(__migrate_disabled); + #endif + +-static void __do_set_cpus_allowed_tail(struct task_struct *p, +- const struct cpumask *new_mask) ++void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) + { + struct rq *rq = task_rq(p); + bool queued, running; +@@ -1106,20 +1106,6 @@ static void __do_set_cpus_allowed_tail(struct task_struct *p, + set_curr_task(rq, p); + } + +-void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) +-{ +-#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) +- if (__migrate_disabled(p)) { +- lockdep_assert_held(&p->pi_lock); +- +- cpumask_copy(&p->cpus_mask, new_mask); +- p->migrate_disable_update = 1; +- return; +- } +-#endif +- __do_set_cpus_allowed_tail(p, new_mask); +-} +- + /* + * Change a given task's CPU affinity. Migrate the thread to a + * proper CPU and schedule it away if the CPU it's executing on +@@ -1179,7 +1165,8 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, + } + + /* Can the task run on the task's current CPU? If so, we're done */ +- if (cpumask_test_cpu(task_cpu(p), new_mask) || __migrate_disabled(p)) ++ if (cpumask_test_cpu(task_cpu(p), new_mask) || ++ p->cpus_ptr != &p->cpus_mask) + goto out; + + if (task_running(rq, p) || p->state == TASK_WAKING) { +@@ -3454,6 +3441,8 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) + BUG(); + } + ++static void migrate_disabled_sched(struct task_struct *p); ++ + /* + * __schedule() is the main scheduler function. + * +@@ -3524,6 +3513,9 @@ static void __sched notrace __schedule(bool preempt) + rq_lock(rq, &rf); + smp_mb__after_spinlock(); + ++ if (__migrate_disabled(prev)) ++ migrate_disabled_sched(prev); ++ + /* Promote REQ to ACT */ + rq->clock_update_flags <<= 1; + update_rq_clock(rq); +@@ -5779,6 +5771,8 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf) + BUG_ON(!next); + put_prev_task(rq, next); + ++ WARN_ON_ONCE(__migrate_disabled(next)); ++ + /* + * Rules for changing task_struct::cpus_mask are holding + * both pi_lock and rq->lock, such that holding either +@@ -7247,14 +7241,9 @@ update_nr_migratory(struct task_struct *p, long delta) + static inline void + migrate_disable_update_cpus_allowed(struct task_struct *p) + { +- struct rq *rq; +- struct rq_flags rf; +- +- rq = task_rq_lock(p, &rf); + p->cpus_ptr = cpumask_of(smp_processor_id()); + update_nr_migratory(p, -1); + p->nr_cpus_allowed = 1; +- task_rq_unlock(rq, p, &rf); + } + + static inline void +@@ -7272,54 +7261,35 @@ migrate_enable_update_cpus_allowed(struct task_struct *p) + + void migrate_disable(void) + { +- struct task_struct *p = current; ++ preempt_disable(); + +- if (in_atomic() || irqs_disabled()) { ++ if (++current->migrate_disable == 1) { ++ this_rq()->nr_pinned++; ++ preempt_lazy_disable(); + #ifdef CONFIG_SCHED_DEBUG +- p->migrate_disable_atomic++; ++ WARN_ON_ONCE(current->pinned_on_cpu >= 0); ++ current->pinned_on_cpu = smp_processor_id(); + #endif +- return; +- } +-#ifdef CONFIG_SCHED_DEBUG +- if (unlikely(p->migrate_disable_atomic)) { +- tracing_off(); +- WARN_ON_ONCE(1); + } +-#endif + +- if (p->migrate_disable) { +- p->migrate_disable++; +- return; +- } ++ preempt_enable(); ++} ++EXPORT_SYMBOL(migrate_disable); + +- preempt_disable(); +- preempt_lazy_disable(); +- pin_current_cpu(); ++static void migrate_disabled_sched(struct task_struct *p) ++{ ++ if (p->migrate_disable_scheduled) ++ return; + + migrate_disable_update_cpus_allowed(p); +- p->migrate_disable = 1; +- +- preempt_enable(); ++ p->migrate_disable_scheduled = 1; + } +-EXPORT_SYMBOL(migrate_disable); + + void migrate_enable(void) + { + struct task_struct *p = current; +- +- if (in_atomic() || irqs_disabled()) { +-#ifdef CONFIG_SCHED_DEBUG +- p->migrate_disable_atomic--; +-#endif +- return; +- } +- +-#ifdef CONFIG_SCHED_DEBUG +- if (unlikely(p->migrate_disable_atomic)) { +- tracing_off(); +- WARN_ON_ONCE(1); +- } +-#endif ++ struct rq *rq = this_rq(); ++ int cpu = task_cpu(p); + + WARN_ON_ONCE(p->migrate_disable <= 0); + if (p->migrate_disable > 1) { +@@ -7329,67 +7299,69 @@ void migrate_enable(void) + + preempt_disable(); + ++#ifdef CONFIG_SCHED_DEBUG ++ WARN_ON_ONCE(current->pinned_on_cpu != cpu); ++ current->pinned_on_cpu = -1; ++#endif ++ ++ WARN_ON_ONCE(rq->nr_pinned < 1); ++ + p->migrate_disable = 0; ++ rq->nr_pinned--; ++ if (rq->nr_pinned == 0 && unlikely(!cpu_active(cpu)) && ++ takedown_cpu_task) ++ wake_up_process(takedown_cpu_task); ++ ++ if (!p->migrate_disable_scheduled) ++ goto out; ++ ++ p->migrate_disable_scheduled = 0; ++ + migrate_enable_update_cpus_allowed(p); + +- if (p->migrate_disable_update) { +- struct rq *rq; ++ WARN_ON(smp_processor_id() != cpu); ++ if (!is_cpu_allowed(p, cpu)) { ++ struct migration_arg arg = { p }; + struct rq_flags rf; +- int cpu = task_cpu(p); + + rq = task_rq_lock(p, &rf); + update_rq_clock(rq); +- +- __do_set_cpus_allowed_tail(p, &p->cpus_mask); ++ arg.dest_cpu = select_fallback_rq(cpu, p); + task_rq_unlock(rq, p, &rf); + +- p->migrate_disable_update = 0; +- +- WARN_ON(smp_processor_id() != cpu); +- if (!cpumask_test_cpu(cpu, &p->cpus_mask)) { +- struct migration_arg arg = { p }; +- struct rq_flags rf; ++ preempt_lazy_enable(); ++ preempt_enable(); + +- rq = task_rq_lock(p, &rf); +- update_rq_clock(rq); +- arg.dest_cpu = select_fallback_rq(cpu, p); +- task_rq_unlock(rq, p, &rf); +- +- unpin_current_cpu(); +- preempt_lazy_enable(); +- preempt_enable(); +- +- sleeping_lock_inc(); +- stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); +- sleeping_lock_dec(); +- tlb_migrate_finish(p->mm); ++ sleeping_lock_inc(); ++ stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); ++ sleeping_lock_dec(); ++ tlb_migrate_finish(p->mm); + +- return; +- } ++ return; + } +- unpin_current_cpu(); ++ ++out: + preempt_lazy_enable(); + preempt_enable(); + } + EXPORT_SYMBOL(migrate_enable); + +-#elif !defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) +-void migrate_disable(void) ++int cpu_nr_pinned(int cpu) + { +-#ifdef CONFIG_SCHED_DEBUG +- struct task_struct *p = current; ++ struct rq *rq = cpu_rq(cpu); + +- if (in_atomic() || irqs_disabled()) { +- p->migrate_disable_atomic++; +- return; +- } ++ return rq->nr_pinned; ++} + +- if (unlikely(p->migrate_disable_atomic)) { +- tracing_off(); +- WARN_ON_ONCE(1); +- } ++#elif !defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) ++static void migrate_disabled_sched(struct task_struct *p) ++{ ++} + +- p->migrate_disable++; ++void migrate_disable(void) ++{ ++#ifdef CONFIG_SCHED_DEBUG ++ current->migrate_disable++; + #endif + barrier(); + } +@@ -7400,20 +7372,14 @@ void migrate_enable(void) + #ifdef CONFIG_SCHED_DEBUG + struct task_struct *p = current; + +- if (in_atomic() || irqs_disabled()) { +- p->migrate_disable_atomic--; +- return; +- } +- +- if (unlikely(p->migrate_disable_atomic)) { +- tracing_off(); +- WARN_ON_ONCE(1); +- } +- + WARN_ON_ONCE(p->migrate_disable <= 0); + p->migrate_disable--; + #endif + barrier(); + } + EXPORT_SYMBOL(migrate_enable); ++#else ++static void migrate_disabled_sched(struct task_struct *p) ++{ ++} + #endif +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index c90574112bca..78fa5911dd55 100644 +--- a/kernel/sched/sched.h ++++ b/kernel/sched/sched.h +@@ -913,6 +913,10 @@ struct rq { + /* Must be inspected within a rcu lock section */ + struct cpuidle_state *idle_state; + #endif ++ ++#if defined(CONFIG_PREEMPT_RT_BASE) && defined(CONFIG_SMP) ++ int nr_pinned; ++#endif + }; + + static inline int cpu_of(struct rq *rq) +diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c +index b8a8a8db2d75..0c80992aa337 100644 +--- a/lib/smp_processor_id.c ++++ b/lib/smp_processor_id.c +@@ -22,6 +22,9 @@ notrace static unsigned int check_preemption_disabled(const char *what1, + * Kernel threads bound to a single CPU can safely use + * smp_processor_id(): + */ ++ if (current->migrate_disable) ++ goto out; ++ + if (current->nr_cpus_allowed == 1) + goto out; + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0313-sched-migrate_enable-Use-stop_one_cpu_nowait.patch b/kernel/patches-4.19.x-rt/0313-sched-migrate_enable-Use-stop_one_cpu_nowait.patch new file mode 100644 index 000000000..ce7fa3f32 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0313-sched-migrate_enable-Use-stop_one_cpu_nowait.patch @@ -0,0 +1,120 @@ +From 1e6b41517e56302ffcac82be49722031f005e97c Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Sat, 12 Oct 2019 01:52:14 -0500 +Subject: [PATCH 313/328] sched: migrate_enable: Use stop_one_cpu_nowait() + +[ Upstream commit 6b39a1fa8c53cae08dc03afdae193b7d3a78a173 ] + +migrate_enable() can be called with current->state != TASK_RUNNING. +Avoid clobbering the existing state by using stop_one_cpu_nowait(). +Since we're stopping the current cpu, we know that we won't get +past __schedule() until migration_cpu_stop() has run (at least up to +the point of migrating us to another cpu). + +Signed-off-by: Scott Wood +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + include/linux/stop_machine.h | 2 ++ + kernel/sched/core.c | 23 +++++++++++++---------- + kernel/stop_machine.c | 7 +++++-- + 3 files changed, 20 insertions(+), 12 deletions(-) + +diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h +index 6d3635c86dbe..82fc686ddd9e 100644 +--- a/include/linux/stop_machine.h ++++ b/include/linux/stop_machine.h +@@ -26,6 +26,8 @@ struct cpu_stop_work { + cpu_stop_fn_t fn; + void *arg; + struct cpu_stop_done *done; ++ /* Did not run due to disabled stopper; for nowait debug checks */ ++ bool disabled; + }; + + int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index e97ac751aad2..e465381b464d 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -990,6 +990,7 @@ static struct rq *move_queued_task(struct rq *rq, struct rq_flags *rf, + struct migration_arg { + struct task_struct *task; + int dest_cpu; ++ bool done; + }; + + /* +@@ -1025,6 +1026,11 @@ static int migration_cpu_stop(void *data) + struct task_struct *p = arg->task; + struct rq *rq = this_rq(); + struct rq_flags rf; ++ int dest_cpu = arg->dest_cpu; ++ ++ /* We don't look at arg after this point. */ ++ smp_mb(); ++ arg->done = true; + + /* + * The original target CPU might have gone down and we might +@@ -1047,9 +1053,9 @@ static int migration_cpu_stop(void *data) + */ + if (task_rq(p) == rq) { + if (task_on_rq_queued(p)) +- rq = __migrate_task(rq, &rf, p, arg->dest_cpu); ++ rq = __migrate_task(rq, &rf, p, dest_cpu); + else +- p->wake_cpu = arg->dest_cpu; ++ p->wake_cpu = dest_cpu; + } + rq_unlock(rq, &rf); + raw_spin_unlock(&p->pi_lock); +@@ -7322,6 +7328,7 @@ void migrate_enable(void) + WARN_ON(smp_processor_id() != cpu); + if (!is_cpu_allowed(p, cpu)) { + struct migration_arg arg = { p }; ++ struct cpu_stop_work work; + struct rq_flags rf; + + rq = task_rq_lock(p, &rf); +@@ -7329,15 +7336,11 @@ void migrate_enable(void) + arg.dest_cpu = select_fallback_rq(cpu, p); + task_rq_unlock(rq, p, &rf); + +- preempt_lazy_enable(); +- preempt_enable(); +- +- sleeping_lock_inc(); +- stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); +- sleeping_lock_dec(); ++ stop_one_cpu_nowait(task_cpu(p), migration_cpu_stop, ++ &arg, &work); + tlb_migrate_finish(p->mm); +- +- return; ++ __schedule(true); ++ WARN_ON_ONCE(!arg.done && !work.disabled); + } + + out: +diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c +index 067cb83f37ea..2d15c0d50625 100644 +--- a/kernel/stop_machine.c ++++ b/kernel/stop_machine.c +@@ -86,8 +86,11 @@ static bool cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work) + enabled = stopper->enabled; + if (enabled) + __cpu_stop_queue_work(stopper, work, &wakeq); +- else if (work->done) +- cpu_stop_signal_done(work->done); ++ else { ++ work->disabled = true; ++ if (work->done) ++ cpu_stop_signal_done(work->done); ++ } + raw_spin_unlock_irqrestore(&stopper->lock, flags); + + wake_up_q(&wakeq); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0314-Revert-ARM-Initialize-split-page-table-locks-for-vec.patch b/kernel/patches-4.19.x-rt/0314-Revert-ARM-Initialize-split-page-table-locks-for-vec.patch new file mode 100644 index 000000000..30110b056 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0314-Revert-ARM-Initialize-split-page-table-locks-for-vec.patch @@ -0,0 +1,86 @@ +From 782db84c043ebd020312649d976fe1c74178ea34 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Fri, 18 Oct 2019 13:04:15 +0200 +Subject: [PATCH 314/328] Revert "ARM: Initialize split page table locks for + vector page" + +[ Upstream commit 247074c44d8c3e619dfde6404a52295d8d671d38 ] + +I'm dropping this patch, with its original description: + +|ARM: Initialize split page table locks for vector page +| +|Without this patch, ARM can not use SPLIT_PTLOCK_CPUS if +|PREEMPT_RT_FULL=y because vectors_user_mapping() creates a +|VM_ALWAYSDUMP mapping of the vector page (address 0xffff0000), but no +|ptl->lock has been allocated for the page. An attempt to coredump +|that page will result in a kernel NULL pointer dereference when +|follow_page() attempts to lock the page. +| +|The call tree to the NULL pointer dereference is: +| +| do_notify_resume() +| get_signal_to_deliver() +| do_coredump() +| elf_core_dump() +| get_dump_page() +| __get_user_pages() +| follow_page() +| pte_offset_map_lock() <----- a #define +| ... +| rt_spin_lock() +| +|The underlying problem is exposed by mm-shrink-the-page-frame-to-rt-size.patch. + +The patch named mm-shrink-the-page-frame-to-rt-size.patch was dropped +from the RT queue once the SPLIT_PTLOCK_CPUS feature (in a slightly +different shape) went upstream (somewhere between v3.12 and v3.14). + +I can see that the patch still allocates a lock which wasn't there +before. However I can't trigger a kernel oops like described in the +patch by triggering a coredump. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + arch/arm/kernel/process.c | 24 ------------------------ + 1 file changed, 24 deletions(-) + +diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c +index 8d3c7ce34c24..82ab015bf42b 100644 +--- a/arch/arm/kernel/process.c ++++ b/arch/arm/kernel/process.c +@@ -324,30 +324,6 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) + } + + #ifdef CONFIG_MMU +-/* +- * CONFIG_SPLIT_PTLOCK_CPUS results in a page->ptl lock. If the lock is not +- * initialized by pgtable_page_ctor() then a coredump of the vector page will +- * fail. +- */ +-static int __init vectors_user_mapping_init_page(void) +-{ +- struct page *page; +- unsigned long addr = 0xffff0000; +- pgd_t *pgd; +- pud_t *pud; +- pmd_t *pmd; +- +- pgd = pgd_offset_k(addr); +- pud = pud_offset(pgd, addr); +- pmd = pmd_offset(pud, addr); +- page = pmd_page(*(pmd)); +- +- pgtable_page_ctor(page); +- +- return 0; +-} +-late_initcall(vectors_user_mapping_init_page); +- + #ifdef CONFIG_KUSER_HELPERS + /* + * The vectors page is always readable from user space for the +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0315-locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch b/kernel/patches-4.19.x-rt/0315-locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch new file mode 100644 index 000000000..d4a84cf86 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0315-locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch @@ -0,0 +1,128 @@ +From 14da0cff2bdb4c5c183a38c223f4d0b03532852a Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Tue, 19 Nov 2019 09:25:04 +0100 +Subject: [PATCH 315/328] locking: Make spinlock_t and rwlock_t a RCU section + on RT + +[ Upstream commit 84440022a0e1c8c936d61f8f97593674a295d409 ] + +On !RT a locked spinlock_t and rwlock_t disables preemption which +implies a RCU read section. There is code that relies on that behaviour. + +Add an explicit RCU read section on RT while a sleeping lock (a lock +which would disables preemption on !RT) acquired. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/locking/rtmutex.c | 6 ++++++ + kernel/locking/rwlock-rt.c | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 63b3d6f306fa..c7d3ae01b4e5 100644 +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -1142,6 +1142,7 @@ void __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) + void __lockfunc rt_spin_lock(spinlock_t *lock) + { + sleeping_lock_inc(); ++ rcu_read_lock(); + migrate_disable(); + spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); + rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); +@@ -1157,6 +1158,7 @@ void __lockfunc __rt_spin_lock(struct rt_mutex *lock) + void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) + { + sleeping_lock_inc(); ++ rcu_read_lock(); + migrate_disable(); + spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); + rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); +@@ -1170,6 +1172,7 @@ void __lockfunc rt_spin_unlock(spinlock_t *lock) + spin_release(&lock->dep_map, 1, _RET_IP_); + rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); + migrate_enable(); ++ rcu_read_unlock(); + sleeping_lock_dec(); + } + EXPORT_SYMBOL(rt_spin_unlock); +@@ -1201,6 +1204,7 @@ int __lockfunc rt_spin_trylock(spinlock_t *lock) + ret = __rt_mutex_trylock(&lock->lock); + if (ret) { + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ++ rcu_read_lock(); + } else { + migrate_enable(); + sleeping_lock_dec(); +@@ -1217,6 +1221,7 @@ int __lockfunc rt_spin_trylock_bh(spinlock_t *lock) + ret = __rt_mutex_trylock(&lock->lock); + if (ret) { + sleeping_lock_inc(); ++ rcu_read_lock(); + migrate_disable(); + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); + } else +@@ -1233,6 +1238,7 @@ int __lockfunc rt_spin_trylock_irqsave(spinlock_t *lock, unsigned long *flags) + ret = __rt_mutex_trylock(&lock->lock); + if (ret) { + sleeping_lock_inc(); ++ rcu_read_lock(); + migrate_disable(); + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); + } +diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c +index c3b91205161c..0ae8c62ea832 100644 +--- a/kernel/locking/rwlock-rt.c ++++ b/kernel/locking/rwlock-rt.c +@@ -310,6 +310,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock) + ret = do_read_rt_trylock(rwlock); + if (ret) { + rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_); ++ rcu_read_lock(); + } else { + migrate_enable(); + sleeping_lock_dec(); +@@ -327,6 +328,7 @@ int __lockfunc rt_write_trylock(rwlock_t *rwlock) + ret = do_write_rt_trylock(rwlock); + if (ret) { + rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); ++ rcu_read_lock(); + } else { + migrate_enable(); + sleeping_lock_dec(); +@@ -338,6 +340,7 @@ EXPORT_SYMBOL(rt_write_trylock); + void __lockfunc rt_read_lock(rwlock_t *rwlock) + { + sleeping_lock_inc(); ++ rcu_read_lock(); + migrate_disable(); + rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_); + do_read_rt_lock(rwlock); +@@ -347,6 +350,7 @@ EXPORT_SYMBOL(rt_read_lock); + void __lockfunc rt_write_lock(rwlock_t *rwlock) + { + sleeping_lock_inc(); ++ rcu_read_lock(); + migrate_disable(); + rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); + do_write_rt_lock(rwlock); +@@ -358,6 +362,7 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock) + rwlock_release(&rwlock->dep_map, 1, _RET_IP_); + do_read_rt_unlock(rwlock); + migrate_enable(); ++ rcu_read_unlock(); + sleeping_lock_dec(); + } + EXPORT_SYMBOL(rt_read_unlock); +@@ -367,6 +372,7 @@ void __lockfunc rt_write_unlock(rwlock_t *rwlock) + rwlock_release(&rwlock->dep_map, 1, _RET_IP_); + do_write_rt_unlock(rwlock); + migrate_enable(); ++ rcu_read_unlock(); + sleeping_lock_dec(); + } + EXPORT_SYMBOL(rt_write_unlock); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0316-sched-core-migrate_enable-must-access-takedown_cpu_t.patch b/kernel/patches-4.19.x-rt/0316-sched-core-migrate_enable-must-access-takedown_cpu_t.patch new file mode 100644 index 000000000..fa6151b8b --- /dev/null +++ b/kernel/patches-4.19.x-rt/0316-sched-core-migrate_enable-must-access-takedown_cpu_t.patch @@ -0,0 +1,54 @@ +From 459ffc40b777727525726563ee2522a82ecfa12c Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Fri, 29 Nov 2019 17:24:55 +0100 +Subject: [PATCH 316/328] sched/core: migrate_enable() must access + takedown_cpu_task on !HOTPLUG_CPU + +[ Upstream commit a61d1977f692e46bad99a100f264981ba08cb4bd ] + +The variable takedown_cpu_task is never declared/used on !HOTPLUG_CPU +except for migrate_enable(). This leads to a link error. + +Don't use takedown_cpu_task in !HOTPLUG_CPU. + +Reported-by: Dick Hollenbeck +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/cpu.c | 2 ++ + kernel/sched/core.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/kernel/cpu.c b/kernel/cpu.c +index 2834eed32b55..d28254597f59 100644 +--- a/kernel/cpu.c ++++ b/kernel/cpu.c +@@ -845,7 +845,9 @@ static int take_cpu_down(void *_param) + return 0; + } + ++#ifdef CONFIG_PREEMPT_RT_BASE + struct task_struct *takedown_cpu_task; ++#endif + + static int takedown_cpu(unsigned int cpu) + { +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index e465381b464d..cbd76324babd 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -7314,9 +7314,11 @@ void migrate_enable(void) + + p->migrate_disable = 0; + rq->nr_pinned--; ++#ifdef CONFIG_HOTPLUG_CPU + if (rq->nr_pinned == 0 && unlikely(!cpu_active(cpu)) && + takedown_cpu_task) + wake_up_process(takedown_cpu_task); ++#endif + + if (!p->migrate_disable_scheduled) + goto out; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0317-lib-smp_processor_id-Adjust-check_preemption_disable.patch b/kernel/patches-4.19.x-rt/0317-lib-smp_processor_id-Adjust-check_preemption_disable.patch new file mode 100644 index 000000000..10526b18c --- /dev/null +++ b/kernel/patches-4.19.x-rt/0317-lib-smp_processor_id-Adjust-check_preemption_disable.patch @@ -0,0 +1,40 @@ +From 9280cd27ed3c962fd0a1c6b2337bdbdd097a7466 Mon Sep 17 00:00:00 2001 +From: Daniel Wagner +Date: Mon, 16 Dec 2019 16:15:57 +0100 +Subject: [PATCH 317/328] lib/smp_processor_id: Adjust + check_preemption_disabled() + +[ Upstream commit af3c1c5fdf177870fb5e6e16b24e374696ab28f5 ] + +The current->migrate_disable counter is not always defined leading to +build failures with DEBUG_PREEMPT && !PREEMPT_RT_BASE. + +Restrict the access to ->migrate_disable to same set where +->migrate_disable is modified. + +Signed-off-by: Daniel Wagner +Signed-off-by: Steven Rostedt (VMware) +[bigeasy: adjust condition + description] +Signed-off-by: Sebastian Andrzej Siewior +--- + lib/smp_processor_id.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c +index 0c80992aa337..2e7398534b66 100644 +--- a/lib/smp_processor_id.c ++++ b/lib/smp_processor_id.c +@@ -22,8 +22,10 @@ notrace static unsigned int check_preemption_disabled(const char *what1, + * Kernel threads bound to a single CPU can safely use + * smp_processor_id(): + */ ++#if defined(CONFIG_PREEMPT_RT_BASE) && (defined(CONFIG_SMP) || defined(CONFIG_SCHED_DEBUG)) + if (current->migrate_disable) + goto out; ++#endif + + if (current->nr_cpus_allowed == 1) + goto out; +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0318-sched-migrate_enable-Busy-loop-until-the-migration-r.patch b/kernel/patches-4.19.x-rt/0318-sched-migrate_enable-Busy-loop-until-the-migration-r.patch new file mode 100644 index 000000000..a6e33b48a --- /dev/null +++ b/kernel/patches-4.19.x-rt/0318-sched-migrate_enable-Busy-loop-until-the-migration-r.patch @@ -0,0 +1,56 @@ +From 7c90df1e8e20e69467cf37d9fafb5a6993f7bf65 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Thu, 12 Dec 2019 10:53:59 +0100 +Subject: [PATCH 318/328] sched: migrate_enable: Busy loop until the migration + request is completed + +[ Upstream commit 140d7f54a5fff02898d2ca9802b39548bf7455f1 ] + +If user task changes the CPU affinity mask of a running task it will +dispatch migration request if the current CPU is no longer allowed. This +might happen shortly before a task enters a migrate_disable() section. +Upon leaving the migrate_disable() section, the task will notice that +the current CPU is no longer allowed and will will dispatch its own +migration request to move it off the current CPU. +While invoking __schedule() the first migration request will be +processed and the task returns on the "new" CPU with "arg.done = 0". Its +own migration request will be processed shortly after and will result in +memory corruption if the stack memory, designed for request, was used +otherwise in the meantime. + +Spin until the migration request has been processed if it was accepted. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/core.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index cbd76324babd..4616c086dd26 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -7329,7 +7329,7 @@ void migrate_enable(void) + + WARN_ON(smp_processor_id() != cpu); + if (!is_cpu_allowed(p, cpu)) { +- struct migration_arg arg = { p }; ++ struct migration_arg arg = { .task = p }; + struct cpu_stop_work work; + struct rq_flags rf; + +@@ -7342,7 +7342,10 @@ void migrate_enable(void) + &arg, &work); + tlb_migrate_finish(p->mm); + __schedule(true); +- WARN_ON_ONCE(!arg.done && !work.disabled); ++ if (!work.disabled) { ++ while (!arg.done) ++ cpu_relax(); ++ } + } + + out: +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0319-userfaultfd-Use-a-seqlock-instead-of-seqcount.patch b/kernel/patches-4.19.x-rt/0319-userfaultfd-Use-a-seqlock-instead-of-seqcount.patch new file mode 100644 index 000000000..c8632febf --- /dev/null +++ b/kernel/patches-4.19.x-rt/0319-userfaultfd-Use-a-seqlock-instead-of-seqcount.patch @@ -0,0 +1,79 @@ +From cb67e79f0923a4a0a62dbedf1d5708586aa67d22 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 18 Dec 2019 12:25:09 +0100 +Subject: [PATCH 319/328] userfaultfd: Use a seqlock instead of seqcount + +[ Upstream commit dc952a564d02997330654be9628bbe97ba2a05d3 ] + +On RT write_seqcount_begin() disables preemption which leads to warning +in add_wait_queue() while the spinlock_t is acquired. +The waitqueue can't be converted to swait_queue because +userfaultfd_wake_function() is used as a custom wake function. + +Use seqlock instead seqcount to avoid the preempt_disable() section +during add_wait_queue(). + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + fs/userfaultfd.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c +index d269d1139f7f..ff6be687f68e 100644 +--- a/fs/userfaultfd.c ++++ b/fs/userfaultfd.c +@@ -61,7 +61,7 @@ struct userfaultfd_ctx { + /* waitqueue head for events */ + wait_queue_head_t event_wqh; + /* a refile sequence protected by fault_pending_wqh lock */ +- struct seqcount refile_seq; ++ seqlock_t refile_seq; + /* pseudo fd refcounting */ + atomic_t refcount; + /* userfaultfd syscall flags */ +@@ -1064,7 +1064,7 @@ static ssize_t userfaultfd_ctx_read(struct userfaultfd_ctx *ctx, int no_wait, + * waitqueue could become empty if this is the + * only userfault. + */ +- write_seqcount_begin(&ctx->refile_seq); ++ write_seqlock(&ctx->refile_seq); + + /* + * The fault_pending_wqh.lock prevents the uwq +@@ -1090,7 +1090,7 @@ static ssize_t userfaultfd_ctx_read(struct userfaultfd_ctx *ctx, int no_wait, + list_del(&uwq->wq.entry); + add_wait_queue(&ctx->fault_wqh, &uwq->wq); + +- write_seqcount_end(&ctx->refile_seq); ++ write_sequnlock(&ctx->refile_seq); + + /* careful to always initialize msg if ret == 0 */ + *msg = uwq->msg; +@@ -1263,11 +1263,11 @@ static __always_inline void wake_userfault(struct userfaultfd_ctx *ctx, + * sure we've userfaults to wake. + */ + do { +- seq = read_seqcount_begin(&ctx->refile_seq); ++ seq = read_seqbegin(&ctx->refile_seq); + need_wakeup = waitqueue_active(&ctx->fault_pending_wqh) || + waitqueue_active(&ctx->fault_wqh); + cond_resched(); +- } while (read_seqcount_retry(&ctx->refile_seq, seq)); ++ } while (read_seqretry(&ctx->refile_seq, seq)); + if (need_wakeup) + __wake_userfault(ctx, range); + } +@@ -1938,7 +1938,7 @@ static void init_once_userfaultfd_ctx(void *mem) + init_waitqueue_head(&ctx->fault_wqh); + init_waitqueue_head(&ctx->event_wqh); + init_waitqueue_head(&ctx->fd_wqh); +- seqcount_init(&ctx->refile_seq); ++ seqlock_init(&ctx->refile_seq); + } + + SYSCALL_DEFINE1(userfaultfd, int, flags) +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0320-sched-migrate_enable-Use-per-cpu-cpu_stop_work.patch b/kernel/patches-4.19.x-rt/0320-sched-migrate_enable-Use-per-cpu-cpu_stop_work.patch new file mode 100644 index 000000000..2fe467b80 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0320-sched-migrate_enable-Use-per-cpu-cpu_stop_work.patch @@ -0,0 +1,82 @@ +From ed060a7dea70ea820b7816dac901e12ad9e40c8a Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Fri, 24 Jan 2020 06:11:46 -0500 +Subject: [PATCH 320/328] sched: migrate_enable: Use per-cpu cpu_stop_work + +[ Upstream commit 2dcd94b443c5dcbc20281666321b7f025f9cc85c ] + +Commit e6c287b1512d ("sched: migrate_enable: Use stop_one_cpu_nowait()") +adds a busy wait to deal with an edge case where the migrated thread +can resume running on another CPU before the stopper has consumed +cpu_stop_work. However, this is done with preemption disabled and can +potentially lead to deadlock. + +While it is not guaranteed that the cpu_stop_work will be consumed before +the migrating thread resumes and exits the stack frame, it is guaranteed +that nothing other than the stopper can run on the old cpu between the +migrating thread scheduling out and the cpu_stop_work being consumed. +Thus, we can store cpu_stop_work in per-cpu data without it being +reused too early. + +Fixes: e6c287b1512d ("sched: migrate_enable: Use stop_one_cpu_nowait()") +Suggested-by: Sebastian Andrzej Siewior +Signed-off-by: Scott Wood +Reviewed-by: Steven Rostedt (VMware) +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/core.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 4616c086dd26..c4290fa5c0b6 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -7291,6 +7291,9 @@ static void migrate_disabled_sched(struct task_struct *p) + p->migrate_disable_scheduled = 1; + } + ++static DEFINE_PER_CPU(struct cpu_stop_work, migrate_work); ++static DEFINE_PER_CPU(struct migration_arg, migrate_arg); ++ + void migrate_enable(void) + { + struct task_struct *p = current; +@@ -7329,23 +7332,26 @@ void migrate_enable(void) + + WARN_ON(smp_processor_id() != cpu); + if (!is_cpu_allowed(p, cpu)) { +- struct migration_arg arg = { .task = p }; +- struct cpu_stop_work work; ++ struct migration_arg __percpu *arg; ++ struct cpu_stop_work __percpu *work; + struct rq_flags rf; + ++ work = this_cpu_ptr(&migrate_work); ++ arg = this_cpu_ptr(&migrate_arg); ++ WARN_ON_ONCE(!arg->done && !work->disabled && work->arg); ++ ++ arg->task = p; ++ arg->done = false; ++ + rq = task_rq_lock(p, &rf); + update_rq_clock(rq); +- arg.dest_cpu = select_fallback_rq(cpu, p); ++ arg->dest_cpu = select_fallback_rq(cpu, p); + task_rq_unlock(rq, p, &rf); + + stop_one_cpu_nowait(task_cpu(p), migration_cpu_stop, +- &arg, &work); ++ arg, work); + tlb_migrate_finish(p->mm); + __schedule(true); +- if (!work.disabled) { +- while (!arg.done) +- cpu_relax(); +- } + } + + out: +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0321-sched-migrate_enable-Remove-__schedule-call.patch b/kernel/patches-4.19.x-rt/0321-sched-migrate_enable-Remove-__schedule-call.patch new file mode 100644 index 000000000..bf41716d2 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0321-sched-migrate_enable-Remove-__schedule-call.patch @@ -0,0 +1,40 @@ +From 5c7f33dce6217b1e9903dbc0b05492b13a1be8c8 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Fri, 24 Jan 2020 06:11:47 -0500 +Subject: [PATCH 321/328] sched: migrate_enable: Remove __schedule() call + +[ Upstream commit b8162e61e9a33bd1de6452eb838fbf50a93ddd9a ] + +We can rely on preempt_enable() to schedule. Besides simplifying the +code, this potentially allows sequences such as the following to be +permitted: + +migrate_disable(); +preempt_disable(); +migrate_enable(); +preempt_enable(); + +Suggested-by: Sebastian Andrzej Siewior +Signed-off-by: Scott Wood +Reviewed-by: Steven Rostedt (VMware) +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/sched/core.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index c4290fa5c0b6..02e51c74e0bf 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -7351,7 +7351,6 @@ void migrate_enable(void) + stop_one_cpu_nowait(task_cpu(p), migration_cpu_stop, + arg, work); + tlb_migrate_finish(p->mm); +- __schedule(true); + } + + out: +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0322-mm-memcontrol-Move-misplaced-local_unlock_irqrestore.patch b/kernel/patches-4.19.x-rt/0322-mm-memcontrol-Move-misplaced-local_unlock_irqrestore.patch new file mode 100644 index 000000000..e8b93ec05 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0322-mm-memcontrol-Move-misplaced-local_unlock_irqrestore.patch @@ -0,0 +1,41 @@ +From 31f20b92c6fb36429f50063bfab6b642d54013c8 Mon Sep 17 00:00:00 2001 +From: Matt Fleming +Date: Sun, 26 Jan 2020 21:19:45 +0000 +Subject: [PATCH 322/328] mm/memcontrol: Move misplaced + local_unlock_irqrestore() + +[ Upstream commit 071a1d6a6e14d0dec240a8c67b425140d7f92f6a ] + +The comment about local_lock_irqsave() mentions just the counters and +css_put_many()'s callback just invokes a worker so it is safe to move the +unlock function after memcg_check_events() so css_put_many() can be invoked +without the lock acquired. + +Cc: Daniel Wagner +Signed-off-by: Matt Fleming +Signed-off-by: Steven Rostedt (VMware) +[bigeasy: rewrote the patch description] +Signed-off-by: Sebastian Andrzej Siewior +--- + mm/memcontrol.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index 421ac74450f6..519528959eef 100644 +--- a/mm/memcontrol.c ++++ b/mm/memcontrol.c +@@ -6540,10 +6540,10 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) + mem_cgroup_charge_statistics(memcg, page, PageTransHuge(page), + -nr_entries); + memcg_check_events(memcg, page); ++ local_unlock_irqrestore(event_lock, flags); + + if (!mem_cgroup_is_root(memcg)) + css_put_many(&memcg->css, nr_entries); +- local_unlock_irqrestore(event_lock, flags); + } + + /** +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0323-locallock-Include-header-for-the-current-macro.patch b/kernel/patches-4.19.x-rt/0323-locallock-Include-header-for-the-current-macro.patch new file mode 100644 index 000000000..13bc0fcc1 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0323-locallock-Include-header-for-the-current-macro.patch @@ -0,0 +1,31 @@ +From eed4b1765107814294260e3f2a1838a7837efffa Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Tue, 4 Feb 2020 13:29:50 +0100 +Subject: [PATCH 323/328] locallock: Include header for the `current' macro + +[ Upstream commit e693075a5fd852043fa8d2b0467e078d9e5cb782 ] + +Include the header for `current' macro so that +CONFIG_KERNEL_HEADER_TEST=y passes. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + include/linux/locallock.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/linux/locallock.h b/include/linux/locallock.h +index 921eab83cd34..81c89d87723b 100644 +--- a/include/linux/locallock.h ++++ b/include/linux/locallock.h +@@ -3,6 +3,7 @@ + + #include + #include ++#include + + #ifdef CONFIG_PREEMPT_RT_BASE + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0324-drm-vmwgfx-Drop-preempt_disable-in-vmw_fifo_ping_hos.patch b/kernel/patches-4.19.x-rt/0324-drm-vmwgfx-Drop-preempt_disable-in-vmw_fifo_ping_hos.patch new file mode 100644 index 000000000..32e31ecf3 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0324-drm-vmwgfx-Drop-preempt_disable-in-vmw_fifo_ping_hos.patch @@ -0,0 +1,44 @@ +From 7a22dfee8ba8e659823a05703d9efb516e7686d2 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Fri, 21 Feb 2020 18:57:11 +0100 +Subject: [PATCH 324/328] drm/vmwgfx: Drop preempt_disable() in + vmw_fifo_ping_host() + +[ Upstream commit b901491e7b9b7a676818d84e482b69be72fc142f ] + +vmw_fifo_ping_host() disables preemption around a test and a register +write via vmw_write(). The write function acquires a spinlock_t typed +lock which is not allowed in a preempt_disable()ed section on +PREEMPT_RT. This has been reported in the bugzilla. + +It has been explained by Thomas Hellstrom that this preempt_disable()ed +section is not required for correctness. + +Remove the preempt_disable() section. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=206591 +Link: https://lkml.kernel.org/r/0b5e1c65d89951de993deab06d1d197b40fd67aa.camel@vmware.com +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +index d0fd147ef75f..fb5a3461bb8c 100644 +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +@@ -167,10 +167,8 @@ void vmw_fifo_ping_host(struct vmw_private *dev_priv, uint32_t reason) + { + u32 *fifo_mem = dev_priv->mmio_virt; + +- preempt_disable(); + if (cmpxchg(fifo_mem + SVGA_FIFO_BUSY, 0, 1) == 0) + vmw_write(dev_priv, SVGA_REG_SYNC, reason); +- preempt_enable(); + } + + void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo) +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0325-tracing-make-preempt_lazy-and-migrate_disable-counte.patch b/kernel/patches-4.19.x-rt/0325-tracing-make-preempt_lazy-and-migrate_disable-counte.patch new file mode 100644 index 000000000..151684a19 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0325-tracing-make-preempt_lazy-and-migrate_disable-counte.patch @@ -0,0 +1,55 @@ +From d64eb967cd8f5dfd95b39da264635c257ac56564 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Fri, 21 Feb 2020 18:15:15 +0100 +Subject: [PATCH 325/328] tracing: make preempt_lazy and migrate_disable + counter smaller + +[ Upstream commit dd430bf5ecb40f9a89679c85868826475d71de54 ] + +The migrate_disable counter should not exceed 255 so it is enough to +store it in an 8bit field. +With this change we can move the `preempt_lazy_count' member into the +gap so the whole struct shrinks by 4 bytes to 12 bytes in total. +Remove the `padding' field, it is not needed. +Update the tracing fields in trace_define_common_fields() (it was +missing the preempt_lazy_count field). + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Steven Rostedt (VMware) +--- + include/linux/trace_events.h | 3 +-- + kernel/trace/trace_events.c | 4 ++-- + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index 72864a11cec0..e26a85c1b7ba 100644 +--- a/include/linux/trace_events.h ++++ b/include/linux/trace_events.h +@@ -62,8 +62,7 @@ struct trace_entry { + unsigned char flags; + unsigned char preempt_count; + int pid; +- unsigned short migrate_disable; +- unsigned short padding; ++ unsigned char migrate_disable; + unsigned char preempt_lazy_count; + }; + +diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c +index 1febb0ca4c81..07b8f5bfd263 100644 +--- a/kernel/trace/trace_events.c ++++ b/kernel/trace/trace_events.c +@@ -188,8 +188,8 @@ static int trace_define_common_fields(void) + __common_field(unsigned char, flags); + __common_field(unsigned char, preempt_count); + __common_field(int, pid); +- __common_field(unsigned short, migrate_disable); +- __common_field(unsigned short, padding); ++ __common_field(unsigned char, migrate_disable); ++ __common_field(unsigned char, preempt_lazy_count); + + return ret; + } +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0326-lib-ubsan-Remove-flags-parameter-from-calls-to-ubsan.patch b/kernel/patches-4.19.x-rt/0326-lib-ubsan-Remove-flags-parameter-from-calls-to-ubsan.patch new file mode 100644 index 000000000..9b3ed0703 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0326-lib-ubsan-Remove-flags-parameter-from-calls-to-ubsan.patch @@ -0,0 +1,56 @@ +From 14d40a0de6df764cb0284a2f94b5c54c75eba9ee Mon Sep 17 00:00:00 2001 +From: Tiejun Chen +Date: Mon, 30 Mar 2020 18:45:23 -0400 +Subject: [PATCH 326/328] lib/ubsan: Remove flags parameter from calls to + ubsan_prologue() and ubsan_epilogue() + +Fails to build with CONFIG_UBSAN=y + +lib/ubsan.c: In function '__ubsan_handle_vla_bound_not_positive': +lib/ubsan.c:348:2: error: too many arguments to function 'ubsan_prologue' + ubsan_prologue(&data->location, &flags); + ^~~~~~~~~~~~~~ +lib/ubsan.c:146:13: note: declared here + static void ubsan_prologue(struct source_location *location) + ^~~~~~~~~~~~~~ +lib/ubsan.c:353:2: error: too many arguments to function 'ubsan_epilogue' + ubsan_epilogue(&flags); + ^~~~~~~~~~~~~~ +lib/ubsan.c:155:13: note: declared here + static void ubsan_epilogue(void) + ^~~~~~~~~~~~~~ + +Signed-off-by: Tiejun Chen +Signed-off-by: Steven Rostedt (VMware) +--- + lib/ubsan.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/lib/ubsan.c b/lib/ubsan.c +index 5830cc9a2164..199c75e03469 100644 +--- a/lib/ubsan.c ++++ b/lib/ubsan.c +@@ -339,18 +339,17 @@ EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1); + void __ubsan_handle_vla_bound_not_positive(struct vla_bound_data *data, + void *bound) + { +- unsigned long flags; + char bound_str[VALUE_LENGTH]; + + if (suppress_report(&data->location)) + return; + +- ubsan_prologue(&data->location, &flags); ++ ubsan_prologue(&data->location); + + val_to_string(bound_str, sizeof(bound_str), data->type, bound); + pr_err("variable length array bound value %s <= 0\n", bound_str); + +- ubsan_epilogue(&flags); ++ ubsan_epilogue(); + } + EXPORT_SYMBOL(__ubsan_handle_vla_bound_not_positive); + +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0327-irq_work-Fix-checking-of-IRQ_WORK_LAZY-flag-set-on-n.patch b/kernel/patches-4.19.x-rt/0327-irq_work-Fix-checking-of-IRQ_WORK_LAZY-flag-set-on-n.patch new file mode 100644 index 000000000..99a639619 --- /dev/null +++ b/kernel/patches-4.19.x-rt/0327-irq_work-Fix-checking-of-IRQ_WORK_LAZY-flag-set-on-n.patch @@ -0,0 +1,71 @@ +From 4fcf946bf6e220c1b07cafc8412afffa5b7e1f10 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Sun, 22 Mar 2020 00:00:28 +0100 +Subject: [PATCH 327/328] irq_work: Fix checking of IRQ_WORK_LAZY flag set on + non PREEMPT_RT + +When CONFIG_PREEMPT_RT_FULL is not set, some of the checks for using +lazy_list are not properly made as the IRQ_WORK_LAZY is not checked. There's +two locations that need this update, so a use_lazy_list() helper function is +added and used in both locations. + +Link: https://lore.kernel.org/r/20200321230028.GA22058@duo.ucw.cz +Reported-by: Pavel Machek +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/irq_work.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/kernel/irq_work.c b/kernel/irq_work.c +index 2940622da5b3..b6d9d35941ac 100644 +--- a/kernel/irq_work.c ++++ b/kernel/irq_work.c +@@ -70,6 +70,12 @@ static void __irq_work_queue_local(struct irq_work *work, struct llist_head *lis + arch_irq_work_raise(); + } + ++static inline bool use_lazy_list(struct irq_work *work) ++{ ++ return (IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !(work->flags & IRQ_WORK_HARD_IRQ)) ++ || (work->flags & IRQ_WORK_LAZY); ++} ++ + /* Enqueue the irq work @work on the current CPU */ + bool irq_work_queue(struct irq_work *work) + { +@@ -81,11 +87,10 @@ bool irq_work_queue(struct irq_work *work) + + /* Queue the entry and raise the IPI if needed. */ + preempt_disable(); +- if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !(work->flags & IRQ_WORK_HARD_IRQ)) ++ if (use_lazy_list(work)) + list = this_cpu_ptr(&lazy_list); + else + list = this_cpu_ptr(&raised_list); +- + __irq_work_queue_local(work, list); + preempt_enable(); + +@@ -106,7 +111,6 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) + + #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)); +@@ -116,10 +120,7 @@ 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))) ++ if (use_lazy_list(work)) + list = &per_cpu(lazy_list, cpu); + else + list = &per_cpu(raised_list, cpu); +-- +2.25.1 + diff --git a/kernel/patches-4.19.x-rt/0283-Linux-4.19.59-rt24-REBASE.patch b/kernel/patches-4.19.x-rt/0328-Linux-4.19.106-rt46-REBASE.patch similarity index 54% rename from kernel/patches-4.19.x-rt/0283-Linux-4.19.59-rt24-REBASE.patch rename to kernel/patches-4.19.x-rt/0328-Linux-4.19.106-rt46-REBASE.patch index 4f4e62f34..66acd5ae1 100644 --- a/kernel/patches-4.19.x-rt/0283-Linux-4.19.59-rt24-REBASE.patch +++ b/kernel/patches-4.19.x-rt/0328-Linux-4.19.106-rt46-REBASE.patch @@ -1,19 +1,19 @@ -From bfbf9b36800f945fc7bd6bf934e65b59831aa03d Mon Sep 17 00:00:00 2001 +From aad78d70e503de59191ef6b3a9a86ef08857e902 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" -Date: Fri, 19 Jul 2019 17:46:46 -0400 -Subject: [PATCH 283/283] Linux 4.19.59-rt24 REBASE +Date: Tue, 31 Mar 2020 12:32:04 -0400 +Subject: [PATCH 328/328] Linux 4.19.106-rt46 REBASE --- localversion-rt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localversion-rt b/localversion-rt -index 1199ebade17b..b2111a212663 100644 +index 1199ebade17b..272158183778 100644 --- a/localversion-rt +++ b/localversion-rt @@ -1 +1 @@ --rt16 -+-rt24 ++-rt46 -- -2.20.1 +2.25.1