diff --git a/examples/rt-for-vmware.yml b/examples/rt-for-vmware.yml index c1306a489..28cbd3b13 100644 --- a/examples/rt-for-vmware.yml +++ b/examples/rt-for-vmware.yml @@ -1,5 +1,5 @@ kernel: - image: linuxkit/kernel:4.14.39-rt + image: linuxkit/kernel:4.14.40-rt cmdline: "console=tty0" init: - linuxkit/init:v0.4 diff --git a/kernel/Makefile b/kernel/Makefile index fbd2ef47a..3a073cfec 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -221,14 +221,14 @@ ifeq ($(ARCH),x86_64) $(eval $(call kernel,4.16.8,4.16.x,$(EXTRA),$(DEBUG))) $(eval $(call kernel,4.14.40,4.14.x,$(EXTRA),$(DEBUG))) $(eval $(call kernel,4.14.40,4.14.x,,-dbg)) -$(eval $(call kernel,4.14.39,4.14.x,-rt,)) +$(eval $(call kernel,4.14.40,4.14.x,-rt,)) $(eval $(call kernel,4.9.99,4.9.x,$(EXTRA),$(DEBUG))) $(eval $(call kernel,4.4.131,4.4.x,$(EXTRA),$(DEBUG))) else ifeq ($(ARCH),aarch64) $(eval $(call kernel,4.16.8,4.16.x,$(EXTRA),$(DEBUG))) $(eval $(call kernel,4.14.40,4.14.x,$(EXTRA),$(DEBUG))) -$(eval $(call kernel,4.14.39,4.14.x,-rt,)) +$(eval $(call kernel,4.14.40,4.14.x,-rt,)) else ifeq ($(ARCH),s390x) $(eval $(call kernel,4.16.8,4.16.x,$(EXTRA),$(DEBUG))) diff --git a/kernel/patches-4.14.x-rt/0001-rtmutex-Make-rt_mutex_futex_unlock-safe-for-irq-off-.patch b/kernel/patches-4.14.x-rt/0001-0001-rtmutex-Make-rt_mutex_futex_unlock-safe-for-irq-off-.patch similarity index 92% rename from kernel/patches-4.14.x-rt/0001-rtmutex-Make-rt_mutex_futex_unlock-safe-for-irq-off-.patch rename to kernel/patches-4.14.x-rt/0001-0001-rtmutex-Make-rt_mutex_futex_unlock-safe-for-irq-off-.patch index 4a72e38e6..d45ca5c07 100644 --- a/kernel/patches-4.14.x-rt/0001-rtmutex-Make-rt_mutex_futex_unlock-safe-for-irq-off-.patch +++ b/kernel/patches-4.14.x-rt/0001-0001-rtmutex-Make-rt_mutex_futex_unlock-safe-for-irq-off-.patch @@ -1,7 +1,8 @@ +From c4e599b49e5c8d708a5aae50cba3885c08e14f10 Mon Sep 17 00:00:00 2001 From: Boqun Feng Date: Fri, 9 Mar 2018 14:56:28 +0800 -Subject: [PATCH] rtmutex: Make rt_mutex_futex_unlock() safe for irq-off - callsites +Subject: [PATCH 001/414] rtmutex: Make rt_mutex_futex_unlock() safe for + irq-off callsites Upstream commit 6b0ef92fee2a3189eba6d6b827b247cb4f6da7e9 @@ -99,12 +100,14 @@ Cc: "Paul E . McKenney" Link: https://lkml.kernel.org/r/20180309065630.8283-1-boqun.feng@gmail.com Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 5 +++-- + kernel/locking/rtmutex.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 65cc0cb984e6..940633c63254 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1616,11 +1616,12 @@ bool __sched __rt_mutex_futex_unlock(str +@@ -1616,11 +1616,12 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex *lock, void __sched rt_mutex_futex_unlock(struct rt_mutex *lock) { DEFINE_WAKE_Q(wake_q); @@ -119,3 +122,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (postunlock) rt_mutex_postunlock(&wake_q); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0002-rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch b/kernel/patches-4.14.x-rt/0002-0002-rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0002-rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch rename to kernel/patches-4.14.x-rt/0002-0002-rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch index 9c3d3c52a..33676f92b 100644 --- a/kernel/patches-4.14.x-rt/0002-rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch +++ b/kernel/patches-4.14.x-rt/0002-0002-rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch @@ -1,6 +1,8 @@ +From 931e32f1e9d36b8c7ca0f365cdb203b146881193 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Tue, 19 Sep 2017 15:36:42 -0700 -Subject: [PATCH] rcu: Suppress lockdep false-positive ->boost_mtx complaints +Subject: [PATCH 002/414] rcu: Suppress lockdep false-positive ->boost_mtx + complaints Upstream commit bcda31a2659497df39d6bedfbdf17498b4f4ac89 @@ -20,9 +22,11 @@ Suggested-by: Peter Zijlstra Signed-off-by: Paul E. McKenney Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/tree_plugin.h | 5 ++--- + kernel/rcu/tree_plugin.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index fed95fa941e6..4428c8edb074 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -31,11 +31,10 @@ @@ -38,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Control variables for per-CPU and per-rcu_node kthreads. These * handle all flavors of RCU. -@@ -530,7 +529,7 @@ void rcu_read_unlock_special(struct task +@@ -530,7 +529,7 @@ void rcu_read_unlock_special(struct task_struct *t) /* Unboost if we were boosted. */ if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex) @@ -47,3 +51,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * If this was the last task on the expedited lists, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0003-brd-remove-unused-brd_mutex.patch b/kernel/patches-4.14.x-rt/0003-0003-brd-remove-unused-brd_mutex.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0003-brd-remove-unused-brd_mutex.patch rename to kernel/patches-4.14.x-rt/0003-0003-brd-remove-unused-brd_mutex.patch index ff9f7053b..028f88893 100644 --- a/kernel/patches-4.14.x-rt/0003-brd-remove-unused-brd_mutex.patch +++ b/kernel/patches-4.14.x-rt/0003-0003-brd-remove-unused-brd_mutex.patch @@ -1,6 +1,7 @@ +From d689ef6876481d308cbbd28351b8130e474c3363 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Fri, 10 Nov 2017 12:29:34 -0500 -Subject: [PATCH] brd: remove unused brd_mutex +Subject: [PATCH 003/414] brd: remove unused brd_mutex Upstream commit 15f7b41f70ddcca3b555bd0fdc7c8da7466b517e @@ -11,9 +12,11 @@ Signed-off-by: Mikulas Patocka Signed-off-by: Jens Axboe Signed-off-by: Sebastian Andrzej Siewior --- - drivers/block/brd.c | 1 - + drivers/block/brd.c | 1 - 1 file changed, 1 deletion(-) +diff --git a/drivers/block/brd.c b/drivers/block/brd.c +index 2d7178f7754e..c1cf87718c2e 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -60,7 +60,6 @@ struct brd_device { @@ -24,3 +27,6 @@ Signed-off-by: Sebastian Andrzej Siewior static struct page *brd_lookup_page(struct brd_device *brd, sector_t sector) { pgoff_t idx; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0004-KVM-arm-arm64-Remove-redundant-preemptible-checks.patch b/kernel/patches-4.14.x-rt/0004-0004-KVM-arm-arm64-Remove-redundant-preemptible-checks.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0004-KVM-arm-arm64-Remove-redundant-preemptible-checks.patch rename to kernel/patches-4.14.x-rt/0004-0004-KVM-arm-arm64-Remove-redundant-preemptible-checks.patch index c9da70d31..cf1ae473f 100644 --- a/kernel/patches-4.14.x-rt/0004-KVM-arm-arm64-Remove-redundant-preemptible-checks.patch +++ b/kernel/patches-4.14.x-rt/0004-0004-KVM-arm-arm64-Remove-redundant-preemptible-checks.patch @@ -1,6 +1,7 @@ +From 520763c6d6fd5b219945a64ecbd55e53d3da02db Mon Sep 17 00:00:00 2001 From: Christoffer Dall Date: Fri, 8 Sep 2017 07:07:13 -0700 -Subject: [PATCH] KVM: arm/arm64: Remove redundant preemptible checks +Subject: [PATCH 004/414] KVM: arm/arm64: Remove redundant preemptible checks Upstream commit 5a24575032971c5a9a4580417a791c427ebdb8e5 @@ -15,12 +16,14 @@ Reviewed-by: Andre Przywara Signed-off-by: Christoffer Dall Signed-off-by: Sebastian Andrzej Siewior --- - virt/kvm/arm/arm.c | 2 -- + virt/kvm/arm/arm.c | 2 -- 1 file changed, 2 deletions(-) +diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c +index 9bee849db682..0c5d846ba809 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c -@@ -69,7 +69,6 @@ static DEFINE_PER_CPU(unsigned char, kvm +@@ -69,7 +69,6 @@ static DEFINE_PER_CPU(unsigned char, kvm_arm_hardware_enabled); static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) { @@ -28,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior __this_cpu_write(kvm_arm_running_vcpu, vcpu); } -@@ -79,7 +78,6 @@ static void kvm_arm_set_running_vcpu(str +@@ -79,7 +78,6 @@ static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) */ struct kvm_vcpu *kvm_arm_get_running_vcpu(void) { @@ -36,3 +39,6 @@ Signed-off-by: Sebastian Andrzej Siewior return __this_cpu_read(kvm_arm_running_vcpu); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0005-string-drop-__must_check-from-strscpy-and-restore-st.patch b/kernel/patches-4.14.x-rt/0005-0005-string-drop-__must_check-from-strscpy-and-restore-st.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0005-string-drop-__must_check-from-strscpy-and-restore-st.patch rename to kernel/patches-4.14.x-rt/0005-0005-string-drop-__must_check-from-strscpy-and-restore-st.patch index 4a6e141da..3d81e3455 100644 --- a/kernel/patches-4.14.x-rt/0005-string-drop-__must_check-from-strscpy-and-restore-st.patch +++ b/kernel/patches-4.14.x-rt/0005-0005-string-drop-__must_check-from-strscpy-and-restore-st.patch @@ -1,6 +1,7 @@ +From 01a042ced8c75ed10fd78fa8209831f0ef009057 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 9 Jan 2018 07:21:15 -0800 -Subject: [PATCH] string: drop __must_check from strscpy() and restore +Subject: [PATCH 005/414] string: drop __must_check from strscpy() and restore strscpy() usages in cgroup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -46,12 +47,14 @@ Cc: Chris Metcalf [bigeasy: drop the cgroup.c hunk] Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/string.h | 2 +- + include/linux/string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/include/linux/string.h b/include/linux/string.h +index cfd83eb2f926..96115bf561b4 100644 --- a/include/linux/string.h +++ b/include/linux/string.h -@@ -28,7 +28,7 @@ extern char * strncpy(char *,const char +@@ -28,7 +28,7 @@ extern char * strncpy(char *,const char *, __kernel_size_t); size_t strlcpy(char *, const char *, size_t); #endif #ifndef __HAVE_ARCH_STRSCPY @@ -60,3 +63,6 @@ Signed-off-by: Sebastian Andrzej Siewior #endif #ifndef __HAVE_ARCH_STRCAT extern char * strcat(char *, const char *); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0006-0001-iommu-amd-Use-raw-locks-on-atomic-context-paths.patch b/kernel/patches-4.14.x-rt/0006-0006-iommu-amd-Use-raw-locks-on-atomic-context-paths.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0006-0001-iommu-amd-Use-raw-locks-on-atomic-context-paths.patch rename to kernel/patches-4.14.x-rt/0006-0006-iommu-amd-Use-raw-locks-on-atomic-context-paths.patch index 3f2de7b84..c12d0dc91 100644 --- a/kernel/patches-4.14.x-rt/0006-0001-iommu-amd-Use-raw-locks-on-atomic-context-paths.patch +++ b/kernel/patches-4.14.x-rt/0006-0006-iommu-amd-Use-raw-locks-on-atomic-context-paths.patch @@ -1,6 +1,7 @@ +From 9349f5838334cb833010161e09660abee2f51b31 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Sun, 21 Jan 2018 03:28:54 -0600 -Subject: [PATCH 1/3] iommu/amd: Use raw locks on atomic context paths +Subject: [PATCH 006/414] iommu/amd: Use raw locks on atomic context paths Upstream commit 27790398c2aed917828dc3c6f81240d57f1584c9 @@ -13,14 +14,16 @@ a potential PREEMPT_RT latency concern but not easily avoidable. Signed-off-by: Scott Wood Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 30 +++++++++++++++--------------- - drivers/iommu/amd_iommu_init.c | 2 +- - drivers/iommu/amd_iommu_types.h | 4 ++-- + drivers/iommu/amd_iommu.c | 30 +++++++++++++++--------------- + drivers/iommu/amd_iommu_init.c | 2 +- + drivers/iommu/amd_iommu_types.h | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index 99a2a57b6cfd..5e519630eefb 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -1054,9 +1054,9 @@ static int iommu_queue_command_sync(stru +@@ -1054,9 +1054,9 @@ static int iommu_queue_command_sync(struct amd_iommu *iommu, unsigned long flags; int ret; @@ -32,7 +35,7 @@ Signed-off-by: Joerg Roedel return ret; } -@@ -1082,7 +1082,7 @@ static int iommu_completion_wait(struct +@@ -1082,7 +1082,7 @@ static int iommu_completion_wait(struct amd_iommu *iommu) build_completion_wait(&cmd, (u64)&iommu->cmd_sem); @@ -41,7 +44,7 @@ Signed-off-by: Joerg Roedel iommu->cmd_sem = 0; -@@ -1093,7 +1093,7 @@ static int iommu_completion_wait(struct +@@ -1093,7 +1093,7 @@ static int iommu_completion_wait(struct amd_iommu *iommu) ret = wait_on_sem(&iommu->cmd_sem); out_unlock: @@ -50,7 +53,7 @@ Signed-off-by: Joerg Roedel return ret; } -@@ -3618,7 +3618,7 @@ static struct irq_remap_table *get_irq_t +@@ -3618,7 +3618,7 @@ static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic) goto out_unlock; /* Initialize table spin-lock */ @@ -59,7 +62,7 @@ Signed-off-by: Joerg Roedel if (ioapic) /* Keep the first 32 indexes free for IOAPIC interrupts */ -@@ -3677,7 +3677,7 @@ static int alloc_irq_index(u16 devid, in +@@ -3677,7 +3677,7 @@ static int alloc_irq_index(u16 devid, int count) if (!table) return -ENODEV; @@ -68,7 +71,7 @@ Signed-off-by: Joerg Roedel /* Scan table for free entries */ for (c = 0, index = table->min_index; -@@ -3700,7 +3700,7 @@ static int alloc_irq_index(u16 devid, in +@@ -3700,7 +3700,7 @@ static int alloc_irq_index(u16 devid, int count) index = -ENOSPC; out: @@ -77,7 +80,7 @@ Signed-off-by: Joerg Roedel return index; } -@@ -3721,7 +3721,7 @@ static int modify_irte_ga(u16 devid, int +@@ -3721,7 +3721,7 @@ static int modify_irte_ga(u16 devid, int index, struct irte_ga *irte, if (!table) return -ENOMEM; @@ -86,7 +89,7 @@ Signed-off-by: Joerg Roedel entry = (struct irte_ga *)table->table; entry = &entry[index]; -@@ -3732,7 +3732,7 @@ static int modify_irte_ga(u16 devid, int +@@ -3732,7 +3732,7 @@ static int modify_irte_ga(u16 devid, int index, struct irte_ga *irte, if (data) data->ref = entry; @@ -95,7 +98,7 @@ Signed-off-by: Joerg Roedel iommu_flush_irt(iommu, devid); iommu_completion_wait(iommu); -@@ -3754,9 +3754,9 @@ static int modify_irte(u16 devid, int in +@@ -3754,9 +3754,9 @@ static int modify_irte(u16 devid, int index, union irte *irte) if (!table) return -ENOMEM; @@ -107,7 +110,7 @@ Signed-off-by: Joerg Roedel iommu_flush_irt(iommu, devid); iommu_completion_wait(iommu); -@@ -3778,9 +3778,9 @@ static void free_irte(u16 devid, int ind +@@ -3778,9 +3778,9 @@ static void free_irte(u16 devid, int index) if (!table) return; @@ -119,7 +122,7 @@ Signed-off-by: Joerg Roedel iommu_flush_irt(iommu, devid); iommu_completion_wait(iommu); -@@ -4359,7 +4359,7 @@ int amd_iommu_update_ga(int cpu, bool is +@@ -4359,7 +4359,7 @@ int amd_iommu_update_ga(int cpu, bool is_run, void *data) if (!irt) return -ENODEV; @@ -128,7 +131,7 @@ Signed-off-by: Joerg Roedel if (ref->lo.fields_vapic.guest_mode) { if (cpu >= 0) -@@ -4368,7 +4368,7 @@ int amd_iommu_update_ga(int cpu, bool is +@@ -4368,7 +4368,7 @@ int amd_iommu_update_ga(int cpu, bool is_run, void *data) barrier(); } @@ -137,9 +140,11 @@ Signed-off-by: Joerg Roedel iommu_flush_irt(iommu, devid); iommu_completion_wait(iommu); +diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c +index 6fe2d0346073..e3cd81b32a33 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c -@@ -1474,7 +1474,7 @@ static int __init init_iommu_one(struct +@@ -1474,7 +1474,7 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h) { int ret; @@ -148,6 +153,8 @@ Signed-off-by: Joerg Roedel /* Add IOMMU to internal data structures */ list_add_tail(&iommu->list, &amd_iommu_list); +diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h +index f6b24c7d8b70..7521745dc2a5 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -406,7 +406,7 @@ extern bool amd_iommu_iotlb_sup; @@ -168,3 +175,6 @@ Signed-off-by: Joerg Roedel /* Pointer to PCI device of this IOMMU */ struct pci_dev *dev; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0007-0002-iommu-amd-Don-t-use-dev_data-in-irte_ga_set_affinity.patch b/kernel/patches-4.14.x-rt/0007-0007-iommu-amd-Don-t-use-dev_data-in-irte_ga_set_affinity.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0007-0002-iommu-amd-Don-t-use-dev_data-in-irte_ga_set_affinity.patch rename to kernel/patches-4.14.x-rt/0007-0007-iommu-amd-Don-t-use-dev_data-in-irte_ga_set_affinity.patch index dbc0ac85a..43c182463 100644 --- a/kernel/patches-4.14.x-rt/0007-0002-iommu-amd-Don-t-use-dev_data-in-irte_ga_set_affinity.patch +++ b/kernel/patches-4.14.x-rt/0007-0007-iommu-amd-Don-t-use-dev_data-in-irte_ga_set_affinity.patch @@ -1,6 +1,8 @@ +From b906b00cd362b81ac8c584c5323c103ed49e5a8b Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Sun, 28 Jan 2018 14:22:19 -0600 -Subject: [PATCH 2/3] iommu/amd: Don't use dev_data in irte_ga_set_affinity() +Subject: [PATCH 007/414] iommu/amd: Don't use dev_data in + irte_ga_set_affinity() Upstream commit 01ee04badefd296eb7a4430497373be9b7b16783 @@ -12,12 +14,14 @@ not set. Signed-off-by: Scott Wood Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 4 +--- + drivers/iommu/amd_iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index 5e519630eefb..f8051e20d889 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -3861,10 +3861,8 @@ static void irte_ga_set_affinity(void *e +@@ -3861,10 +3861,8 @@ static void irte_ga_set_affinity(void *entry, u16 devid, u16 index, u8 vector, u32 dest_apicid) { struct irte_ga *irte = (struct irte_ga *) entry; @@ -29,3 +33,6 @@ Signed-off-by: Joerg Roedel irte->hi.fields.vector = vector; irte->lo.fields_remap.destination = dest_apicid; modify_irte_ga(devid, index, irte, NULL); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0008-0003-iommu-amd-Avoid-locking-get_irq_table-from-atomic-co.patch b/kernel/patches-4.14.x-rt/0008-0008-iommu-amd-Avoid-locking-get_irq_table-from-atomic-co.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0008-0003-iommu-amd-Avoid-locking-get_irq_table-from-atomic-co.patch rename to kernel/patches-4.14.x-rt/0008-0008-iommu-amd-Avoid-locking-get_irq_table-from-atomic-co.patch index 5b82337b7..6b94f3dba 100644 --- a/kernel/patches-4.14.x-rt/0008-0003-iommu-amd-Avoid-locking-get_irq_table-from-atomic-co.patch +++ b/kernel/patches-4.14.x-rt/0008-0008-iommu-amd-Avoid-locking-get_irq_table-from-atomic-co.patch @@ -1,6 +1,7 @@ +From 072abaf533882390fe60b431f8b60cd30f183a11 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Wed, 14 Feb 2018 17:36:28 -0600 -Subject: [PATCH 3/3] iommu/amd: Avoid locking get_irq_table() from atomic +Subject: [PATCH 008/414] iommu/amd: Avoid locking get_irq_table() from atomic context Upstream commit df42a04b15f19a842393dc98a84cbc52b1f8ed49 @@ -31,12 +32,14 @@ if it doesn't find what it's looking for. Signed-off-by: Scott Wood Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 29 ++++++++++++++++++++++------- + drivers/iommu/amd_iommu.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index f8051e20d889..1d9ba3e59fb0 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -3586,7 +3586,22 @@ static void set_dte_irq_entry(u16 devid, +@@ -3586,7 +3586,22 @@ static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table) amd_iommu_dev_table[devid].data[2] = dte; } @@ -60,7 +63,7 @@ Signed-off-by: Joerg Roedel { struct irq_remap_table *table = NULL; struct amd_iommu *iommu; -@@ -3673,7 +3688,7 @@ static int alloc_irq_index(u16 devid, in +@@ -3673,7 +3688,7 @@ static int alloc_irq_index(u16 devid, int count) if (!iommu) return -ENODEV; @@ -69,7 +72,7 @@ Signed-off-by: Joerg Roedel if (!table) return -ENODEV; -@@ -3717,7 +3732,7 @@ static int modify_irte_ga(u16 devid, int +@@ -3717,7 +3732,7 @@ static int modify_irte_ga(u16 devid, int index, struct irte_ga *irte, if (iommu == NULL) return -EINVAL; @@ -78,7 +81,7 @@ Signed-off-by: Joerg Roedel if (!table) return -ENOMEM; -@@ -3750,7 +3765,7 @@ static int modify_irte(u16 devid, int in +@@ -3750,7 +3765,7 @@ static int modify_irte(u16 devid, int index, union irte *irte) if (iommu == NULL) return -EINVAL; @@ -87,7 +90,7 @@ Signed-off-by: Joerg Roedel if (!table) return -ENOMEM; -@@ -3774,7 +3789,7 @@ static void free_irte(u16 devid, int ind +@@ -3774,7 +3789,7 @@ static void free_irte(u16 devid, int index) if (iommu == NULL) return; @@ -96,7 +99,7 @@ Signed-off-by: Joerg Roedel if (!table) return; -@@ -4092,7 +4107,7 @@ static int irq_remapping_alloc(struct ir +@@ -4092,7 +4107,7 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, return ret; if (info->type == X86_IRQ_ALLOC_TYPE_IOAPIC) { @@ -105,7 +108,7 @@ Signed-off-by: Joerg Roedel index = info->ioapic_pin; else ret = -ENOMEM; -@@ -4353,7 +4368,7 @@ int amd_iommu_update_ga(int cpu, bool is +@@ -4353,7 +4368,7 @@ int amd_iommu_update_ga(int cpu, bool is_run, void *data) if (!iommu) return -ENODEV; @@ -114,3 +117,6 @@ Signed-off-by: Joerg Roedel if (!irt) return -ENODEV; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0009-0001-iommu-amd-Take-into-account-that-alloc_dev_data-may-.patch b/kernel/patches-4.14.x-rt/0009-0009-iommu-amd-Take-into-account-that-alloc_dev_data-may-.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0009-0001-iommu-amd-Take-into-account-that-alloc_dev_data-may-.patch rename to kernel/patches-4.14.x-rt/0009-0009-iommu-amd-Take-into-account-that-alloc_dev_data-may-.patch index 5f7d6e149..507de6379 100644 --- a/kernel/patches-4.14.x-rt/0009-0001-iommu-amd-Take-into-account-that-alloc_dev_data-may-.patch +++ b/kernel/patches-4.14.x-rt/0009-0009-iommu-amd-Take-into-account-that-alloc_dev_data-may-.patch @@ -1,7 +1,8 @@ +From 24cf22a0af51ede25f532a63abc0651f31892f6a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:33 +0100 -Subject: [PATCH 01/10] iommu/amd: Take into account that alloc_dev_data() may - return NULL +Subject: [PATCH 009/414] iommu/amd: Take into account that alloc_dev_data() + may return NULL Upstream commit 39ffe39545cd5cb5b8cee9f0469165cf24dc62c2 @@ -16,12 +17,14 @@ Fixes: df3f7a6e8e85 ("iommu/amd: Use is_attach_deferred call-back") Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 2 ++ + drivers/iommu/amd_iommu.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index 1d9ba3e59fb0..e42992fcebca 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -311,6 +311,8 @@ static struct iommu_dev_data *find_dev_d +@@ -311,6 +311,8 @@ static struct iommu_dev_data *find_dev_data(u16 devid) if (dev_data == NULL) { dev_data = alloc_dev_data(devid); @@ -30,3 +33,6 @@ Signed-off-by: Joerg Roedel if (translation_pre_enabled(iommu)) dev_data->defer_attach = true; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0010-0002-iommu-amd-Turn-dev_data_list-into-a-lock-less-list.patch b/kernel/patches-4.14.x-rt/0010-0010-iommu-amd-Turn-dev_data_list-into-a-lock-less-list.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0010-0002-iommu-amd-Turn-dev_data_list-into-a-lock-less-list.patch rename to kernel/patches-4.14.x-rt/0010-0010-iommu-amd-Turn-dev_data_list-into-a-lock-less-list.patch index bc909a2b8..d020a3b20 100644 --- a/kernel/patches-4.14.x-rt/0010-0002-iommu-amd-Turn-dev_data_list-into-a-lock-less-list.patch +++ b/kernel/patches-4.14.x-rt/0010-0010-iommu-amd-Turn-dev_data_list-into-a-lock-less-list.patch @@ -1,6 +1,7 @@ +From 863473ee01efb23dcc2bbe8c7f93e2e6355b06ab Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:34 +0100 -Subject: [PATCH 02/10] iommu/amd: Turn dev_data_list into a lock less list +Subject: [PATCH 010/414] iommu/amd: Turn dev_data_list into a lock less list Upstream commit 779da73273fc4c4c6f41579a95e4fb7880a1720e @@ -18,10 +19,12 @@ it. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 28 ++++++++++------------------ - drivers/iommu/amd_iommu_types.h | 2 +- + drivers/iommu/amd_iommu.c | 28 ++++++++++------------------ + drivers/iommu/amd_iommu_types.h | 2 +- 2 files changed, 11 insertions(+), 19 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index e42992fcebca..1babecd37819 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -84,8 +84,7 @@ @@ -34,7 +37,7 @@ Signed-off-by: Joerg Roedel LIST_HEAD(ioapic_map); LIST_HEAD(hpet_map); -@@ -204,40 +203,33 @@ static struct dma_ops_domain* to_dma_ops +@@ -204,40 +203,33 @@ static struct dma_ops_domain* to_dma_ops_domain(struct protection_domain *domain static struct iommu_dev_data *alloc_dev_data(u16 devid) { struct iommu_dev_data *dev_data; @@ -84,6 +87,8 @@ Signed-off-by: Joerg Roedel } static int __last_alias(struct pci_dev *pdev, u16 alias, void *data) +diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h +index 7521745dc2a5..16b1404da58c 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -625,7 +625,7 @@ struct devid_map { @@ -95,3 +100,6 @@ Signed-off-by: Joerg Roedel struct protection_domain *domain; /* Domain the device is bound to */ u16 devid; /* PCI Device ID */ u16 alias; /* Alias Device ID */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0011-0003-iommu-amd-Split-domain-id-out-of-amd_iommu_devtable_.patch b/kernel/patches-4.14.x-rt/0011-0011-iommu-amd-Split-domain-id-out-of-amd_iommu_devtable_.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0011-0003-iommu-amd-Split-domain-id-out-of-amd_iommu_devtable_.patch rename to kernel/patches-4.14.x-rt/0011-0011-iommu-amd-Split-domain-id-out-of-amd_iommu_devtable_.patch index da2620d56..60bc7a1f9 100644 --- a/kernel/patches-4.14.x-rt/0011-0003-iommu-amd-Split-domain-id-out-of-amd_iommu_devtable_.patch +++ b/kernel/patches-4.14.x-rt/0011-0011-iommu-amd-Split-domain-id-out-of-amd_iommu_devtable_.patch @@ -1,6 +1,7 @@ +From 7cb31bdffcda0eecb44fe97161cca58de406b30d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:35 +0100 -Subject: [PATCH 03/10] iommu/amd: Split domain id out of +Subject: [PATCH 011/414] iommu/amd: Split domain id out of amd_iommu_devtable_lock Upstream commit 2bc00180890427dcc092b2f2b0d03c904bcade29 @@ -13,9 +14,11 @@ amd_iommu_devtable_lock, it can use its own lock for this operation. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 12 +++++------- + drivers/iommu/amd_iommu.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index 1babecd37819..250b6354fae5 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -82,6 +82,7 @@ @@ -26,7 +29,7 @@ Signed-off-by: Joerg Roedel /* List of all available dev_data structures */ static LLIST_HEAD(dev_data_list); -@@ -1596,29 +1597,26 @@ static void del_domain_from_list(struct +@@ -1596,29 +1597,26 @@ static void del_domain_from_list(struct protection_domain *domain) static u16 domain_id_alloc(void) { @@ -60,3 +63,6 @@ Signed-off-by: Joerg Roedel } #define DEFINE_FREE_PT_FN(LVL, FN) \ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0012-0004-iommu-amd-Split-irq_lookup_table-out-of-the-amd_iomm.patch b/kernel/patches-4.14.x-rt/0012-0012-iommu-amd-Split-irq_lookup_table-out-of-the-amd_iomm.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0012-0004-iommu-amd-Split-irq_lookup_table-out-of-the-amd_iomm.patch rename to kernel/patches-4.14.x-rt/0012-0012-iommu-amd-Split-irq_lookup_table-out-of-the-amd_iomm.patch index 6d90ec963..a06df83a2 100644 --- a/kernel/patches-4.14.x-rt/0012-0004-iommu-amd-Split-irq_lookup_table-out-of-the-amd_iomm.patch +++ b/kernel/patches-4.14.x-rt/0012-0012-iommu-amd-Split-irq_lookup_table-out-of-the-amd_iomm.patch @@ -1,6 +1,7 @@ +From 8ecb90107b650a4db6b9226e0c0049642a1172c9 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:36 +0100 -Subject: [PATCH 04/10] iommu/amd: Split irq_lookup_table out of the +Subject: [PATCH 012/414] iommu/amd: Split irq_lookup_table out of the amd_iommu_devtable_lock Upstream commit ea6166f4b83e9cfba1c18f46a764d50045682fe5 @@ -17,9 +18,11 @@ So split out get_irq_table() out of amd_iommu_devtable_lock's lock. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 5 +++-- + drivers/iommu/amd_iommu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index 250b6354fae5..2cedb0caec73 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -83,6 +83,7 @@ @@ -30,7 +33,7 @@ Signed-off-by: Joerg Roedel /* List of all available dev_data structures */ static LLIST_HEAD(dev_data_list); -@@ -3600,7 +3601,7 @@ static struct irq_remap_table *alloc_irq +@@ -3600,7 +3601,7 @@ static struct irq_remap_table *alloc_irq_table(u16 devid, bool ioapic) unsigned long flags; u16 alias; @@ -39,7 +42,7 @@ Signed-off-by: Joerg Roedel iommu = amd_iommu_rlookup_table[devid]; if (!iommu) -@@ -3665,7 +3666,7 @@ static struct irq_remap_table *alloc_irq +@@ -3665,7 +3666,7 @@ static struct irq_remap_table *alloc_irq_table(u16 devid, bool ioapic) iommu_completion_wait(iommu); out_unlock: @@ -48,3 +51,6 @@ Signed-off-by: Joerg Roedel return table; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0013-0005-iommu-amd-Remove-the-special-case-from-alloc_irq_tab.patch b/kernel/patches-4.14.x-rt/0013-0013-iommu-amd-Remove-the-special-case-from-alloc_irq_tab.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0013-0005-iommu-amd-Remove-the-special-case-from-alloc_irq_tab.patch rename to kernel/patches-4.14.x-rt/0013-0013-iommu-amd-Remove-the-special-case-from-alloc_irq_tab.patch index 0acd6d2f3..d6551d1bc 100644 --- a/kernel/patches-4.14.x-rt/0013-0005-iommu-amd-Remove-the-special-case-from-alloc_irq_tab.patch +++ b/kernel/patches-4.14.x-rt/0013-0013-iommu-amd-Remove-the-special-case-from-alloc_irq_tab.patch @@ -1,6 +1,7 @@ +From ab23fbb1785b1b4d6746dc36c507bf0a8991be7d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:37 +0100 -Subject: [PATCH 05/10] iommu/amd: Remove the special case from +Subject: [PATCH 013/414] iommu/amd: Remove the special case from alloc_irq_table() Upstream commit fde65dd3d3096e8f6ecc7bbe544eb91f4220772c @@ -16,12 +17,14 @@ against other user. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 34 ++++++++++++++++++++-------------- + drivers/iommu/amd_iommu.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index 2cedb0caec73..fc23b89d2372 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -3594,7 +3594,7 @@ static struct irq_remap_table *get_irq_t +@@ -3594,7 +3594,7 @@ static struct irq_remap_table *get_irq_table(u16 devid) return table; } @@ -30,7 +33,7 @@ Signed-off-by: Joerg Roedel { struct irq_remap_table *table = NULL; struct amd_iommu *iommu; -@@ -3628,10 +3628,6 @@ static struct irq_remap_table *alloc_irq +@@ -3628,10 +3628,6 @@ static struct irq_remap_table *alloc_irq_table(u16 devid, bool ioapic) /* Initialize table spin-lock */ raw_spin_lock_init(&table->lock); @@ -41,7 +44,7 @@ Signed-off-by: Joerg Roedel table->table = kmem_cache_alloc(amd_iommu_irq_cache, GFP_ATOMIC); if (!table->table) { kfree(table); -@@ -3646,12 +3642,6 @@ static struct irq_remap_table *alloc_irq +@@ -3646,12 +3642,6 @@ static struct irq_remap_table *alloc_irq_table(u16 devid, bool ioapic) memset(table->table, 0, (MAX_IRQS_PER_TABLE * (sizeof(u64) * 2))); @@ -54,7 +57,7 @@ Signed-off-by: Joerg Roedel irq_lookup_table[devid] = table; set_dte_irq_entry(devid, table); -@@ -3681,7 +3671,7 @@ static int alloc_irq_index(u16 devid, in +@@ -3681,7 +3671,7 @@ static int alloc_irq_index(u16 devid, int count) if (!iommu) return -ENODEV; @@ -63,7 +66,7 @@ Signed-off-by: Joerg Roedel if (!table) return -ENODEV; -@@ -4100,10 +4090,26 @@ static int irq_remapping_alloc(struct ir +@@ -4100,10 +4090,26 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, return ret; if (info->type == X86_IRQ_ALLOC_TYPE_IOAPIC) { @@ -92,3 +95,6 @@ Signed-off-by: Joerg Roedel } else { index = alloc_irq_index(devid, nr_irqs); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0014-0006-iommu-amd-Use-table-instead-irt-as-variable-name-in-.patch b/kernel/patches-4.14.x-rt/0014-0014-iommu-amd-Use-table-instead-irt-as-variable-name-in-.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0014-0006-iommu-amd-Use-table-instead-irt-as-variable-name-in-.patch rename to kernel/patches-4.14.x-rt/0014-0014-iommu-amd-Use-table-instead-irt-as-variable-name-in-.patch index 157407927..861add066 100644 --- a/kernel/patches-4.14.x-rt/0014-0006-iommu-amd-Use-table-instead-irt-as-variable-name-in-.patch +++ b/kernel/patches-4.14.x-rt/0014-0014-iommu-amd-Use-table-instead-irt-as-variable-name-in-.patch @@ -1,6 +1,7 @@ +From cf22088f7362c4376ce97060706eab7ba9300cac Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:38 +0100 -Subject: [PATCH 06/10] iommu/amd: Use `table' instead `irt' as variable name +Subject: [PATCH 014/414] iommu/amd: Use `table' instead `irt' as variable name in amd_iommu_update_ga() Upstream commit 4fde541c9dc114c5b448ad34b0286fe8b7c550f1 @@ -12,12 +13,14 @@ consistent and name it also `table'. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 10 +++++----- + drivers/iommu/amd_iommu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index fc23b89d2372..bfda5f26ea50 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -4353,7 +4353,7 @@ int amd_iommu_update_ga(int cpu, bool is +@@ -4353,7 +4353,7 @@ int amd_iommu_update_ga(int cpu, bool is_run, void *data) { unsigned long flags; struct amd_iommu *iommu; @@ -26,7 +29,7 @@ Signed-off-by: Joerg Roedel struct amd_ir_data *ir_data = (struct amd_ir_data *)data; int devid = ir_data->irq_2_irte.devid; struct irte_ga *entry = (struct irte_ga *) ir_data->entry; -@@ -4367,11 +4367,11 @@ int amd_iommu_update_ga(int cpu, bool is +@@ -4367,11 +4367,11 @@ int amd_iommu_update_ga(int cpu, bool is_run, void *data) if (!iommu) return -ENODEV; @@ -41,7 +44,7 @@ Signed-off-by: Joerg Roedel if (ref->lo.fields_vapic.guest_mode) { if (cpu >= 0) -@@ -4380,7 +4380,7 @@ int amd_iommu_update_ga(int cpu, bool is +@@ -4380,7 +4380,7 @@ int amd_iommu_update_ga(int cpu, bool is_run, void *data) barrier(); } @@ -50,3 +53,6 @@ Signed-off-by: Joerg Roedel iommu_flush_irt(iommu, devid); iommu_completion_wait(iommu); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0015-0007-iommu-amd-Factor-out-setting-the-remap-table-for-a-d.patch b/kernel/patches-4.14.x-rt/0015-0015-iommu-amd-Factor-out-setting-the-remap-table-for-a-d.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0015-0007-iommu-amd-Factor-out-setting-the-remap-table-for-a-d.patch rename to kernel/patches-4.14.x-rt/0015-0015-iommu-amd-Factor-out-setting-the-remap-table-for-a-d.patch index f850e4313..f1fdea7df 100644 --- a/kernel/patches-4.14.x-rt/0015-0007-iommu-amd-Factor-out-setting-the-remap-table-for-a-d.patch +++ b/kernel/patches-4.14.x-rt/0015-0015-iommu-amd-Factor-out-setting-the-remap-table-for-a-d.patch @@ -1,6 +1,7 @@ +From 8adc34a18946fcff0e5642de8ed48e358abdb601 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:39 +0100 -Subject: [PATCH 07/10] iommu/amd: Factor out setting the remap table for a +Subject: [PATCH 015/414] iommu/amd: Factor out setting the remap table for a devid Upstream commit 2fcc1e8ac4a8514c64f946178fc36c2e30e56a41 @@ -15,12 +16,14 @@ inline. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 23 ++++++++++++----------- + drivers/iommu/amd_iommu.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index bfda5f26ea50..d4eeb91afa36 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -3594,6 +3594,14 @@ static struct irq_remap_table *get_irq_t +@@ -3594,6 +3594,14 @@ static struct irq_remap_table *get_irq_table(u16 devid) return table; } @@ -35,7 +38,7 @@ Signed-off-by: Joerg Roedel static struct irq_remap_table *alloc_irq_table(u16 devid) { struct irq_remap_table *table = NULL; -@@ -3614,9 +3622,7 @@ static struct irq_remap_table *alloc_irq +@@ -3614,9 +3622,7 @@ static struct irq_remap_table *alloc_irq_table(u16 devid) alias = amd_iommu_alias_table[devid]; table = irq_lookup_table[alias]; if (table) { @@ -46,7 +49,7 @@ Signed-off-by: Joerg Roedel goto out; } -@@ -3643,14 +3649,9 @@ static struct irq_remap_table *alloc_irq +@@ -3643,14 +3649,9 @@ static struct irq_remap_table *alloc_irq_table(u16 devid) (MAX_IRQS_PER_TABLE * (sizeof(u64) * 2))); @@ -64,3 +67,6 @@ Signed-off-by: Joerg Roedel out: iommu_completion_wait(iommu); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0016-0008-iommu-amd-Drop-the-lock-while-allocating-new-irq-rem.patch b/kernel/patches-4.14.x-rt/0016-0016-iommu-amd-Drop-the-lock-while-allocating-new-irq-rem.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0016-0008-iommu-amd-Drop-the-lock-while-allocating-new-irq-rem.patch rename to kernel/patches-4.14.x-rt/0016-0016-iommu-amd-Drop-the-lock-while-allocating-new-irq-rem.patch index 8af9a6ae8..080265396 100644 --- a/kernel/patches-4.14.x-rt/0016-0008-iommu-amd-Drop-the-lock-while-allocating-new-irq-rem.patch +++ b/kernel/patches-4.14.x-rt/0016-0016-iommu-amd-Drop-the-lock-while-allocating-new-irq-rem.patch @@ -1,7 +1,8 @@ +From b2cd3595f6f7461fed03b9fdd6ae08901108db2c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:40 +0100 -Subject: [PATCH 08/10] iommu/amd: Drop the lock while allocating new irq remap - table +Subject: [PATCH 016/414] iommu/amd: Drop the lock while allocating new irq + remap table Upstream commit 993ca6e063a69a0c65ca42ed449b6bc1b3844151 @@ -22,12 +23,14 @@ However I check for both cases, just to be sure. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 63 ++++++++++++++++++++++++++++++++-------------- + drivers/iommu/amd_iommu.c | 63 ++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 18 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index d4eeb91afa36..8b6e515b395e 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -3594,6 +3594,30 @@ static struct irq_remap_table *get_irq_t +@@ -3594,6 +3594,30 @@ static struct irq_remap_table *get_irq_table(u16 devid) return table; } @@ -58,7 +61,7 @@ Signed-off-by: Joerg Roedel static void set_remap_table_entry(struct amd_iommu *iommu, u16 devid, struct irq_remap_table *table) { -@@ -3605,6 +3629,7 @@ static void set_remap_table_entry(struct +@@ -3605,6 +3629,7 @@ static void set_remap_table_entry(struct amd_iommu *iommu, u16 devid, static struct irq_remap_table *alloc_irq_table(u16 devid) { struct irq_remap_table *table = NULL; @@ -66,7 +69,7 @@ Signed-off-by: Joerg Roedel struct amd_iommu *iommu; unsigned long flags; u16 alias; -@@ -3623,42 +3648,44 @@ static struct irq_remap_table *alloc_irq +@@ -3623,42 +3648,44 @@ static struct irq_remap_table *alloc_irq_table(u16 devid) table = irq_lookup_table[alias]; if (table) { set_remap_table_entry(iommu, devid, table); @@ -129,3 +132,6 @@ Signed-off-by: Joerg Roedel return table; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0017-0009-iommu-amd-Make-amd_iommu_devtable_lock-a-spin_lock.patch b/kernel/patches-4.14.x-rt/0017-0017-iommu-amd-Make-amd_iommu_devtable_lock-a-spin_lock.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0017-0009-iommu-amd-Make-amd_iommu_devtable_lock-a-spin_lock.patch rename to kernel/patches-4.14.x-rt/0017-0017-iommu-amd-Make-amd_iommu_devtable_lock-a-spin_lock.patch index d8c2de001..0a64914b6 100644 --- a/kernel/patches-4.14.x-rt/0017-0009-iommu-amd-Make-amd_iommu_devtable_lock-a-spin_lock.patch +++ b/kernel/patches-4.14.x-rt/0017-0017-iommu-amd-Make-amd_iommu_devtable_lock-a-spin_lock.patch @@ -1,6 +1,7 @@ +From ad8625266d3c4e93f6b170604dc5ba25dbafd0f7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:41 +0100 -Subject: [PATCH 09/10] iommu/amd: Make amd_iommu_devtable_lock a spin_lock +Subject: [PATCH 017/414] iommu/amd: Make amd_iommu_devtable_lock a spin_lock Upstream commit 2cd1083d79a0a8c223af430ca97884c28a1e2fc0 @@ -15,9 +16,11 @@ current user seem to have their own protection. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 14 +++++++------- + drivers/iommu/amd_iommu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index 8b6e515b395e..f685026e6d9e 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -81,7 +81,7 @@ @@ -29,7 +32,7 @@ Signed-off-by: Joerg Roedel static DEFINE_SPINLOCK(pd_bitmap_lock); static DEFINE_SPINLOCK(iommu_table_lock); -@@ -2086,9 +2086,9 @@ static int attach_device(struct device * +@@ -2086,9 +2086,9 @@ static int attach_device(struct device *dev, } skip_ats_check: @@ -41,7 +44,7 @@ Signed-off-by: Joerg Roedel /* * We might boot into a crash-kernel here. The crashed kernel -@@ -2138,9 +2138,9 @@ static void detach_device(struct device +@@ -2138,9 +2138,9 @@ static void detach_device(struct device *dev) domain = dev_data->domain; /* lock device table */ @@ -53,7 +56,7 @@ Signed-off-by: Joerg Roedel if (!dev_is_pci(dev)) return; -@@ -2804,7 +2804,7 @@ static void cleanup_domain(struct protec +@@ -2804,7 +2804,7 @@ static void cleanup_domain(struct protection_domain *domain) struct iommu_dev_data *entry; unsigned long flags; @@ -62,7 +65,7 @@ Signed-off-by: Joerg Roedel while (!list_empty(&domain->dev_list)) { entry = list_first_entry(&domain->dev_list, -@@ -2812,7 +2812,7 @@ static void cleanup_domain(struct protec +@@ -2812,7 +2812,7 @@ static void cleanup_domain(struct protection_domain *domain) __detach_device(entry); } @@ -71,3 +74,6 @@ Signed-off-by: Joerg Roedel } static void protection_domain_free(struct protection_domain *domain) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0018-0010-iommu-amd-Return-proper-error-code-in-irq_remapping_.patch b/kernel/patches-4.14.x-rt/0018-0018-iommu-amd-Return-proper-error-code-in-irq_remapping_.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0018-0010-iommu-amd-Return-proper-error-code-in-irq_remapping_.patch rename to kernel/patches-4.14.x-rt/0018-0018-iommu-amd-Return-proper-error-code-in-irq_remapping_.patch index 766f0be5a..99e247b0b 100644 --- a/kernel/patches-4.14.x-rt/0018-0010-iommu-amd-Return-proper-error-code-in-irq_remapping_.patch +++ b/kernel/patches-4.14.x-rt/0018-0018-iommu-amd-Return-proper-error-code-in-irq_remapping_.patch @@ -1,6 +1,7 @@ +From 584da253bb5bca9e60d72dca8df1d60574457530 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Mar 2018 16:22:42 +0100 -Subject: [PATCH 10/10] iommu/amd: Return proper error code in +Subject: [PATCH 018/414] iommu/amd: Return proper error code in irq_remapping_alloc() Upstream commit 29d049be9438278c47253a74cf8d0ddf36bd5d68 @@ -15,12 +16,14 @@ In order to correct this, I assign -ENOMEM to index. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Joerg Roedel --- - drivers/iommu/amd_iommu.c | 4 ++-- + drivers/iommu/amd_iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index f685026e6d9e..f61c2dab5490 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -4094,7 +4094,7 @@ static int irq_remapping_alloc(struct ir +@@ -4094,7 +4094,7 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, struct amd_ir_data *data = NULL; struct irq_cfg *cfg; int i, ret, devid; @@ -29,7 +32,7 @@ Signed-off-by: Joerg Roedel if (!info) return -EINVAL; -@@ -4136,7 +4136,7 @@ static int irq_remapping_alloc(struct ir +@@ -4136,7 +4136,7 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, WARN_ON(table->min_index != 32); index = info->ioapic_pin; } else { @@ -38,3 +41,6 @@ Signed-off-by: Joerg Roedel } } else { index = alloc_irq_index(devid, nr_irqs); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0019-0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch b/kernel/patches-4.14.x-rt/0019-0019-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0019-0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch rename to kernel/patches-4.14.x-rt/0019-0019-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch index 865d9c6c2..3a076fe6f 100644 --- a/kernel/patches-4.14.x-rt/0019-0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch +++ b/kernel/patches-4.14.x-rt/0019-0019-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch @@ -1,6 +1,8 @@ +From ae8d11384afb52f7d1a2afe9ea44fdec48b5642e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 20 Dec 2017 17:12:50 +0100 -Subject: [PATCH 01/29] timers: Use static keys for migrate_enable/nohz_active +Subject: [PATCH 019/414] timers: Use static keys for + migrate_enable/nohz_active The members migrate_enable and nohz_active in the timer/hrtimer per CPU bases have been introduced to avoid accessing global variables for these @@ -17,13 +19,15 @@ Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 4 -- - kernel/time/hrtimer.c | 17 ++------- - kernel/time/tick-internal.h | 19 ++++++---- - kernel/time/tick-sched.c | 2 - - kernel/time/timer.c | 83 ++++++++++++++++++++++---------------------- + include/linux/hrtimer.h | 4 -- + kernel/time/hrtimer.c | 17 +++----- + kernel/time/tick-internal.h | 19 +++++---- + kernel/time/tick-sched.c | 2 +- + kernel/time/timer.c | 83 +++++++++++++++++++------------------ 5 files changed, 61 insertions(+), 64 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 012c37fdb688..79b2a8d29d8c 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -153,8 +153,6 @@ enum hrtimer_base_type { @@ -44,9 +48,11 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_HIGH_RES_TIMERS unsigned int in_hrtirq : 1, hres_active : 1, +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index d00e85ac10d6..883fef2926e9 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -178,23 +178,16 @@ hrtimer_check_target(struct hrtimer *tim +@@ -178,23 +178,16 @@ hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base) #endif } @@ -74,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * We switch the timer base to a power-optimized selected CPU target, -@@ -973,7 +966,7 @@ void hrtimer_start_range_ns(struct hrtim +@@ -973,7 +966,7 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, * Kick to reschedule the next tick to handle the new timer * on dynticks target. */ @@ -83,9 +89,11 @@ Signed-off-by: Sebastian Andrzej Siewior wake_up_nohz_cpu(new_base->cpu_base->cpu); } else { hrtimer_reprogram(timer, new_base); +diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h +index f8e1845aa464..4ac74dff59f0 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h -@@ -150,14 +150,19 @@ static inline void tick_nohz_init(void) +@@ -150,14 +150,19 @@ static inline void tick_nohz_init(void) { } #ifdef CONFIG_NO_HZ_COMMON extern unsigned long tick_nohz_active; @@ -112,9 +120,11 @@ Signed-off-by: Sebastian Andrzej Siewior #endif DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases); +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index bb2af74e6b62..9a372e16791c 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -1132,7 +1132,7 @@ static inline void tick_nohz_activate(st +@@ -1132,7 +1132,7 @@ static inline void tick_nohz_activate(struct tick_sched *ts, int mode) ts->nohz_mode = mode; /* One update is enough */ if (!test_and_set_bit(0, &tick_nohz_active)) @@ -123,6 +133,8 @@ Signed-off-by: Sebastian Andrzej Siewior } /** +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 9fe525f410bf..b24232985960 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -200,8 +200,6 @@ struct timer_base { @@ -215,7 +227,7 @@ Signed-off-by: Sebastian Andrzej Siewior static unsigned long round_jiffies_common(unsigned long j, int cpu, bool force_up) -@@ -534,7 +546,7 @@ static void +@@ -534,7 +546,7 @@ __internal_add_timer(struct timer_base *base, struct timer_list *timer) static void trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer) { @@ -224,7 +236,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; /* -@@ -840,21 +852,20 @@ static inline struct timer_base *get_tim +@@ -840,21 +852,20 @@ static inline struct timer_base *get_timer_base(u32 tflags) return get_timer_cpu_base(tflags, tflags & TIMER_CPUMASK); } @@ -252,7 +264,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned long jnow; /* -@@ -878,16 +889,8 @@ static inline void forward_timer_base(st +@@ -878,16 +889,8 @@ static inline void forward_timer_base(struct timer_base *base) base->clk = jnow; else base->clk = base->next_expiry; @@ -270,3 +282,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0020-0002-hrtimer-Correct-blantanly-wrong-comment.patch b/kernel/patches-4.14.x-rt/0020-0020-hrtimer-Correct-blantanly-wrong-comment.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0020-0002-hrtimer-Correct-blantanly-wrong-comment.patch rename to kernel/patches-4.14.x-rt/0020-0020-hrtimer-Correct-blantanly-wrong-comment.patch index 4ac02de83..e1db0082a 100644 --- a/kernel/patches-4.14.x-rt/0020-0002-hrtimer-Correct-blantanly-wrong-comment.patch +++ b/kernel/patches-4.14.x-rt/0020-0020-hrtimer-Correct-blantanly-wrong-comment.patch @@ -1,6 +1,7 @@ +From 6cdd07db109099455b4fcaad8446d5cced9df7e9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 20 Dec 2017 17:12:51 +0100 -Subject: [PATCH 02/29] hrtimer: Correct blantanly wrong comment +Subject: [PATCH 020/414] hrtimer: Correct blantanly wrong comment The protection of a hrtimer which runs its callback against migration to a different CPU has nothing to do with hard interrupt context. @@ -16,12 +17,14 @@ Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 6 +++--- + kernel/time/hrtimer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 883fef2926e9..65543d31af32 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1204,9 +1204,9 @@ static void __run_hrtimer(struct hrtimer +@@ -1204,9 +1204,9 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, timer->is_rel = false; /* @@ -34,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior */ raw_spin_unlock(&cpu_base->lock); trace_hrtimer_expire_entry(timer, now); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0021-0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch b/kernel/patches-4.14.x-rt/0021-0021-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0021-0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch rename to kernel/patches-4.14.x-rt/0021-0021-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch index aa3840f43..c321b24cf 100644 --- a/kernel/patches-4.14.x-rt/0021-0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch +++ b/kernel/patches-4.14.x-rt/0021-0021-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch @@ -1,6 +1,7 @@ +From f62ec4e980194574862b0329315cf2b36cd10751 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:52 +0100 -Subject: [PATCH 03/29] hrtimer: Fix kerneldoc for struct hrtimer_cpu_base +Subject: [PATCH 021/414] hrtimer: Fix kerneldoc for struct hrtimer_cpu_base The sequence '/**' marks the start of a struct description. Add the missing second asterisk. While at it adapt the ordering of the struct @@ -10,9 +11,11 @@ expires_next more precisely. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 8 ++++---- + include/linux/hrtimer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 79b2a8d29d8c..b3a382be8db0 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -144,7 +144,7 @@ enum hrtimer_base_type { @@ -40,3 +43,6 @@ Signed-off-by: Sebastian Andrzej Siewior * @nr_events: Total number of hrtimer interrupt events * @nr_retries: Total number of hrtimer interrupt retries * @nr_hangs: Total number of hrtimer interrupt hangs +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0022-0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch b/kernel/patches-4.14.x-rt/0022-0022-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0022-0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch rename to kernel/patches-4.14.x-rt/0022-0022-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch index b8ed3d518..159f16738 100644 --- a/kernel/patches-4.14.x-rt/0022-0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch +++ b/kernel/patches-4.14.x-rt/0022-0022-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch @@ -1,6 +1,7 @@ +From 4130d51df9d8bf1cdc31936212773fa9aae4e54e Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:53 +0100 -Subject: [PATCH 04/29] hrtimer: Cleanup clock argument in +Subject: [PATCH 022/414] hrtimer: Cleanup clock argument in schedule_hrtimeout_range_clock() schedule_hrtimeout_range_clock() uses an integer for the clock id @@ -18,13 +19,15 @@ No functional change. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 2 +- - kernel/time/hrtimer.c | 12 ++++++------ + include/linux/hrtimer.h | 2 +- + kernel/time/hrtimer.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index b3a382be8db0..931ce9c89c93 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -462,7 +462,7 @@ extern int schedule_hrtimeout_range(ktim +@@ -462,7 +462,7 @@ extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta, extern int schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, const enum hrtimer_mode mode, @@ -33,6 +36,8 @@ Signed-off-by: Sebastian Andrzej Siewior extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode); /* Soft interrupt function to run the hrtimer queues: */ +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 65543d31af32..790841b59433 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1672,12 +1672,12 @@ void __init hrtimers_init(void) @@ -51,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hrtimer_sleeper t; -@@ -1698,7 +1698,7 @@ schedule_hrtimeout_range_clock(ktime_t * +@@ -1698,7 +1698,7 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, return -EINTR; } @@ -60,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires_range_ns(&t.timer, *expires, delta); hrtimer_init_sleeper(&t, current); -@@ -1720,7 +1720,7 @@ schedule_hrtimeout_range_clock(ktime_t * +@@ -1720,7 +1720,7 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, * schedule_hrtimeout_range - sleep until timeout * @expires: timeout value (ktime_t) * @delta: slack in expires timeout (ktime_t) @@ -69,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior * * Make the current task sleep until the given expiry time has * elapsed. The routine will return immediately unless -@@ -1759,7 +1759,7 @@ EXPORT_SYMBOL_GPL(schedule_hrtimeout_ran +@@ -1759,7 +1759,7 @@ EXPORT_SYMBOL_GPL(schedule_hrtimeout_range); /** * schedule_hrtimeout - sleep until timeout * @expires: timeout value (ktime_t) @@ -78,3 +83,6 @@ Signed-off-by: Sebastian Andrzej Siewior * * Make the current task sleep until the given expiry time has * elapsed. The routine will return immediately unless +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0023-0005-hrtimer-Fix-hrtimer-function-description.patch b/kernel/patches-4.14.x-rt/0023-0023-hrtimer-Fix-hrtimer-function-description.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0023-0005-hrtimer-Fix-hrtimer-function-description.patch rename to kernel/patches-4.14.x-rt/0023-0023-hrtimer-Fix-hrtimer-function-description.patch index 6a39a0e74..30d6a46e1 100644 --- a/kernel/patches-4.14.x-rt/0023-0005-hrtimer-Fix-hrtimer-function-description.patch +++ b/kernel/patches-4.14.x-rt/0023-0023-hrtimer-Fix-hrtimer-function-description.patch @@ -1,6 +1,7 @@ +From 3177fadb000eacc66a94abca08bd560bd2b6bcdf Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:54 +0100 -Subject: [PATCH 05/29] hrtimer: Fix hrtimer function description +Subject: [PATCH 023/414] hrtimer: Fix hrtimer function description The hrtimer_start[_range_ns]() starts a timer reliable on this CPU only when HRTIMER_MODE_PINNED is set. Furthermore the HRTIMER_MODE_PINNED mode @@ -9,13 +10,15 @@ is not considered, when a hrtimer is initialized. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 6 +++--- - kernel/time/hrtimer.c | 9 +++++---- + include/linux/hrtimer.h | 6 +++--- + kernel/time/hrtimer.c | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 931ce9c89c93..4e6a8841dcbe 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -361,11 +361,11 @@ extern void hrtimer_start_range_ns(struc +@@ -361,11 +361,11 @@ extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, u64 range_ns, const enum hrtimer_mode mode); /** @@ -30,9 +33,11 @@ Signed-off-by: Sebastian Andrzej Siewior */ static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 790841b59433..6460aa2d9b25 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -928,12 +928,12 @@ static inline ktime_t hrtimer_update_low +@@ -928,12 +928,12 @@ static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim, } /** @@ -48,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, u64 delta_ns, const enum hrtimer_mode mode) -@@ -1116,7 +1116,8 @@ static void __hrtimer_init(struct hrtime +@@ -1116,7 +1116,8 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, * hrtimer_init - initialize a timer to the given clock * @timer: the timer to be initialized * @clock_id: the clock to be used @@ -58,3 +63,6 @@ Signed-off-by: Sebastian Andrzej Siewior */ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode mode) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0024-0007-hrtimer-Cleanup-hrtimer_mode-enum.patch b/kernel/patches-4.14.x-rt/0024-0024-hrtimer-Cleanup-hrtimer_mode-enum.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0024-0007-hrtimer-Cleanup-hrtimer_mode-enum.patch rename to kernel/patches-4.14.x-rt/0024-0024-hrtimer-Cleanup-hrtimer_mode-enum.patch index 47307862f..dfb52e091 100644 --- a/kernel/patches-4.14.x-rt/0024-0007-hrtimer-Cleanup-hrtimer_mode-enum.patch +++ b/kernel/patches-4.14.x-rt/0024-0024-hrtimer-Cleanup-hrtimer_mode-enum.patch @@ -1,6 +1,7 @@ +From 849a4dda6d5b76e03d3c91ef404402e7b7812c46 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:56 +0100 -Subject: [PATCH 07/29] hrtimer: Cleanup hrtimer_mode enum +Subject: [PATCH 024/414] hrtimer: Cleanup hrtimer_mode enum It's not obvious that the HRTIMER_MODE variants are bit combinations because all modes are hard coded constants. @@ -13,9 +14,11 @@ While at it get rid of the ugly tail comments. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 16 +++++++++++----- + include/linux/hrtimer.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 4e6a8841dcbe..28f267cf2851 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -28,13 +28,19 @@ struct hrtimer_cpu_base; @@ -43,3 +46,6 @@ Signed-off-by: Sebastian Andrzej Siewior }; /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0025-0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch b/kernel/patches-4.14.x-rt/0025-0025-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0025-0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch rename to kernel/patches-4.14.x-rt/0025-0025-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch index 9e377f545..fc7b7b169 100644 --- a/kernel/patches-4.14.x-rt/0025-0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch +++ b/kernel/patches-4.14.x-rt/0025-0025-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch @@ -1,6 +1,7 @@ +From b47bd57802cb10af5b096f6d6c850a4ce1c58cb0 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:58 +0100 -Subject: [PATCH 09/29] tracing/hrtimer: Print hrtimer mode in hrtimer_start +Subject: [PATCH 025/414] tracing/hrtimer: Print hrtimer mode in hrtimer_start tracepoint The hrtimer_start tracepoint lacks the mode information. The mode is @@ -12,10 +13,12 @@ Add the mode information. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/trace/events/timer.h | 13 ++++++++----- - kernel/time/hrtimer.c | 16 +++++++++------- + include/trace/events/timer.h | 13 ++++++++----- + kernel/time/hrtimer.c | 16 +++++++++------- 2 files changed, 17 insertions(+), 12 deletions(-) +diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h +index c6f728037c53..744b4310b24b 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -186,15 +186,16 @@ TRACE_EVENT(hrtimer_init, @@ -55,9 +58,11 @@ Signed-off-by: Sebastian Andrzej Siewior ); /** +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 6460aa2d9b25..476fe683e8ed 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -435,10 +435,11 @@ debug_init(struct hrtimer *timer, clocki +@@ -435,10 +435,11 @@ debug_init(struct hrtimer *timer, clockid_t clockid, trace_hrtimer_init(timer, clockid, mode); } @@ -84,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior base->cpu_base->active_bases |= 1 << base->index; -@@ -957,7 +959,7 @@ void hrtimer_start_range_ns(struct hrtim +@@ -957,7 +959,7 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, /* Switch the timer base, if necessary: */ new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED); @@ -93,7 +98,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!leftmost) goto unlock; -@@ -1226,7 +1228,7 @@ static void __run_hrtimer(struct hrtimer +@@ -1226,7 +1228,7 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, */ if (restart != HRTIMER_NORESTART && !(timer->state & HRTIMER_STATE_ENQUEUED)) @@ -102,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Separate the ->running assignment from the ->state assignment. -@@ -1626,7 +1628,7 @@ static void migrate_hrtimer_list(struct +@@ -1626,7 +1628,7 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, * sort out already expired timers and reprogram the * event device. */ @@ -111,3 +116,6 @@ Signed-off-by: Sebastian Andrzej Siewior } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0026-0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch b/kernel/patches-4.14.x-rt/0026-0026-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0026-0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch rename to kernel/patches-4.14.x-rt/0026-0026-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch index f8c3427f9..cd0858304 100644 --- a/kernel/patches-4.14.x-rt/0026-0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch +++ b/kernel/patches-4.14.x-rt/0026-0026-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch @@ -1,6 +1,7 @@ +From de61806cf2311994d697a907900cd71e4255df17 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:59 +0100 -Subject: [PATCH 10/29] hrtimer: Switch for loop to _ffs() evaluation +Subject: [PATCH 026/414] hrtimer: Switch for loop to _ffs() evaluation Looping over all clock bases to find active bits is suboptimal if not all bases are active. @@ -13,12 +14,14 @@ Suggested-by: Peter Zijlstra Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 31 +++++++++++++++++++++---------- + kernel/time/hrtimer.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 476fe683e8ed..85f9335d0d60 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -448,6 +448,23 @@ static inline void debug_deactivate(stru +@@ -448,6 +448,23 @@ static inline void debug_deactivate(struct hrtimer *timer) trace_hrtimer_cancel(timer); } @@ -42,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior #if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) static inline void hrtimer_update_next_timer(struct hrtimer_cpu_base *cpu_base, struct hrtimer *timer) -@@ -459,18 +476,15 @@ static inline void hrtimer_update_next_t +@@ -459,18 +476,15 @@ static inline void hrtimer_update_next_timer(struct hrtimer_cpu_base *cpu_base, static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) { @@ -63,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior next = timerqueue_getnext(&base->active); timer = container_of(next, struct hrtimer, node); expires = ktime_sub(hrtimer_get_expires(timer), base->offset); -@@ -1245,16 +1259,13 @@ static void __run_hrtimer(struct hrtimer +@@ -1245,16 +1259,13 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now) { @@ -82,3 +85,6 @@ Signed-off-by: Sebastian Andrzej Siewior basenow = ktime_add(now, base->offset); while ((node = timerqueue_getnext(&base->active))) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0027-0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch b/kernel/patches-4.14.x-rt/0027-0027-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch similarity index 90% rename from kernel/patches-4.14.x-rt/0027-0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch rename to kernel/patches-4.14.x-rt/0027-0027-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch index 3ed7fd177..082b890a8 100644 --- a/kernel/patches-4.14.x-rt/0027-0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch +++ b/kernel/patches-4.14.x-rt/0027-0027-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch @@ -1,6 +1,7 @@ +From 743a7e5c5a00389d149c5baf47e4baf7345de67c Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:00 +0100 -Subject: [PATCH 11/29] hrtimer: Store running timer in hrtimer_clock_base +Subject: [PATCH 027/414] hrtimer: Store running timer in hrtimer_clock_base The pointer to the currently running timer is stored in hrtimer_cpu_base before the base lock is dropped and the callback is invoked. @@ -28,10 +29,12 @@ clocks. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 20 +++++++++----------- - kernel/time/hrtimer.c | 28 +++++++++++++--------------- + include/linux/hrtimer.h | 20 +++++++++----------- + kernel/time/hrtimer.c | 28 +++++++++++++--------------- 2 files changed, 22 insertions(+), 26 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 28f267cf2851..1bae7b9f071d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -118,9 +118,9 @@ struct hrtimer_sleeper { @@ -98,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior timer->node.expires = time; timer->_softexpires = time; } -@@ -424,7 +422,7 @@ static inline int hrtimer_is_queued(stru +@@ -424,7 +422,7 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) */ static inline int hrtimer_callback_running(struct hrtimer *timer) { @@ -107,6 +110,8 @@ Signed-off-by: Sebastian Andrzej Siewior } /* Forward a hrtimer so it expires after now: */ +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 85f9335d0d60..bedfc2865901 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -70,7 +70,6 @@ @@ -117,7 +122,7 @@ Signed-off-by: Sebastian Andrzej Siewior .clock_base = { { -@@ -118,7 +117,6 @@ static const int hrtimer_clock_to_base_t +@@ -118,7 +117,6 @@ static const int hrtimer_clock_to_base_table[MAX_CLOCKS] = { * timer->base->cpu_base */ static struct hrtimer_cpu_base migration_cpu_base = { @@ -151,7 +156,7 @@ Signed-off-by: Sebastian Andrzej Siewior return false; } -@@ -1198,16 +1196,16 @@ static void __run_hrtimer(struct hrtimer +@@ -1198,16 +1196,16 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, lockdep_assert_held(&cpu_base->lock); debug_deactivate(timer); @@ -171,7 +176,7 @@ Signed-off-by: Sebastian Andrzej Siewior __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0); fn = timer->function; -@@ -1248,13 +1246,13 @@ static void __run_hrtimer(struct hrtimer +@@ -1248,13 +1246,13 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, * Separate the ->running assignment from the ->state assignment. * * As with a regular write barrier, this ensures the read side in @@ -189,3 +194,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0028-0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch b/kernel/patches-4.14.x-rt/0028-0028-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0028-0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch rename to kernel/patches-4.14.x-rt/0028-0028-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch index 2e7c181cc..01d5faff2 100644 --- a/kernel/patches-4.14.x-rt/0028-0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch +++ b/kernel/patches-4.14.x-rt/0028-0028-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch @@ -1,6 +1,7 @@ +From d68428306aadc4282164f1696f6da0a354235739 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:01 +0100 -Subject: [PATCH 12/29] hrtimer: Make room in struct hrtimer_cpu_base +Subject: [PATCH 028/414] hrtimer: Make room in struct hrtimer_cpu_base The upcoming softirq based hrtimers support requires an additional field in the hrtimer_cpu_base struct, which would grow the struct size beyond a @@ -15,9 +16,11 @@ functional change. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 4 ++-- + include/linux/hrtimer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 1bae7b9f071d..56e56bcb6f0f 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -189,8 +189,8 @@ struct hrtimer_cpu_base { @@ -31,3 +34,6 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned int max_hang_time; #endif struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0029-0013-hrtimer-Reduce-conditional-code-hres_active.patch b/kernel/patches-4.14.x-rt/0029-0029-hrtimer-Reduce-conditional-code-hres_active.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0029-0013-hrtimer-Reduce-conditional-code-hres_active.patch rename to kernel/patches-4.14.x-rt/0029-0029-hrtimer-Reduce-conditional-code-hres_active.patch index 357fbce56..a05c3a824 100644 --- a/kernel/patches-4.14.x-rt/0029-0013-hrtimer-Reduce-conditional-code-hres_active.patch +++ b/kernel/patches-4.14.x-rt/0029-0029-hrtimer-Reduce-conditional-code-hres_active.patch @@ -1,6 +1,7 @@ +From 79e04e38a6c7c3a1259ad00ba8b1f462c90d78fa Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:02 +0100 -Subject: [PATCH 13/29] hrtimer: Reduce conditional code (hres_active) +Subject: [PATCH 029/414] hrtimer: Reduce conditional code (hres_active) The hrtimer_cpu_base struct has the CONFIG_HIGH_RES_TIMERS conditional struct member hres_active. All related functions to this member are @@ -17,10 +18,12 @@ Suggested-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 20 ++++++++------------ - kernel/time/hrtimer.c | 31 +++++++++++++++---------------- + include/linux/hrtimer.h | 20 ++++++++------------ + kernel/time/hrtimer.c | 31 +++++++++++++++---------------- 2 files changed, 23 insertions(+), 28 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 56e56bcb6f0f..22627b3a33fe 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -161,8 +161,8 @@ enum hrtimer_base_type { @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior hang_detected : 1; ktime_t expires_next; struct hrtimer *next_timer; -@@ -266,16 +266,17 @@ static inline ktime_t hrtimer_cb_get_tim +@@ -266,16 +266,17 @@ static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) return timer->base->get_time(); } @@ -79,9 +82,11 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void clock_was_set_delayed(void) { } #endif +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index bedfc2865901..7e0490143275 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -512,6 +512,20 @@ static inline ktime_t hrtimer_update_bas +@@ -512,6 +512,20 @@ static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) offs_real, offs_boot, offs_tai); } @@ -102,10 +107,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* High resolution timer related functions */ #ifdef CONFIG_HIGH_RES_TIMERS -@@ -541,19 +555,6 @@ static inline int hrtimer_is_hres_enable +@@ -540,19 +554,6 @@ static inline int hrtimer_is_hres_enabled(void) + return hrtimer_hres_enabled; } - /* +-/* - * Is the high resolution mode active ? - */ -static inline int __hrtimer_hres_active(struct hrtimer_cpu_base *cpu_base) @@ -118,11 +124,10 @@ Signed-off-by: Sebastian Andrzej Siewior - return __hrtimer_hres_active(this_cpu_ptr(&hrtimer_bases)); -} - --/* + /* * Reprogram the event source with checking both queues for the * next event - * Called with interrupts disabled and base->lock held -@@ -662,7 +663,6 @@ static inline void hrtimer_init_hres(str +@@ -662,7 +663,6 @@ static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) { base->expires_next = KTIME_MAX; base->hang_detected = 0; @@ -139,7 +144,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline int hrtimer_is_hres_enabled(void) { return 0; } static inline void hrtimer_switch_to_hres(void) { } static inline void -@@ -1605,6 +1603,7 @@ int hrtimers_prepare_cpu(unsigned int cp +@@ -1605,6 +1603,7 @@ int hrtimers_prepare_cpu(unsigned int cpu) cpu_base->active_bases = 0; cpu_base->cpu = cpu; @@ -147,3 +152,6 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_init_hres(cpu_base); return 0; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0030-0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch b/kernel/patches-4.14.x-rt/0030-0030-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch similarity index 64% rename from kernel/patches-4.14.x-rt/0030-0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch rename to kernel/patches-4.14.x-rt/0030-0030-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch index d6875c605..20968fd13 100644 --- a/kernel/patches-4.14.x-rt/0030-0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch +++ b/kernel/patches-4.14.x-rt/0030-0030-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch @@ -1,6 +1,8 @@ +From 0c28a3a42a6c4524828e0de3f8683df0715e4a30 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:03 +0100 -Subject: [PATCH 14/29] hrtimer: Use accesor functions instead of direct access +Subject: [PATCH 030/414] hrtimer: Use accesor functions instead of direct + access __hrtimer_hres_active() is now available unconditionally. Replace the direct access to hrtimer_cpu_base.hres_active. @@ -10,12 +12,14 @@ No functional change. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 4 ++-- + kernel/time/hrtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 7e0490143275..85882d5da523 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -564,7 +564,7 @@ hrtimer_force_reprogram(struct hrtimer_c +@@ -564,7 +564,7 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) { ktime_t expires_next; @@ -24,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; expires_next = __hrtimer_get_next_event(cpu_base); -@@ -675,7 +675,7 @@ static void retrigger_next_event(void *a +@@ -675,7 +675,7 @@ static void retrigger_next_event(void *arg) { struct hrtimer_cpu_base *base = this_cpu_ptr(&hrtimer_bases); @@ -33,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior return; raw_spin_lock(&base->lock); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0031-0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch b/kernel/patches-4.14.x-rt/0031-0031-hrtimer-Make-the-remote-enqueue-check-unconditional.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0031-0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch rename to kernel/patches-4.14.x-rt/0031-0031-hrtimer-Make-the-remote-enqueue-check-unconditional.patch index 0166c3c39..75566d075 100644 --- a/kernel/patches-4.14.x-rt/0031-0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch +++ b/kernel/patches-4.14.x-rt/0031-0031-hrtimer-Make-the-remote-enqueue-check-unconditional.patch @@ -1,6 +1,7 @@ +From a9e0b8eb976e20f6043041423f00062a292d61c7 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:04 +0100 -Subject: [PATCH 15/29] hrtimer: Make the remote enqueue check unconditional +Subject: [PATCH 031/414] hrtimer: Make the remote enqueue check unconditional hrtimer_cpu_base.expires_next is used to cache the next event armed in the timer hardware. The value is used to check whether an hrtimer can be @@ -23,10 +24,12 @@ which further reduce the #ifdef zoo in this code. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 6 +++--- - kernel/time/hrtimer.c | 32 +++++++++----------------------- + include/linux/hrtimer.h | 6 +++--- + kernel/time/hrtimer.c | 32 +++++++++----------------------- 2 files changed, 12 insertions(+), 26 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 22627b3a33fe..bb7270e8bc37 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -164,13 +164,13 @@ enum hrtimer_base_type { @@ -60,9 +63,11 @@ Signed-off-by: Sebastian Andrzej Siewior struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; } ____cacheline_aligned; +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 85882d5da523..b1016aabc73a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -154,26 +154,21 @@ struct hrtimer_clock_base *lock_hrtimer_ +@@ -154,26 +154,21 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, } /* @@ -94,10 +99,11 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline -@@ -657,16 +652,6 @@ static void hrtimer_reprogram(struct hrt +@@ -656,16 +651,6 @@ static void hrtimer_reprogram(struct hrtimer *timer, + tick_program_event(expires, 1); } - /* +-/* - * Initialize the high resolution related parts of cpu_base - */ -static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) @@ -107,11 +113,10 @@ Signed-off-by: Sebastian Andrzej Siewior - base->next_timer = NULL; -} - --/* + /* * Retrigger next event is called after clock was set * - * Called with interrupts disabled via on_each_cpu() -@@ -731,7 +716,6 @@ static inline int hrtimer_reprogram(stru +@@ -731,7 +716,6 @@ static inline int hrtimer_reprogram(struct hrtimer *timer, { return 0; } @@ -119,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void retrigger_next_event(void *arg) { } #endif /* CONFIG_HIGH_RES_TIMERS */ -@@ -1601,10 +1585,12 @@ int hrtimers_prepare_cpu(unsigned int cp +@@ -1601,10 +1585,12 @@ int hrtimers_prepare_cpu(unsigned int cpu) timerqueue_init_head(&cpu_base->clock_base[i].active); } @@ -134,3 +139,6 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0032-0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch b/kernel/patches-4.14.x-rt/0032-0032-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0032-0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch rename to kernel/patches-4.14.x-rt/0032-0032-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch index 004cc873d..ea290ef43 100644 --- a/kernel/patches-4.14.x-rt/0032-0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch +++ b/kernel/patches-4.14.x-rt/0032-0032-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch @@ -1,6 +1,7 @@ +From b9f89574e69f7b1f18dbf0518330f559e841bf2b Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:05 +0100 -Subject: [PATCH 16/29] hrtimer: Make hrtimer_cpu_base.next_timer handling +Subject: [PATCH 032/414] hrtimer: Make hrtimer_cpu_base.next_timer handling unconditional hrtimer_cpu_base.next_timer stores the pointer to the next expiring timer @@ -25,10 +26,12 @@ No functional change. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 4 ++-- - kernel/time/hrtimer.c | 12 ++---------- + include/linux/hrtimer.h | 4 ++-- + kernel/time/hrtimer.c | 12 ++---------- 2 files changed, 4 insertions(+), 12 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index bb7270e8bc37..2d3e1d678a4d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -164,13 +164,13 @@ enum hrtimer_base_type { @@ -61,9 +64,11 @@ Signed-off-by: Sebastian Andrzej Siewior struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; } ____cacheline_aligned; +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index b1016aabc73a..e01c2e78c032 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -459,21 +459,13 @@ static struct hrtimer_clock_base * +@@ -459,21 +459,13 @@ __next_base(struct hrtimer_cpu_base *cpu_base, unsigned int *active) while ((base = __next_base((cpu_base), &(active)))) #if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) @@ -86,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_active_base(base, cpu_base, active) { struct timerqueue_node *next; struct hrtimer *timer; -@@ -483,7 +475,7 @@ static ktime_t __hrtimer_get_next_event( +@@ -483,7 +475,7 @@ static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) expires = ktime_sub(hrtimer_get_expires(timer), base->offset); if (expires < expires_next) { expires_next = expires; @@ -95,3 +100,6 @@ Signed-off-by: Sebastian Andrzej Siewior } } /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0033-0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch b/kernel/patches-4.14.x-rt/0033-0033-hrtimer-Make-hrtimer_reprogramm-unconditional.patch similarity index 88% rename from kernel/patches-4.14.x-rt/0033-0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch rename to kernel/patches-4.14.x-rt/0033-0033-hrtimer-Make-hrtimer_reprogramm-unconditional.patch index b43311729..1a9d50679 100644 --- a/kernel/patches-4.14.x-rt/0033-0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch +++ b/kernel/patches-4.14.x-rt/0033-0033-hrtimer-Make-hrtimer_reprogramm-unconditional.patch @@ -1,6 +1,7 @@ +From 45b61c6a2e3b71d48921aea76713c19795905c5a Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:06 +0100 -Subject: [PATCH 17/29] hrtimer: Make hrtimer_reprogramm() unconditional +Subject: [PATCH 033/414] hrtimer: Make hrtimer_reprogramm() unconditional hrtimer_reprogram() needs to be available unconditionally for softirq based hrtimers. Move the function and all required struct members out of the @@ -14,10 +15,12 @@ replication of that code for the upcoming softirq based hrtimers support. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 6 +- - kernel/time/hrtimer.c | 129 +++++++++++++++++++++++------------------------- + include/linux/hrtimer.h | 6 +- + kernel/time/hrtimer.c | 129 +++++++++++++++++++--------------------- 2 files changed, 65 insertions(+), 70 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 2d3e1d678a4d..98ed35767ac5 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -182,10 +182,10 @@ struct hrtimer_cpu_base { @@ -34,12 +37,15 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned int nr_events; unsigned short nr_retries; unsigned short nr_hangs; +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index e01c2e78c032..37085a13f19a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -582,68 +582,6 @@ hrtimer_force_reprogram(struct hrtimer_c +@@ -581,68 +581,6 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) + tick_program_event(cpu_base->expires_next, 1); } - /* +-/* - * When a timer is enqueued and expires earlier than the already enqueued - * timers, we have to check, whether it expires earlier than the timer for - * which the clock event device was armed. @@ -101,11 +107,10 @@ Signed-off-by: Sebastian Andrzej Siewior - tick_program_event(expires, 1); -} - --/* + /* * Retrigger next event is called after clock was set * - * Called with interrupts disabled via on_each_cpu() -@@ -703,16 +641,73 @@ static inline int hrtimer_is_hres_enable +@@ -703,15 +641,72 @@ static inline int hrtimer_is_hres_enabled(void) { return 0; } static inline void hrtimer_switch_to_hres(void) { } static inline void hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { } @@ -118,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif /* CONFIG_HIGH_RES_TIMERS */ - /* ++/* + * When a timer is enqueued and expires earlier than the already enqueued + * timers, we have to check, whether it expires earlier than the timer for + * which the clock event device was armed. @@ -180,7 +185,9 @@ Signed-off-by: Sebastian Andrzej Siewior + tick_program_event(expires, 1); +} + -+/* + /* * Clock realtime was set * - * Change the offset of the realtime clock vs. the monotonic +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0034-0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch b/kernel/patches-4.14.x-rt/0034-0034-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0034-0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch rename to kernel/patches-4.14.x-rt/0034-0034-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch index 1b280798c..f007a8b96 100644 --- a/kernel/patches-4.14.x-rt/0034-0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch +++ b/kernel/patches-4.14.x-rt/0034-0034-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch @@ -1,6 +1,7 @@ +From 296b6f8f96067a3acd75a96325e47bc48684b724 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:07 +0100 -Subject: [PATCH 18/29] hrtimer: Make hrtimer_force_reprogramm() +Subject: [PATCH 034/414] hrtimer: Make hrtimer_force_reprogramm() unconditionally available hrtimer_force_reprogram() needs to be available unconditionally for softirq @@ -19,12 +20,14 @@ eliminated in the CONFIG_HIGH_RES_TIMERS=n case by the compiler. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 58 ++++++++++++++++++++++++-------------------------- + kernel/time/hrtimer.c | 58 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 30 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 37085a13f19a..5fd669dd46be 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -513,34 +513,6 @@ static inline int hrtimer_hres_active(vo +@@ -513,34 +513,6 @@ static inline int hrtimer_hres_active(void) return __hrtimer_hres_active(this_cpu_ptr(&hrtimer_bases)); } @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Reprogram the event source with checking both queues for the * next event -@@ -581,6 +553,34 @@ hrtimer_force_reprogram(struct hrtimer_c +@@ -581,6 +553,34 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) tick_program_event(cpu_base->expires_next, 1); } @@ -103,3 +106,6 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void retrigger_next_event(void *arg) { } #endif /* CONFIG_HIGH_RES_TIMERS */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0035-0019-hrtimer-Unify-handling-of-hrtimer-remove.patch b/kernel/patches-4.14.x-rt/0035-0035-hrtimer-Unify-handling-of-hrtimer-remove.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0035-0019-hrtimer-Unify-handling-of-hrtimer-remove.patch rename to kernel/patches-4.14.x-rt/0035-0035-hrtimer-Unify-handling-of-hrtimer-remove.patch index e08612bc2..b2d61daeb 100644 --- a/kernel/patches-4.14.x-rt/0035-0019-hrtimer-Unify-handling-of-hrtimer-remove.patch +++ b/kernel/patches-4.14.x-rt/0035-0035-hrtimer-Unify-handling-of-hrtimer-remove.patch @@ -1,6 +1,7 @@ +From f4b8779db8b944689effad2ade03a5ac5d1e3cfa Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:08 +0100 -Subject: [PATCH 19/29] hrtimer: Unify handling of hrtimer remove +Subject: [PATCH 035/414] hrtimer: Unify handling of hrtimer remove When the first hrtimer on the current CPU is removed, hrtimer_force_reprogram() is invoked but only when @@ -36,12 +37,14 @@ compiler in the CONFIG_HIGH_RES_TIMERS=n case. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 10 ++++------ + kernel/time/hrtimer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 5fd669dd46be..ce9a3ef7a796 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -523,9 +523,6 @@ hrtimer_force_reprogram(struct hrtimer_c +@@ -523,9 +523,6 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) { ktime_t expires_next; @@ -51,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior expires_next = __hrtimer_get_next_event(cpu_base); if (skip_equal && expires_next == cpu_base->expires_next) -@@ -534,6 +531,9 @@ hrtimer_force_reprogram(struct hrtimer_c +@@ -534,6 +531,9 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) cpu_base->expires_next = expires_next; /* @@ -61,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior * If a hang was detected in the last timer interrupt then we * leave the hang delay active in the hardware. We want the * system to make progress. That also prevents the following -@@ -547,7 +547,7 @@ hrtimer_force_reprogram(struct hrtimer_c +@@ -547,7 +547,7 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) * set. So we'd effectivly block all timers until the T2 event * fires. */ @@ -70,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; tick_program_event(cpu_base->expires_next, 1); -@@ -848,7 +848,6 @@ static void __remove_hrtimer(struct hrti +@@ -848,7 +848,6 @@ static void __remove_hrtimer(struct hrtimer *timer, if (!timerqueue_del(&base->active, &timer->node)) cpu_base->active_bases &= ~(1 << base->index); @@ -78,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Note: If reprogram is false we do not update * cpu_base->next_timer. This happens when we remove the first -@@ -859,7 +858,6 @@ static void __remove_hrtimer(struct hrti +@@ -859,7 +858,6 @@ static void __remove_hrtimer(struct hrtimer *timer, */ if (reprogram && timer == cpu_base->next_timer) hrtimer_force_reprogram(cpu_base, 1); @@ -86,3 +89,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0036-0020-hrtimer-Unify-handling-of-remote-enqueue.patch b/kernel/patches-4.14.x-rt/0036-0036-hrtimer-Unify-handling-of-remote-enqueue.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0036-0020-hrtimer-Unify-handling-of-remote-enqueue.patch rename to kernel/patches-4.14.x-rt/0036-0036-hrtimer-Unify-handling-of-remote-enqueue.patch index 70cdcca87..4b975847c 100644 --- a/kernel/patches-4.14.x-rt/0036-0020-hrtimer-Unify-handling-of-remote-enqueue.patch +++ b/kernel/patches-4.14.x-rt/0036-0036-hrtimer-Unify-handling-of-remote-enqueue.patch @@ -1,6 +1,7 @@ +From b565edf2df1347c8d0fe93057c5da89786b20107 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:09 +0100 -Subject: [PATCH 20/29] hrtimer: Unify handling of remote enqueue +Subject: [PATCH 036/414] hrtimer: Unify handling of remote enqueue hrtimer_reprogram() is conditionally invoked from hrtimer_start_range_ns() when hrtimer_cpu_base.hres_active is true. @@ -48,14 +49,16 @@ now. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 18 ++++++------------ - kernel/time/tick-internal.h | 6 ------ - kernel/time/timer.c | 9 ++++++++- + kernel/time/hrtimer.c | 18 ++++++------------ + kernel/time/tick-internal.h | 6 ------ + kernel/time/timer.c | 9 ++++++++- 3 files changed, 14 insertions(+), 19 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index ce9a3ef7a796..35d7d0c8c3d6 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -687,21 +687,24 @@ static void hrtimer_reprogram(struct hrt +@@ -687,21 +687,24 @@ static void hrtimer_reprogram(struct hrtimer *timer, /* Update the pointer to the next expiring timer */ cpu_base->next_timer = timer; @@ -82,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior tick_program_event(expires, 1); } -@@ -940,16 +943,7 @@ void hrtimer_start_range_ns(struct hrtim +@@ -940,16 +943,7 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, if (!leftmost) goto unlock; @@ -100,9 +103,11 @@ Signed-off-by: Sebastian Andrzej Siewior unlock: unlock_hrtimer_base(timer, &flags); } +diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h +index 4ac74dff59f0..e277284c2831 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h -@@ -151,18 +151,12 @@ static inline void tick_nohz_init(void) +@@ -151,18 +151,12 @@ static inline void tick_nohz_init(void) { } #ifdef CONFIG_NO_HZ_COMMON extern unsigned long tick_nohz_active; extern void timers_update_nohz(void); @@ -121,9 +126,11 @@ Signed-off-by: Sebastian Andrzej Siewior #endif DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases); +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index b24232985960..34415f2b3f04 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -210,7 +210,7 @@ static DEFINE_PER_CPU(struct timer_base, +@@ -210,7 +210,7 @@ static DEFINE_PER_CPU(struct timer_base, timer_bases[NR_BASES]); #ifdef CONFIG_NO_HZ_COMMON @@ -132,7 +139,7 @@ Signed-off-by: Sebastian Andrzej Siewior static DEFINE_MUTEX(timer_keys_mutex); static void timer_update_keys(struct work_struct *work); -@@ -260,6 +260,13 @@ int timer_migration_handler(struct ctl_t +@@ -260,6 +260,13 @@ int timer_migration_handler(struct ctl_table *table, int write, mutex_unlock(&timer_keys_mutex); return ret; } @@ -146,3 +153,6 @@ Signed-off-by: Sebastian Andrzej Siewior #endif /* NO_HZ_COMMON */ static unsigned long round_jiffies_common(unsigned long j, int cpu, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0037-0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch b/kernel/patches-4.14.x-rt/0037-0037-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0037-0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch rename to kernel/patches-4.14.x-rt/0037-0037-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch index 5bbb4d5ee..2dc96295b 100644 --- a/kernel/patches-4.14.x-rt/0037-0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch +++ b/kernel/patches-4.14.x-rt/0037-0037-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch @@ -1,6 +1,8 @@ +From 8cdb34edfcfc64ca7dbf397f0f9235f2d8d6762f Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:10 +0100 -Subject: [PATCH 21/29] hrtimer: Make remote enqueue decision less restrictive +Subject: [PATCH 037/414] hrtimer: Make remote enqueue decision less + restrictive The current decision whether a timer can be queued on a remote CPU checks for timer->expiry <= remote_cpu_base.expires_next. @@ -15,12 +17,14 @@ first expiring timer on a remote CPU base. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 2 +- + 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 35d7d0c8c3d6..1b2866645c83 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -168,7 +168,7 @@ hrtimer_check_target(struct hrtimer *tim +@@ -168,7 +168,7 @@ hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base) ktime_t expires; expires = ktime_sub(hrtimer_get_expires(timer), new_base->offset); @@ -29,3 +33,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0038-0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch b/kernel/patches-4.14.x-rt/0038-0038-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0038-0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch rename to kernel/patches-4.14.x-rt/0038-0038-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch index 86faaf1ee..aefd9b25d 100644 --- a/kernel/patches-4.14.x-rt/0038-0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch +++ b/kernel/patches-4.14.x-rt/0038-0038-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch @@ -1,6 +1,8 @@ +From fb9c6739c8274982180e104abd48a945f9aa8349 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:11 +0100 -Subject: [PATCH 22/29] hrtimer: Remove base argument from hrtimer_reprogram() +Subject: [PATCH 038/414] hrtimer: Remove base argument from + hrtimer_reprogram() hrtimer_reprogram() must have access to the hrtimer_clock_base of the new first expiring timer to access hrtimer_clock_base.offset for adjusting the @@ -20,12 +22,14 @@ argument from hrtimer_reprogram() and retrieve the clock base internally. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 6 +++--- + kernel/time/hrtimer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 1b2866645c83..9030dcb3ef14 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -650,10 +650,10 @@ static inline void retrigger_next_event( +@@ -650,10 +650,10 @@ static inline void retrigger_next_event(void *arg) { } * * Called with interrupts disabled and base->cpu_base.lock held */ @@ -38,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset); WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0); -@@ -943,7 +943,7 @@ void hrtimer_start_range_ns(struct hrtim +@@ -943,7 +943,7 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, if (!leftmost) goto unlock; @@ -47,3 +51,6 @@ Signed-off-by: Sebastian Andrzej Siewior unlock: unlock_hrtimer_base(timer, &flags); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0039-0023-hrtimer-Split-hrtimer_start_range_ns.patch b/kernel/patches-4.14.x-rt/0039-0039-hrtimer-Split-hrtimer_start_range_ns.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0039-0023-hrtimer-Split-hrtimer_start_range_ns.patch rename to kernel/patches-4.14.x-rt/0039-0039-hrtimer-Split-hrtimer_start_range_ns.patch index a55143365..321268b2b 100644 --- a/kernel/patches-4.14.x-rt/0039-0023-hrtimer-Split-hrtimer_start_range_ns.patch +++ b/kernel/patches-4.14.x-rt/0039-0039-hrtimer-Split-hrtimer_start_range_ns.patch @@ -1,6 +1,7 @@ +From c898510c489084e806002595da513370d3088901 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:12 +0100 -Subject: [PATCH 23/29] hrtimer: Split hrtimer_start_range_ns() +Subject: [PATCH 039/414] hrtimer: Split hrtimer_start_range_ns() Preparatory patch for softirq based hrtimers to avoid code duplication. No functional change. @@ -8,12 +9,14 @@ functional change. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 44 ++++++++++++++++++++++++-------------------- + kernel/time/hrtimer.c | 44 +++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 9030dcb3ef14..687a8d903a18 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -909,22 +909,11 @@ static inline ktime_t hrtimer_update_low +@@ -909,22 +909,11 @@ static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim, return tim; } @@ -40,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Remove an active timer from the queue: */ remove_hrtimer(timer, base, true); -@@ -939,12 +928,27 @@ void hrtimer_start_range_ns(struct hrtim +@@ -939,12 +928,27 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, /* Switch the timer base, if necessary: */ new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED); @@ -73,3 +76,6 @@ Signed-off-by: Sebastian Andrzej Siewior unlock_hrtimer_base(timer, &flags); } EXPORT_SYMBOL_GPL(hrtimer_start_range_ns); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0040-0024-hrtimer-Split-__hrtimer_get_next_event.patch b/kernel/patches-4.14.x-rt/0040-0040-hrtimer-Split-__hrtimer_get_next_event.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0040-0024-hrtimer-Split-__hrtimer_get_next_event.patch rename to kernel/patches-4.14.x-rt/0040-0040-hrtimer-Split-__hrtimer_get_next_event.patch index ddffefb13..997bf7202 100644 --- a/kernel/patches-4.14.x-rt/0040-0024-hrtimer-Split-__hrtimer_get_next_event.patch +++ b/kernel/patches-4.14.x-rt/0040-0040-hrtimer-Split-__hrtimer_get_next_event.patch @@ -1,6 +1,7 @@ +From 277b1870d5329ddfbb1343c8627a8f83b4250f45 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:13 +0100 -Subject: [PATCH 24/29] hrtimer: Split __hrtimer_get_next_event() +Subject: [PATCH 040/414] hrtimer: Split __hrtimer_get_next_event() Preparatory patch for softirq based hrtimers to avoid code duplication. No functional change. @@ -8,12 +9,14 @@ functional change. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 20 ++++++++++++++++---- + kernel/time/hrtimer.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 687a8d903a18..2382bc5d8e4d 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -459,13 +459,13 @@ static struct hrtimer_clock_base * +@@ -459,13 +459,13 @@ __next_base(struct hrtimer_cpu_base *cpu_base, unsigned int *active) while ((base = __next_base((cpu_base), &(active)))) #if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_active_base(base, cpu_base, active) { struct timerqueue_node *next; struct hrtimer *timer; -@@ -487,6 +487,18 @@ static ktime_t __hrtimer_get_next_event( +@@ -487,6 +487,18 @@ static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) expires_next = 0; return expires_next; } @@ -50,3 +53,6 @@ Signed-off-by: Sebastian Andrzej Siewior #endif static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0041-0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch b/kernel/patches-4.14.x-rt/0041-0041-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0041-0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch rename to kernel/patches-4.14.x-rt/0041-0041-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch index 8f99ff680..144ec5b24 100644 --- a/kernel/patches-4.14.x-rt/0041-0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch +++ b/kernel/patches-4.14.x-rt/0041-0041-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch @@ -1,6 +1,8 @@ +From 5cd854bf805216d2a22f14c9f29d0cc51f7cdc66 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:14 +0100 -Subject: [PATCH 25/29] hrtimer: Use irqsave/irqrestore around __run_hrtimer() +Subject: [PATCH 041/414] hrtimer: Use irqsave/irqrestore around + __run_hrtimer() __run_hrtimer() is called with the hrtimer_cpu_base.lock held and interrupts disabled. Before invoking the timer callback the base lock is @@ -19,9 +21,11 @@ Suggested-by: Peter Zijlstra Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 31 ++++++++++++++++++------------- + kernel/time/hrtimer.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 2382bc5d8e4d..86cdc9a76911 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1163,7 +1163,8 @@ EXPORT_SYMBOL_GPL(hrtimer_active); @@ -34,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior { enum hrtimer_restart (*fn)(struct hrtimer *); int restart; -@@ -1198,11 +1199,11 @@ static void __run_hrtimer(struct hrtimer +@@ -1198,11 +1199,11 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, * protected against migration to a different CPU even if the lock * is dropped. */ @@ -48,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Note: We clear the running state after enqueue_hrtimer and -@@ -1230,7 +1231,8 @@ static void __run_hrtimer(struct hrtimer +@@ -1230,7 +1231,8 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, base->running = NULL; } @@ -58,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hrtimer_clock_base *base; unsigned int active = cpu_base->active_bases; -@@ -1261,7 +1263,7 @@ static void __hrtimer_run_queues(struct +@@ -1261,7 +1263,7 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now) if (basenow < hrtimer_get_softexpires_tv64(timer)) break; @@ -67,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } } -@@ -1276,13 +1278,14 @@ void hrtimer_interrupt(struct clock_even +@@ -1276,13 +1278,14 @@ void hrtimer_interrupt(struct clock_event_device *dev) { struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); ktime_t expires_next, now, entry_time, delta; @@ -83,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior entry_time = now = hrtimer_update_base(cpu_base); retry: cpu_base->in_hrtirq = 1; -@@ -1295,7 +1298,7 @@ void hrtimer_interrupt(struct clock_even +@@ -1295,7 +1298,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) */ cpu_base->expires_next = KTIME_MAX; @@ -92,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Reevaluate the clock bases for the next expiry */ expires_next = __hrtimer_get_next_event(cpu_base); -@@ -1305,7 +1308,7 @@ void hrtimer_interrupt(struct clock_even +@@ -1305,7 +1308,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) */ cpu_base->expires_next = expires_next; cpu_base->in_hrtirq = 0; @@ -101,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Reprogramming necessary ? */ if (!tick_program_event(expires_next, 0)) { -@@ -1326,7 +1329,7 @@ void hrtimer_interrupt(struct clock_even +@@ -1326,7 +1329,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) * Acquire base lock for updating the offsets and retrieving * the current time. */ @@ -110,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior now = hrtimer_update_base(cpu_base); cpu_base->nr_retries++; if (++retries < 3) -@@ -1339,7 +1342,8 @@ void hrtimer_interrupt(struct clock_even +@@ -1339,7 +1342,8 @@ void hrtimer_interrupt(struct clock_event_device *dev) */ cpu_base->nr_hangs++; cpu_base->hang_detected = 1; @@ -120,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior delta = ktime_sub(now, entry_time); if ((unsigned int)delta > cpu_base->max_hang_time) cpu_base->max_hang_time = (unsigned int) delta; -@@ -1381,6 +1385,7 @@ static inline void __hrtimer_peek_ahead_ +@@ -1381,6 +1385,7 @@ static inline void __hrtimer_peek_ahead_timers(void) { } void hrtimer_run_queues(void) { struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); @@ -142,3 +146,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0042-0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch b/kernel/patches-4.14.x-rt/0042-0042-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0042-0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch rename to kernel/patches-4.14.x-rt/0042-0042-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch index be27a42a1..8179a3379 100644 --- a/kernel/patches-4.14.x-rt/0042-0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch +++ b/kernel/patches-4.14.x-rt/0042-0042-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch @@ -1,7 +1,8 @@ +From d16c4975b23e4429a198b5bcc16d46e12eaad23c Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:15 +0100 -Subject: [PATCH 26/29] hrtimer: Add clock bases and hrtimer mode for soft irq - context +Subject: [PATCH 042/414] hrtimer: Add clock bases and hrtimer mode for soft + irq context hrtimer callback functions are always executed in hard interrupt context. Users of hrtimer which need their timer function to be executed @@ -19,11 +20,13 @@ bits and update the decoding of hrtimer_mode in tracepoints. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 14 ++++++++++++++ - include/trace/events/timer.h | 6 +++++- - kernel/time/hrtimer.c | 20 ++++++++++++++++++++ + include/linux/hrtimer.h | 14 ++++++++++++++ + include/trace/events/timer.h | 6 +++++- + kernel/time/hrtimer.c | 20 ++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 98ed35767ac5..26ae8a868ea8 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -33,14 +33,24 @@ struct hrtimer_cpu_base; @@ -62,6 +65,8 @@ Signed-off-by: Sebastian Andrzej Siewior HRTIMER_MAX_CLOCK_BASES, }; +diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h +index 744b4310b24b..a57e4ee989d6 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -148,7 +148,11 @@ DEFINE_EVENT(timer_class, timer_cancel, @@ -77,9 +82,11 @@ Signed-off-by: Sebastian Andrzej Siewior /** * hrtimer_init - called when the hrtimer is initialized +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 86cdc9a76911..b5121845d12c 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -92,6 +92,26 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, +@@ -92,6 +92,26 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) = .clockid = CLOCK_TAI, .get_time = &ktime_get_clocktai, }, @@ -106,3 +113,6 @@ Signed-off-by: Sebastian Andrzej Siewior } }; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0043-0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch b/kernel/patches-4.14.x-rt/0043-0043-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0043-0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch rename to kernel/patches-4.14.x-rt/0043-0043-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch index 71d327bcd..778a47b00 100644 --- a/kernel/patches-4.14.x-rt/0043-0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch +++ b/kernel/patches-4.14.x-rt/0043-0043-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch @@ -1,6 +1,7 @@ +From fcbfa28f6d81a03a9145742c7765ef00c42b1e06 Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:16 +0100 -Subject: [PATCH 27/29] hrtimer: Prepare handling of hard and softirq based +Subject: [PATCH 043/414] hrtimer: Prepare handling of hard and softirq based hrtimers The softirq based hrtimer can utilize most of the existing hrtimers @@ -13,15 +14,18 @@ mask. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 38 +++++++++++++++++++++++++++++--------- + kernel/time/hrtimer.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index b5121845d12c..9a1f2b00c847 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -60,6 +60,15 @@ +@@ -59,6 +59,15 @@ + #include "tick-internal.h" - /* ++/* + * Masks for selecting the soft and hard context timers from + * cpu_base->active + */ @@ -30,11 +34,10 @@ Signed-off-by: Sebastian Andrzej Siewior +#define HRTIMER_ACTIVE_SOFT (HRTIMER_ACTIVE_HARD << MASK_SHIFT) +#define HRTIMER_ACTIVE_ALL (HRTIMER_ACTIVE_SOFT | HRTIMER_ACTIVE_HARD) + -+/* + /* * The timer bases: * - * There are more clockids than hrtimer bases. Thus, we index -@@ -508,13 +517,24 @@ static ktime_t __hrtimer_next_event_base +@@ -508,13 +517,24 @@ static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base, return expires_next; } @@ -61,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior expires_next = __hrtimer_next_event_base(cpu_base, active, expires_next); return expires_next; -@@ -555,7 +575,7 @@ hrtimer_force_reprogram(struct hrtimer_c +@@ -555,7 +575,7 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) { ktime_t expires_next; @@ -79,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&cpu_base->lock, flags); -@@ -1252,10 +1272,10 @@ static void __run_hrtimer(struct hrtimer +@@ -1252,10 +1272,10 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, } static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now, @@ -92,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_active_base(base, cpu_base, active) { struct timerqueue_node *node; -@@ -1318,10 +1338,10 @@ void hrtimer_interrupt(struct clock_even +@@ -1318,10 +1338,10 @@ void hrtimer_interrupt(struct clock_event_device *dev) */ cpu_base->expires_next = KTIME_MAX; @@ -114,3 +117,6 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&cpu_base->lock, flags); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0044-0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch b/kernel/patches-4.14.x-rt/0044-0044-hrtimer-Implement-support-for-softirq-based-hrtimers.patch similarity index 89% rename from kernel/patches-4.14.x-rt/0044-0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch rename to kernel/patches-4.14.x-rt/0044-0044-hrtimer-Implement-support-for-softirq-based-hrtimers.patch index 073b4d66a..d42652e49 100644 --- a/kernel/patches-4.14.x-rt/0044-0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch +++ b/kernel/patches-4.14.x-rt/0044-0044-hrtimer-Implement-support-for-softirq-based-hrtimers.patch @@ -1,6 +1,7 @@ +From 4070b8e3ab87c596835bede6b35be54a03fa515b Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:17 +0100 -Subject: [PATCH 28/29] hrtimer: Implement support for softirq based hrtimers +Subject: [PATCH 044/414] hrtimer: Implement support for softirq based hrtimers hrtimer callbacks are always invoked in hard interrupt context. Several users in tree require soft interrupt context for their callbacks and @@ -33,10 +34,12 @@ Suggested-by: Peter Zijlstra Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 21 +++-- - kernel/time/hrtimer.c | 199 +++++++++++++++++++++++++++++++++++++++++------- + include/linux/hrtimer.h | 21 ++++- + kernel/time/hrtimer.c | 199 ++++++++++++++++++++++++++++++++++------ 2 files changed, 189 insertions(+), 31 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 26ae8a868ea8..c7902ca7c9f4 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -103,6 +103,7 @@ enum hrtimer_restart { @@ -98,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; } ____cacheline_aligned; -@@ -379,7 +389,8 @@ extern void hrtimer_start_range_ns(struc +@@ -379,7 +389,8 @@ extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, * @timer: the timer to be added * @tim: expiry time * @mode: timer mode: absolute (HRTIMER_MODE_ABS) or @@ -108,9 +111,11 @@ Signed-off-by: Sebastian Andrzej Siewior */ static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 9a1f2b00c847..66d7a12d7256 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -411,7 +411,8 @@ static inline void debug_hrtimer_init(st +@@ -411,7 +411,8 @@ static inline void debug_hrtimer_init(struct hrtimer *timer) debug_object_init(timer, &hrtimer_debug_descr); } @@ -120,7 +125,7 @@ Signed-off-by: Sebastian Andrzej Siewior { debug_object_activate(timer, &hrtimer_debug_descr); } -@@ -444,8 +445,10 @@ void destroy_hrtimer_on_stack(struct hrt +@@ -444,8 +445,10 @@ void destroy_hrtimer_on_stack(struct hrtimer *timer) EXPORT_SYMBOL_GPL(destroy_hrtimer_on_stack); #else @@ -132,7 +137,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { } #endif -@@ -460,7 +463,7 @@ debug_init(struct hrtimer *timer, clocki +@@ -460,7 +463,7 @@ debug_init(struct hrtimer *timer, clockid_t clockid, static inline void debug_activate(struct hrtimer *timer, enum hrtimer_mode mode) { @@ -141,7 +146,7 @@ Signed-off-by: Sebastian Andrzej Siewior trace_hrtimer_start(timer, mode); } -@@ -487,7 +490,6 @@ static struct hrtimer_clock_base * +@@ -487,7 +490,6 @@ __next_base(struct hrtimer_cpu_base *cpu_base, unsigned int *active) #define for_each_active_base(base, cpu_base, active) \ while ((base = __next_base((cpu_base), &(active)))) @@ -149,7 +154,7 @@ Signed-off-by: Sebastian Andrzej Siewior static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base, unsigned int active, ktime_t expires_next) -@@ -504,7 +506,10 @@ static ktime_t __hrtimer_next_event_base +@@ -504,7 +506,10 @@ static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base, expires = ktime_sub(hrtimer_get_expires(timer), base->offset); if (expires < expires_next) { expires_next = expires; @@ -161,7 +166,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } /* -@@ -521,25 +526,42 @@ static ktime_t __hrtimer_next_event_base +@@ -521,25 +526,42 @@ static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base, * Recomputes cpu_base::*next_timer and returns the earliest expires_next but * does not set cpu_base::*expires_next, that is done by hrtimer_reprogram. * @@ -211,7 +216,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) { -@@ -547,8 +569,14 @@ static inline ktime_t hrtimer_update_bas +@@ -547,8 +569,14 @@ static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset; @@ -227,7 +232,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -575,7 +603,23 @@ hrtimer_force_reprogram(struct hrtimer_c +@@ -575,7 +603,23 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) { ktime_t expires_next; @@ -252,7 +257,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (skip_equal && expires_next == cpu_base->expires_next) return; -@@ -702,7 +746,7 @@ static inline void retrigger_next_event( +@@ -702,7 +746,7 @@ static inline void retrigger_next_event(void *arg) { } * * Called with interrupts disabled and base->cpu_base.lock held */ @@ -261,10 +266,11 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); struct hrtimer_clock_base *base = timer->base; -@@ -711,6 +755,37 @@ static void hrtimer_reprogram(struct hrt +@@ -710,6 +754,37 @@ static void hrtimer_reprogram(struct hrtimer *timer) + WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0); - /* ++ /* + * CLOCK_REALTIME timer might be requested with an absolute + * expiry time which is less than base->offset. Set it to 0. + */ @@ -295,11 +301,10 @@ Signed-off-by: Sebastian Andrzej Siewior + return; + } + -+ /* + /* * If the timer is not on the current cpu, we cannot reprogram * the other cpus clock event device. - */ -@@ -727,13 +802,6 @@ static void hrtimer_reprogram(struct hrt +@@ -727,13 +802,6 @@ static void hrtimer_reprogram(struct hrtimer *timer) if (cpu_base->in_hrtirq) return; @@ -313,7 +318,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (expires >= cpu_base->expires_next) return; -@@ -961,6 +1029,31 @@ static inline ktime_t hrtimer_update_low +@@ -961,6 +1029,31 @@ static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim, return tim; } @@ -345,7 +350,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, u64 delta_ns, const enum hrtimer_mode mode, struct hrtimer_clock_base *base) -@@ -982,13 +1075,15 @@ static int __hrtimer_start_range_ns(stru +@@ -982,13 +1075,15 @@ static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, return enqueue_hrtimer(timer, new_base, mode); } @@ -362,7 +367,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, u64 delta_ns, const enum hrtimer_mode mode) -@@ -996,10 +1091,16 @@ void hrtimer_start_range_ns(struct hrtim +@@ -996,10 +1091,16 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, struct hrtimer_clock_base *base; unsigned long flags; @@ -389,7 +394,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&cpu_base->lock, flags); -@@ -1308,6 +1409,23 @@ static void __hrtimer_run_queues(struct +@@ -1308,6 +1409,23 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now, } } @@ -413,7 +418,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_HIGH_RES_TIMERS /* -@@ -1338,10 +1456,16 @@ void hrtimer_interrupt(struct clock_even +@@ -1338,10 +1456,16 @@ void hrtimer_interrupt(struct clock_event_device *dev) */ cpu_base->expires_next = KTIME_MAX; @@ -445,7 +450,7 @@ Signed-off-by: Sebastian Andrzej Siewior __hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD); raw_spin_unlock_irqrestore(&cpu_base->lock, flags); } -@@ -1628,7 +1759,9 @@ int hrtimers_prepare_cpu(unsigned int cp +@@ -1628,7 +1759,9 @@ int hrtimers_prepare_cpu(unsigned int cpu) cpu_base->hres_active = 0; cpu_base->hang_detected = 0; cpu_base->next_timer = NULL; @@ -496,3 +501,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /** +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0045-0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch b/kernel/patches-4.14.x-rt/0045-0045-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0045-0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch rename to kernel/patches-4.14.x-rt/0045-0045-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch index 71780dcf6..b1dae0eeb 100644 --- a/kernel/patches-4.14.x-rt/0045-0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch +++ b/kernel/patches-4.14.x-rt/0045-0045-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch @@ -1,6 +1,7 @@ +From f32935dba4227215f4872b837873273cb08784ba Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:18 +0100 -Subject: [PATCH 29/29] hrtimer: Implement SOFT/HARD clock base selection +Subject: [PATCH 045/414] hrtimer: Implement SOFT/HARD clock base selection All prerequisites to handle hrtimers for expiry in either hard or soft interrupt context are in place. @@ -11,12 +12,14 @@ hard or the soft irq clock base. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 15 +++++++++++---- + kernel/time/hrtimer.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 66d7a12d7256..9947480ad731 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1222,8 +1222,9 @@ static inline int hrtimer_clockid_to_bas +@@ -1222,8 +1222,9 @@ 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) { @@ -27,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior memset(timer, 0, sizeof(struct hrtimer)); -@@ -1237,7 +1238,8 @@ static void __hrtimer_init(struct hrtime +@@ -1237,7 +1238,8 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, if (clock_id == CLOCK_REALTIME && mode & HRTIMER_MODE_REL) clock_id = CLOCK_MONOTONIC; @@ -37,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior timer->base = &cpu_base->clock_base[base]; timerqueue_init(&timer->node); } -@@ -1246,8 +1248,13 @@ static void __hrtimer_init(struct hrtime +@@ -1246,8 +1248,13 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, * hrtimer_init - initialize a timer to the given clock * @timer: the timer to be initialized * @clock_id: the clock to be used @@ -53,3 +56,6 @@ Signed-off-by: Sebastian Andrzej Siewior */ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode mode) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0046-0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch b/kernel/patches-4.14.x-rt/0046-0046-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0046-0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch rename to kernel/patches-4.14.x-rt/0046-0046-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch index 26e06e2c4..2689ce798 100644 --- a/kernel/patches-4.14.x-rt/0046-0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch +++ b/kernel/patches-4.14.x-rt/0046-0046-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch @@ -1,6 +1,7 @@ +From 7e4dacaced7572790d1378572a6cad20845d15e7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:11 +0100 -Subject: [PATCH 30/36] can/bcm: Replace hrtimer_tasklet with softirq based +Subject: [PATCH 046/414] can/bcm: Replace hrtimer_tasklet with softirq based hrtimer Switch the timer to HRTIMER_MODE_SOFT, which executed the timer @@ -14,9 +15,11 @@ Cc: Marc Kleine-Budde Cc: linux-can@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - net/can/bcm.c | 156 +++++++++++++++++++--------------------------------------- + net/can/bcm.c | 156 +++++++++++++++++--------------------------------- 1 file changed, 52 insertions(+), 104 deletions(-) +diff --git a/net/can/bcm.c b/net/can/bcm.c +index 13690334efa3..9cc67ac257f1 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c @@ -102,7 +102,6 @@ struct bcm_op { @@ -27,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior ktime_t rx_stamp, kt_ival1, kt_ival2, kt_lastmsg; int rx_ifindex; int cfsiz; -@@ -364,25 +363,34 @@ static void bcm_send_to_user(struct bcm_ +@@ -364,25 +363,34 @@ static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head, } } @@ -72,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior op->count--; if (!op->count && (op->flags & TX_COUNTEVT)) { -@@ -399,22 +407,12 @@ static void bcm_tx_timeout_tsklet(unsign +@@ -399,22 +407,12 @@ static void bcm_tx_timeout_tsklet(unsigned long data) } bcm_can_tx(op); @@ -99,7 +102,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -480,7 +478,7 @@ static void bcm_rx_update_and_send(struc +@@ -480,7 +478,7 @@ static void bcm_rx_update_and_send(struct bcm_op *op, /* do not send the saved data - only start throttle timer */ hrtimer_start(&op->thrtimer, ktime_add(op->kt_lastmsg, op->kt_ival2), @@ -108,7 +111,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; } -@@ -539,14 +537,21 @@ static void bcm_rx_starttimer(struct bcm +@@ -539,14 +537,21 @@ static void bcm_rx_starttimer(struct bcm_op *op) return; if (op->kt_ival1) @@ -133,7 +136,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* create notification to user */ msg_head.opcode = RX_TIMEOUT; msg_head.flags = op->flags; -@@ -557,25 +562,6 @@ static void bcm_rx_timeout_tsklet(unsign +@@ -557,25 +562,6 @@ static void bcm_rx_timeout_tsklet(unsigned long data) msg_head.nframes = 0; bcm_send_to_user(op, &msg_head, NULL, 0); @@ -159,7 +162,7 @@ Signed-off-by: Sebastian Andrzej Siewior return HRTIMER_NORESTART; } -@@ -583,14 +569,12 @@ static enum hrtimer_restart bcm_rx_timeo +@@ -583,14 +569,12 @@ static enum hrtimer_restart bcm_rx_timeout_handler(struct hrtimer *hrtimer) /* * bcm_rx_do_flush - helper for bcm_rx_thr_flush */ @@ -176,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 1; } return 0; -@@ -598,11 +582,8 @@ static inline int bcm_rx_do_flush(struct +@@ -598,11 +582,8 @@ static inline int bcm_rx_do_flush(struct bcm_op *op, int update, /* * bcm_rx_thr_flush - Check for throttled data and send it to the userspace @@ -189,7 +192,7 @@ Signed-off-by: Sebastian Andrzej Siewior { int updated = 0; -@@ -611,24 +592,16 @@ static int bcm_rx_thr_flush(struct bcm_o +@@ -611,24 +592,16 @@ static int bcm_rx_thr_flush(struct bcm_op *op, int update) /* for MUX filter we start at index 1 */ for (i = 1; i < op->nframes; i++) @@ -216,7 +219,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * bcm_rx_thr_handler - the time for blocked content updates is over now: * Check for throttled data and send it to the userspace -@@ -637,9 +610,7 @@ static enum hrtimer_restart bcm_rx_thr_h +@@ -637,9 +610,7 @@ static enum hrtimer_restart bcm_rx_thr_handler(struct hrtimer *hrtimer) { struct bcm_op *op = container_of(hrtimer, struct bcm_op, thrtimer); @@ -227,7 +230,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2); return HRTIMER_RESTART; } else { -@@ -735,23 +706,8 @@ static struct bcm_op *bcm_find_op(struct +@@ -735,23 +706,8 @@ static struct bcm_op *bcm_find_op(struct list_head *ops, static void bcm_remove_op(struct bcm_op *op) { @@ -253,7 +256,7 @@ Signed-off-by: Sebastian Andrzej Siewior if ((op->frames) && (op->frames != &op->sframe)) kfree(op->frames); -@@ -979,15 +935,13 @@ static int bcm_tx_setup(struct bcm_msg_h +@@ -979,15 +935,13 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, op->ifindex = ifindex; /* initialize uninitialized (kzalloc) structure */ @@ -273,7 +276,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* add this bcm_op to the list of the tx_ops */ list_add(&op->list, &bo->tx_ops); -@@ -1150,20 +1104,14 @@ static int bcm_rx_setup(struct bcm_msg_h +@@ -1150,20 +1104,14 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, op->rx_ifindex = ifindex; /* initialize uninitialized (kzalloc) structure */ @@ -298,7 +301,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* add this bcm_op to the list of the rx_ops */ list_add(&op->list, &bo->rx_ops); -@@ -1209,12 +1157,12 @@ static int bcm_rx_setup(struct bcm_msg_h +@@ -1209,12 +1157,12 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, */ op->kt_lastmsg = 0; hrtimer_cancel(&op->thrtimer); @@ -313,3 +316,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /* now we can register for can_ids, if we added a new bcm_op */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0047-0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch b/kernel/patches-4.14.x-rt/0047-0047-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0047-0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch rename to kernel/patches-4.14.x-rt/0047-0047-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch index cf7687a21..8918f843e 100644 --- a/kernel/patches-4.14.x-rt/0047-0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch +++ b/kernel/patches-4.14.x-rt/0047-0047-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch @@ -1,6 +1,7 @@ +From b28f5667a2a0e339de56b877e2caeabe3cb52ca5 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:12 +0100 -Subject: [PATCH 31/36] mac80211_hwsim: Replace hrtimer tasklet with softirq +Subject: [PATCH 047/414] mac80211_hwsim: Replace hrtimer tasklet with softirq hrtimer Switch the timer to HRTIMER_MODE_SOFT, which executed the timer @@ -13,9 +14,11 @@ Cc: Johannes Berg Cc: Kalle Valo Signed-off-by: Sebastian Andrzej Siewior --- - drivers/net/wireless/mac80211_hwsim.c | 44 +++++++++++++++------------------- + drivers/net/wireless/mac80211_hwsim.c | 44 ++++++++++++--------------- 1 file changed, 20 insertions(+), 24 deletions(-) +diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c +index d686ba10fecc..4afcdee4f8e2 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -537,7 +537,7 @@ struct mac80211_hwsim_data { @@ -27,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior enum ps_mode { PS_DISABLED, PS_ENABLED, PS_AUTO_POLL, PS_MANUAL_POLL } ps; -@@ -1423,7 +1423,7 @@ static void mac80211_hwsim_stop(struct i +@@ -1423,7 +1423,7 @@ static void mac80211_hwsim_stop(struct ieee80211_hw *hw) { struct mac80211_hwsim_data *data = hw->priv; data->started = false; @@ -53,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior ieee80211_iterate_active_interfaces_atomic( hw, IEEE80211_IFACE_ITER_NORMAL, -@@ -1565,11 +1563,9 @@ mac80211_hwsim_beacon(struct hrtimer *ti +@@ -1565,11 +1563,9 @@ mac80211_hwsim_beacon(struct hrtimer *timer) data->bcn_delta = 0; } @@ -68,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static const char * const hwsim_chanwidths[] = { -@@ -1643,15 +1639,15 @@ static int mac80211_hwsim_config(struct +@@ -1643,15 +1639,15 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed) mutex_unlock(&data->mutex); if (!data->started || !data->beacon_int) @@ -89,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior } return 0; -@@ -1714,7 +1710,7 @@ static void mac80211_hwsim_bss_info_chan +@@ -1714,7 +1710,7 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw, info->enable_beacon, info->beacon_int); vp->bcn_en = info->enable_beacon; if (data->started && @@ -98,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior info->enable_beacon) { u64 tsf, until_tbtt; u32 bcn_int; -@@ -1722,9 +1718,9 @@ static void mac80211_hwsim_bss_info_chan +@@ -1722,9 +1718,9 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw, tsf = mac80211_hwsim_get_tsf(hw, vif); bcn_int = data->beacon_int; until_tbtt = bcn_int - do_div(tsf, bcn_int); @@ -111,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else if (!info->enable_beacon) { unsigned int count = 0; ieee80211_iterate_active_interfaces_atomic( -@@ -1733,7 +1729,7 @@ static void mac80211_hwsim_bss_info_chan +@@ -1733,7 +1729,7 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw, wiphy_debug(hw->wiphy, " beaconing vifs remaining: %u", count); if (count == 0) { @@ -120,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior data->beacon_int = 0; } } -@@ -2725,9 +2721,9 @@ static int mac80211_hwsim_new_radio(stru +@@ -2725,9 +2721,9 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, data->debugfs, data, &hwsim_simulate_radar); @@ -133,3 +136,6 @@ Signed-off-by: Sebastian Andrzej Siewior spin_lock_bh(&hwsim_radio_lock); list_add_tail(&data->list, &hwsim_radios); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0048-0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch b/kernel/patches-4.14.x-rt/0048-0048-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0048-0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch rename to kernel/patches-4.14.x-rt/0048-0048-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch index 87ac7271d..48e258243 100644 --- a/kernel/patches-4.14.x-rt/0048-0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch +++ b/kernel/patches-4.14.x-rt/0048-0048-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch @@ -1,6 +1,7 @@ +From 25822e33d44a3895a02f0f051e8b39377ab74c4c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:13 +0100 -Subject: [PATCH 32/36] xfrm: Replace hrtimer tasklet with softirq hrtimer +Subject: [PATCH 048/414] xfrm: Replace hrtimer tasklet with softirq hrtimer Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. @@ -13,10 +14,12 @@ Cc: Herbert Xu Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior --- - include/net/xfrm.h | 2 +- - net/xfrm/xfrm_state.c | 30 ++++++++++++++++++------------ + include/net/xfrm.h | 2 +- + net/xfrm/xfrm_state.c | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) +diff --git a/include/net/xfrm.h b/include/net/xfrm.h +index db99efb2d1d0..a7b95ffbbf8b 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -217,7 +217,7 @@ struct xfrm_state { @@ -28,9 +31,11 @@ Signed-off-by: Sebastian Andrzej Siewior struct xfrm_state_offload xso; +diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c +index 8f13fb57eab5..25cf36faa4d2 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c -@@ -427,7 +427,7 @@ static void xfrm_put_mode(struct xfrm_mo +@@ -427,7 +427,7 @@ static void xfrm_put_mode(struct xfrm_mode *mode) static void xfrm_state_gc_destroy(struct xfrm_state *x) { @@ -39,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior del_timer_sync(&x->rtimer); kfree(x->aead); kfree(x->aalg); -@@ -472,8 +472,8 @@ static void xfrm_state_gc_task(struct wo +@@ -472,8 +472,8 @@ static void xfrm_state_gc_task(struct work_struct *work) static enum hrtimer_restart xfrm_timer_handler(struct hrtimer *me) { @@ -50,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned long now = get_seconds(); long next = LONG_MAX; int warn = 0; -@@ -537,7 +537,8 @@ static enum hrtimer_restart xfrm_timer_h +@@ -537,7 +537,8 @@ static enum hrtimer_restart xfrm_timer_handler(struct hrtimer *me) km_state_expired(x, 0, 0); resched: if (next != LONG_MAX) { @@ -60,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior } goto out; -@@ -554,7 +555,7 @@ static enum hrtimer_restart xfrm_timer_h +@@ -554,7 +555,7 @@ static enum hrtimer_restart xfrm_timer_handler(struct hrtimer *me) out: spin_unlock(&x->lock); @@ -69,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void xfrm_replay_timer_handler(unsigned long data); -@@ -573,8 +574,8 @@ struct xfrm_state *xfrm_state_alloc(stru +@@ -573,8 +574,8 @@ struct xfrm_state *xfrm_state_alloc(struct net *net) INIT_HLIST_NODE(&x->bydst); INIT_HLIST_NODE(&x->bysrc); INIT_HLIST_NODE(&x->byspi); @@ -80,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior setup_timer(&x->rtimer, xfrm_replay_timer_handler, (unsigned long)x); x->curlft.add_time = get_seconds(); -@@ -1031,7 +1032,9 @@ xfrm_state_find(const xfrm_address_t *da +@@ -1031,7 +1032,9 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, hlist_add_head_rcu(&x->byspi, net->xfrm.state_byspi + h); } x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires; @@ -91,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior net->xfrm.state_num++; xfrm_hash_grow_check(net, x->bydst.next != NULL); spin_unlock_bh(&net->xfrm.xfrm_state_lock); -@@ -1142,7 +1145,7 @@ static void __xfrm_state_insert(struct x +@@ -1142,7 +1145,7 @@ static void __xfrm_state_insert(struct xfrm_state *x) hlist_add_head_rcu(&x->byspi, net->xfrm.state_byspi + h); } @@ -100,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (x->replay_maxage) mod_timer(&x->rtimer, jiffies + x->replay_maxage); -@@ -1246,7 +1249,9 @@ static struct xfrm_state *__find_acq_cor +@@ -1246,7 +1249,9 @@ static struct xfrm_state *__find_acq_core(struct net *net, x->mark.m = m->m; x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires; xfrm_state_hold(x); @@ -111,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior list_add(&x->km.all, &net->xfrm.state_all); hlist_add_head_rcu(&x->bydst, net->xfrm.state_bydst + h); h = xfrm_src_hash(net, daddr, saddr, family); -@@ -1545,7 +1550,8 @@ int xfrm_state_update(struct xfrm_state +@@ -1545,7 +1550,8 @@ int xfrm_state_update(struct xfrm_state *x) memcpy(&x1->lft, &x->lft, sizeof(x1->lft)); x1->km.dying = 0; @@ -121,7 +126,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (x1->curlft.use_time) xfrm_state_check_expire(x1); -@@ -1569,7 +1575,7 @@ int xfrm_state_check_expire(struct xfrm_ +@@ -1569,7 +1575,7 @@ int xfrm_state_check_expire(struct xfrm_state *x) if (x->curlft.bytes >= x->lft.hard_byte_limit || x->curlft.packets >= x->lft.hard_packet_limit) { x->km.state = XFRM_STATE_EXPIRED; @@ -130,3 +135,6 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0049-0033-softirq-Remove-tasklet_hrtimer.patch b/kernel/patches-4.14.x-rt/0049-0049-softirq-Remove-tasklet_hrtimer.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0049-0033-softirq-Remove-tasklet_hrtimer.patch rename to kernel/patches-4.14.x-rt/0049-0049-softirq-Remove-tasklet_hrtimer.patch index 14e13bb10..13f7b1c88 100644 --- a/kernel/patches-4.14.x-rt/0049-0033-softirq-Remove-tasklet_hrtimer.patch +++ b/kernel/patches-4.14.x-rt/0049-0049-softirq-Remove-tasklet_hrtimer.patch @@ -1,6 +1,7 @@ +From 42bcae097379d479e0df8f959fd02e01b465fdc2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:14 +0100 -Subject: [PATCH 33/36] softirq: Remove tasklet_hrtimer +Subject: [PATCH 049/414] softirq: Remove tasklet_hrtimer There are no more tasklet_hrtimer users of this interface. Remove it. @@ -9,13 +10,15 @@ Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/interrupt.h | 25 ---------------------- - kernel/softirq.c | 51 ---------------------------------------------- + include/linux/interrupt.h | 25 ------------------- + kernel/softirq.c | 51 --------------------------------------- 2 files changed, 76 deletions(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 69c238210325..af15bfd89598 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -618,31 +618,6 @@ extern void tasklet_kill_immediate(struc +@@ -618,31 +618,6 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); extern void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data); @@ -47,9 +50,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Autoprobing for irqs: * +diff --git a/kernel/softirq.c b/kernel/softirq.c +index e89c3b0cff6d..359cec869172 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -584,57 +584,6 @@ void tasklet_kill(struct tasklet_struct +@@ -584,57 +584,6 @@ void tasklet_kill(struct tasklet_struct *t) } EXPORT_SYMBOL(tasklet_kill); @@ -107,3 +112,6 @@ Signed-off-by: Sebastian Andrzej Siewior void __init softirq_init(void) { int cpu; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0050-0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch b/kernel/patches-4.14.x-rt/0050-0050-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0050-0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch rename to kernel/patches-4.14.x-rt/0050-0050-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch index 84064de84..a1d113967 100644 --- a/kernel/patches-4.14.x-rt/0050-0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch +++ b/kernel/patches-4.14.x-rt/0050-0050-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,6 +1,7 @@ +From 87b0744dcb085fdb3894b682c27aff630a245369 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:15 +0100 -Subject: [PATCH 34/36] ALSA/dummy: Replace tasklet with softirq hrtimer +Subject: [PATCH 050/414] ALSA/dummy: Replace tasklet with softirq hrtimer The tasklet is used to defer the execution of snd_pcm_period_elapsed() to the softirq context. Using the HRTIMER_MODE_SOFT mode invokes the timer @@ -18,9 +19,11 @@ Cc: Jaroslav Kysela Link: http://lkml.kernel.org/r/20170905161820.jtysvxtfleunbbmf@breakpoint.cc Signed-off-by: Sebastian Andrzej Siewior --- - sound/drivers/dummy.c | 27 ++++++++++++--------------- + sound/drivers/dummy.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) +diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c +index c0939a0164a6..549e014ecc0d 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -376,17 +376,9 @@ struct dummy_hrtimer_pcm { @@ -41,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior static enum hrtimer_restart dummy_hrtimer_callback(struct hrtimer *timer) { struct dummy_hrtimer_pcm *dpcm; -@@ -394,7 +386,14 @@ static enum hrtimer_restart dummy_hrtime +@@ -394,7 +386,14 @@ static enum hrtimer_restart dummy_hrtimer_callback(struct hrtimer *timer) dpcm = container_of(timer, struct dummy_hrtimer_pcm, timer); if (!atomic_read(&dpcm->running)) return HRTIMER_NORESTART; @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_forward_now(timer, dpcm->period_time); return HRTIMER_RESTART; } -@@ -404,7 +403,7 @@ static int dummy_hrtimer_start(struct sn +@@ -404,7 +403,7 @@ static int dummy_hrtimer_start(struct snd_pcm_substream *substream) struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data; dpcm->base_time = hrtimer_cb_get_time(&dpcm->timer); @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior atomic_set(&dpcm->running, 1); return 0; } -@@ -414,14 +413,14 @@ static int dummy_hrtimer_stop(struct snd +@@ -414,14 +413,14 @@ static int dummy_hrtimer_stop(struct snd_pcm_substream *substream) struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data; atomic_set(&dpcm->running, 0); @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static snd_pcm_uframes_t -@@ -466,12 +465,10 @@ static int dummy_hrtimer_create(struct s +@@ -466,12 +465,10 @@ static int dummy_hrtimer_create(struct snd_pcm_substream *substream) if (!dpcm) return -ENOMEM; substream->runtime->private_data = dpcm; @@ -97,3 +100,6 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0051-0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch b/kernel/patches-4.14.x-rt/0051-0051-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0051-0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch rename to kernel/patches-4.14.x-rt/0051-0051-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch index 3f67c54be..beb79a706 100644 --- a/kernel/patches-4.14.x-rt/0051-0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch +++ b/kernel/patches-4.14.x-rt/0051-0051-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,6 +1,7 @@ +From 72c4503e32e667180b324dbfbd27d70be2977562 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:16 +0100 -Subject: [PATCH 35/36] usb/gadget/NCM: Replace tasklet with softirq hrtimer +Subject: [PATCH 051/414] usb/gadget/NCM: Replace tasklet with softirq hrtimer The tx_tasklet tasklet is used in invoke the hrtimer (task_timer) in softirq context. This can be also achieved without the tasklet but @@ -12,9 +13,11 @@ Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - drivers/usb/gadget/function/f_ncm.c | 30 +++++++----------------------- + drivers/usb/gadget/function/f_ncm.c | 30 +++++++---------------------- 1 file changed, 7 insertions(+), 23 deletions(-) +diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c +index 45b334ceaf2e..5f24e6d3b6eb 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -77,9 +77,7 @@ struct f_ncm { @@ -27,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior bool timer_stopping; }; -@@ -1108,7 +1106,7 @@ static struct sk_buff *ncm_wrap_ntb(stru +@@ -1108,7 +1106,7 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port, /* Delay the timer. */ hrtimer_start(&ncm->task_timer, TX_TIMEOUT_NSECS, @@ -36,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Add the datagram position entries */ ntb_ndp = skb_put_zero(ncm->skb_tx_ndp, dgram_idx_len); -@@ -1152,17 +1150,15 @@ static struct sk_buff *ncm_wrap_ntb(stru +@@ -1152,17 +1150,15 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port, } /* @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior ncm->timer_force_tx = true; /* XXX This allowance of a NULL skb argument to ndo_start_xmit -@@ -1175,16 +1171,6 @@ static void ncm_tx_tasklet(unsigned long +@@ -1175,16 +1171,6 @@ static void ncm_tx_tasklet(unsigned long data) ncm->timer_force_tx = false; } @@ -76,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior return HRTIMER_NORESTART; } -@@ -1517,8 +1503,7 @@ static int ncm_bind(struct usb_configura +@@ -1517,8 +1503,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f) ncm->port.open = ncm_open; ncm->port.close = ncm_close; @@ -86,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior ncm->task_timer.function = ncm_tx_timeout; DBG(cdev, "CDC Network: %s speed IN/%s OUT/%s NOTIFY/%s\n", -@@ -1627,7 +1612,6 @@ static void ncm_unbind(struct usb_config +@@ -1627,7 +1612,6 @@ static void ncm_unbind(struct usb_configuration *c, struct usb_function *f) DBG(c->cdev, "ncm unbind\n"); hrtimer_cancel(&ncm->task_timer); @@ -94,3 +97,6 @@ Signed-off-by: Sebastian Andrzej Siewior ncm_string_defs[0].id = 0; usb_free_all_descriptors(f); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0052-0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch b/kernel/patches-4.14.x-rt/0052-0052-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0052-0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch rename to kernel/patches-4.14.x-rt/0052-0052-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch index 01d9711ce..31f4f4117 100644 --- a/kernel/patches-4.14.x-rt/0052-0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch +++ b/kernel/patches-4.14.x-rt/0052-0052-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,6 +1,7 @@ +From 30d225bd318c7d54b729bcf76ef5a7e88bd5c546 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:17 +0100 -Subject: [PATCH 36/36] net/mvpp2: Replace tasklet with softirq hrtimer +Subject: [PATCH 052/414] net/mvpp2: Replace tasklet with softirq hrtimer The tx_done_tasklet tasklet is used in invoke the hrtimer (mvpp2_hr_timer_cb) in softirq context. This can be also achieved without @@ -13,9 +14,11 @@ Cc: netdev@vger.kernel.org Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior --- - drivers/net/ethernet/marvell/mvpp2.c | 62 ++++++++++++++--------------------- + drivers/net/ethernet/marvell/mvpp2.c | 62 +++++++++++----------------- 1 file changed, 25 insertions(+), 37 deletions(-) +diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c +index 529be74f609d..b1d7378b131c 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -830,9 +830,8 @@ struct mvpp2_pcpu_stats { @@ -29,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct mvpp2_queue_vector { -@@ -5954,46 +5953,34 @@ static void mvpp2_link_event(struct net_ +@@ -5954,46 +5953,34 @@ static void mvpp2_link_event(struct net_device *dev) } } @@ -92,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior return HRTIMER_NORESTART; } -@@ -6482,7 +6469,12 @@ static int mvpp2_tx(struct sk_buff *skb, +@@ -6482,7 +6469,12 @@ static int mvpp2_tx(struct sk_buff *skb, struct net_device *dev) txq_pcpu->count > 0) { struct mvpp2_port_pcpu *port_pcpu = this_cpu_ptr(port->pcpu); @@ -106,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior } return NETDEV_TX_OK; -@@ -6871,7 +6863,6 @@ static int mvpp2_stop(struct net_device +@@ -6871,7 +6863,6 @@ static int mvpp2_stop(struct net_device *dev) hrtimer_cancel(&port_pcpu->tx_done_timer); port_pcpu->timer_scheduled = false; @@ -114,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } mvpp2_cleanup_rxqs(port); -@@ -7644,13 +7635,10 @@ static int mvpp2_port_probe(struct platf +@@ -7644,13 +7635,10 @@ static int mvpp2_port_probe(struct platform_device *pdev, port_pcpu = per_cpu_ptr(port->pcpu, cpu); hrtimer_init(&port_pcpu->tx_done_timer, CLOCK_MONOTONIC, @@ -130,3 +133,6 @@ Signed-off-by: Sebastian Andrzej Siewior } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0053-at91_dont_enable_disable_clock.patch b/kernel/patches-4.14.x-rt/0053-0053-arm-at91-do-not-disable-enable-clocks-in-a-row.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0053-at91_dont_enable_disable_clock.patch rename to kernel/patches-4.14.x-rt/0053-0053-arm-at91-do-not-disable-enable-clocks-in-a-row.patch index 417e2e792..e91600dca 100644 --- a/kernel/patches-4.14.x-rt/0053-at91_dont_enable_disable_clock.patch +++ b/kernel/patches-4.14.x-rt/0053-0053-arm-at91-do-not-disable-enable-clocks-in-a-row.patch @@ -1,6 +1,7 @@ +From 8b8a0dc21253584aa11d73bc8556a67daa901feb Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior -Date: Wed, 09 Mar 2016 10:51:06 +0100 -Subject: arm: at91: do not disable/enable clocks in a row +Date: Wed, 9 Mar 2016 10:51:06 +0100 +Subject: [PATCH 053/414] 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. @@ -8,9 +9,11 @@ This can be avoided and causes a needless warning on -RT. Signed-off-by: Sebastian Andrzej Siewior --- - drivers/clocksource/tcb_clksrc.c | 33 +++++++++++++++++++++++++++++---- + drivers/clocksource/tcb_clksrc.c | 33 ++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) +diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c +index 9de47d4d2d9e..4f45be268e52 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -126,6 +126,7 @@ static struct clocksource clksrc = { @@ -21,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior void __iomem *regs; }; -@@ -143,6 +144,24 @@ static struct tc_clkevt_device *to_tc_cl +@@ -143,6 +144,24 @@ static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) */ static u32 timer_clock; @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int tc_shutdown(struct clock_event_device *d) { struct tc_clkevt_device *tcd = to_tc_clkevt(d); -@@ -150,8 +169,14 @@ static int tc_shutdown(struct clock_even +@@ -150,8 +169,14 @@ static int tc_shutdown(struct clock_event_device *d) writel(0xff, regs + ATMEL_TC_REG(2, IDR)); writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); @@ -62,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -164,7 +189,7 @@ static int tc_set_oneshot(struct clock_e +@@ -164,7 +189,7 @@ static int tc_set_oneshot(struct clock_event_device *d) if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) tc_shutdown(d); @@ -71,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* slow clock, count up to RC, then irq and stop */ writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | -@@ -186,7 +211,7 @@ static int tc_set_periodic(struct clock_ +@@ -186,7 +211,7 @@ static int tc_set_periodic(struct clock_event_device *d) /* By not making the gentime core emulate periodic mode on top * of oneshot, we get lower overhead and improved accuracy. */ @@ -80,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* slow clock, count up to RC, then irq and restart */ writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, -@@ -220,7 +245,7 @@ static struct tc_clkevt_device clkevt = +@@ -220,7 +245,7 @@ static struct tc_clkevt_device clkevt = { /* Should be lower than at91rm9200's system timer */ .rating = 125, .set_next_event = tc_next_event, @@ -89,3 +92,6 @@ Signed-off-by: Sebastian Andrzej Siewior .set_state_periodic = tc_set_periodic, .set_state_oneshot = tc_set_oneshot, }, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0054-rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch b/kernel/patches-4.14.x-rt/0054-0054-ARM-smp-Move-clear_tasks_mm_cpumask-call-to-__cpu_di.patch similarity index 89% rename from kernel/patches-4.14.x-rt/0054-rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch rename to kernel/patches-4.14.x-rt/0054-0054-ARM-smp-Move-clear_tasks_mm_cpumask-call-to-__cpu_di.patch index 325a7c0a2..5d2819c90 100644 --- a/kernel/patches-4.14.x-rt/0054-rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch +++ b/kernel/patches-4.14.x-rt/0054-0054-ARM-smp-Move-clear_tasks_mm_cpumask-call-to-__cpu_di.patch @@ -1,6 +1,8 @@ -Subject: ARM: smp: Move clear_tasks_mm_cpumask() call to __cpu_die() +From 86dbb8631a7a242cfa68176d0fa434360cc9f2ce Mon Sep 17 00:00:00 2001 From: Grygorii Strashko Date: Fri, 11 Sep 2015 21:21:23 +0300 +Subject: [PATCH 054/414] ARM: smp: Move clear_tasks_mm_cpumask() call to + __cpu_die() When running with the RT-kernel (4.1.5-rt5) on TI OMAP dra7-evm and trying to do Suspend to RAM, the following backtrace occurs: @@ -60,18 +62,11 @@ Cc: stable-rt@vger.kernel.org Link: http://lkml.kernel.org/r/1441995683-30817-1-git-send-email-grygorii.strashko@ti.com Signed-off-by: Thomas Gleixner --- - -RFC: I'm not sure how safe this change is and will be appreciated for any comments. -Most of arches call clear_tasks_mm_cpumask() from __cpu_disable(), but *powerpc* -calls it from CPU_DEAD notifier. This patch follows powerpc's approach in -general. - -This issue was first reported in: - http://www.spinics.net/lists/linux-rt-users/msg13752.html - - arch/arm/kernel/smp.c | 3 +-- + arch/arm/kernel/smp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) +diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c +index c9a0a5299827..7e5122af96ca 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -236,8 +236,6 @@ int __cpu_disable(void) @@ -91,3 +86,6 @@ This issue was first reported in: /* * platform_cpu_kill() is generally expected to do the powering off * and/or cutting of clocks to the dying CPU. Optionally, this may +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0055-rtmutex--Handle-non-enqueued-waiters-gracefully.patch b/kernel/patches-4.14.x-rt/0055-0055-rtmutex-Handle-non-enqueued-waiters-gracefully.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0055-rtmutex--Handle-non-enqueued-waiters-gracefully.patch rename to kernel/patches-4.14.x-rt/0055-0055-rtmutex-Handle-non-enqueued-waiters-gracefully.patch index 1673b3cfd..a29c0ecf2 100644 --- a/kernel/patches-4.14.x-rt/0055-rtmutex--Handle-non-enqueued-waiters-gracefully.patch +++ b/kernel/patches-4.14.x-rt/0055-0055-rtmutex-Handle-non-enqueued-waiters-gracefully.patch @@ -1,6 +1,7 @@ -Subject: rtmutex: Handle non enqueued waiters gracefully +From 9f2487b25f2e8ffbafbe315bcf5befefa920cb89 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Fri, 06 Nov 2015 18:51:03 +0100 +Date: Fri, 6 Nov 2015 18:51:03 +0100 +Subject: [PATCH 055/414] rtmutex: Handle non enqueued waiters gracefully Yimin debugged that in case of a PI wakeup in progress when rt_mutex_start_proxy_lock() calls task_blocks_on_rt_mutex() the latter @@ -14,14 +15,15 @@ remove_waiter() so we can call it unconditionally. Reported-and-debugged-by: Yimin Deng Signed-off-by: Thomas Gleixner Cc: stable-rt@vger.kernel.org - --- - kernel/locking/rtmutex.c | 2 +- + kernel/locking/rtmutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 940633c63254..fe7f97edc94e 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1729,7 +1729,7 @@ int __rt_mutex_start_proxy_lock(struct r +@@ -1729,7 +1729,7 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, ret = 0; } @@ -30,3 +32,6 @@ Cc: stable-rt@vger.kernel.org remove_waiter(lock, waiter); debug_rt_mutex_print_deadlock(waiter); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0056-rbtree-include-rcu.h-because-we-use-it.patch b/kernel/patches-4.14.x-rt/0056-0056-rbtree-include-rcu.h-because-we-use-it.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0056-rbtree-include-rcu.h-because-we-use-it.patch rename to kernel/patches-4.14.x-rt/0056-0056-rbtree-include-rcu.h-because-we-use-it.patch index 3070854de..bf23bb496 100644 --- a/kernel/patches-4.14.x-rt/0056-rbtree-include-rcu.h-because-we-use-it.patch +++ b/kernel/patches-4.14.x-rt/0056-0056-rbtree-include-rcu.h-because-we-use-it.patch @@ -1,6 +1,7 @@ +From 1e763f13882ae919defe08421e1964f5cb429110 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 11:52:17 +0200 -Subject: rbtree: include rcu.h because we use it +Subject: [PATCH 056/414] rbtree: include rcu.h because we use it Since commit c1adf20052d8 ("Introduce rb_replace_node_rcu()") rbtree_augmented.h uses RCU related data structures but does not include @@ -9,10 +10,12 @@ otherwise. Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/rbtree_augmented.h | 1 + - include/linux/rbtree_latch.h | 1 + + include/linux/rbtree_augmented.h | 1 + + include/linux/rbtree_latch.h | 1 + 2 files changed, 2 insertions(+) +diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h +index 6bfd2b581f75..af8a61be2d8d 100644 --- a/include/linux/rbtree_augmented.h +++ b/include/linux/rbtree_augmented.h @@ -26,6 +26,7 @@ @@ -23,6 +26,8 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Please note - only struct rb_augment_callbacks and the prototypes for +diff --git a/include/linux/rbtree_latch.h b/include/linux/rbtree_latch.h +index ece43e882b56..7d012faa509a 100644 --- a/include/linux/rbtree_latch.h +++ b/include/linux/rbtree_latch.h @@ -35,6 +35,7 @@ @@ -33,3 +38,6 @@ Signed-off-by: Sebastian Andrzej Siewior struct latch_tree_node { struct rb_node node[2]; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0057-rxrpc-remove-unused-static-variables.patch b/kernel/patches-4.14.x-rt/0057-0057-rxrpc-remove-unused-static-variables.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0057-rxrpc-remove-unused-static-variables.patch rename to kernel/patches-4.14.x-rt/0057-0057-rxrpc-remove-unused-static-variables.patch index 34b9923b3..68cd0a89c 100644 --- a/kernel/patches-4.14.x-rt/0057-rxrpc-remove-unused-static-variables.patch +++ b/kernel/patches-4.14.x-rt/0057-0057-rxrpc-remove-unused-static-variables.patch @@ -1,6 +1,7 @@ +From 04c557c3e0d947e2084a4de10bc56aa8372ff6e1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 21 Oct 2016 10:54:50 +0200 -Subject: [PATCH] rxrpc: remove unused static variables +Subject: [PATCH 057/414] rxrpc: remove unused static variables The rxrpc_security_methods and rxrpc_security_sem user has been removed in 648af7fca159 ("rxrpc: Absorb the rxkad security module"). This was @@ -9,9 +10,11 @@ noticed by kbuild test robot for the -RT tree but is also true for !RT. Reported-by: kbuild test robot Signed-off-by: Sebastian Andrzej Siewior --- - net/rxrpc/security.c | 3 --- + net/rxrpc/security.c | 3 --- 1 file changed, 3 deletions(-) +diff --git a/net/rxrpc/security.c b/net/rxrpc/security.c +index e9f428351293..c4479afe8ae7 100644 --- a/net/rxrpc/security.c +++ b/net/rxrpc/security.c @@ -19,9 +19,6 @@ @@ -24,3 +27,6 @@ Signed-off-by: Sebastian Andrzej Siewior static const struct rxrpc_security *rxrpc_security_types[] = { [RXRPC_SECURITY_NONE] = &rxrpc_no_security, #ifdef CONFIG_RXKAD +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0058-mfd-syscon-atmel-smc-include-string.h.patch b/kernel/patches-4.14.x-rt/0058-0058-mfd-syscon-atmel-smc-include-string.h.patch similarity index 65% rename from kernel/patches-4.14.x-rt/0058-mfd-syscon-atmel-smc-include-string.h.patch rename to kernel/patches-4.14.x-rt/0058-0058-mfd-syscon-atmel-smc-include-string.h.patch index db4e313e6..ea69dfcb0 100644 --- a/kernel/patches-4.14.x-rt/0058-mfd-syscon-atmel-smc-include-string.h.patch +++ b/kernel/patches-4.14.x-rt/0058-0058-mfd-syscon-atmel-smc-include-string.h.patch @@ -1,15 +1,18 @@ +From 3bb9ec8538c6fbe78e7d1000cdb90d5dc9fef5de Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 09:55:58 +0200 -Subject: [PATCH] mfd: syscon: atmel-smc: include string.h +Subject: [PATCH 058/414] mfd: syscon: atmel-smc: include string.h The string.h header file is needed for the memset() definition. The RT build fails because it is not pulled in via other header files. Signed-off-by: Sebastian Andrzej Siewior --- - drivers/mfd/atmel-smc.c | 1 + + drivers/mfd/atmel-smc.c | 1 + 1 file changed, 1 insertion(+) +diff --git a/drivers/mfd/atmel-smc.c b/drivers/mfd/atmel-smc.c +index 7d77948567d7..0adbd2e796fe 100644 --- a/drivers/mfd/atmel-smc.c +++ b/drivers/mfd/atmel-smc.c @@ -12,6 +12,7 @@ @@ -20,3 +23,6 @@ Signed-off-by: Sebastian Andrzej Siewior /** * atmel_smc_cs_conf_init - initialize a SMC CS conf +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0059-sched-swait-include-wait.h.patch b/kernel/patches-4.14.x-rt/0059-0059-sched-swait-include-wait.h.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0059-sched-swait-include-wait.h.patch rename to kernel/patches-4.14.x-rt/0059-0059-sched-swait-include-wait.h.patch index 33e80727a..cfc4add92 100644 --- a/kernel/patches-4.14.x-rt/0059-sched-swait-include-wait.h.patch +++ b/kernel/patches-4.14.x-rt/0059-0059-sched-swait-include-wait.h.patch @@ -1,6 +1,7 @@ +From 5fb42773ca3ff7b4d7106a80ca60df8ce46bc95c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 4 Dec 2017 13:11:10 +0100 -Subject: [PATCH] sched/swait: include wait.h +Subject: [PATCH 059/414] sched/swait: include wait.h kbuild bot reported against an intermediate RT patch that the build fails with: @@ -20,9 +21,11 @@ I think that swait should include a header file for a function/macro Reported-by: kbuild test robot Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/swait.h | 1 + + include/linux/swait.h | 1 + 1 file changed, 1 insertion(+) +diff --git a/include/linux/swait.h b/include/linux/swait.h +index c98aaf677466..84f9745365ff 100644 --- a/include/linux/swait.h +++ b/include/linux/swait.h @@ -5,6 +5,7 @@ @@ -33,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior #include /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0060-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/kernel/patches-4.14.x-rt/0060-0060-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0060-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch rename to kernel/patches-4.14.x-rt/0060-0060-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index 6f53aa68a..79b2b7591 100644 --- a/kernel/patches-4.14.x-rt/0060-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/kernel/patches-4.14.x-rt/0060-0060-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -1,10 +1,7 @@ -Date: Fri, 28 Oct 2016 23:05:11 +0200 -From: Sebastian Andrzej Siewior -To: Trond Myklebust -Cc: Anna Schumaker , - linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, - tglx@linutronix.de -Subject: NFSv4: replace seqcount_t with a seqlock_t +From 563b91d9d3b7a337be9c292b216f6e40c2bf48d7 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Fri, 28 Oct 2016 23:05:11 +0200 +Subject: [PATCH 060/414] 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 @@ -22,15 +19,17 @@ block readers). Reported-by: kernel test robot Signed-off-by: Sebastian Andrzej Siewior --- - fs/nfs/delegation.c | 4 ++-- - fs/nfs/nfs4_fs.h | 2 +- - fs/nfs/nfs4proc.c | 4 ++-- - fs/nfs/nfs4state.c | 22 ++++++++++++++++------ + fs/nfs/delegation.c | 4 ++-- + fs/nfs/nfs4_fs.h | 2 +- + fs/nfs/nfs4proc.c | 4 ++-- + fs/nfs/nfs4state.c | 22 ++++++++++++++++------ 4 files changed, 21 insertions(+), 11 deletions(-) +diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c +index 606dd3871f66..fa41eb75b4d8 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c -@@ -150,11 +150,11 @@ static int nfs_delegation_claim_opens(st +@@ -150,11 +150,11 @@ static int nfs_delegation_claim_opens(struct inode *inode, sp = state->owner; /* Block nfs4_proc_unlck */ mutex_lock(&sp->so_delegreturn_mutex); @@ -44,6 +43,8 @@ Signed-off-by: Sebastian Andrzej Siewior 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 dcfcf7fd7438..c4498ba4d97b 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -112,7 +112,7 @@ struct nfs4_state_owner { @@ -55,9 +56,11 @@ Signed-off-by: Sebastian Andrzej Siewior struct mutex so_delegreturn_mutex; }; +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c +index ae8f43d270d6..e95055c73ef0 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c -@@ -2642,7 +2642,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2642,7 +2642,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, unsigned int seq; int ret; @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = _nfs4_proc_open(opendata); if (ret != 0) -@@ -2680,7 +2680,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2680,7 +2680,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, if (d_inode(dentry) == state->inode) { nfs_inode_attach_open_context(ctx); @@ -75,9 +78,11 @@ Signed-off-by: Sebastian Andrzej Siewior nfs4_schedule_stateid_recovery(server, state); } out: +diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c +index 45873ed92057..c487a1ca7106 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c -@@ -494,7 +494,7 @@ nfs4_alloc_state_owner(struct nfs_server +@@ -494,7 +494,7 @@ nfs4_alloc_state_owner(struct nfs_server *server, nfs4_init_seqid_counter(&sp->so_seqid); atomic_set(&sp->so_count, 1); INIT_LIST_HEAD(&sp->so_lru); @@ -86,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_init(&sp->so_delegreturn_mutex); return sp; } -@@ -1519,8 +1519,12 @@ static int nfs4_reclaim_open_state(struc +@@ -1519,8 +1519,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. */ @@ -100,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior restart: list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) -@@ -1589,14 +1593,20 @@ static int nfs4_reclaim_open_state(struc +@@ -1589,14 +1593,20 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs spin_lock(&sp->so_lock); goto restart; } @@ -125,3 +130,6 @@ Signed-off-by: Sebastian Andrzej Siewior return status; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0061-Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch b/kernel/patches-4.14.x-rt/0061-0061-Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0061-Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch rename to kernel/patches-4.14.x-rt/0061-0061-Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch index 50c58e5bb..20b7a922a 100644 --- a/kernel/patches-4.14.x-rt/0061-Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch +++ b/kernel/patches-4.14.x-rt/0061-0061-Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch @@ -1,6 +1,7 @@ +From 263c7527d57fce678a521bd94fdb46da18ea5296 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 15:35:57 +0200 -Subject: Bluetooth: avoid recursive locking in +Subject: [PATCH 061/414] Bluetooth: avoid recursive locking in hci_send_to_channel() Mart reported a deadlock in -RT in the call path: @@ -20,12 +21,14 @@ Fixes: 38ceaa00d02d ("Bluetooth: Add support for sending MGMT commands and event Reported-by: Mart van de Wege Signed-off-by: Sebastian Andrzej Siewior --- - net/bluetooth/hci_sock.c | 17 +++++++++++------ + net/bluetooth/hci_sock.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) +diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c +index 65d734c165bd..923e9a271872 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c -@@ -251,15 +251,13 @@ void hci_send_to_sock(struct hci_dev *hd +@@ -251,15 +251,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb) } /* Send frame to sockets with specific channel */ @@ -43,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior sk_for_each(sk, &hci_sk_list.head) { struct sk_buff *nskb; -@@ -285,6 +283,13 @@ void hci_send_to_channel(unsigned short +@@ -285,6 +283,13 @@ void hci_send_to_channel(unsigned short channel, struct sk_buff *skb, kfree_skb(nskb); } @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior read_unlock(&hci_sk_list.lock); } -@@ -388,8 +393,8 @@ void hci_send_monitor_ctrl_event(struct +@@ -388,8 +393,8 @@ void hci_send_monitor_ctrl_event(struct hci_dev *hdev, u16 event, hdr->index = index; hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); @@ -68,3 +71,6 @@ Signed-off-by: Sebastian Andrzej Siewior kfree_skb(skb); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0062-iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch b/kernel/patches-4.14.x-rt/0062-0062-iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0062-iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch rename to kernel/patches-4.14.x-rt/0062-0062-iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch index 7c1776429..12f24e0d2 100644 --- a/kernel/patches-4.14.x-rt/0062-iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch +++ b/kernel/patches-4.14.x-rt/0062-0062-iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch @@ -1,7 +1,8 @@ +From 664685618c427ebd0ab812c5e0c60f1fe27babef Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 17:21:40 +0200 -Subject: [PATCH] iommu/iova: Use raw_cpu_ptr() instead of get_cpu_ptr() for - ->fq +Subject: [PATCH 062/414] iommu/iova: Use raw_cpu_ptr() instead of + get_cpu_ptr() for ->fq get_cpu_ptr() disabled preemption and returns the ->fq object of the current CPU. raw_cpu_ptr() does the same except that it not disable @@ -17,12 +18,14 @@ Cc: iommu@lists.linux-foundation.org Reported-by: vinadhy@gmail.com Signed-off-by: Sebastian Andrzej Siewior --- - drivers/iommu/iova.c | 4 +--- + drivers/iommu/iova.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) +diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c +index 33edfa794ae9..b30900025c62 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c -@@ -570,7 +570,7 @@ void queue_iova(struct iova_domain *iova +@@ -570,7 +570,7 @@ void queue_iova(struct iova_domain *iovad, unsigned long pfn, unsigned long pages, unsigned long data) { @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned long flags; unsigned idx; -@@ -600,8 +600,6 @@ void queue_iova(struct iova_domain *iova +@@ -600,8 +600,6 @@ void queue_iova(struct iova_domain *iovad, if (atomic_cmpxchg(&iovad->fq_timer_on, 0, 1) == 0) mod_timer(&iovad->fq_timer, jiffies + msecs_to_jiffies(IOVA_FQ_TIMEOUT)); @@ -40,3 +43,6 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(queue_iova); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0063-greybus-audio-don-t-inclide-rwlock.h-directly.patch b/kernel/patches-4.14.x-rt/0063-0063-greybus-audio-don-t-inclide-rwlock.h-directly.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0063-greybus-audio-don-t-inclide-rwlock.h-directly.patch rename to kernel/patches-4.14.x-rt/0063-0063-greybus-audio-don-t-inclide-rwlock.h-directly.patch index 2973b4080..06f196ab2 100644 --- a/kernel/patches-4.14.x-rt/0063-greybus-audio-don-t-inclide-rwlock.h-directly.patch +++ b/kernel/patches-4.14.x-rt/0063-0063-greybus-audio-don-t-inclide-rwlock.h-directly.patch @@ -1,6 +1,7 @@ +From 47736832b2310bb49311025ba0e61fe80124cd94 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 5 Oct 2017 14:38:52 +0200 -Subject: [PATCH] greybus: audio: don't inclide rwlock.h directly. +Subject: [PATCH 063/414] greybus: audio: don't inclide rwlock.h directly. rwlock.h should not be included directly. Instead linux/splinlock.h should be included. One thing it does is to break the RT build. @@ -14,9 +15,11 @@ Cc: greybus-dev@lists.linaro.org Cc: devel@driverdev.osuosl.org Signed-off-by: Sebastian Andrzej Siewior --- - drivers/staging/greybus/audio_manager.c | 2 +- + drivers/staging/greybus/audio_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/staging/greybus/audio_manager.c b/drivers/staging/greybus/audio_manager.c +index aa6508b44fab..045696ce85c7 100644 --- a/drivers/staging/greybus/audio_manager.c +++ b/drivers/staging/greybus/audio_manager.c @@ -10,7 +10,7 @@ @@ -28,3 +31,6 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include "audio_manager.h" +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0064-xen-9pfs-don-t-inclide-rwlock.h-directly.patch b/kernel/patches-4.14.x-rt/0064-0064-xen-9pfs-don-t-inclide-rwlock.h-directly.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0064-xen-9pfs-don-t-inclide-rwlock.h-directly.patch rename to kernel/patches-4.14.x-rt/0064-0064-xen-9pfs-don-t-inclide-rwlock.h-directly.patch index 8c36bf8c7..641092279 100644 --- a/kernel/patches-4.14.x-rt/0064-xen-9pfs-don-t-inclide-rwlock.h-directly.patch +++ b/kernel/patches-4.14.x-rt/0064-0064-xen-9pfs-don-t-inclide-rwlock.h-directly.patch @@ -1,6 +1,7 @@ +From 0e7a72ced9f507028a2fd2f593bac4c974d3bb85 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 5 Oct 2017 14:38:52 +0200 -Subject: [PATCH] xen/9pfs: don't inclide rwlock.h directly. +Subject: [PATCH 064/414] xen/9pfs: don't inclide rwlock.h directly. rwlock.h should not be included directly. Instead linux/splinlock.h should be included. One thing it does is to break the RT build. @@ -13,9 +14,11 @@ Cc: v9fs-developer@lists.sourceforge.net Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - net/9p/trans_xen.c | 1 - + net/9p/trans_xen.c | 1 - 1 file changed, 1 deletion(-) +diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c +index 325c56043007..a3f577e81c79 100644 --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c @@ -38,7 +38,6 @@ @@ -26,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include #include +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0065-drm-i915-properly-init-lockdep-class.patch b/kernel/patches-4.14.x-rt/0065-0065-drm-i915-properly-init-lockdep-class.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0065-drm-i915-properly-init-lockdep-class.patch rename to kernel/patches-4.14.x-rt/0065-0065-drm-i915-properly-init-lockdep-class.patch index f424c480d..9f12d8831 100644 --- a/kernel/patches-4.14.x-rt/0065-drm-i915-properly-init-lockdep-class.patch +++ b/kernel/patches-4.14.x-rt/0065-0065-drm-i915-properly-init-lockdep-class.patch @@ -1,6 +1,7 @@ +From 5c2ada25bae668725a91b9c3d968ba297f9d83e2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 30 Nov 2017 16:06:13 +0100 -Subject: [PATCH] drm/i915: properly init lockdep class +Subject: [PATCH 065/414] drm/i915: properly init lockdep class The code has an ifdef and uses two functions to either init the bare spinlock or init it and set a lock-class. It is possible to do the same @@ -11,12 +12,14 @@ name/class function vanishes. Signed-off-by: Sebastian Andrzej Siewior --- - drivers/gpu/drm/i915/i915_gem_timeline.c | 5 +---- + drivers/gpu/drm/i915/i915_gem_timeline.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) +diff --git a/drivers/gpu/drm/i915/i915_gem_timeline.c b/drivers/gpu/drm/i915/i915_gem_timeline.c +index c597ce277a04..c1108d3921f8 100644 --- a/drivers/gpu/drm/i915/i915_gem_timeline.c +++ b/drivers/gpu/drm/i915/i915_gem_timeline.c -@@ -33,11 +33,8 @@ static void __intel_timeline_init(struct +@@ -33,11 +33,8 @@ static void __intel_timeline_init(struct intel_timeline *tl, { tl->fence_context = context; tl->common = parent; @@ -29,3 +32,6 @@ Signed-off-by: Sebastian Andrzej Siewior init_request_active(&tl->last_request, NULL); INIT_LIST_HEAD(&tl->requests); i915_syncmap_init(&tl->sync); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0066-timerqueue-Document-return-values-of-timerqueue_add-.patch b/kernel/patches-4.14.x-rt/0066-0066-timerqueue-Document-return-values-of-timerqueue_add-.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0066-timerqueue-Document-return-values-of-timerqueue_add-.patch rename to kernel/patches-4.14.x-rt/0066-0066-timerqueue-Document-return-values-of-timerqueue_add-.patch index 1e09c3363..c94f78a6c 100644 --- a/kernel/patches-4.14.x-rt/0066-timerqueue-Document-return-values-of-timerqueue_add-.patch +++ b/kernel/patches-4.14.x-rt/0066-0066-timerqueue-Document-return-values-of-timerqueue_add-.patch @@ -1,6 +1,7 @@ +From ec5fd96756a5ba739aa063ec489a5969052b17a9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 22 Dec 2017 15:51:15 +0100 -Subject: [PATCH 4/4] timerqueue: Document return values of +Subject: [PATCH 066/414] timerqueue: Document return values of timerqueue_add/del() The return values of timerqueue_add/del() are not documented in the kernel doc @@ -10,9 +11,11 @@ Signed-off-by: Thomas Gleixner Cc: rt@linutronix.de Signed-off-by: Sebastian Andrzej Siewior --- - lib/timerqueue.c | 8 +++++--- + lib/timerqueue.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) +diff --git a/lib/timerqueue.c b/lib/timerqueue.c +index 4a720ed4fdaf..0d54bcbc8170 100644 --- a/lib/timerqueue.c +++ b/lib/timerqueue.c @@ -33,8 +33,9 @@ @@ -37,3 +40,6 @@ Signed-off-by: Sebastian Andrzej Siewior */ bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0067-sparc64-use-generic-rwsem-spinlocks-rt.patch b/kernel/patches-4.14.x-rt/0067-0067-sparc64-use-generic-rwsem-spinlocks-rt.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0067-sparc64-use-generic-rwsem-spinlocks-rt.patch rename to kernel/patches-4.14.x-rt/0067-0067-sparc64-use-generic-rwsem-spinlocks-rt.patch index fadbc6829..4aa6d2190 100644 --- a/kernel/patches-4.14.x-rt/0067-sparc64-use-generic-rwsem-spinlocks-rt.patch +++ b/kernel/patches-4.14.x-rt/0067-0067-sparc64-use-generic-rwsem-spinlocks-rt.patch @@ -1,13 +1,16 @@ +From 56c6ab8998f8c01e128cd6abf7721efaccfbd17b Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 13 Dec 2013 09:44:41 +0530 -Subject: sparc64: use generic rwsem spinlocks rt +Subject: [PATCH 067/414] sparc64: use generic rwsem spinlocks rt Signed-off-by: Allen Pais Signed-off-by: Sebastian Andrzej Siewior --- - arch/sparc/Kconfig | 6 ++---- + arch/sparc/Kconfig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) +diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig +index 4e83f950713e..7f9d71523763 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -206,12 +206,10 @@ config NR_CPUS @@ -25,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior config GENERIC_HWEIGHT bool +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0068-kernel-SRCU-provide-a-static-initializer.patch b/kernel/patches-4.14.x-rt/0068-0068-kernel-SRCU-provide-a-static-initializer.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0068-kernel-SRCU-provide-a-static-initializer.patch rename to kernel/patches-4.14.x-rt/0068-0068-kernel-SRCU-provide-a-static-initializer.patch index 5c14f9fc0..0ec5fad5a 100644 --- a/kernel/patches-4.14.x-rt/0068-kernel-SRCU-provide-a-static-initializer.patch +++ b/kernel/patches-4.14.x-rt/0068-0068-kernel-SRCU-provide-a-static-initializer.patch @@ -1,6 +1,7 @@ +From bd0fdb707a3a6f12d982868ec34545529180ba3c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 19 Mar 2013 14:44:30 +0100 -Subject: kernel/SRCU: provide a static initializer +Subject: [PATCH 068/414] kernel/SRCU: provide a static initializer There are macros for static initializer for the three out of four possible notifier types, that are: @@ -13,11 +14,13 @@ complete. Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/notifier.h | 42 +++++++++++++++++++++++++++++++++--------- - include/linux/srcutiny.h | 6 +++--- - include/linux/srcutree.h | 6 +++--- + include/linux/notifier.h | 42 +++++++++++++++++++++++++++++++--------- + include/linux/srcutiny.h | 6 +++--- + include/linux/srcutree.h | 6 +++--- 3 files changed, 39 insertions(+), 15 deletions(-) +diff --git a/include/linux/notifier.h b/include/linux/notifier.h +index 6d731110e0db..e758627da14d 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h @@ -7,7 +7,7 @@ @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); #define srcu_cleanup_notifier_head(name) \ cleanup_srcu_struct(&(name)->srcu); -@@ -104,7 +102,13 @@ extern void srcu_init_notifier_head(stru +@@ -104,7 +102,13 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); .head = NULL } #define RAW_NOTIFIER_INIT(name) { \ .head = NULL } @@ -64,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior #define ATOMIC_NOTIFIER_HEAD(name) \ struct atomic_notifier_head name = \ -@@ -116,6 +120,26 @@ extern void srcu_init_notifier_head(stru +@@ -116,6 +120,26 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); struct raw_notifier_head name = \ RAW_NOTIFIER_INIT(name) @@ -91,7 +94,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef __KERNEL__ extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh, -@@ -185,12 +209,12 @@ static inline int notifier_to_errno(int +@@ -185,12 +209,12 @@ static inline int notifier_to_errno(int ret) /* * Declared notifiers so far. I can imagine quite a few more chains @@ -107,6 +110,8 @@ Signed-off-by: Sebastian Andrzej Siewior /* CPU notfiers are defined in include/linux/cpu.h. */ /* netdevice notifiers are defined in include/linux/netdevice.h */ +diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h +index 261471f407a5..f41d2fb09f87 100644 --- a/include/linux/srcutiny.h +++ b/include/linux/srcutiny.h @@ -43,7 +43,7 @@ struct srcu_struct { @@ -118,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior { \ .srcu_wq = __SWAIT_QUEUE_HEAD_INITIALIZER(name.srcu_wq), \ .srcu_cb_tail = &name.srcu_cb_head, \ -@@ -56,9 +56,9 @@ void srcu_drive_gp(struct work_struct *w +@@ -56,9 +56,9 @@ void srcu_drive_gp(struct work_struct *wp); * Tree SRCU, which needs some per-CPU data. */ #define DEFINE_SRCU(name) \ @@ -130,6 +135,8 @@ Signed-off-by: Sebastian Andrzej Siewior void synchronize_srcu(struct srcu_struct *sp); +diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h +index a949f4f9e4d7..85ae8c0dddb4 100644 --- a/include/linux/srcutree.h +++ b/include/linux/srcutree.h @@ -104,9 +104,9 @@ struct srcu_struct { @@ -153,3 +160,6 @@ Signed-off-by: Sebastian Andrzej Siewior #define DEFINE_SRCU(name) __DEFINE_SRCU(name, /* not static */) #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0069-target-drop-spin_lock_assert-irqs_disabled-combo-che.patch b/kernel/patches-4.14.x-rt/0069-0069-target-drop-spin_lock_assert-irqs_disabled-combo-che.patch similarity index 67% rename from kernel/patches-4.14.x-rt/0069-target-drop-spin_lock_assert-irqs_disabled-combo-che.patch rename to kernel/patches-4.14.x-rt/0069-0069-target-drop-spin_lock_assert-irqs_disabled-combo-che.patch index 27ae736e1..4f0cb6df7 100644 --- a/kernel/patches-4.14.x-rt/0069-target-drop-spin_lock_assert-irqs_disabled-combo-che.patch +++ b/kernel/patches-4.14.x-rt/0069-0069-target-drop-spin_lock_assert-irqs_disabled-combo-che.patch @@ -1,7 +1,8 @@ +From 014036dc7301ff7b0787a4a0b08cd83497a5facb Mon Sep 17 00:00:00 2001 From: "bigeasy@linutronix.de" Date: Fri, 23 Mar 2018 18:17:36 +0100 -Subject: [PATCH] target: drop spin_lock_assert() + irqs_disabled() combo - checks +Subject: [PATCH 069/414] target: drop spin_lock_assert() + irqs_disabled() + combo checks There are a few functions which check for if the lock is held (spin_lock_assert()) and the interrupts are disabled (irqs_disabled()). @@ -21,13 +22,15 @@ Reported-by: Arnaldo Carvalho de Melo Suggested-by: Linus Torvalds Signed-off-by: Sebastian Andrzej Siewior --- - drivers/target/target_core_tmr.c | 2 -- - drivers/target/target_core_transport.c | 6 ------ + drivers/target/target_core_tmr.c | 2 -- + drivers/target/target_core_transport.c | 6 ------ 2 files changed, 8 deletions(-) +diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c +index 9c7bc1ca341a..3d35dad1de2c 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c -@@ -114,8 +114,6 @@ static bool __target_check_io_state(stru +@@ -114,8 +114,6 @@ static bool __target_check_io_state(struct se_cmd *se_cmd, { struct se_session *sess = se_cmd->se_sess; @@ -36,9 +39,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * If command already reached CMD_T_COMPLETE state within * target_complete_cmd() or CMD_T_FABRIC_STOP due to shutdown, +diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c +index e6d51135d105..b00829995131 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c -@@ -2966,9 +2966,6 @@ static bool +@@ -2966,9 +2966,6 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, __acquires(&cmd->t_state_lock) { @@ -48,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (fabric_stop) cmd->transport_state |= CMD_T_FABRIC_STOP; -@@ -3238,9 +3235,6 @@ static int __transport_check_aborted_sta +@@ -3238,9 +3235,6 @@ static int __transport_check_aborted_status(struct se_cmd *cmd, int send_status) { int ret; @@ -58,3 +63,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (!(cmd->transport_state & CMD_T_ABORTED)) return 0; /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0070-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/kernel/patches-4.14.x-rt/0070-0070-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0070-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch rename to kernel/patches-4.14.x-rt/0070-0070-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index 8a8a338c8..586da4acf 100644 --- a/kernel/patches-4.14.x-rt/0070-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/kernel/patches-4.14.x-rt/0070-0070-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -1,6 +1,8 @@ +From 1c5e16bc89fc0e8ce205056a152e0e315fafea96 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 4 Apr 2017 12:50:16 +0200 -Subject: [PATCH] kernel: sched: Provide a pointer to the valid CPU mask +Subject: [PATCH 070/414] kernel: sched: Provide a pointer to the valid CPU + mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -56,35 +58,37 @@ Cc: Ingo Molnar Cc: Rafael J. Wysocki Signed-off-by: Sebastian Andrzej Siewior --- - arch/ia64/kernel/mca.c | 2 - - arch/mips/include/asm/switch_to.h | 4 +- - arch/mips/kernel/mips-mt-fpaff.c | 2 - - arch/mips/kernel/traps.c | 6 ++-- - arch/powerpc/platforms/cell/spufs/sched.c | 2 - - arch/tile/include/asm/setup.h | 2 - - arch/tile/kernel/hardwall.c | 10 +++--- - drivers/infiniband/hw/hfi1/affinity.c | 6 ++-- - drivers/infiniband/hw/hfi1/sdma.c | 3 -- - drivers/infiniband/hw/qib/qib_file_ops.c | 7 ++-- - fs/proc/array.c | 4 +- - include/linux/init_task.h | 3 +- - include/linux/sched.h | 5 ++- - kernel/cgroup/cpuset.c | 2 - - kernel/fork.c | 3 +- - kernel/sched/core.c | 42 ++++++++++++++--------------- - kernel/sched/cpudeadline.c | 4 +- - kernel/sched/cpupri.c | 4 +- - kernel/sched/deadline.c | 6 ++-- - kernel/sched/fair.c | 28 +++++++++---------- - kernel/sched/rt.c | 4 +- - kernel/trace/trace_hwlat.c | 2 - - lib/smp_processor_id.c | 2 - - samples/trace_events/trace-events-sample.c | 2 - + arch/ia64/kernel/mca.c | 2 +- + arch/mips/include/asm/switch_to.h | 4 +-- + arch/mips/kernel/mips-mt-fpaff.c | 2 +- + arch/mips/kernel/traps.c | 6 ++-- + arch/powerpc/platforms/cell/spufs/sched.c | 2 +- + arch/tile/include/asm/setup.h | 2 +- + arch/tile/kernel/hardwall.c | 10 +++--- + drivers/infiniband/hw/hfi1/affinity.c | 6 ++-- + drivers/infiniband/hw/hfi1/sdma.c | 3 +- + drivers/infiniband/hw/qib/qib_file_ops.c | 7 ++-- + fs/proc/array.c | 4 +-- + include/linux/init_task.h | 3 +- + include/linux/sched.h | 5 +-- + kernel/cgroup/cpuset.c | 2 +- + kernel/fork.c | 3 +- + kernel/sched/core.c | 42 +++++++++++----------- + kernel/sched/cpudeadline.c | 4 +-- + kernel/sched/cpupri.c | 4 +-- + kernel/sched/deadline.c | 6 ++-- + kernel/sched/fair.c | 28 +++++++-------- + kernel/sched/rt.c | 4 +-- + kernel/trace/trace_hwlat.c | 2 +- + lib/smp_processor_id.c | 2 +- + samples/trace_events/trace-events-sample.c | 2 +- 24 files changed, 78 insertions(+), 77 deletions(-) +diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c +index 555b11180156..6866201a7603 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c -@@ -1824,7 +1824,7 @@ format_mca_init_stack(void *mca_data, un +@@ -1824,7 +1824,7 @@ format_mca_init_stack(void *mca_data, unsigned long offset, ti->cpu = cpu; p->stack = ti; p->state = TASK_UNINTERRUPTIBLE; @@ -93,6 +97,8 @@ Signed-off-by: Sebastian Andrzej Siewior INIT_LIST_HEAD(&p->tasks); p->parent = p->real_parent = p->group_leader = p; INIT_LIST_HEAD(&p->children); +diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h +index e610473d61b8..1428b4febbc9 100644 --- a/arch/mips/include/asm/switch_to.h +++ b/arch/mips/include/asm/switch_to.h @@ -42,7 +42,7 @@ extern struct task_struct *ll_task; @@ -113,9 +119,11 @@ Signed-off-by: Sebastian Andrzej Siewior } \ next->thread.emulated_fp = 0; \ } while(0) +diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c +index a7c0f97e4b0d..1a08428eedcf 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c -@@ -177,7 +177,7 @@ asmlinkage long mipsmt_sys_sched_getaffi +@@ -177,7 +177,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, if (retval) goto out_unlock; @@ -124,6 +132,8 @@ Signed-off-by: Sebastian Andrzej Siewior cpumask_and(&mask, &allowed, cpu_active_mask); out_unlock: +diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c +index 5669d3b8bd38..53bfb74e5f67 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -1192,12 +1192,12 @@ static void mt_ase_fp_affinity(void) @@ -142,9 +152,11 @@ Signed-off-by: Sebastian Andrzej Siewior &mt_fpu_cpumask); set_cpus_allowed_ptr(current, &tmask); set_thread_flag(TIF_FPUBOUND); +diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c +index 1fbb5da17dd2..ca86366d5424 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c -@@ -141,7 +141,7 @@ void __spu_update_sched_info(struct spu_ +@@ -141,7 +141,7 @@ void __spu_update_sched_info(struct spu_context *ctx) * runqueue. The context will be rescheduled on the proper node * if it is timesliced or preempted. */ @@ -153,6 +165,8 @@ Signed-off-by: Sebastian Andrzej Siewior /* Save the current cpu id for spu interrupt routing. */ ctx->last_ran = raw_smp_processor_id(); +diff --git a/arch/tile/include/asm/setup.h b/arch/tile/include/asm/setup.h +index 2a0347af0702..670fa2f4cfc3 100644 --- a/arch/tile/include/asm/setup.h +++ b/arch/tile/include/asm/setup.h @@ -49,7 +49,7 @@ int hardwall_ipi_valid(int cpu); @@ -164,9 +178,11 @@ Signed-off-by: Sebastian Andrzej Siewior hardwall_deactivate_all(p); \ } while (0) #endif +diff --git a/arch/tile/kernel/hardwall.c b/arch/tile/kernel/hardwall.c +index 2fd1694ac1d0..98f4fb696289 100644 --- a/arch/tile/kernel/hardwall.c +++ b/arch/tile/kernel/hardwall.c -@@ -590,12 +590,12 @@ static int hardwall_activate(struct hard +@@ -590,12 +590,12 @@ static int hardwall_activate(struct hardwall_info *info) * Get our affinity; if we're not bound to this tile uniquely, * we can't access the network registers. */ @@ -181,7 +197,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!cpumask_test_cpu(cpu, &info->cpumask)) return -EINVAL; -@@ -621,17 +621,17 @@ static int hardwall_activate(struct hard +@@ -621,17 +621,17 @@ static int hardwall_activate(struct hardwall_info *info) * Deactivate a task's hardwall. Must hold lock for hardwall_type. * This method may be called from exit_thread(), so we don't want to * rely on too many fields of struct task_struct still being valid. @@ -202,6 +218,8 @@ Signed-off-by: Sebastian Andrzej Siewior BUG(); } +diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c +index a97055dd4fbd..6a624e733abc 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c @@ -576,7 +576,7 @@ int hfi1_get_proc_affinity(int node) @@ -231,9 +249,11 @@ Signed-off-by: Sebastian Andrzej Siewior hfi1_cdbg(PROC, "PID %u %s affinity set to CPU set(s) %*pbl", 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 6781bcdb10b3..d069ad261572 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c -@@ -856,14 +856,13 @@ struct sdma_engine *sdma_select_user_eng +@@ -856,14 +856,13 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd, { struct sdma_rht_node *rht_node; struct sdma_engine *sde = NULL; @@ -249,9 +269,11 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; cpu_id = smp_processor_id(); +diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c +index 9396c1807cc3..a42fcd4735cb 100644 --- a/drivers/infiniband/hw/qib/qib_file_ops.c +++ b/drivers/infiniband/hw/qib/qib_file_ops.c -@@ -1163,7 +1163,7 @@ static unsigned int qib_poll(struct file +@@ -1163,7 +1163,7 @@ static unsigned int qib_poll(struct file *fp, struct poll_table_struct *pt) static void assign_ctxt_affinity(struct file *fp, struct qib_devdata *dd) { struct qib_filedata *fd = fp->private_data; @@ -260,7 +282,7 @@ Signed-off-by: Sebastian Andrzej Siewior const struct cpumask *local_mask = cpumask_of_pcibus(dd->pcidev->bus); int local_cpu; -@@ -1644,9 +1644,8 @@ static int qib_assign_ctxt(struct file * +@@ -1644,9 +1644,8 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo) ret = find_free_ctxt(i_minor - 1, fp, uinfo); else { int unit; @@ -272,9 +294,11 @@ Signed-off-by: Sebastian Andrzej Siewior if (weight == 1 && !test_bit(cpu, qib_cpulist)) if (!find_hca(cpu, &unit) && unit >= 0) +diff --git a/fs/proc/array.c b/fs/proc/array.c +index e6094a15ef30..230dcf56e85a 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c -@@ -361,9 +361,9 @@ static inline void task_context_switch_c +@@ -361,9 +361,9 @@ static inline void task_context_switch_counts(struct seq_file *m, static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) { seq_printf(m, "Cpus_allowed:\t%*pb\n", @@ -286,6 +310,8 @@ Signed-off-by: Sebastian Andrzej Siewior } int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, +diff --git a/include/linux/init_task.h b/include/linux/init_task.h +index 8062e6cc607c..53ee20e0b168 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -234,7 +234,8 @@ extern struct cred init_cred; @@ -298,6 +324,8 @@ Signed-off-by: Sebastian Andrzej Siewior .nr_cpus_allowed= NR_CPUS, \ .mm = NULL, \ .active_mm = &init_mm, \ +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 41354690e4e3..5bd2ab2df9d4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -578,7 +578,8 @@ struct task_struct { @@ -319,9 +347,11 @@ Signed-off-by: Sebastian Andrzej Siewior #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ +diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c +index 4657e2924ecb..7bb7384b543a 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c -@@ -2094,7 +2094,7 @@ static void cpuset_fork(struct task_stru +@@ -2094,7 +2094,7 @@ static void cpuset_fork(struct task_struct *task) if (task_css_is_root(task, cpuset_cgrp_id)) return; @@ -330,9 +360,11 @@ Signed-off-by: Sebastian Andrzej Siewior task->mems_allowed = current->mems_allowed; } +diff --git a/kernel/fork.c b/kernel/fork.c +index 98c91bd341b4..04c3ebd7a9a9 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -564,7 +564,8 @@ static struct task_struct *dup_task_stru +@@ -564,7 +564,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) #ifdef CONFIG_CC_STACKPROTECTOR tsk->stack_canary = get_random_canary(); #endif @@ -342,9 +374,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * One for us, one for whoever does the "release_task()" (usually * parent) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 8cf36b30a006..c12765ab3a3a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -960,7 +960,7 @@ static struct rq *__migrate_task(struct +@@ -960,7 +960,7 @@ static struct rq *__migrate_task(struct rq *rq, struct rq_flags *rf, } /* Affinity changed (again). */ @@ -353,7 +387,7 @@ Signed-off-by: Sebastian Andrzej Siewior return rq; update_rq_clock(rq); -@@ -988,7 +988,7 @@ static int migration_cpu_stop(void *data +@@ -988,7 +988,7 @@ static int migration_cpu_stop(void *data) local_irq_disable(); /* * We need to explicitly wake pending tasks before running @@ -362,7 +396,7 @@ Signed-off-by: Sebastian Andrzej Siewior * during wakeups, see set_cpus_allowed_ptr()'s TASK_WAKING test. */ sched_ttwu_pending(); -@@ -1019,7 +1019,7 @@ static int migration_cpu_stop(void *data +@@ -1019,7 +1019,7 @@ static int migration_cpu_stop(void *data) */ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask) { @@ -371,7 +405,7 @@ Signed-off-by: Sebastian Andrzej Siewior p->nr_cpus_allowed = cpumask_weight(new_mask); } -@@ -1089,7 +1089,7 @@ static int __set_cpus_allowed_ptr(struct +@@ -1089,7 +1089,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, goto out; } @@ -393,7 +427,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto unlock; __migrate_swap_task(arg->src_task, arg->dst_cpu); -@@ -1294,10 +1294,10 @@ int migrate_swap(struct task_struct *cur +@@ -1294,10 +1294,10 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p) if (!cpu_active(arg.src_cpu) || !cpu_active(arg.dst_cpu)) goto out; @@ -415,7 +449,7 @@ Signed-off-by: Sebastian Andrzej Siewior * * A few notes on cpu_active vs cpu_online: * -@@ -1481,14 +1481,14 @@ static int select_fallback_rq(int cpu, s +@@ -1481,14 +1481,14 @@ static int select_fallback_rq(int cpu, struct task_struct *p) for_each_cpu(dest_cpu, nodemask) { if (!cpu_active(dest_cpu)) continue; @@ -432,7 +466,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!(p->flags & PF_KTHREAD) && !cpu_active(dest_cpu)) continue; if (!cpu_online(dest_cpu)) -@@ -1533,7 +1533,7 @@ static int select_fallback_rq(int cpu, s +@@ -1533,7 +1533,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p) } /* @@ -441,7 +475,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ static inline int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) -@@ -1543,11 +1543,11 @@ int select_task_rq(struct task_struct *p +@@ -1543,11 +1543,11 @@ int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) if (p->nr_cpus_allowed > 1) cpu = p->sched_class->select_task_rq(p, cpu, sd_flags, wake_flags); else @@ -455,7 +489,7 @@ Signed-off-by: Sebastian Andrzej Siewior * CPU. * * Since this is common to all placement strategies, this lives here. -@@ -1555,7 +1555,7 @@ int select_task_rq(struct task_struct *p +@@ -1555,7 +1555,7 @@ int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) * [ this allows ->select_task() to simply return task_cpu(p) and * not worry about this generic constraint ] */ @@ -464,7 +498,7 @@ Signed-off-by: Sebastian Andrzej Siewior !cpu_online(cpu))) cpu = select_fallback_rq(task_cpu(p), p); -@@ -2445,7 +2445,7 @@ void wake_up_new_task(struct task_struct +@@ -2445,7 +2445,7 @@ void wake_up_new_task(struct task_struct *p) #ifdef CONFIG_SMP /* * Fork balancing, do it here and not earlier because: @@ -473,7 +507,7 @@ Signed-off-by: Sebastian Andrzej Siewior * - any previously selected CPU might disappear through hotplug * * Use __set_task_cpu() to avoid calling sched_class::migrate_task_rq, -@@ -4162,7 +4162,7 @@ static int __sched_setscheduler(struct t +@@ -4162,7 +4162,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. */ @@ -482,7 +516,7 @@ Signed-off-by: Sebastian Andrzej Siewior rq->rd->dl_bw.bw == 0) { task_rq_unlock(rq, p, &rf); return -EPERM; -@@ -4756,7 +4756,7 @@ long sched_getaffinity(pid_t pid, struct +@@ -4756,7 +4756,7 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) goto out_unlock; raw_spin_lock_irqsave(&p->pi_lock, flags); @@ -491,7 +525,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&p->pi_lock, flags); out_unlock: -@@ -5321,7 +5321,7 @@ int task_can_attach(struct task_struct * +@@ -5321,7 +5321,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 @@ -500,7 +534,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ if (p->flags & PF_NO_SETAFFINITY) { ret = -EINVAL; -@@ -5348,7 +5348,7 @@ int migrate_task_to(struct task_struct * +@@ -5348,7 +5348,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu) if (curr_cpu == target_cpu) return 0; @@ -509,7 +543,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; /* TODO: This is not properly updating schedstats */ -@@ -5485,7 +5485,7 @@ static void migrate_tasks(struct rq *dea +@@ -5485,7 +5485,7 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf) put_prev_task(rq, next); /* @@ -518,9 +552,11 @@ Signed-off-by: Sebastian Andrzej Siewior * both pi_lock and rq->lock, such that holding either * stabilizes the mask. * +diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c +index 8d9562d890d3..91a0702fe3df 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c -@@ -127,13 +127,13 @@ int cpudl_find(struct cpudl *cp, struct +@@ -127,13 +127,13 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p, const struct sched_dl_entity *dl_se = &p->dl; if (later_mask && @@ -536,9 +572,11 @@ Signed-off-by: Sebastian Andrzej Siewior dl_time_before(dl_se->deadline, cp->elements[0].dl)) { if (later_mask) cpumask_set_cpu(best_cpu, later_mask); +diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c +index 2511aba36b89..7b9bc1de0e6c 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c -@@ -103,11 +103,11 @@ int cpupri_find(struct cpupri *cp, struc +@@ -103,11 +103,11 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p, if (skip) continue; @@ -552,9 +590,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * We have to ensure that we have at least one bit +diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c +index 4ae5c1ea90e2..72a396253dc0 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -504,7 +504,7 @@ static struct rq *dl_task_offline_migrat +@@ -504,7 +504,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. */ @@ -563,7 +603,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (cpu >= nr_cpu_ids) { /* * Fail to find any suitable cpu. -@@ -1749,7 +1749,7 @@ static void set_curr_task_dl(struct rq * +@@ -1749,7 +1749,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) && @@ -572,7 +612,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 1; return 0; } -@@ -1899,7 +1899,7 @@ static struct rq *find_lock_later_rq(str +@@ -1899,7 +1899,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 || @@ -581,9 +621,11 @@ Signed-off-by: Sebastian Andrzej Siewior task_running(rq, task) || !dl_task(task) || !task_on_rq_queued(task))) { +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index 5c09ddf8c832..d1916d33f7ff 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -1596,7 +1596,7 @@ static void task_numa_compare(struct tas +@@ -1596,7 +1596,7 @@ static void task_numa_compare(struct task_numa_env *env, */ if (cur) { /* Skip this swap candidate if cannot move to the source cpu */ @@ -592,7 +634,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto unlock; /* -@@ -1706,7 +1706,7 @@ static void task_numa_find_cpu(struct ta +@@ -1706,7 +1706,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 */ @@ -601,7 +643,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; env->dst_cpu = cpu; -@@ -5475,7 +5475,7 @@ find_idlest_group(struct sched_domain *s +@@ -5475,7 +5475,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), @@ -610,7 +652,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; local_group = cpumask_test_cpu(this_cpu, -@@ -5595,7 +5595,7 @@ find_idlest_cpu(struct sched_group *grou +@@ -5595,7 +5595,7 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu) return cpumask_first(sched_group_span(group)); /* Traverse only the allowed CPUs */ @@ -619,7 +661,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (idle_cpu(i)) { struct rq *rq = cpu_rq(i); struct cpuidle_state *idle = idle_get_state(rq); -@@ -5697,7 +5697,7 @@ static int select_idle_core(struct task_ +@@ -5697,7 +5697,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int if (!test_idle_cores(target, false)) return -1; @@ -628,7 +670,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_cpu_wrap(core, cpus, target) { bool idle = true; -@@ -5731,7 +5731,7 @@ static int select_idle_smt(struct task_s +@@ -5731,7 +5731,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)) { @@ -637,7 +679,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (idle_cpu(cpu)) return cpu; -@@ -5794,7 +5794,7 @@ static int select_idle_cpu(struct task_s +@@ -5794,7 +5794,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; @@ -646,7 +688,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (idle_cpu(cpu)) break; -@@ -5949,7 +5949,7 @@ select_task_rq_fair(struct task_struct * +@@ -5949,7 +5949,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) @@ -655,7 +697,7 @@ Signed-off-by: Sebastian Andrzej Siewior } rcu_read_lock(); -@@ -6698,14 +6698,14 @@ int can_migrate_task(struct task_struct +@@ -6698,14 +6698,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 @@ -672,7 +714,7 @@ Signed-off-by: Sebastian Andrzej Siewior int cpu; schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -6725,7 +6725,7 @@ int can_migrate_task(struct task_struct +@@ -6725,7 +6725,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) { @@ -681,7 +723,7 @@ Signed-off-by: Sebastian Andrzej Siewior env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; break; -@@ -7294,7 +7294,7 @@ check_cpu_capacity(struct rq *rq, struct +@@ -7294,7 +7294,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -690,7 +732,7 @@ Signed-off-by: Sebastian Andrzej Siewior * * 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. -@@ -7870,7 +7870,7 @@ static struct sched_group *find_busiest_ +@@ -7870,7 +7870,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 @@ -699,7 +741,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -8262,7 +8262,7 @@ static int load_balance(int this_cpu, st +@@ -8262,7 +8262,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 */ @@ -708,9 +750,11 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&busiest->lock, flags); env.flags |= LBF_ALL_PINNED; +diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c +index 470a0c9e93de..a892c5e0ed41 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c -@@ -1592,7 +1592,7 @@ static void put_prev_task_rt(struct rq * +@@ -1592,7 +1592,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p) static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu) { if (!task_running(rq, p) && @@ -719,7 +763,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 1; return 0; } -@@ -1727,7 +1727,7 @@ static struct rq *find_lock_lowest_rq(st +@@ -1727,7 +1727,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq) * Also make sure that it wasn't scheduled on its rq. */ if (unlikely(task_rq(task) != rq || @@ -728,6 +772,8 @@ Signed-off-by: Sebastian Andrzej Siewior task_running(rq, task) || !rt_task(task) || !task_on_rq_queued(task))) { +diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c +index d7c8e4ec3d9d..518c61a1bceb 100644 --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -279,7 +279,7 @@ static void move_to_next_cpu(void) @@ -739,9 +785,11 @@ Signed-off-by: Sebastian Andrzej Siewior goto disable; get_online_cpus(); +diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c +index 835cc6df2776..6f4a4ae881c8 100644 --- a/lib/smp_processor_id.c +++ b/lib/smp_processor_id.c -@@ -23,7 +23,7 @@ notrace static unsigned int check_preemp +@@ -23,7 +23,7 @@ notrace static unsigned int check_preemption_disabled(const char *what1, * Kernel threads bound to a single CPU can safely use * smp_processor_id(): */ @@ -750,6 +798,8 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; /* +diff --git a/samples/trace_events/trace-events-sample.c b/samples/trace_events/trace-events-sample.c +index 5522692100ba..8b4be8e1802a 100644 --- a/samples/trace_events/trace-events-sample.c +++ b/samples/trace_events/trace-events-sample.c @@ -33,7 +33,7 @@ static void simple_thread_func(int cnt) @@ -761,3 +811,6 @@ Signed-off-by: Sebastian Andrzej Siewior trace_foo_with_template_simple("HELLO", cnt); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0071-add_migrate_disable.patch b/kernel/patches-4.14.x-rt/0071-0071-kernel-sched-core-add-migrate_disable.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0071-add_migrate_disable.patch rename to kernel/patches-4.14.x-rt/0071-0071-kernel-sched-core-add-migrate_disable.patch index d6b48f1fa..201d2c83c 100644 --- a/kernel/patches-4.14.x-rt/0071-add_migrate_disable.patch +++ b/kernel/patches-4.14.x-rt/0071-0071-kernel-sched-core-add-migrate_disable.patch @@ -1,15 +1,18 @@ +From 3afe2037283d5bff1b403d802e93ab44e8ec9d4b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: kernel/sched/core: add migrate_disable() +Subject: [PATCH 071/414] kernel/sched/core: add migrate_disable() --- - include/linux/preempt.h | 23 ++++++++ - include/linux/sched.h | 7 ++ - include/linux/smp.h | 3 + - kernel/sched/core.c | 130 +++++++++++++++++++++++++++++++++++++++++++++++- - kernel/sched/debug.c | 4 + + include/linux/preempt.h | 23 +++++++ + include/linux/sched.h | 7 +++ + include/linux/smp.h | 3 + + kernel/sched/core.c | 130 +++++++++++++++++++++++++++++++++++++++- + kernel/sched/debug.c | 4 ++ 5 files changed, 165 insertions(+), 2 deletions(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 5bd3f151da78..81c69aeab662 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -185,6 +185,22 @@ do { \ @@ -49,6 +52,8 @@ Subject: kernel/sched/core: add migrate_disable() #endif /* CONFIG_PREEMPT_COUNT */ #ifdef MODULE +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 5bd2ab2df9d4..0ab4cec5c7ec 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -580,6 +580,13 @@ struct task_struct { @@ -65,6 +70,8 @@ Subject: kernel/sched/core: add migrate_disable() #ifdef CONFIG_PREEMPT_RCU int rcu_read_lock_nesting; +diff --git a/include/linux/smp.h b/include/linux/smp.h +index 9fb239e12b82..5801e516ba63 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -202,6 +202,9 @@ static inline int get_boot_cpu_id(void) @@ -77,9 +84,11 @@ Subject: kernel/sched/core: add migrate_disable() /* * 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 c12765ab3a3a..1d8f359903c2 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1023,7 +1023,15 @@ void set_cpus_allowed_common(struct task +@@ -1023,7 +1023,15 @@ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_ma p->nr_cpus_allowed = cpumask_weight(new_mask); } @@ -96,7 +105,7 @@ Subject: kernel/sched/core: add migrate_disable() { struct rq *rq = task_rq(p); bool queued, running; -@@ -1052,6 +1060,20 @@ void do_set_cpus_allowed(struct task_str +@@ -1052,6 +1060,20 @@ void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) set_curr_task(rq, p); } @@ -117,7 +126,7 @@ Subject: kernel/sched/core: add migrate_disable() /* * 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 -@@ -1110,9 +1132,16 @@ static int __set_cpus_allowed_ptr(struct +@@ -1110,9 +1132,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 */ @@ -236,9 +245,11 @@ Subject: kernel/sched/core: add migrate_disable() +} +EXPORT_SYMBOL(migrate_enable); +#endif +diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c +index 2f93e4a2d9f6..3108da1ee253 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c -@@ -1017,6 +1017,10 @@ void proc_sched_show_task(struct task_st +@@ -1017,6 +1017,10 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, P(dl.runtime); P(dl.deadline); } @@ -249,3 +260,6 @@ Subject: kernel/sched/core: add migrate_disable() #undef PN_SCHEDSTAT #undef PN #undef __PN +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0072-0001-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch b/kernel/patches-4.14.x-rt/0072-0072-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0072-0001-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch rename to kernel/patches-4.14.x-rt/0072-0072-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch index 2c2213421..d61d358b9 100644 --- a/kernel/patches-4.14.x-rt/0072-0001-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch +++ b/kernel/patches-4.14.x-rt/0072-0072-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch @@ -1,6 +1,7 @@ +From 97df7f1c21cc0f118f328d37baaa815a7598f71f Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" Date: Thu, 21 Sep 2017 16:22:49 -0400 -Subject: [PATCH 01/48] tracing: Reverse the order of trace_types_lock and +Subject: [PATCH 072/414] tracing: Reverse the order of trace_types_lock and event_mutex In order to make future changes where we need to call @@ -16,13 +17,15 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 12ecef0cb12102d8c034770173d2d1363cb97d52) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace.c | 5 +++++ - kernel/trace/trace_events.c | 31 +++++++++++++++---------------- + kernel/trace/trace.c | 5 +++++ + kernel/trace/trace_events.c | 31 +++++++++++++++---------------- 2 files changed, 20 insertions(+), 16 deletions(-) +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 76bcc80b893e..2d74c9054e94 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -7671,6 +7671,7 @@ static int instance_mkdir(const char *na +@@ -7671,6 +7671,7 @@ static int instance_mkdir(const char *name) struct trace_array *tr; int ret; @@ -30,7 +33,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_lock(&trace_types_lock); ret = -EEXIST; -@@ -7726,6 +7727,7 @@ static int instance_mkdir(const char *na +@@ -7726,6 +7727,7 @@ static int instance_mkdir(const char *name) list_add(&tr->list, &ftrace_trace_arrays); mutex_unlock(&trace_types_lock); @@ -38,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; -@@ -7737,6 +7739,7 @@ static int instance_mkdir(const char *na +@@ -7737,6 +7739,7 @@ static int instance_mkdir(const char *name) out_unlock: mutex_unlock(&trace_types_lock); @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; -@@ -7749,6 +7752,7 @@ static int instance_rmdir(const char *na +@@ -7749,6 +7752,7 @@ static int instance_rmdir(const char *name) int ret; int i; @@ -54,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_lock(&trace_types_lock); ret = -ENODEV; -@@ -7794,6 +7798,7 @@ static int instance_rmdir(const char *na +@@ -7794,6 +7798,7 @@ static int instance_rmdir(const char *name) out_unlock: mutex_unlock(&trace_types_lock); @@ -62,9 +65,11 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } +diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c +index d53268a4e167..1b87157edbff 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c -@@ -1406,8 +1406,8 @@ static int subsystem_open(struct inode * +@@ -1406,8 +1406,8 @@ static int subsystem_open(struct inode *inode, struct file *filp) return -ENODEV; /* Make sure the system still exists */ @@ -74,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior list_for_each_entry(tr, &ftrace_trace_arrays, list) { list_for_each_entry(dir, &tr->systems, list) { if (dir == inode->i_private) { -@@ -1421,8 +1421,8 @@ static int subsystem_open(struct inode * +@@ -1421,8 +1421,8 @@ static int subsystem_open(struct inode *inode, struct file *filp) } } exit_loop: @@ -84,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!system) return -ENODEV; -@@ -2308,15 +2308,15 @@ static void __add_event_to_tracers(struc +@@ -2308,15 +2308,15 @@ static void __add_event_to_tracers(struct trace_event_call *call); int trace_add_event_call(struct trace_event_call *call) { int ret; @@ -102,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2370,13 +2370,13 @@ int trace_remove_event_call(struct trace +@@ -2370,13 +2370,13 @@ int trace_remove_event_call(struct trace_event_call *call) { int ret; @@ -118,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2438,8 +2438,8 @@ static int trace_module_notify(struct no +@@ -2438,8 +2438,8 @@ static int trace_module_notify(struct notifier_block *self, { struct module *mod = data; @@ -128,7 +133,7 @@ Signed-off-by: Sebastian Andrzej Siewior switch (val) { case MODULE_STATE_COMING: trace_module_add_events(mod); -@@ -2448,8 +2448,8 @@ static int trace_module_notify(struct no +@@ -2448,8 +2448,8 @@ static int trace_module_notify(struct notifier_block *self, trace_module_remove_events(mod); break; } @@ -138,7 +143,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -2964,24 +2964,24 @@ create_event_toplevel_files(struct dentr +@@ -2964,24 +2964,24 @@ create_event_toplevel_files(struct dentry *parent, struct trace_array *tr) * creates the event hierachry in the @parent/events directory. * * Returns 0 on success. @@ -168,7 +173,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -3010,9 +3010,10 @@ early_event_add_tracer(struct dentry *pa +@@ -3010,9 +3010,10 @@ early_event_add_tracer(struct dentry *parent, struct trace_array *tr) return ret; } @@ -180,7 +185,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Disable any event triggers and associated soft-disabled events */ clear_event_triggers(tr); -@@ -3033,8 +3034,6 @@ int event_trace_del_tracer(struct trace_ +@@ -3033,8 +3034,6 @@ int event_trace_del_tracer(struct trace_array *tr) tr->event_dir = NULL; @@ -189,3 +194,6 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0073-0002-ring-buffer-Rewrite-trace_recursive_-un-lock-to-be-s.patch b/kernel/patches-4.14.x-rt/0073-0073-ring-buffer-Rewrite-trace_recursive_-un-lock-to-be-s.patch similarity index 88% rename from kernel/patches-4.14.x-rt/0073-0002-ring-buffer-Rewrite-trace_recursive_-un-lock-to-be-s.patch rename to kernel/patches-4.14.x-rt/0073-0073-ring-buffer-Rewrite-trace_recursive_-un-lock-to-be-s.patch index 3a37c6037..58badd8c3 100644 --- a/kernel/patches-4.14.x-rt/0073-0002-ring-buffer-Rewrite-trace_recursive_-un-lock-to-be-s.patch +++ b/kernel/patches-4.14.x-rt/0073-0073-ring-buffer-Rewrite-trace_recursive_-un-lock-to-be-s.patch @@ -1,6 +1,7 @@ +From d8eb45e589f7d743c84f977b513a6cbd68c5ea8c Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" Date: Fri, 22 Sep 2017 16:59:02 -0400 -Subject: [PATCH 02/48] ring-buffer: Rewrite trace_recursive_(un)lock() to be +Subject: [PATCH 073/414] ring-buffer: Rewrite trace_recursive_(un)lock() to be simpler The current method to prevent the ring buffer from entering into a recursize @@ -23,12 +24,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 1a149d7d3f45d311da1f63473736c05f30ae8a75) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/ring_buffer.c | 66 ++++++++++++--------------------------------- - 1 file changed, 18 insertions(+), 48 deletions(-) + kernel/trace/ring_buffer.c | 64 ++++++++++---------------------------- + 1 file changed, 17 insertions(+), 47 deletions(-) +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index 36f018b15392..29bad749560a 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c -@@ -2545,61 +2545,29 @@ rb_wakeups(struct ring_buffer *buffer, s +@@ -2545,61 +2545,29 @@ rb_wakeups(struct ring_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer) * The lock and unlock are done within a preempt disable section. * The current_context per_cpu variable can only be modified * by the current task between lock and unlock. But it can @@ -44,7 +47,11 @@ Signed-off-by: Sebastian Andrzej Siewior - * bit 1 = IRQ context - * bit 2 = SoftIRQ context - * bit 3 = normal context. -- * ++ * Normal context. ++ * SoftIRQ context ++ * IRQ context ++ * NMI context + * - * This works because this is the order of contexts that can - * preempt other contexts. A SoftIRQ never preempts an IRQ - * context. @@ -66,11 +73,6 @@ Signed-off-by: Sebastian Andrzej Siewior - * The least significant bit can be cleared this way, and it - * just so happens that it is the same bit corresponding to - * the current context. -+ * Normal context. -+ * SoftIRQ context -+ * IRQ context -+ * NMI context -+ * + * If for some reason the ring buffer starts to recurse, we + * only allow that to happen at most 4 times (one for each + * context). If it happens 5 times, then we consider this a @@ -105,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -2607,7 +2575,9 @@ trace_recursive_lock(struct ring_buffer_ +@@ -2607,7 +2575,9 @@ trace_recursive_lock(struct ring_buffer_per_cpu *cpu_buffer) static __always_inline void trace_recursive_unlock(struct ring_buffer_per_cpu *cpu_buffer) { @@ -116,3 +118,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /** +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0074-0003-tracing-Remove-lookups-from-tracing_map-hitcount.patch b/kernel/patches-4.14.x-rt/0074-0074-tracing-Remove-lookups-from-tracing_map-hitcount.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0074-0003-tracing-Remove-lookups-from-tracing_map-hitcount.patch rename to kernel/patches-4.14.x-rt/0074-0074-tracing-Remove-lookups-from-tracing_map-hitcount.patch index c3f323673..358f721cc 100644 --- a/kernel/patches-4.14.x-rt/0074-0003-tracing-Remove-lookups-from-tracing_map-hitcount.patch +++ b/kernel/patches-4.14.x-rt/0074-0074-tracing-Remove-lookups-from-tracing_map-hitcount.patch @@ -1,6 +1,7 @@ +From 0260035447656440e07552084b049f2557771aba Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:18 -0500 -Subject: [PATCH 03/48] tracing: Remove lookups from tracing_map hitcount +Subject: [PATCH 074/414] tracing: Remove lookups from tracing_map hitcount Lookups inflate the hitcount, making it essentially useless. Only inserts and updates should really affect the hitcount anyway, so @@ -13,12 +14,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 83c07ecc4203728e85fc4a2ce6fdf25d16ea118e) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/tracing_map.c | 3 ++- + kernel/trace/tracing_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c +index 305039b122fa..07e75344725b 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c -@@ -428,7 +428,8 @@ static inline struct tracing_map_elt * +@@ -428,7 +428,8 @@ __tracing_map_insert(struct tracing_map *map, void *key, bool lookup_only) if (test_key && test_key == key_hash && entry->val && keys_match(key, entry->val->key, map->key_size)) { @@ -28,3 +31,6 @@ Signed-off-by: Sebastian Andrzej Siewior return entry->val; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0075-0004-tracing-Increase-tracing-map-KEYS_MAX-size.patch b/kernel/patches-4.14.x-rt/0075-0075-tracing-Increase-tracing-map-KEYS_MAX-size.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0075-0004-tracing-Increase-tracing-map-KEYS_MAX-size.patch rename to kernel/patches-4.14.x-rt/0075-0075-tracing-Increase-tracing-map-KEYS_MAX-size.patch index 20c3ef406..0d67ccbde 100644 --- a/kernel/patches-4.14.x-rt/0075-0004-tracing-Increase-tracing-map-KEYS_MAX-size.patch +++ b/kernel/patches-4.14.x-rt/0075-0075-tracing-Increase-tracing-map-KEYS_MAX-size.patch @@ -1,6 +1,7 @@ +From d82878711f489e0ab7256c0bccaed2516cc316ba Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:19 -0500 -Subject: [PATCH 04/48] tracing: Increase tracing map KEYS_MAX size +Subject: [PATCH 075/414] tracing: Increase tracing map KEYS_MAX size The current default for the number of subkeys in a compound key is 2, which is too restrictive. Increase it to a more realistic value of 3. @@ -12,9 +13,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 4f36c2d85cedea60ad424d44534121ab0458069e) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/tracing_map.h | 2 +- + kernel/trace/tracing_map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/trace/tracing_map.h b/kernel/trace/tracing_map.h +index ab0ca77331d0..5b5bbf8ae550 100644 --- a/kernel/trace/tracing_map.h +++ b/kernel/trace/tracing_map.h @@ -6,7 +6,7 @@ @@ -26,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior #define TRACING_MAP_VALS_MAX 3 #define TRACING_MAP_FIELDS_MAX (TRACING_MAP_KEYS_MAX + \ TRACING_MAP_VALS_MAX) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0076-0005-tracing-Make-traceprobe-parsing-code-reusable.patch b/kernel/patches-4.14.x-rt/0076-0076-tracing-Make-traceprobe-parsing-code-reusable.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0076-0005-tracing-Make-traceprobe-parsing-code-reusable.patch rename to kernel/patches-4.14.x-rt/0076-0076-tracing-Make-traceprobe-parsing-code-reusable.patch index be506729c..9a701e420 100644 --- a/kernel/patches-4.14.x-rt/0076-0005-tracing-Make-traceprobe-parsing-code-reusable.patch +++ b/kernel/patches-4.14.x-rt/0076-0076-tracing-Make-traceprobe-parsing-code-reusable.patch @@ -1,6 +1,7 @@ +From 180c8a6d2132ea7101c5209321f5afff44db523a Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:20 -0500 -Subject: [PATCH 05/48] tracing: Make traceprobe parsing code reusable +Subject: [PATCH 076/414] tracing: Make traceprobe parsing code reusable traceprobe_probes_write() and traceprobe_command() actually contain nothing that ties them to kprobes - the code is generically useful for @@ -18,17 +19,19 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 7e465baa80293ed5f87fdf6405391d6f02110d4e) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace.c | 86 ++++++++++++++++++++++++++++++++++++++++++++ - kernel/trace/trace.h | 7 +++ - kernel/trace/trace_kprobe.c | 18 ++++----- - kernel/trace/trace_probe.c | 86 -------------------------------------------- - kernel/trace/trace_probe.h | 7 --- - kernel/trace/trace_uprobe.c | 2 - + kernel/trace/trace.c | 86 +++++++++++++++++++++++++++++++++++++ + kernel/trace/trace.h | 7 +++ + kernel/trace/trace_kprobe.c | 18 ++++---- + kernel/trace/trace_probe.c | 86 ------------------------------------- + kernel/trace/trace_probe.h | 7 --- + kernel/trace/trace_uprobe.c | 2 +- 6 files changed, 103 insertions(+), 103 deletions(-) +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 2d74c9054e94..2ce9e0eee9ec 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -8265,6 +8265,92 @@ void ftrace_dump(enum ftrace_dump_mode o +@@ -8265,6 +8265,92 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) } EXPORT_SYMBOL_GPL(ftrace_dump); @@ -121,6 +124,8 @@ Signed-off-by: Sebastian Andrzej Siewior __init static int tracer_alloc_buffers(void) { int ring_buf_size; +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 401b0639116f..418facf3389c 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -1755,6 +1755,13 @@ void trace_printk_start_comm(void); @@ -137,9 +142,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Normal trace_printk() and friends allocates special buffers * to do the manipulation, as well as saves the print formats +diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c +index f8d3bd974bcc..1f8b72d82ad9 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c -@@ -907,8 +907,8 @@ static int probes_open(struct inode *ino +@@ -907,8 +907,8 @@ static int probes_open(struct inode *inode, struct file *file) static ssize_t probes_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { @@ -150,7 +157,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static const struct file_operations kprobe_events_ops = { -@@ -1433,9 +1433,9 @@ static __init int kprobe_trace_self_test +@@ -1433,9 +1433,9 @@ static __init int kprobe_trace_self_tests_init(void) pr_info("Testing kprobe tracing: "); @@ -163,7 +170,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON_ONCE(ret)) { pr_warn("error on probing function entry.\n"); warn++; -@@ -1455,8 +1455,8 @@ static __init int kprobe_trace_self_test +@@ -1455,8 +1455,8 @@ static __init int kprobe_trace_self_tests_init(void) } } @@ -174,7 +181,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON_ONCE(ret)) { pr_warn("error on probing function return.\n"); warn++; -@@ -1526,13 +1526,13 @@ static __init int kprobe_trace_self_test +@@ -1526,13 +1526,13 @@ static __init int kprobe_trace_self_tests_init(void) disable_trace_kprobe(tk, file); } @@ -190,9 +197,11 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON_ONCE(ret)) { pr_warn("error on deleting a probe.\n"); warn++; +diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c +index fe4513330412..daf54bda4dc8 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c -@@ -621,92 +621,6 @@ void traceprobe_free_probe_arg(struct pr +@@ -621,92 +621,6 @@ void traceprobe_free_probe_arg(struct probe_arg *arg) kfree(arg->comm); } @@ -285,6 +294,8 @@ Signed-off-by: Sebastian Andrzej Siewior static int __set_print_fmt(struct trace_probe *tp, char *buf, int len, bool is_return) { +diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h +index dc39472ca9e4..a0d750e3d17c 100644 --- a/kernel/trace/trace_probe.h +++ b/kernel/trace/trace_probe.h @@ -42,7 +42,6 @@ @@ -295,7 +306,7 @@ Signed-off-by: Sebastian Andrzej Siewior #define MAX_STRING_SIZE PATH_MAX /* Reserved field names */ -@@ -356,12 +355,6 @@ extern void traceprobe_free_probe_arg(st +@@ -356,12 +355,6 @@ extern void traceprobe_free_probe_arg(struct probe_arg *arg); extern int traceprobe_split_symbol_offset(char *symbol, long *offset); @@ -308,9 +319,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* Sum up total data length for dynamic arraies (strings) */ static nokprobe_inline int __get_data_size(struct trace_probe *tp, struct pt_regs *regs) +diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c +index 14d3af6a2953..f89a12a1c8f3 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c -@@ -651,7 +651,7 @@ static int probes_open(struct inode *ino +@@ -645,7 +645,7 @@ static int probes_open(struct inode *inode, struct file *file) static ssize_t probes_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { @@ -319,3 +332,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static const struct file_operations uprobe_events_ops = { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0077-0006-tracing-Clean-up-hist_field_flags-enum.patch b/kernel/patches-4.14.x-rt/0077-0077-tracing-Clean-up-hist_field_flags-enum.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0077-0006-tracing-Clean-up-hist_field_flags-enum.patch rename to kernel/patches-4.14.x-rt/0077-0077-tracing-Clean-up-hist_field_flags-enum.patch index 61e6a4c75..4a45c7b8e 100644 --- a/kernel/patches-4.14.x-rt/0077-0006-tracing-Clean-up-hist_field_flags-enum.patch +++ b/kernel/patches-4.14.x-rt/0077-0077-tracing-Clean-up-hist_field_flags-enum.patch @@ -1,6 +1,7 @@ +From 8ec6c38a5590b63fe522ad4143d1ffb5f5166a5c Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:21 -0500 -Subject: [PATCH 06/48] tracing: Clean up hist_field_flags enum +Subject: [PATCH 077/414] tracing: Clean up hist_field_flags enum As we add more flags, specifying explicit integers for the flag values becomes more unwieldy and error-prone - switch them over to left-shift @@ -13,9 +14,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 0d7a8325bf3326c92da2d21b4496a9ddde896d4f) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 20 ++++++++++---------- + kernel/trace/trace_events_hist.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 7eb975a2d0e1..4f6b6406d6ec 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -110,16 +110,16 @@ DEFINE_HIST_FIELD_FN(u8); @@ -45,3 +48,6 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct hist_trigger_attrs { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0078-0007-tracing-Add-hist_field_name-accessor.patch b/kernel/patches-4.14.x-rt/0078-0078-tracing-Add-hist_field_name-accessor.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0078-0007-tracing-Add-hist_field_name-accessor.patch rename to kernel/patches-4.14.x-rt/0078-0078-tracing-Add-hist_field_name-accessor.patch index e4e0e9401..81d548f30 100644 --- a/kernel/patches-4.14.x-rt/0078-0007-tracing-Add-hist_field_name-accessor.patch +++ b/kernel/patches-4.14.x-rt/0078-0078-tracing-Add-hist_field_name-accessor.patch @@ -1,6 +1,7 @@ +From a1c53738433410a2c14cb1f3678441c54d1db478 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:22 -0500 -Subject: [PATCH 07/48] tracing: Add hist_field_name() accessor +Subject: [PATCH 078/414] tracing: Add hist_field_name() accessor In preparation for hist_fields that won't be strictly based on trace_event_fields, add a new hist_field_name() accessor to allow that @@ -13,9 +14,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 85013256cf01629f72a327674c5d007b4a4b40da) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 67 ++++++++++++++++++++++++++------------- + kernel/trace/trace_events_hist.c | 67 +++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 22 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 4f6b6406d6ec..4dc39e3efb21 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -146,6 +146,23 @@ struct hist_trigger_data { @@ -42,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior static hist_field_fn_t select_value_fn(int field_size, int field_is_signed) { hist_field_fn_t fn = NULL; -@@ -653,7 +670,6 @@ static int is_descending(const char *str +@@ -653,7 +670,6 @@ static int is_descending(const char *str) static int create_sort_keys(struct hist_trigger_data *hist_data) { char *fields_str = hist_data->attrs->sort_key_str; @@ -50,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct tracing_map_sort_key *sort_key; int descending, ret = 0; unsigned int i, j; -@@ -670,7 +686,9 @@ static int create_sort_keys(struct hist_ +@@ -670,7 +686,9 @@ static int create_sort_keys(struct hist_trigger_data *hist_data) } for (i = 0; i < TRACING_MAP_SORT_KEYS_MAX; i++) { @@ -60,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior sort_key = &hist_data->sort_keys[i]; -@@ -703,8 +721,10 @@ static int create_sort_keys(struct hist_ +@@ -703,8 +721,10 @@ static int create_sort_keys(struct hist_trigger_data *hist_data) } for (j = 1; j < hist_data->n_fields; j++) { @@ -73,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior sort_key->field_idx = j; descending = is_descending(field_str); if (descending < 0) { -@@ -952,6 +972,7 @@ hist_trigger_entry_print(struct seq_file +@@ -952,6 +972,7 @@ hist_trigger_entry_print(struct seq_file *m, struct hist_field *key_field; char str[KSYM_SYMBOL_LEN]; bool multiline = false; @@ -81,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned int i; u64 uval; -@@ -963,26 +984,27 @@ hist_trigger_entry_print(struct seq_file +@@ -963,26 +984,27 @@ hist_trigger_entry_print(struct seq_file *m, if (i > hist_data->n_vals) seq_puts(m, ", "); @@ -117,7 +120,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else if (key_field->flags & HIST_FIELD_FL_SYSCALL) { const char *syscall_name; -@@ -991,8 +1013,8 @@ hist_trigger_entry_print(struct seq_file +@@ -991,8 +1013,8 @@ hist_trigger_entry_print(struct seq_file *m, if (!syscall_name) syscall_name = "unknown_syscall"; @@ -128,7 +131,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else if (key_field->flags & HIST_FIELD_FL_STACKTRACE) { seq_puts(m, "stacktrace:\n"); hist_trigger_stacktrace_print(m, -@@ -1000,15 +1022,14 @@ hist_trigger_entry_print(struct seq_file +@@ -1000,15 +1022,14 @@ hist_trigger_entry_print(struct seq_file *m, HIST_STACKTRACE_DEPTH); multiline = true; } else if (key_field->flags & HIST_FIELD_FL_LOG2) { @@ -147,7 +150,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -1021,13 +1042,13 @@ hist_trigger_entry_print(struct seq_file +@@ -1021,13 +1042,13 @@ hist_trigger_entry_print(struct seq_file *m, tracing_map_read_sum(elt, HITCOUNT_IDX)); for (i = 1; i < hist_data->n_vals; i++) { @@ -165,7 +168,7 @@ Signed-off-by: Sebastian Andrzej Siewior tracing_map_read_sum(elt, i)); } } -@@ -1142,7 +1163,9 @@ static const char *get_hist_field_flags( +@@ -1142,7 +1163,9 @@ static const char *get_hist_field_flags(struct hist_field *hist_field) static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) { @@ -176,3 +179,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_field->flags) { const char *flags_str = get_hist_field_flags(hist_field); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0079-0008-tracing-Reimplement-log2.patch b/kernel/patches-4.14.x-rt/0079-0079-tracing-Reimplement-log2.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0079-0008-tracing-Reimplement-log2.patch rename to kernel/patches-4.14.x-rt/0079-0079-tracing-Reimplement-log2.patch index fced6863d..26c4f52ee 100644 --- a/kernel/patches-4.14.x-rt/0079-0008-tracing-Reimplement-log2.patch +++ b/kernel/patches-4.14.x-rt/0079-0079-tracing-Reimplement-log2.patch @@ -1,6 +1,7 @@ +From 6e1dac2b7eea67d875f3028d91bb163aff840e2a Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:23 -0500 -Subject: [PATCH 08/48] tracing: Reimplement log2 +Subject: [PATCH 079/414] tracing: Reimplement log2 log2 as currently implemented applies only to u64 trace_event_field derived fields, and assumes that anything it's applied to is a u64 @@ -23,9 +24,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 5819eaddf35b24d628ddfa4fbb5f8d4026e44b96) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 31 +++++++++++++++++++++++++++---- + kernel/trace/trace_events_hist.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 4dc39e3efb21..4eddc1933079 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -28,12 +28,16 @@ struct hist_field; @@ -45,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_none(struct hist_field *field, void *event) -@@ -71,7 +75,9 @@ static u64 hist_field_pstring(struct his +@@ -71,7 +75,9 @@ static u64 hist_field_pstring(struct hist_field *hist_field, void *event) static u64 hist_field_log2(struct hist_field *hist_field, void *event) { @@ -56,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior return (u64) ilog2(roundup_pow_of_two(val)); } -@@ -156,6 +162,8 @@ static const char *hist_field_name(struc +@@ -156,6 +162,8 @@ static const char *hist_field_name(struct hist_field *field, if (field->field) field_name = field->field->name; @@ -65,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field_name == NULL) field_name = ""; -@@ -357,8 +365,20 @@ static const struct tracing_map_ops hist +@@ -357,8 +365,20 @@ static const struct tracing_map_ops hist_trigger_elt_comm_ops = { .elt_init = hist_trigger_elt_comm_init, }; @@ -87,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_field); } -@@ -385,7 +405,10 @@ static struct hist_field *create_hist_fi +@@ -385,7 +405,10 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field, } if (flags & HIST_FIELD_FL_LOG2) { @@ -98,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; } -@@ -405,7 +428,7 @@ static struct hist_field *create_hist_fi +@@ -405,7 +428,7 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field, hist_field->fn = select_value_fn(field->size, field->is_signed); if (!hist_field->fn) { @@ -107,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior return NULL; } } -@@ -422,7 +445,7 @@ static void destroy_hist_fields(struct h +@@ -422,7 +445,7 @@ static void destroy_hist_fields(struct hist_trigger_data *hist_data) for (i = 0; i < TRACING_MAP_FIELDS_MAX; i++) { if (hist_data->fields[i]) { @@ -116,3 +119,6 @@ Signed-off-by: Sebastian Andrzej Siewior hist_data->fields[i] = NULL; } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0080-0009-tracing-Move-hist-trigger-Documentation-to-histogram.patch b/kernel/patches-4.14.x-rt/0080-0080-tracing-Move-hist-trigger-Documentation-to-histogram.patch similarity index 99% rename from kernel/patches-4.14.x-rt/0080-0009-tracing-Move-hist-trigger-Documentation-to-histogram.patch rename to kernel/patches-4.14.x-rt/0080-0080-tracing-Move-hist-trigger-Documentation-to-histogram.patch index 115c00216..f880fa52b 100644 --- a/kernel/patches-4.14.x-rt/0080-0009-tracing-Move-hist-trigger-Documentation-to-histogram.patch +++ b/kernel/patches-4.14.x-rt/0080-0080-tracing-Move-hist-trigger-Documentation-to-histogram.patch @@ -1,6 +1,7 @@ +From 35e9c475fc07eda583d1727c5b2c85d105fd3823 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:35 -0600 -Subject: [PATCH 09/48] tracing: Move hist trigger Documentation to +Subject: [PATCH 080/414] tracing: Move hist trigger Documentation to histogram.txt The hist trigger Documentation takes up a large part of events.txt - @@ -13,14 +14,16 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 995f87b4d6ddb6bbb40309c08c3ca2a1f9f9db80) Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/events.txt | 1548 ------------------------------------- - Documentation/trace/histogram.txt | 1568 ++++++++++++++++++++++++++++++++++++++ + Documentation/trace/events.txt | 1548 +--------------------------- + Documentation/trace/histogram.txt | 1568 +++++++++++++++++++++++++++++ 2 files changed, 1569 insertions(+), 1547 deletions(-) create mode 100644 Documentation/trace/histogram.txt +diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt +index 2cc08d4a326e..e28f7f29f2b3 100644 --- a/Documentation/trace/events.txt +++ b/Documentation/trace/events.txt -@@ -517,1550 +517,4 @@ triggers (you have to use '!' for each o +@@ -517,1550 +517,4 @@ The following commands are supported: totals derived from one or more trace event format fields and/or event counts (hitcount). @@ -1572,6 +1575,9 @@ Signed-off-by: Sebastian Andrzej Siewior - Entries: 7 - Dropped: 0 + See Documentation/trace/histogram.txt for details and examples. +diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt +new file mode 100644 +index 000000000000..b2145f44b190 --- /dev/null +++ b/Documentation/trace/histogram.txt @@ -0,0 +1,1568 @@ @@ -3143,3 +3149,6 @@ Signed-off-by: Sebastian Andrzej Siewior + Hits: 489 + Entries: 7 + Dropped: 0 +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0081-0010-tracing-Add-Documentation-for-log2-modifier.patch b/kernel/patches-4.14.x-rt/0081-0081-tracing-Add-Documentation-for-log2-modifier.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0081-0010-tracing-Add-Documentation-for-log2-modifier.patch rename to kernel/patches-4.14.x-rt/0081-0081-tracing-Add-Documentation-for-log2-modifier.patch index a5f686cf9..ce06e4e75 100644 --- a/kernel/patches-4.14.x-rt/0081-0010-tracing-Add-Documentation-for-log2-modifier.patch +++ b/kernel/patches-4.14.x-rt/0081-0081-tracing-Add-Documentation-for-log2-modifier.patch @@ -1,6 +1,7 @@ +From e262dcbfd00fe5c2f193d491609d69cf5ca9abac Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:36 -0600 -Subject: [PATCH 10/48] tracing: Add Documentation for log2 modifier +Subject: [PATCH 081/414] tracing: Add Documentation for log2 modifier Add a line for the log2 modifier, to keep it aligned with tracing/README. @@ -12,9 +13,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit fcb5b95a2bb931f8e72e2dbd2def67382dd99d42) Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 1 + + Documentation/trace/histogram.txt | 1 + 1 file changed, 1 insertion(+) +diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt +index b2145f44b190..a4143f04a097 100644 --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt @@ -73,6 +73,7 @@ @@ -25,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior Note that in general the semantics of a given field aren't interpreted when applying a modifier to it, but there are some +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0082-0011-tracing-Add-support-to-detect-and-avoid-duplicates.patch b/kernel/patches-4.14.x-rt/0082-0082-tracing-Add-support-to-detect-and-avoid-duplicates.patch similarity index 88% rename from kernel/patches-4.14.x-rt/0082-0011-tracing-Add-support-to-detect-and-avoid-duplicates.patch rename to kernel/patches-4.14.x-rt/0082-0082-tracing-Add-support-to-detect-and-avoid-duplicates.patch index 3c34776e3..3dbd7e591 100644 --- a/kernel/patches-4.14.x-rt/0082-0011-tracing-Add-support-to-detect-and-avoid-duplicates.patch +++ b/kernel/patches-4.14.x-rt/0082-0082-tracing-Add-support-to-detect-and-avoid-duplicates.patch @@ -1,6 +1,7 @@ +From e3eb9cd483d81edaa250fa7395cdd415b606e8c7 Mon Sep 17 00:00:00 2001 From: Vedang Patel Date: Mon, 15 Jan 2018 20:51:37 -0600 -Subject: [PATCH 11/48] tracing: Add support to detect and avoid duplicates +Subject: [PATCH 082/414] tracing: Add support to detect and avoid duplicates A duplicate in the tracing_map hash table is when 2 different entries have the same key and, as a result, the key_hash. This is possible due @@ -48,9 +49,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit bd0a7ab135d0d0872296c3ae3c4f816a9a4c3dee) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/tracing_map.c | 41 ++++++++++++++++++++++++++++++++++++----- + kernel/trace/tracing_map.c | 41 +++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) +diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c +index 07e75344725b..b30f3439f27f 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -414,7 +414,9 @@ static inline struct tracing_map_elt * @@ -63,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior key_hash = jhash(key, map->key_size, 0); if (key_hash == 0) -@@ -426,11 +428,33 @@ static inline struct tracing_map_elt * +@@ -426,11 +428,33 @@ __tracing_map_insert(struct tracing_map *map, void *key, bool lookup_only) entry = TRACING_MAP_ENTRY(map->map, idx); test_key = entry->key; @@ -102,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior } if (!test_key) { -@@ -452,6 +476,13 @@ static inline struct tracing_map_elt * +@@ -452,6 +476,13 @@ __tracing_map_insert(struct tracing_map *map, void *key, bool lookup_only) atomic64_inc(&map->hits); return entry->val; @@ -116,3 +119,6 @@ Signed-off-by: Sebastian Andrzej Siewior } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0083-0012-tracing-Remove-code-which-merges-duplicates.patch b/kernel/patches-4.14.x-rt/0083-0083-tracing-Remove-code-which-merges-duplicates.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0083-0012-tracing-Remove-code-which-merges-duplicates.patch rename to kernel/patches-4.14.x-rt/0083-0083-tracing-Remove-code-which-merges-duplicates.patch index e0e3da1ae..dedb3ea30 100644 --- a/kernel/patches-4.14.x-rt/0083-0012-tracing-Remove-code-which-merges-duplicates.patch +++ b/kernel/patches-4.14.x-rt/0083-0083-tracing-Remove-code-which-merges-duplicates.patch @@ -1,6 +1,7 @@ +From 0b1125ff0b3c07711cd1c2124e77278c8a9b2f58 Mon Sep 17 00:00:00 2001 From: Vedang Patel Date: Mon, 15 Jan 2018 20:51:38 -0600 -Subject: [PATCH 12/48] tracing: Remove code which merges duplicates +Subject: [PATCH 083/414] tracing: Remove code which merges duplicates We now have the logic to detect and remove duplicates in the tracing_map hash table. The code which merges duplicates in the @@ -17,14 +18,16 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 3f7f4cc21fc62ff7da7d34b5ca95a69d73a1f764) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 11 ----- - kernel/trace/tracing_map.c | 83 ++------------------------------------- - kernel/trace/tracing_map.h | 7 --- + kernel/trace/trace_events_hist.c | 11 ----- + kernel/trace/tracing_map.c | 83 +++----------------------------- + kernel/trace/tracing_map.h | 7 --- 3 files changed, 6 insertions(+), 95 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 4eddc1933079..c57e5369b0c2 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -340,16 +340,6 @@ static int hist_trigger_elt_comm_alloc(s +@@ -340,16 +340,6 @@ static int hist_trigger_elt_comm_alloc(struct tracing_map_elt *elt) return 0; } @@ -41,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void hist_trigger_elt_comm_init(struct tracing_map_elt *elt) { char *comm = elt->private_data; -@@ -360,7 +350,6 @@ static void hist_trigger_elt_comm_init(s +@@ -360,7 +350,6 @@ static void hist_trigger_elt_comm_init(struct tracing_map_elt *elt) static const struct tracing_map_ops hist_trigger_elt_comm_ops = { .elt_alloc = hist_trigger_elt_comm_alloc, @@ -49,9 +52,11 @@ Signed-off-by: Sebastian Andrzej Siewior .elt_free = hist_trigger_elt_comm_free, .elt_init = hist_trigger_elt_comm_init, }; +diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c +index b30f3439f27f..f47a4d54bcf0 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c -@@ -847,67 +847,15 @@ create_sort_entry(void *key, struct trac +@@ -847,67 +847,15 @@ create_sort_entry(void *key, struct tracing_map_elt *elt) return sort_entry; } @@ -122,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior sort(sort_entries, n_entries, sizeof(struct tracing_map_sort_entry *), (int (*)(const void *, const void *))cmp_entries_dup, NULL); -@@ -916,30 +864,14 @@ static int merge_dups(struct tracing_map +@@ -916,30 +864,14 @@ static int merge_dups(struct tracing_map_sort_entry **sort_entries, for (i = 1; i < n_entries; i++) { if (!memcmp(sort_entries[i]->key, key, key_size)) { dups++; total_dups++; @@ -155,7 +160,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static bool is_key(struct tracing_map *map, unsigned int field_idx) -@@ -1065,10 +997,7 @@ int tracing_map_sort_entries(struct trac +@@ -1065,10 +997,7 @@ int tracing_map_sort_entries(struct tracing_map *map, return 1; } @@ -167,6 +172,8 @@ Signed-off-by: Sebastian Andrzej Siewior if (is_key(map, sort_keys[0].field_idx)) cmp_entries_fn = cmp_entries_key; +diff --git a/kernel/trace/tracing_map.h b/kernel/trace/tracing_map.h +index 5b5bbf8ae550..de57887c0670 100644 --- a/kernel/trace/tracing_map.h +++ b/kernel/trace/tracing_map.h @@ -215,11 +215,6 @@ struct tracing_map { @@ -190,3 +197,6 @@ Signed-off-by: Sebastian Andrzej Siewior void (*elt_free)(struct tracing_map_elt *elt); void (*elt_clear)(struct tracing_map_elt *elt); void (*elt_init)(struct tracing_map_elt *elt); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0084-0013-ring-buffer-Add-interface-for-setting-absolute-time-.patch b/kernel/patches-4.14.x-rt/0084-0084-ring-buffer-Add-interface-for-setting-absolute-time-.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0084-0013-ring-buffer-Add-interface-for-setting-absolute-time-.patch rename to kernel/patches-4.14.x-rt/0084-0084-ring-buffer-Add-interface-for-setting-absolute-time-.patch index d9de2b388..a318e05c6 100644 --- a/kernel/patches-4.14.x-rt/0084-0013-ring-buffer-Add-interface-for-setting-absolute-time-.patch +++ b/kernel/patches-4.14.x-rt/0084-0084-ring-buffer-Add-interface-for-setting-absolute-time-.patch @@ -1,6 +1,7 @@ +From 11ff5d3b6ba01f2c71565819d070cade4f827cb8 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:39 -0600 -Subject: [PATCH 13/48] ring-buffer: Add interface for setting absolute time +Subject: [PATCH 084/414] ring-buffer: Add interface for setting absolute time stamps Define a new function, tracing_set_time_stamp_abs(), which can be used @@ -18,15 +19,17 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 22753475c5232cd6f024746d6a6696a4dd2683ab) Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/ring_buffer.h | 2 ++ - kernel/trace/ring_buffer.c | 11 +++++++++++ - kernel/trace/trace.c | 33 ++++++++++++++++++++++++++++++++- - kernel/trace/trace.h | 3 +++ + include/linux/ring_buffer.h | 2 ++ + kernel/trace/ring_buffer.c | 11 +++++++++++ + kernel/trace/trace.c | 33 ++++++++++++++++++++++++++++++++- + kernel/trace/trace.h | 3 +++ 4 files changed, 48 insertions(+), 1 deletion(-) +diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h +index 289e4d54e3e0..42b626aa88c7 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h -@@ -178,6 +178,8 @@ void ring_buffer_normalize_time_stamp(st +@@ -178,6 +178,8 @@ void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, int cpu, u64 *ts); void ring_buffer_set_clock(struct ring_buffer *buffer, u64 (*clock)(void)); @@ -35,6 +38,8 @@ Signed-off-by: Sebastian Andrzej Siewior size_t ring_buffer_page_len(void *page); +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index 29bad749560a..2be361b63c7b 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -488,6 +488,7 @@ struct ring_buffer { @@ -45,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct ring_buffer_iter { -@@ -1387,6 +1388,16 @@ void ring_buffer_set_clock(struct ring_b +@@ -1387,6 +1388,16 @@ void ring_buffer_set_clock(struct ring_buffer *buffer, buffer->clock = clock; } @@ -62,9 +67,11 @@ Signed-off-by: Sebastian Andrzej Siewior static void rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer); static inline unsigned long rb_page_entries(struct buffer_page *bpage) +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 2ce9e0eee9ec..97cdcfe88596 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2269,7 +2269,7 @@ trace_event_buffer_lock_reserve(struct r +@@ -2269,7 +2269,7 @@ trace_event_buffer_lock_reserve(struct ring_buffer **current_rb, *current_rb = trace_file->tr->trace_buffer.buffer; @@ -73,11 +80,10 @@ Signed-off-by: Sebastian Andrzej Siewior (EVENT_FILE_FL_SOFT_DISABLED | EVENT_FILE_FL_FILTERED)) && (entry = this_cpu_read(trace_buffered_event))) { /* Try to use the per cpu buffer first */ -@@ -6286,6 +6286,37 @@ static int tracing_clock_open(struct ino - +@@ -6287,6 +6287,37 @@ static int tracing_clock_open(struct inode *inode, struct file *file) return ret; } -+ + +int tracing_set_time_stamp_abs(struct trace_array *tr, bool abs) +{ + int ret = 0; @@ -108,9 +114,12 @@ Signed-off-by: Sebastian Andrzej Siewior + + return ret; +} - ++ struct ftrace_buffer_info { struct trace_iterator iter; + void *spare; +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 418facf3389c..d02143043ac2 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -273,6 +273,7 @@ struct trace_array { @@ -130,3 +139,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * The global tracer (top) should be the first trace array added, * but we check the flag anyway. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0085-0014-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch b/kernel/patches-4.14.x-rt/0085-0085-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0085-0014-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch rename to kernel/patches-4.14.x-rt/0085-0085-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch index 28f3aa397..8a6ba2019 100644 --- a/kernel/patches-4.14.x-rt/0085-0014-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch +++ b/kernel/patches-4.14.x-rt/0085-0085-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch @@ -1,6 +1,7 @@ +From 2aa6001fd69d29a4a37b6830f08ce08cef476397 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:40 -0600 -Subject: [PATCH 14/48] ring-buffer: Redefine the unimplemented +Subject: [PATCH 085/414] ring-buffer: Redefine the unimplemented RINGBUF_TYPE_TIME_STAMP RINGBUF_TYPE_TIME_STAMP is defined but not used, and from what I can @@ -27,10 +28,12 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 58c0bd803060b0c0c9de8751382a7af5f507d74d) Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/ring_buffer.h | 12 ++--- - kernel/trace/ring_buffer.c | 104 ++++++++++++++++++++++++++++++++------------ + include/linux/ring_buffer.h | 12 +++-- + kernel/trace/ring_buffer.c | 104 ++++++++++++++++++++++++++---------- 2 files changed, 83 insertions(+), 33 deletions(-) +diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h +index 42b626aa88c7..b37a5df05e81 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h @@ -34,10 +34,12 @@ struct ring_buffer_event { @@ -64,9 +67,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * ring_buffer_discard_commit will remove an event that has not +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index 2be361b63c7b..e48989ff0427 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c -@@ -41,6 +41,8 @@ int ring_buffer_print_entry_header(struc +@@ -41,6 +41,8 @@ int ring_buffer_print_entry_header(struct trace_seq *s) RINGBUF_TYPE_PADDING); trace_seq_printf(s, "\ttime_extend : type == %d\n", RINGBUF_TYPE_TIME_EXTEND); @@ -75,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior trace_seq_printf(s, "\tdata max type_len == %d\n", RINGBUF_TYPE_DATA_TYPE_LEN_MAX); -@@ -140,12 +142,15 @@ int ring_buffer_print_entry_header(struc +@@ -140,12 +142,15 @@ int ring_buffer_print_entry_header(struct trace_seq *s) enum { RB_LEN_TIME_EXTEND = 8, @@ -92,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline int rb_null_event(struct ring_buffer_event *event) { return event->type_len == RINGBUF_TYPE_PADDING && !event->time_delta; -@@ -209,7 +214,7 @@ rb_event_ts_length(struct ring_buffer_ev +@@ -209,7 +214,7 @@ rb_event_ts_length(struct ring_buffer_event *event) { unsigned len = 0; @@ -101,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* time extends include the data event after it */ len = RB_LEN_TIME_EXTEND; event = skip_time_extend(event); -@@ -231,7 +236,7 @@ unsigned ring_buffer_event_length(struct +@@ -231,7 +236,7 @@ unsigned ring_buffer_event_length(struct ring_buffer_event *event) { unsigned length; @@ -110,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior event = skip_time_extend(event); length = rb_event_length(event); -@@ -248,7 +253,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_event_leng +@@ -248,7 +253,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_event_length); static __always_inline void * rb_event_data(struct ring_buffer_event *event) { @@ -119,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior event = skip_time_extend(event); BUG_ON(event->type_len > RINGBUF_TYPE_DATA_TYPE_LEN_MAX); /* If length is in len field, then array[0] has the data */ -@@ -275,6 +280,27 @@ EXPORT_SYMBOL_GPL(ring_buffer_event_data +@@ -275,6 +280,27 @@ EXPORT_SYMBOL_GPL(ring_buffer_event_data); #define TS_MASK ((1ULL << TS_SHIFT) - 1) #define TS_DELTA_TEST (~TS_MASK) @@ -147,7 +152,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Flag when events were overwritten */ #define RB_MISSED_EVENTS (1 << 31) /* Missed count stored at end */ -@@ -2228,12 +2254,15 @@ rb_move_tail(struct ring_buffer_per_cpu +@@ -2228,12 +2254,15 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer, /* Slow path, do not inline */ static noinline struct ring_buffer_event * @@ -167,7 +172,7 @@ Signed-off-by: Sebastian Andrzej Siewior event->time_delta = delta & TS_MASK; event->array[0] = delta >> TS_SHIFT; } else { -@@ -2276,7 +2305,9 @@ rb_update_event(struct ring_buffer_per_c +@@ -2276,7 +2305,9 @@ rb_update_event(struct ring_buffer_per_cpu *cpu_buffer, * add it to the start of the resevered space. */ if (unlikely(info->add_timestamp)) { @@ -178,7 +183,7 @@ Signed-off-by: Sebastian Andrzej Siewior length -= RB_LEN_TIME_EXTEND; delta = 0; } -@@ -2464,7 +2495,7 @@ static __always_inline void rb_end_commi +@@ -2464,7 +2495,7 @@ static __always_inline void rb_end_commit(struct ring_buffer_per_cpu *cpu_buffer static inline void rb_event_discard(struct ring_buffer_event *event) { @@ -187,7 +192,7 @@ Signed-off-by: Sebastian Andrzej Siewior event = skip_time_extend(event); /* array[0] holds the actual length for the discarded event */ -@@ -2508,10 +2539,11 @@ rb_update_write_stamp(struct ring_buffer +@@ -2508,10 +2539,11 @@ rb_update_write_stamp(struct ring_buffer_per_cpu *cpu_buffer, cpu_buffer->write_stamp = cpu_buffer->commit_page->page->time_stamp; else if (event->type_len == RINGBUF_TYPE_TIME_EXTEND) { @@ -202,7 +207,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else cpu_buffer->write_stamp += event->time_delta; } -@@ -2664,7 +2696,7 @@ static struct ring_buffer_event * +@@ -2664,7 +2696,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, * If this is the first commit on the page, then it has the same * timestamp as the page itself. */ @@ -211,7 +216,7 @@ Signed-off-by: Sebastian Andrzej Siewior info->delta = 0; /* See if we shot pass the end of this buffer page */ -@@ -2741,8 +2773,11 @@ rb_reserve_next_event(struct ring_buffer +@@ -2741,8 +2773,11 @@ rb_reserve_next_event(struct ring_buffer *buffer, /* make sure this diff is calculated here */ barrier(); @@ -225,7 +230,7 @@ Signed-off-by: Sebastian Andrzej Siewior info.delta = diff; if (unlikely(test_time_stamp(info.delta))) rb_handle_timestamp(cpu_buffer, &info); -@@ -3424,14 +3459,13 @@ rb_update_read_stamp(struct ring_buffer_ +@@ -3424,14 +3459,13 @@ rb_update_read_stamp(struct ring_buffer_per_cpu *cpu_buffer, return; case RINGBUF_TYPE_TIME_EXTEND: @@ -243,7 +248,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; case RINGBUF_TYPE_DATA: -@@ -3455,14 +3489,13 @@ rb_update_iter_read_stamp(struct ring_bu +@@ -3455,14 +3489,13 @@ rb_update_iter_read_stamp(struct ring_buffer_iter *iter, return; case RINGBUF_TYPE_TIME_EXTEND: @@ -261,7 +266,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; case RINGBUF_TYPE_DATA: -@@ -3686,6 +3719,8 @@ rb_buffer_peek(struct ring_buffer_per_cp +@@ -3686,6 +3719,8 @@ rb_buffer_peek(struct ring_buffer_per_cpu *cpu_buffer, u64 *ts, struct buffer_page *reader; int nr_loops = 0; @@ -270,7 +275,7 @@ Signed-off-by: Sebastian Andrzej Siewior again: /* * We repeat when a time extend is encountered. -@@ -3722,12 +3757,17 @@ rb_buffer_peek(struct ring_buffer_per_cp +@@ -3722,12 +3757,17 @@ rb_buffer_peek(struct ring_buffer_per_cpu *cpu_buffer, u64 *ts, goto again; case RINGBUF_TYPE_TIME_STAMP: @@ -290,7 +295,7 @@ Signed-off-by: Sebastian Andrzej Siewior *ts = cpu_buffer->read_stamp + event->time_delta; ring_buffer_normalize_time_stamp(cpu_buffer->buffer, cpu_buffer->cpu, ts); -@@ -3752,6 +3792,9 @@ rb_iter_peek(struct ring_buffer_iter *it +@@ -3752,6 +3792,9 @@ rb_iter_peek(struct ring_buffer_iter *iter, u64 *ts) struct ring_buffer_event *event; int nr_loops = 0; @@ -300,7 +305,7 @@ Signed-off-by: Sebastian Andrzej Siewior cpu_buffer = iter->cpu_buffer; buffer = cpu_buffer->buffer; -@@ -3804,12 +3847,17 @@ rb_iter_peek(struct ring_buffer_iter *it +@@ -3804,12 +3847,17 @@ rb_iter_peek(struct ring_buffer_iter *iter, u64 *ts) goto again; case RINGBUF_TYPE_TIME_STAMP: @@ -320,3 +325,6 @@ Signed-off-by: Sebastian Andrzej Siewior *ts = iter->read_stamp + event->time_delta; ring_buffer_normalize_time_stamp(buffer, cpu_buffer->cpu, ts); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0086-0015-tracing-Add-timestamp_mode-trace-file.patch b/kernel/patches-4.14.x-rt/0086-0086-tracing-Add-timestamp_mode-trace-file.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0086-0015-tracing-Add-timestamp_mode-trace-file.patch rename to kernel/patches-4.14.x-rt/0086-0086-tracing-Add-timestamp_mode-trace-file.patch index cfab8da4a..48dd4f403 100644 --- a/kernel/patches-4.14.x-rt/0086-0015-tracing-Add-timestamp_mode-trace-file.patch +++ b/kernel/patches-4.14.x-rt/0086-0086-tracing-Add-timestamp_mode-trace-file.patch @@ -1,6 +1,7 @@ +From b5895d8584d43c5118e2f0bdc9e06457c0f08132 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:41 -0600 -Subject: [PATCH 15/48] tracing: Add timestamp_mode trace file +Subject: [PATCH 086/414] tracing: Add timestamp_mode trace file Add a new option flag indicating whether or not the ring buffer is in 'absolute timestamp' mode. @@ -21,13 +22,15 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 0eba34f9bf5b66217355a6a66054b3194aca123d) Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/ftrace.txt | 24 ++++++++++++++++++++ - kernel/trace/trace.c | 47 +++++++++++++++++++++++++++++++++++++++++ + Documentation/trace/ftrace.txt | 24 +++++++++++++++++ + kernel/trace/trace.c | 47 ++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) +diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt +index d4601df6e72e..54213e5c23f6 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt -@@ -539,6 +539,30 @@ After mounting tracefs you will have acc +@@ -539,6 +539,30 @@ of ftrace. Here is a list of some of the key files: See events.txt for more information. @@ -58,6 +61,8 @@ Signed-off-by: Sebastian Andrzej Siewior hwlat_detector: Directory for the Hardware Latency Detector. +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 97cdcfe88596..1c2e0296e713 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4520,6 +4520,9 @@ static const char readme_msg[] = @@ -70,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior "\n trace_marker\t\t- Writes into this file writes into the kernel buffer\n" "\n trace_marker_raw\t\t- Writes into this file writes binary data into the kernel buffer\n" " tracing_cpumask\t- Limit which CPUs to trace\n" -@@ -6287,6 +6290,40 @@ static int tracing_clock_open(struct ino +@@ -6287,6 +6290,40 @@ static int tracing_clock_open(struct inode *inode, struct file *file) return ret; } @@ -111,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior int tracing_set_time_stamp_abs(struct trace_array *tr, bool abs) { int ret = 0; -@@ -6565,6 +6602,13 @@ static const struct file_operations trac +@@ -6565,6 +6602,13 @@ static const struct file_operations trace_clock_fops = { .write = tracing_clock_write, }; @@ -125,7 +130,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_TRACER_SNAPSHOT static const struct file_operations snapshot_fops = { .open = tracing_snapshot_open, -@@ -7887,6 +7931,9 @@ init_tracer_tracefs(struct trace_array * +@@ -7887,6 +7931,9 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer) trace_create_file("tracing_on", 0644, d_tracer, tr, &rb_simple_fops); @@ -135,3 +140,6 @@ Signed-off-by: Sebastian Andrzej Siewior create_trace_options_dir(tr); #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0087-0016-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch b/kernel/patches-4.14.x-rt/0087-0087-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0087-0016-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch rename to kernel/patches-4.14.x-rt/0087-0087-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch index adaba32d0..1144cb8a0 100644 --- a/kernel/patches-4.14.x-rt/0087-0016-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch +++ b/kernel/patches-4.14.x-rt/0087-0087-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch @@ -1,6 +1,7 @@ +From 3fd9b06808eb8a4788adefc36600615d4303977f Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:42 -0600 -Subject: [PATCH 16/48] tracing: Give event triggers access to +Subject: [PATCH 087/414] tracing: Give event triggers access to ring_buffer_event The ring_buffer event can provide a timestamp that may be useful to @@ -13,12 +14,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 373514437a6f75b5cfe890742b590f2c12f6c335) Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/trace_events.h | 14 ++++++---- - kernel/trace/trace.h | 9 +++--- - kernel/trace/trace_events_hist.c | 11 +++++--- - kernel/trace/trace_events_trigger.c | 47 ++++++++++++++++++++++-------------- + include/linux/trace_events.h | 14 +++++---- + kernel/trace/trace.h | 9 +++--- + kernel/trace/trace_events_hist.c | 11 ++++--- + kernel/trace/trace_events_trigger.c | 47 ++++++++++++++++++----------- 4 files changed, 49 insertions(+), 32 deletions(-) +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index 2bcb4dc6df1a..aefc80f2909b 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -402,11 +402,13 @@ enum event_trigger_type { @@ -40,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior bool trace_event_ignore_this_pid(struct trace_event_file *trace_file); -@@ -426,7 +428,7 @@ trace_trigger_soft_disabled(struct trace +@@ -426,7 +428,7 @@ trace_trigger_soft_disabled(struct trace_event_file *file) if (!(eflags & EVENT_FILE_FL_TRIGGER_COND)) { if (eflags & EVENT_FILE_FL_TRIGGER_MODE) @@ -49,9 +52,11 @@ Signed-off-by: Sebastian Andrzej Siewior if (eflags & EVENT_FILE_FL_SOFT_DISABLED) return true; if (eflags & EVENT_FILE_FL_PID_FILTER) +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index d02143043ac2..b123c626b159 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h -@@ -1296,7 +1296,7 @@ static inline bool +@@ -1296,7 +1296,7 @@ __event_trigger_test_discard(struct trace_event_file *file, unsigned long eflags = file->flags; if (eflags & EVENT_FILE_FL_TRIGGER_COND) @@ -60,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (test_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &file->flags) || (unlikely(file->flags & EVENT_FILE_FL_FILTERED) && -@@ -1333,7 +1333,7 @@ event_trigger_unlock_commit(struct trace +@@ -1333,7 +1333,7 @@ event_trigger_unlock_commit(struct trace_event_file *file, trace_buffer_unlock_commit(file->tr, buffer, event, irq_flags, pc); if (tt) @@ -69,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /** -@@ -1366,7 +1366,7 @@ event_trigger_unlock_commit_regs(struct +@@ -1366,7 +1366,7 @@ event_trigger_unlock_commit_regs(struct trace_event_file *file, irq_flags, pc, regs); if (tt) @@ -78,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior } #define FILTER_PRED_INVALID ((unsigned short)-1) -@@ -1591,7 +1591,8 @@ extern int register_trigger_hist_enable_ +@@ -1591,7 +1591,8 @@ extern int register_trigger_hist_enable_disable_cmds(void); */ struct event_trigger_ops { void (*func)(struct event_trigger_data *data, @@ -88,9 +93,11 @@ Signed-off-by: Sebastian Andrzej Siewior int (*init)(struct event_trigger_ops *ops, struct event_trigger_data *data); void (*free)(struct event_trigger_ops *ops, +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index c57e5369b0c2..77079c79b6d4 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -909,7 +909,8 @@ static inline void add_to_key(char *comp +@@ -909,7 +909,8 @@ static inline void add_to_key(char *compound_key, void *key, memcpy(compound_key + key_field->offset, key, size); } @@ -100,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hist_trigger_data *hist_data = data->private_data; bool use_compound_key = (hist_data->n_keys > 1); -@@ -1660,7 +1661,8 @@ static struct event_command trigger_hist +@@ -1660,7 +1661,8 @@ __init int register_trigger_hist_cmd(void) } static void @@ -110,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct enable_trigger_data *enable_data = data->private_data; struct event_trigger_data *test; -@@ -1676,7 +1678,8 @@ hist_enable_trigger(struct event_trigger +@@ -1676,7 +1678,8 @@ hist_enable_trigger(struct event_trigger_data *data, void *rec) } static void @@ -120,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior { if (!data->count) return; -@@ -1684,7 +1687,7 @@ hist_enable_count_trigger(struct event_t +@@ -1684,7 +1687,7 @@ hist_enable_count_trigger(struct event_trigger_data *data, void *rec) if (data->count != -1) (data->count)--; @@ -129,9 +136,11 @@ Signed-off-by: Sebastian Andrzej Siewior } static struct event_trigger_ops hist_enable_trigger_ops = { +diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c +index f2ac9d44f6c4..9b0fe3198932 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c -@@ -63,7 +63,8 @@ void trigger_data_free(struct event_trig +@@ -63,7 +63,8 @@ void trigger_data_free(struct event_trigger_data *data) * any trigger that should be deferred, ETT_NONE if nothing to defer. */ enum event_trigger_type @@ -141,7 +150,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct event_trigger_data *data; enum event_trigger_type tt = ETT_NONE; -@@ -76,7 +77,7 @@ event_triggers_call(struct trace_event_f +@@ -76,7 +77,7 @@ event_triggers_call(struct trace_event_file *file, void *rec) if (data->paused) continue; if (!rec) { @@ -150,7 +159,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; } filter = rcu_dereference_sched(data->filter); -@@ -86,7 +87,7 @@ event_triggers_call(struct trace_event_f +@@ -86,7 +87,7 @@ event_triggers_call(struct trace_event_file *file, void *rec) tt |= data->cmd_ops->trigger_type; continue; } @@ -168,7 +177,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct event_trigger_data *data; -@@ -116,7 +117,7 @@ event_triggers_post_call(struct trace_ev +@@ -116,7 +117,7 @@ event_triggers_post_call(struct trace_event_file *file, if (data->paused) continue; if (data->cmd_ops->trigger_type & tt) @@ -177,7 +186,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } EXPORT_SYMBOL_GPL(event_triggers_post_call); -@@ -909,7 +910,8 @@ void set_named_trigger_data(struct event +@@ -909,7 +910,8 @@ void set_named_trigger_data(struct event_trigger_data *data, } static void @@ -187,7 +196,7 @@ Signed-off-by: Sebastian Andrzej Siewior { if (tracing_is_on()) return; -@@ -918,7 +920,8 @@ traceon_trigger(struct event_trigger_dat +@@ -918,7 +920,8 @@ traceon_trigger(struct event_trigger_data *data, void *rec) } static void @@ -197,7 +206,7 @@ Signed-off-by: Sebastian Andrzej Siewior { if (tracing_is_on()) return; -@@ -933,7 +936,8 @@ traceon_count_trigger(struct event_trigg +@@ -933,7 +936,8 @@ traceon_count_trigger(struct event_trigger_data *data, void *rec) } static void @@ -207,7 +216,7 @@ Signed-off-by: Sebastian Andrzej Siewior { if (!tracing_is_on()) return; -@@ -942,7 +946,8 @@ traceoff_trigger(struct event_trigger_da +@@ -942,7 +946,8 @@ traceoff_trigger(struct event_trigger_data *data, void *rec) } static void @@ -217,7 +226,7 @@ Signed-off-by: Sebastian Andrzej Siewior { if (!tracing_is_on()) return; -@@ -1039,13 +1044,15 @@ static struct event_command trigger_trac +@@ -1039,13 +1044,15 @@ static struct event_command trigger_traceoff_cmd = { #ifdef CONFIG_TRACER_SNAPSHOT static void @@ -235,7 +244,7 @@ Signed-off-by: Sebastian Andrzej Siewior { if (!data->count) return; -@@ -1053,7 +1060,7 @@ snapshot_count_trigger(struct event_trig +@@ -1053,7 +1060,7 @@ snapshot_count_trigger(struct event_trigger_data *data, void *rec) if (data->count != -1) (data->count)--; @@ -244,7 +253,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static int -@@ -1132,13 +1139,15 @@ static __init int register_trigger_snaps +@@ -1132,13 +1139,15 @@ static __init int register_trigger_snapshot_cmd(void) { return 0; } #define STACK_SKIP 3 static void @@ -262,7 +271,7 @@ Signed-off-by: Sebastian Andrzej Siewior { if (!data->count) return; -@@ -1146,7 +1155,7 @@ stacktrace_count_trigger(struct event_tr +@@ -1146,7 +1155,7 @@ stacktrace_count_trigger(struct event_trigger_data *data, void *rec) if (data->count != -1) (data->count)--; @@ -271,7 +280,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static int -@@ -1208,7 +1217,8 @@ static __init void unregister_trigger_tr +@@ -1208,7 +1217,8 @@ static __init void unregister_trigger_traceon_traceoff_cmds(void) } static void @@ -281,7 +290,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct enable_trigger_data *enable_data = data->private_data; -@@ -1219,7 +1229,8 @@ event_enable_trigger(struct event_trigge +@@ -1219,7 +1229,8 @@ event_enable_trigger(struct event_trigger_data *data, void *rec) } static void @@ -291,7 +300,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct enable_trigger_data *enable_data = data->private_data; -@@ -1233,7 +1244,7 @@ event_enable_count_trigger(struct event_ +@@ -1233,7 +1244,7 @@ event_enable_count_trigger(struct event_trigger_data *data, void *rec) if (data->count != -1) (data->count)--; @@ -300,3 +309,6 @@ Signed-off-by: Sebastian Andrzej Siewior } int event_enable_trigger_print(struct seq_file *m, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0088-0017-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch b/kernel/patches-4.14.x-rt/0088-0088-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0088-0017-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch rename to kernel/patches-4.14.x-rt/0088-0088-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch index ac7f0824b..3e8b053ed 100644 --- a/kernel/patches-4.14.x-rt/0088-0017-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch +++ b/kernel/patches-4.14.x-rt/0088-0088-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch @@ -1,6 +1,7 @@ +From fc4a1cc917f4909f034c823cfb2e828a1559c12e Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:43 -0600 -Subject: [PATCH 17/48] tracing: Add ring buffer event param to hist field +Subject: [PATCH 088/414] tracing: Add ring buffer event param to hist field functions Some events such as timestamps require access to a ring_buffer_event @@ -13,9 +14,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit df7253a730d0aaef760d45ea234dc087ba7cac88) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 39 ++++++++++++++++++++++++--------------- + kernel/trace/trace_events_hist.c | 39 ++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 15 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 77079c79b6d4..9126be52ff4d 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -26,7 +26,8 @@ @@ -61,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior { u32 str_item = *(u32 *)(event + hist_field->field->offset); int str_loc = str_item & 0xffff; -@@ -66,24 +71,28 @@ static u64 hist_field_dynstring(struct h +@@ -66,24 +71,28 @@ static u64 hist_field_dynstring(struct hist_field *hist_field, void *event) return (u64)(unsigned long)addr; } @@ -105,7 +108,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hist_field *hist_field; unsigned int i; -@@ -880,7 +889,7 @@ static void hist_trigger_elt_update(stru +@@ -880,7 +889,7 @@ static void hist_trigger_elt_update(struct hist_trigger_data *hist_data, for_each_hist_val_field(i, hist_data) { hist_field = hist_data->fields[i]; @@ -114,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior tracing_map_update_sum(elt, i, hist_val); } } -@@ -910,7 +919,7 @@ static inline void add_to_key(char *comp +@@ -910,7 +919,7 @@ static inline void add_to_key(char *compound_key, void *key, } static void event_hist_trigger(struct event_trigger_data *data, void *rec, @@ -123,7 +126,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hist_trigger_data *hist_data = data->private_data; bool use_compound_key = (hist_data->n_keys > 1); -@@ -939,7 +948,7 @@ static void event_hist_trigger(struct ev +@@ -939,7 +948,7 @@ static void event_hist_trigger(struct event_trigger_data *data, void *rec, key = entries; } else { @@ -132,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (key_field->flags & HIST_FIELD_FL_STRING) { key = (void *)(unsigned long)field_contents; use_compound_key = true; -@@ -956,7 +965,7 @@ static void event_hist_trigger(struct ev +@@ -956,7 +965,7 @@ static void event_hist_trigger(struct event_trigger_data *data, void *rec, elt = tracing_map_insert(hist_data->map, key); if (elt) @@ -141,3 +144,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static void hist_trigger_stacktrace_print(struct seq_file *m, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0089-0018-tracing-Break-out-hist-trigger-assignment-parsing.patch b/kernel/patches-4.14.x-rt/0089-0089-tracing-Break-out-hist-trigger-assignment-parsing.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0089-0018-tracing-Break-out-hist-trigger-assignment-parsing.patch rename to kernel/patches-4.14.x-rt/0089-0089-tracing-Break-out-hist-trigger-assignment-parsing.patch index de84be4d2..0437e0e8a 100644 --- a/kernel/patches-4.14.x-rt/0089-0018-tracing-Break-out-hist-trigger-assignment-parsing.patch +++ b/kernel/patches-4.14.x-rt/0089-0089-tracing-Break-out-hist-trigger-assignment-parsing.patch @@ -1,6 +1,7 @@ +From c8cc6e5e6baa1414f1227d1fe4affc3fa3842956 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:44 -0600 -Subject: [PATCH 18/48] tracing: Break out hist trigger assignment parsing +Subject: [PATCH 089/414] tracing: Break out hist trigger assignment parsing This will make it easier to add variables, and makes the parsing code cleaner regardless. @@ -13,12 +14,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 3c1e23def1291b21a2057f883ccc0456418dc5ad) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 72 +++++++++++++++++++++++++++------------ + kernel/trace/trace_events_hist.c | 72 ++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 21 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 9126be52ff4d..4935290fd1e8 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -251,6 +251,51 @@ static void destroy_hist_trigger_attrs(s +@@ -251,6 +251,51 @@ static void destroy_hist_trigger_attrs(struct hist_trigger_attrs *attrs) kfree(attrs); } @@ -70,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_trigger_attrs *parse_hist_trigger_attrs(char *trigger_str) { struct hist_trigger_attrs *attrs; -@@ -263,33 +308,18 @@ static struct hist_trigger_attrs *parse_ +@@ -263,33 +308,18 @@ static struct hist_trigger_attrs *parse_hist_trigger_attrs(char *trigger_str) while (trigger_str) { char *str = strsep(&trigger_str, ":"); @@ -110,3 +113,6 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto free; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0090-0019-tracing-Add-hist-trigger-timestamp-support.patch b/kernel/patches-4.14.x-rt/0090-0090-tracing-Add-hist-trigger-timestamp-support.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0090-0019-tracing-Add-hist-trigger-timestamp-support.patch rename to kernel/patches-4.14.x-rt/0090-0090-tracing-Add-hist-trigger-timestamp-support.patch index dfbf39e6a..399dc80e7 100644 --- a/kernel/patches-4.14.x-rt/0090-0019-tracing-Add-hist-trigger-timestamp-support.patch +++ b/kernel/patches-4.14.x-rt/0090-0090-tracing-Add-hist-trigger-timestamp-support.patch @@ -1,6 +1,7 @@ +From 925384a56703b5e682209c577065141be3d02727 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:45 -0600 -Subject: [PATCH 19/48] tracing: Add hist trigger timestamp support +Subject: [PATCH 090/414] tracing: Add hist trigger timestamp support Add support for a timestamp event field. This is actually a 'pseudo-' event field in that it behaves like it's part of the event record, but @@ -30,12 +31,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 5d9d58b00ff82078deac8557c91359cd13c8959d) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 94 +++++++++++++++++++++++++++++---------- + kernel/trace/trace_events_hist.c | 94 ++++++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 23 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 4935290fd1e8..cd80bca34cec 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -89,6 +89,12 @@ static u64 hist_field_log2(struct hist_f +@@ -89,6 +89,12 @@ static u64 hist_field_log2(struct hist_field *hist_field, void *event, return (u64) ilog2(roundup_pow_of_two(val)); } @@ -64,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static const char *hist_field_name(struct hist_field *field, -@@ -173,6 +181,8 @@ static const char *hist_field_name(struc +@@ -173,6 +181,8 @@ static const char *hist_field_name(struct hist_field *field, field_name = field->field->name; else if (field->flags & HIST_FIELD_FL_LOG2) field_name = hist_field_name(field->operands[0], ++level); @@ -73,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field_name == NULL) field_name = ""; -@@ -440,6 +450,12 @@ static struct hist_field *create_hist_fi +@@ -440,6 +450,12 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field, goto out; } @@ -86,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON_ONCE(!field)) goto out; -@@ -517,10 +533,15 @@ static int create_val_field(struct hist_ +@@ -517,10 +533,15 @@ static int create_val_field(struct hist_trigger_data *hist_data, } } @@ -106,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior } hist_data->fields[val_idx] = create_hist_field(field, flags); -@@ -615,16 +636,22 @@ static int create_key_field(struct hist_ +@@ -615,16 +636,22 @@ static int create_key_field(struct hist_trigger_data *hist_data, } } @@ -138,7 +141,7 @@ Signed-off-by: Sebastian Andrzej Siewior } hist_data->fields[key_idx] = create_hist_field(field, flags); -@@ -820,6 +847,9 @@ static int create_tracing_map_fields(str +@@ -820,6 +847,9 @@ static int create_tracing_map_fields(struct hist_trigger_data *hist_data) if (hist_field->flags & HIST_FIELD_FL_STACKTRACE) cmp_fn = tracing_map_cmp_none; @@ -148,7 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior else if (is_string_field(field)) cmp_fn = tracing_map_cmp_string; else -@@ -1217,7 +1247,11 @@ static void hist_field_print(struct seq_ +@@ -1217,7 +1247,11 @@ static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) { const char *field_name = hist_field_name(hist_field, 0); @@ -161,7 +164,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_field->flags) { const char *flags_str = get_hist_field_flags(hist_field); -@@ -1268,27 +1302,25 @@ static int event_hist_trigger_print(stru +@@ -1268,27 +1302,25 @@ static int event_hist_trigger_print(struct seq_file *m, for (i = 0; i < hist_data->n_sort_keys; i++) { struct tracing_map_sort_key *sort_key; @@ -196,7 +199,7 @@ Signed-off-by: Sebastian Andrzej Siewior seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits)); if (data->filter_str) -@@ -1456,6 +1488,10 @@ static bool hist_trigger_match(struct ev +@@ -1456,6 +1488,10 @@ static bool hist_trigger_match(struct event_trigger_data *data, return false; if (key_field->offset != key_field_test->offset) return false; @@ -207,7 +210,7 @@ Signed-off-by: Sebastian Andrzej Siewior } for (i = 0; i < hist_data->n_sort_keys; i++) { -@@ -1538,6 +1574,9 @@ static int hist_register_trigger(char *g +@@ -1538,6 +1574,9 @@ static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, update_cond_flag(file); @@ -217,7 +220,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (trace_event_trigger_enable_disable(file, 1) < 0) { list_del_rcu(&data->list); update_cond_flag(file); -@@ -1572,17 +1611,26 @@ static void hist_unregister_trigger(char +@@ -1572,17 +1611,26 @@ static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops, if (unregistered && test->ops->free) test->ops->free(test->ops, test); @@ -244,3 +247,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (test->ops->free) test->ops->free(test->ops, test); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0091-0020-tracing-Add-per-element-variable-support-to-tracing_.patch b/kernel/patches-4.14.x-rt/0091-0091-tracing-Add-per-element-variable-support-to-tracing_.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0091-0020-tracing-Add-per-element-variable-support-to-tracing_.patch rename to kernel/patches-4.14.x-rt/0091-0091-tracing-Add-per-element-variable-support-to-tracing_.patch index 909886416..3606d3522 100644 --- a/kernel/patches-4.14.x-rt/0091-0020-tracing-Add-per-element-variable-support-to-tracing_.patch +++ b/kernel/patches-4.14.x-rt/0091-0091-tracing-Add-per-element-variable-support-to-tracing_.patch @@ -1,6 +1,7 @@ +From f8c4644971e9b33a73439cc4a2c1fd8a3883e608 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:46 -0600 -Subject: [PATCH 20/48] tracing: Add per-element variable support to +Subject: [PATCH 091/414] tracing: Add per-element variable support to tracing_map In order to allow information to be passed between trace events, add @@ -24,13 +25,15 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 42a38132f9e154e1fa2dd2182dff17f9c0e7ee7e) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/tracing_map.c | 108 +++++++++++++++++++++++++++++++++++++++++++++ - kernel/trace/tracing_map.h | 11 ++++ + kernel/trace/tracing_map.c | 108 +++++++++++++++++++++++++++++++++++++ + kernel/trace/tracing_map.h | 11 ++++ 2 files changed, 119 insertions(+) +diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c +index f47a4d54bcf0..5cadb1b8b5fe 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c -@@ -66,6 +66,73 @@ u64 tracing_map_read_sum(struct tracing_ +@@ -66,6 +66,73 @@ u64 tracing_map_read_sum(struct tracing_map_elt *elt, unsigned int i) return (u64)atomic64_read(&elt->fields[i].sum); } @@ -104,10 +107,11 @@ Signed-off-by: Sebastian Andrzej Siewior int tracing_map_cmp_string(void *val_a, void *val_b) { char *a = val_a; -@@ -171,6 +238,28 @@ int tracing_map_add_sum_field(struct tra +@@ -170,6 +237,28 @@ int tracing_map_add_sum_field(struct tracing_map *map) + return tracing_map_add_field(map, tracing_map_cmp_atomic64); } - /** ++/** + * tracing_map_add_var - Add a field describing a tracing_map var + * @map: The tracing_map + * @@ -129,11 +133,10 @@ Signed-off-by: Sebastian Andrzej Siewior + return ret; +} + -+/** + /** * tracing_map_add_key_field - Add a field describing a tracing_map key * @map: The tracing_map - * @offset: The offset within the key -@@ -280,6 +369,11 @@ static void tracing_map_elt_clear(struct +@@ -280,6 +369,11 @@ static void tracing_map_elt_clear(struct tracing_map_elt *elt) if (elt->fields[i].cmp_fn == tracing_map_cmp_atomic64) atomic64_set(&elt->fields[i].sum, 0); @@ -145,7 +148,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (elt->map->ops && elt->map->ops->elt_clear) elt->map->ops->elt_clear(elt); } -@@ -306,6 +400,8 @@ static void tracing_map_elt_free(struct +@@ -306,6 +400,8 @@ static void tracing_map_elt_free(struct tracing_map_elt *elt) if (elt->map->ops && elt->map->ops->elt_free) elt->map->ops->elt_free(elt); kfree(elt->fields); @@ -154,11 +157,10 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(elt->key); kfree(elt); } -@@ -332,6 +428,18 @@ static struct tracing_map_elt *tracing_m - err = -ENOMEM; +@@ -333,6 +429,18 @@ static struct tracing_map_elt *tracing_map_elt_alloc(struct tracing_map *map) goto free; } -+ + + elt->vars = kcalloc(map->n_vars, sizeof(*elt->vars), GFP_KERNEL); + if (!elt->vars) { + err = -ENOMEM; @@ -170,9 +172,12 @@ Signed-off-by: Sebastian Andrzej Siewior + err = -ENOMEM; + goto free; + } - ++ tracing_map_elt_init_fields(elt); + if (map->ops && map->ops->elt_alloc) { +diff --git a/kernel/trace/tracing_map.h b/kernel/trace/tracing_map.h +index de57887c0670..053eb92b2d31 100644 --- a/kernel/trace/tracing_map.h +++ b/kernel/trace/tracing_map.h @@ -10,6 +10,7 @@ @@ -200,7 +205,7 @@ Signed-off-by: Sebastian Andrzej Siewior atomic64_t hits; atomic64_t drops; }; -@@ -241,6 +245,7 @@ tracing_map_create(unsigned int map_bits +@@ -241,6 +245,7 @@ tracing_map_create(unsigned int map_bits, extern int tracing_map_init(struct tracing_map *map); extern int tracing_map_add_sum_field(struct tracing_map *map); @@ -208,7 +213,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern int tracing_map_add_key_field(struct tracing_map *map, unsigned int offset, tracing_map_cmp_fn_t cmp_fn); -@@ -260,7 +265,13 @@ extern int tracing_map_cmp_none(void *va +@@ -260,7 +265,13 @@ extern int tracing_map_cmp_none(void *val_a, void *val_b); extern void tracing_map_update_sum(struct tracing_map_elt *elt, unsigned int i, u64 n); @@ -222,3 +227,6 @@ Signed-off-by: Sebastian Andrzej Siewior extern void tracing_map_set_field_descr(struct tracing_map *map, unsigned int i, unsigned int key_offset, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0092-0021-tracing-Add-hist_data-member-to-hist_field.patch b/kernel/patches-4.14.x-rt/0092-0092-tracing-Add-hist_data-member-to-hist_field.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0092-0021-tracing-Add-hist_data-member-to-hist_field.patch rename to kernel/patches-4.14.x-rt/0092-0092-tracing-Add-hist_data-member-to-hist_field.patch index e0041209a..cc97f6343 100644 --- a/kernel/patches-4.14.x-rt/0092-0021-tracing-Add-hist_data-member-to-hist_field.patch +++ b/kernel/patches-4.14.x-rt/0092-0092-tracing-Add-hist_data-member-to-hist_field.patch @@ -1,6 +1,7 @@ +From 1d45a475f024995a68ce32590ac7f2e2c16f7b8f Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:47 -0600 -Subject: [PATCH 21/48] tracing: Add hist_data member to hist_field +Subject: [PATCH 092/414] tracing: Add hist_data member to hist_field Allow hist_data access via hist_field. Some users of hist_fields require or will require more access to the associated hist_data. @@ -12,9 +13,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 14ab3edac407939009700c04215935576250e969) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 14 +++++++++----- + kernel/trace/trace_events_hist.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index cd80bca34cec..ec58902145e9 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -39,6 +39,7 @@ struct hist_field { @@ -25,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_none(struct hist_field *field, void *event, -@@ -420,7 +421,8 @@ static void destroy_hist_field(struct hi +@@ -420,7 +421,8 @@ static void destroy_hist_field(struct hist_field *hist_field, kfree(hist_field); } @@ -35,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned long flags) { struct hist_field *hist_field; -@@ -432,6 +434,8 @@ static struct hist_field *create_hist_fi +@@ -432,6 +434,8 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field, if (!hist_field) return NULL; @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; goto out; -@@ -445,7 +449,7 @@ static struct hist_field *create_hist_fi +@@ -445,7 +449,7 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field, if (flags & HIST_FIELD_FL_LOG2) { unsigned long fl = flags & ~HIST_FIELD_FL_LOG2; hist_field->fn = hist_field_log2; @@ -53,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_field->size = hist_field->operands[0]->size; goto out; } -@@ -498,7 +502,7 @@ static void destroy_hist_fields(struct h +@@ -498,7 +502,7 @@ static void destroy_hist_fields(struct hist_trigger_data *hist_data) static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = @@ -62,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!hist_data->fields[HITCOUNT_IDX]) return -ENOMEM; -@@ -544,7 +548,7 @@ static int create_val_field(struct hist_ +@@ -544,7 +548,7 @@ static int create_val_field(struct hist_trigger_data *hist_data, } } @@ -71,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!hist_data->fields[val_idx]) { ret = -ENOMEM; goto out; -@@ -654,7 +658,7 @@ static int create_key_field(struct hist_ +@@ -654,7 +658,7 @@ static int create_key_field(struct hist_trigger_data *hist_data, } } @@ -80,3 +83,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (!hist_data->fields[key_idx]) { ret = -ENOMEM; goto out; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0093-0022-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch b/kernel/patches-4.14.x-rt/0093-0093-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0093-0022-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch rename to kernel/patches-4.14.x-rt/0093-0093-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch index 81541442f..956cc0a3d 100644 --- a/kernel/patches-4.14.x-rt/0093-0022-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch +++ b/kernel/patches-4.14.x-rt/0093-0093-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch @@ -1,6 +1,8 @@ +From 8c493fb158d587e3fbdcb572f5f44709c04b4080 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:48 -0600 -Subject: [PATCH 22/48] tracing: Add usecs modifier for hist trigger timestamps +Subject: [PATCH 093/414] tracing: Add usecs modifier for hist trigger + timestamps Appending .usecs onto a common_timestamp field will cause the timestamp value to be in microseconds instead of the default @@ -20,12 +22,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 4fa4fdb0fe5d0e87e05b0c5b443cec2269ec0609) Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 1 + - kernel/trace/trace.c | 13 +++++++++++-- - kernel/trace/trace.h | 2 ++ - kernel/trace/trace_events_hist.c | 28 ++++++++++++++++++++++------ + Documentation/trace/histogram.txt | 1 + + kernel/trace/trace.c | 13 +++++++++++-- + kernel/trace/trace.h | 2 ++ + kernel/trace/trace_events_hist.c | 28 ++++++++++++++++++++++------ 4 files changed, 36 insertions(+), 8 deletions(-) +diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt +index a4143f04a097..25c94730d3fe 100644 --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt @@ -74,6 +74,7 @@ @@ -36,6 +40,8 @@ Signed-off-by: Sebastian Andrzej Siewior Note that in general the semantics of a given field aren't interpreted when applying a modifier to it, but there are some +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 1c2e0296e713..6aef03230842 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1170,6 +1170,14 @@ static struct { @@ -65,9 +71,11 @@ Signed-off-by: Sebastian Andrzej Siewior "\t The 'pause' parameter can be used to pause an existing hist\n" "\t trigger or to start a hist trigger but not log any events\n" "\t until told to do so. 'continue' can be used to start or\n" +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index b123c626b159..64ba9e1d4c38 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h -@@ -289,6 +289,8 @@ extern void trace_array_put(struct trace +@@ -289,6 +289,8 @@ extern void trace_array_put(struct trace_array *tr); extern int tracing_set_time_stamp_abs(struct trace_array *tr, bool abs); @@ -76,9 +84,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * The global tracer (top) should be the first trace array added, * but we check the flag anyway. +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index ec58902145e9..6d268e25d051 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -90,12 +90,6 @@ static u64 hist_field_log2(struct hist_f +@@ -90,12 +90,6 @@ static u64 hist_field_log2(struct hist_field *hist_field, void *event, return (u64) ilog2(roundup_pow_of_two(val)); } @@ -128,7 +138,7 @@ Signed-off-by: Sebastian Andrzej Siewior static const char *hist_field_name(struct hist_field *field, unsigned int level) { -@@ -634,6 +644,8 @@ static int create_key_field(struct hist_ +@@ -634,6 +644,8 @@ static int create_key_field(struct hist_trigger_data *hist_data, flags |= HIST_FIELD_FL_SYSCALL; else if (strcmp(field_str, "log2") == 0) flags |= HIST_FIELD_FL_LOG2; @@ -137,7 +147,7 @@ Signed-off-by: Sebastian Andrzej Siewior else { ret = -EINVAL; goto out; -@@ -643,6 +655,8 @@ static int create_key_field(struct hist_ +@@ -643,6 +655,8 @@ static int create_key_field(struct hist_trigger_data *hist_data, if (strcmp(field_name, "common_timestamp") == 0) { flags |= HIST_FIELD_FL_TIMESTAMP; hist_data->enable_timestamps = true; @@ -146,7 +156,7 @@ Signed-off-by: Sebastian Andrzej Siewior key_size = sizeof(u64); } else { field = trace_find_event_field(file->event_call, field_name); -@@ -1243,6 +1257,8 @@ static const char *get_hist_field_flags( +@@ -1243,6 +1257,8 @@ static const char *get_hist_field_flags(struct hist_field *hist_field) flags_str = "syscall"; else if (hist_field->flags & HIST_FIELD_FL_LOG2) flags_str = "log2"; @@ -155,3 +165,6 @@ Signed-off-by: Sebastian Andrzej Siewior return flags_str; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0094-0023-tracing-Add-variable-support-to-hist-triggers.patch b/kernel/patches-4.14.x-rt/0094-0094-tracing-Add-variable-support-to-hist-triggers.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0094-0023-tracing-Add-variable-support-to-hist-triggers.patch rename to kernel/patches-4.14.x-rt/0094-0094-tracing-Add-variable-support-to-hist-triggers.patch index 4b85d24eb..f38bfbf76 100644 --- a/kernel/patches-4.14.x-rt/0094-0023-tracing-Add-variable-support-to-hist-triggers.patch +++ b/kernel/patches-4.14.x-rt/0094-0094-tracing-Add-variable-support-to-hist-triggers.patch @@ -1,6 +1,7 @@ +From d2e809dd6c585dc55b2effa0907b64d9746c5f2c Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:49 -0600 -Subject: [PATCH 23/48] tracing: Add variable support to hist triggers +Subject: [PATCH 094/414] tracing: Add variable support to hist triggers Add support for saving the value of a current event's event field by assigning it to a variable that can be read by a subsequent event. @@ -40,12 +41,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit b073711690e3af61965e53f197a56638b3c65a81) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 370 ++++++++++++++++++++++++++++++++++----- + kernel/trace/trace_events_hist.c | 370 +++++++++++++++++++++++++++---- 1 file changed, 331 insertions(+), 39 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 6d268e25d051..b4301542bb4a 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -30,6 +30,13 @@ typedef u64 (*hist_field_fn_t) (struct h +@@ -30,6 +30,13 @@ typedef u64 (*hist_field_fn_t) (struct hist_field *field, void *event, struct ring_buffer_event *rbe); #define HIST_FIELD_OPERANDS_MAX 2 @@ -110,7 +113,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_timestamp(struct hist_field *hist_field, void *event, -@@ -180,6 +202,48 @@ static u64 hist_field_timestamp(struct h +@@ -180,6 +202,48 @@ static u64 hist_field_timestamp(struct hist_field *hist_field, void *event, return ts; } @@ -174,7 +177,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(attrs->name); kfree(attrs->sort_key_str); kfree(attrs->keys_str); -@@ -311,8 +380,22 @@ static int parse_assignment(char *str, s +@@ -311,8 +380,22 @@ static int parse_assignment(char *str, struct hist_trigger_attrs *attrs) goto out; } attrs->map_bits = map_bits; @@ -199,7 +202,7 @@ Signed-off-by: Sebastian Andrzej Siewior out: return ret; } -@@ -428,12 +511,15 @@ static void destroy_hist_field(struct hi +@@ -428,12 +511,15 @@ static void destroy_hist_field(struct hist_field *hist_field, for (i = 0; i < HIST_FIELD_OPERANDS_MAX; i++) destroy_hist_field(hist_field->operands[i], level + 1); @@ -216,7 +219,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hist_field *hist_field; -@@ -459,7 +545,7 @@ static struct hist_field *create_hist_fi +@@ -459,7 +545,7 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, if (flags & HIST_FIELD_FL_LOG2) { unsigned long fl = flags & ~HIST_FIELD_FL_LOG2; hist_field->fn = hist_field_log2; @@ -225,7 +228,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_field->size = hist_field->operands[0]->size; goto out; } -@@ -494,14 +580,23 @@ static struct hist_field *create_hist_fi +@@ -494,14 +580,23 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, hist_field->field = field; hist_field->flags = flags; @@ -250,7 +253,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_data->fields[i]) { destroy_hist_field(hist_data->fields[i], 0); hist_data->fields[i] = NULL; -@@ -512,11 +607,12 @@ static void destroy_hist_fields(struct h +@@ -512,11 +607,12 @@ static void destroy_hist_fields(struct hist_trigger_data *hist_data) static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = @@ -264,7 +267,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX)) return -EINVAL; -@@ -524,19 +620,16 @@ static int create_hitcount_val(struct hi +@@ -524,19 +620,16 @@ static int create_hitcount_val(struct hist_trigger_data *hist_data) return 0; } @@ -289,7 +292,7 @@ Signed-off-by: Sebastian Andrzej Siewior field_name = strsep(&field_str, "."); if (field_str) { if (strcmp(field_str, "hex") == 0) -@@ -558,25 +651,58 @@ static int create_val_field(struct hist_ +@@ -558,25 +651,58 @@ static int create_val_field(struct hist_trigger_data *hist_data, } } @@ -351,7 +354,7 @@ Signed-off-by: Sebastian Andrzej Siewior int ret; ret = create_hitcount_val(hist_data); -@@ -596,12 +722,15 @@ static int create_val_fields(struct hist +@@ -596,12 +722,15 @@ static int create_val_fields(struct hist_trigger_data *hist_data, field_str = strsep(&fields_str, ","); if (!field_str) break; @@ -367,7 +370,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (fields_str && (strcmp(fields_str, "hitcount") != 0)) ret = -EINVAL; out: -@@ -615,11 +744,12 @@ static int create_key_field(struct hist_ +@@ -615,11 +744,12 @@ static int create_key_field(struct hist_trigger_data *hist_data, char *field_str) { struct ftrace_event_field *field = NULL; @@ -381,7 +384,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; flags |= HIST_FIELD_FL_KEY; -@@ -627,6 +757,7 @@ static int create_key_field(struct hist_ +@@ -627,6 +757,7 @@ static int create_key_field(struct hist_trigger_data *hist_data, if (strcmp(field_str, "stacktrace") == 0) { flags |= HIST_FIELD_FL_STACKTRACE; key_size = sizeof(unsigned long) * HIST_STACKTRACE_DEPTH; @@ -389,7 +392,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else { char *field_name = strsep(&field_str, "."); -@@ -672,7 +803,7 @@ static int create_key_field(struct hist_ +@@ -672,7 +803,7 @@ static int create_key_field(struct hist_trigger_data *hist_data, } } @@ -398,7 +401,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!hist_data->fields[key_idx]) { ret = -ENOMEM; goto out; -@@ -688,6 +819,7 @@ static int create_key_field(struct hist_ +@@ -688,6 +819,7 @@ static int create_key_field(struct hist_trigger_data *hist_data, } hist_data->n_keys++; @@ -406,7 +409,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON(hist_data->n_keys > TRACING_MAP_KEYS_MAX)) return -EINVAL; -@@ -731,21 +863,111 @@ static int create_key_fields(struct hist +@@ -731,21 +863,111 @@ static int create_key_fields(struct hist_trigger_data *hist_data, return ret; } @@ -520,7 +523,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -768,7 +990,7 @@ static int create_sort_keys(struct hist_ +@@ -768,7 +990,7 @@ static int create_sort_keys(struct hist_trigger_data *hist_data) char *fields_str = hist_data->attrs->sort_key_str; struct tracing_map_sort_key *sort_key; int descending, ret = 0; @@ -529,7 +532,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_data->n_sort_keys = 1; /* we always have at least one, hitcount */ -@@ -816,12 +1038,19 @@ static int create_sort_keys(struct hist_ +@@ -816,12 +1038,19 @@ static int create_sort_keys(struct hist_trigger_data *hist_data) continue; } @@ -551,7 +554,7 @@ Signed-off-by: Sebastian Andrzej Siewior descending = is_descending(field_str); if (descending < 0) { ret = descending; -@@ -836,6 +1065,7 @@ static int create_sort_keys(struct hist_ +@@ -836,6 +1065,7 @@ static int create_sort_keys(struct hist_trigger_data *hist_data) break; } } @@ -559,7 +562,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_data->n_sort_keys = i; out: return ret; -@@ -876,12 +1106,19 @@ static int create_tracing_map_fields(str +@@ -876,12 +1106,19 @@ static int create_tracing_map_fields(struct hist_trigger_data *hist_data) idx = tracing_map_add_key_field(map, hist_field->offset, cmp_fn); @@ -581,7 +584,7 @@ Signed-off-by: Sebastian Andrzej Siewior } return 0; -@@ -905,7 +1142,8 @@ static bool need_tracing_map_ops(struct +@@ -905,7 +1142,8 @@ static bool need_tracing_map_ops(struct hist_trigger_data *hist_data) static struct hist_trigger_data * create_hist_data(unsigned int map_bits, struct hist_trigger_attrs *attrs, @@ -599,7 +602,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = create_hist_fields(hist_data, file); if (ret) -@@ -962,14 +1201,28 @@ static void hist_trigger_elt_update(stru +@@ -962,14 +1201,28 @@ static void hist_trigger_elt_update(struct hist_trigger_data *hist_data, struct ring_buffer_event *rbe) { struct hist_field *hist_field; @@ -629,7 +632,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline void add_to_key(char *compound_key, void *key, -@@ -1144,6 +1397,9 @@ hist_trigger_entry_print(struct seq_file +@@ -1144,6 +1397,9 @@ hist_trigger_entry_print(struct seq_file *m, for (i = 1; i < hist_data->n_vals; i++) { field_name = hist_field_name(hist_data->fields[i], 0); @@ -639,7 +642,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_data->fields[i]->flags & HIST_FIELD_FL_HEX) { seq_printf(m, " %s: %10llx", field_name, tracing_map_read_sum(elt, i)); -@@ -1267,6 +1523,9 @@ static void hist_field_print(struct seq_ +@@ -1267,6 +1523,9 @@ static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) { const char *field_name = hist_field_name(hist_field, 0); @@ -649,7 +652,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) seq_puts(m, "common_timestamp"); else if (field_name) -@@ -1285,7 +1544,8 @@ static int event_hist_trigger_print(stru +@@ -1285,7 +1544,8 @@ static int event_hist_trigger_print(struct seq_file *m, struct event_trigger_data *data) { struct hist_trigger_data *hist_data = data->private_data; @@ -659,7 +662,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned int i; seq_puts(m, "hist:"); -@@ -1296,25 +1556,47 @@ static int event_hist_trigger_print(stru +@@ -1296,25 +1556,47 @@ static int event_hist_trigger_print(struct seq_file *m, seq_puts(m, "keys="); for_each_hist_key_field(i, hist_data) { @@ -711,7 +714,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -1322,7 +1604,10 @@ static int event_hist_trigger_print(stru +@@ -1322,7 +1604,10 @@ static int event_hist_trigger_print(struct seq_file *m, for (i = 0; i < hist_data->n_sort_keys; i++) { struct tracing_map_sort_key *sort_key; @@ -723,7 +726,7 @@ Signed-off-by: Sebastian Andrzej Siewior sort_key = &hist_data->sort_keys[i]; idx = sort_key->field_idx; -@@ -1335,8 +1620,11 @@ static int event_hist_trigger_print(stru +@@ -1335,8 +1620,11 @@ static int event_hist_trigger_print(struct seq_file *m, if (idx == HITCOUNT_IDX) seq_puts(m, "hitcount"); @@ -736,7 +739,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (sort_key->descending) seq_puts(m, ".descending"); -@@ -1633,7 +1921,7 @@ static void hist_unregister_trigger(char +@@ -1633,7 +1921,7 @@ static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops, test->ops->free(test->ops, test); if (hist_data->enable_timestamps) { @@ -745,7 +748,7 @@ Signed-off-by: Sebastian Andrzej Siewior tracing_set_time_stamp_abs(file->tr, false); } } -@@ -1666,12 +1954,16 @@ static int event_hist_trigger_func(struc +@@ -1666,12 +1954,16 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, struct hist_trigger_attrs *attrs; struct event_trigger_ops *trigger_ops; struct hist_trigger_data *hist_data; @@ -762,7 +765,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* separate the trigger from the filter (k:v [if filter]) */ trigger = strsep(¶m, " \t"); if (!trigger) -@@ -1684,7 +1976,7 @@ static int event_hist_trigger_func(struc +@@ -1684,7 +1976,7 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, if (attrs->map_bits) hist_trigger_bits = attrs->map_bits; @@ -771,7 +774,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (IS_ERR(hist_data)) { destroy_hist_trigger_attrs(attrs); return PTR_ERR(hist_data); -@@ -1713,7 +2005,7 @@ static int event_hist_trigger_func(struc +@@ -1713,7 +2005,7 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, goto out_free; } @@ -780,3 +783,6 @@ Signed-off-by: Sebastian Andrzej Siewior cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); ret = 0; goto out_free; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0095-0024-tracing-Account-for-variables-in-named-trigger-compa.patch b/kernel/patches-4.14.x-rt/0095-0095-tracing-Account-for-variables-in-named-trigger-compa.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0095-0024-tracing-Account-for-variables-in-named-trigger-compa.patch rename to kernel/patches-4.14.x-rt/0095-0095-tracing-Account-for-variables-in-named-trigger-compa.patch index a7617a26b..d1b8dc337 100644 --- a/kernel/patches-4.14.x-rt/0095-0024-tracing-Account-for-variables-in-named-trigger-compa.patch +++ b/kernel/patches-4.14.x-rt/0095-0095-tracing-Account-for-variables-in-named-trigger-compa.patch @@ -1,6 +1,7 @@ +From 472418ca534a8ceaa363f21b5b2a2c4a9d4753cc Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:50 -0600 -Subject: [PATCH 24/48] tracing: Account for variables in named trigger +Subject: [PATCH 095/414] tracing: Account for variables in named trigger compatibility Named triggers must also have the same set of variables in order to be @@ -17,12 +18,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit f94add7df3d72bc8e659f9491e25d91c9dae1b44) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 7 ++++++- + kernel/trace/trace_events_hist.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index b4301542bb4a..68ff2491edd0 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -1612,7 +1612,7 @@ static int event_hist_trigger_print(stru +@@ -1612,7 +1612,7 @@ static int event_hist_trigger_print(struct seq_file *m, sort_key = &hist_data->sort_keys[i]; idx = sort_key->field_idx; @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; if (i > 0) -@@ -1800,6 +1800,11 @@ static bool hist_trigger_match(struct ev +@@ -1800,6 +1800,11 @@ static bool hist_trigger_match(struct event_trigger_data *data, return false; if (key_field->is_signed != key_field_test->is_signed) return false; @@ -43,3 +46,6 @@ Signed-off-by: Sebastian Andrzej Siewior } for (i = 0; i < hist_data->n_sort_keys; i++) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0096-0025-tracing-Move-get_hist_field_flags.patch b/kernel/patches-4.14.x-rt/0096-0096-tracing-Move-get_hist_field_flags.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0096-0025-tracing-Move-get_hist_field_flags.patch rename to kernel/patches-4.14.x-rt/0096-0096-tracing-Move-get_hist_field_flags.patch index 767bf7e8f..81761cf41 100644 --- a/kernel/patches-4.14.x-rt/0096-0025-tracing-Move-get_hist_field_flags.patch +++ b/kernel/patches-4.14.x-rt/0096-0096-tracing-Move-get_hist_field_flags.patch @@ -1,6 +1,7 @@ +From 72482a9d923e2d7fb067be707391268171b17421 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:51 -0600 -Subject: [PATCH 25/48] tracing: Move get_hist_field_flags() +Subject: [PATCH 096/414] tracing: Move get_hist_field_flags() Move get_hist_field_flags() to make it more easily accessible for new code (and keep the move separate from new functionality). @@ -12,12 +13,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit fde3bce553d359c01beb9a6fce4013b65076aff3) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 44 +++++++++++++++++++-------------------- + kernel/trace/trace_events_hist.c | 44 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 68ff2491edd0..c6c24d6d2be8 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -497,6 +497,28 @@ static const struct tracing_map_ops hist +@@ -497,6 +497,28 @@ static const struct tracing_map_ops hist_trigger_elt_comm_ops = { .elt_init = hist_trigger_elt_comm_init, }; @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_hist_field(struct hist_field *hist_field, unsigned int level) { -@@ -1497,28 +1519,6 @@ const struct file_operations event_hist_ +@@ -1497,28 +1519,6 @@ const struct file_operations event_hist_fops = { .release = single_release, }; @@ -75,3 +78,6 @@ Signed-off-by: Sebastian Andrzej Siewior static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) { const char *field_name = hist_field_name(hist_field, 0); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0097-0026-tracing-Add-simple-expression-support-to-hist-trigge.patch b/kernel/patches-4.14.x-rt/0097-0097-tracing-Add-simple-expression-support-to-hist-trigge.patch similarity index 92% rename from kernel/patches-4.14.x-rt/0097-0026-tracing-Add-simple-expression-support-to-hist-trigge.patch rename to kernel/patches-4.14.x-rt/0097-0097-tracing-Add-simple-expression-support-to-hist-trigge.patch index acfd1dd1f..8fedebae5 100644 --- a/kernel/patches-4.14.x-rt/0097-0026-tracing-Add-simple-expression-support-to-hist-trigge.patch +++ b/kernel/patches-4.14.x-rt/0097-0097-tracing-Add-simple-expression-support-to-hist-trigge.patch @@ -1,6 +1,8 @@ +From 125e31bde34445f9374487842b10f5634dc2fcca Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:52 -0600 -Subject: [PATCH 26/48] tracing: Add simple expression support to hist triggers +Subject: [PATCH 097/414] tracing: Add simple expression support to hist + triggers Add support for simple addition, subtraction, and unary expressions (-(expr) and expr, where expr = b-a, a+b, a+b+c) to hist triggers, in @@ -22,12 +24,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 26c5cb5e4790fec96e3eba02c347e78fa72273a8) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 487 +++++++++++++++++++++++++++++++++------ + kernel/trace/trace_events_hist.c | 487 ++++++++++++++++++++++++++----- 1 file changed, 413 insertions(+), 74 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index c6c24d6d2be8..d2f01f3f26e1 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -32,6 +32,13 @@ typedef u64 (*hist_field_fn_t) (struct h +@@ -32,6 +32,13 @@ typedef u64 (*hist_field_fn_t) (struct hist_field *field, void *event, #define HIST_FIELD_OPERANDS_MAX 2 #define HIST_FIELDS_MAX (TRACING_MAP_FIELDS_MAX + TRACING_MAP_VARS_MAX) @@ -50,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_none(struct hist_field *field, void *event, -@@ -98,6 +107,41 @@ static u64 hist_field_log2(struct hist_f +@@ -98,6 +107,41 @@ static u64 hist_field_log2(struct hist_field *hist_field, void *event, return (u64) ilog2(roundup_pow_of_two(val)); } @@ -100,7 +104,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct var_defs { -@@ -258,6 +303,8 @@ static const char *hist_field_name(struc +@@ -258,6 +303,8 @@ static const char *hist_field_name(struct hist_field *field, field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) field_name = "common_timestamp"; @@ -109,7 +113,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field_name == NULL) field_name = ""; -@@ -519,12 +566,104 @@ static const char *get_hist_field_flags( +@@ -519,12 +566,104 @@ static const char *get_hist_field_flags(struct hist_field *hist_field) return flags_str; } @@ -215,7 +219,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; if (!hist_field) -@@ -534,6 +673,7 @@ static void destroy_hist_field(struct hi +@@ -534,6 +673,7 @@ static void destroy_hist_field(struct hist_field *hist_field, destroy_hist_field(hist_field->operands[i], level + 1); kfree(hist_field->var.name); @@ -223,7 +227,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_field); } -@@ -554,6 +694,9 @@ static struct hist_field *create_hist_fi +@@ -554,6 +694,9 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, hist_field->hist_data = hist_data; @@ -233,7 +237,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; goto out; -@@ -626,6 +769,257 @@ static void destroy_hist_fields(struct h +@@ -626,6 +769,257 @@ static void destroy_hist_fields(struct hist_trigger_data *hist_data) } } @@ -491,7 +495,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = -@@ -648,37 +1042,17 @@ static int __create_val_field(struct his +@@ -648,37 +1042,17 @@ static int __create_val_field(struct hist_trigger_data *hist_data, char *var_name, char *field_str, unsigned long flags) { @@ -535,7 +539,7 @@ Signed-off-by: Sebastian Andrzej Siewior ++hist_data->n_vals; ++hist_data->n_fields; -@@ -765,8 +1139,8 @@ static int create_key_field(struct hist_ +@@ -765,8 +1139,8 @@ static int create_key_field(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *field_str) { @@ -545,7 +549,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned long flags = 0; unsigned int key_size; int ret = 0; -@@ -781,60 +1155,24 @@ static int create_key_field(struct hist_ +@@ -781,60 +1155,24 @@ static int create_key_field(struct hist_trigger_data *hist_data, key_size = sizeof(unsigned long) * HIST_STACKTRACE_DEPTH; hist_field = create_hist_field(hist_data, NULL, flags, NULL); } else { @@ -615,7 +619,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_data->key_size > HIST_KEY_SIZE_MAX) { ret = -EINVAL; goto out; -@@ -1419,7 +1757,8 @@ hist_trigger_entry_print(struct seq_file +@@ -1419,7 +1757,8 @@ hist_trigger_entry_print(struct seq_file *m, for (i = 1; i < hist_data->n_vals; i++) { field_name = hist_field_name(hist_data->fields[i], 0); @@ -625,3 +629,6 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (hist_data->fields[i]->flags & HIST_FIELD_FL_HEX) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0098-0027-tracing-Generalize-per-element-hist-trigger-data.patch b/kernel/patches-4.14.x-rt/0098-0098-tracing-Generalize-per-element-hist-trigger-data.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0098-0027-tracing-Generalize-per-element-hist-trigger-data.patch rename to kernel/patches-4.14.x-rt/0098-0098-tracing-Generalize-per-element-hist-trigger-data.patch index c51640d37..455fbacf4 100644 --- a/kernel/patches-4.14.x-rt/0098-0027-tracing-Generalize-per-element-hist-trigger-data.patch +++ b/kernel/patches-4.14.x-rt/0098-0098-tracing-Generalize-per-element-hist-trigger-data.patch @@ -1,6 +1,7 @@ +From 00f8c97c62c63a5aca370c0aa86b8d99df213ab4 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:53 -0600 -Subject: [PATCH 27/48] tracing: Generalize per-element hist trigger data +Subject: [PATCH 098/414] tracing: Generalize per-element hist trigger data Up until now, hist triggers only needed per-element support for saving 'comm' data, which was saved directly as a private data pointer. @@ -16,12 +17,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 8102d0cb859d223564b17afb01e33701f57191d1) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 76 ++++++++++++++++++++++----------------- + kernel/trace/trace_events_hist.c | 76 ++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 33 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index d2f01f3f26e1..893f65ce31a5 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -289,6 +289,10 @@ static struct hist_field *find_var(struc +@@ -289,6 +289,10 @@ static struct hist_field *find_var(struct hist_trigger_data *hist_data, return NULL; } @@ -32,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior static const char *hist_field_name(struct hist_field *field, unsigned int level) { -@@ -503,45 +507,61 @@ static inline void save_comm(char *comm, +@@ -503,45 +507,61 @@ static inline void save_comm(char *comm, struct task_struct *task) memcpy(comm, task->comm, TASK_COMM_LEN); } @@ -109,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static const char *get_hist_field_flags(struct hist_field *hist_field) -@@ -1484,21 +1504,6 @@ static int create_tracing_map_fields(str +@@ -1484,21 +1504,6 @@ static int create_tracing_map_fields(struct hist_trigger_data *hist_data) return 0; } @@ -141,7 +144,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_data->map = tracing_map_create(map_bits, hist_data->key_size, map_ops, hist_data); -@@ -1713,7 +1717,13 @@ hist_trigger_entry_print(struct seq_file +@@ -1713,7 +1717,13 @@ hist_trigger_entry_print(struct seq_file *m, seq_printf(m, "%s: [%llx] %-55s", field_name, uval, str); } else if (key_field->flags & HIST_FIELD_FL_EXECNAME) { @@ -156,3 +159,6 @@ Signed-off-by: Sebastian Andrzej Siewior uval = *(u64 *)(key + key_field->offset); seq_printf(m, "%s: %-16s[%10llu]", field_name, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0099-0028-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch b/kernel/patches-4.14.x-rt/0099-0099-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch similarity index 88% rename from kernel/patches-4.14.x-rt/0099-0028-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch rename to kernel/patches-4.14.x-rt/0099-0099-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch index 1634c7210..88d625298 100644 --- a/kernel/patches-4.14.x-rt/0099-0028-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch +++ b/kernel/patches-4.14.x-rt/0099-0099-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch @@ -1,6 +1,7 @@ +From b9c22129a458019a99aefd676d8aa505df0c89a5 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:54 -0600 -Subject: [PATCH 28/48] tracing: Pass tracing_map_elt to hist_field accessor +Subject: [PATCH 099/414] tracing: Pass tracing_map_elt to hist_field accessor functions Some accessor functions, such as for variable references, require @@ -16,9 +17,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 8405bbbbc9dc0d88ffc92848cb8f0bda2c7a1b30) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 91 ++++++++++++++++++++++++--------------- + kernel/trace/trace_events_hist.c | 91 ++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 34 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 893f65ce31a5..becf37b2b0da 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -26,8 +26,10 @@ @@ -79,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior { u32 str_item = *(u32 *)(event + hist_field->field->offset); int str_loc = str_item & 0xffff; -@@ -89,54 +99,64 @@ static u64 hist_field_dynstring(struct h +@@ -89,54 +99,64 @@ static u64 hist_field_dynstring(struct hist_field *hist_field, void *event, return (u64)(unsigned long)addr; } @@ -160,7 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior u64 val = (u64)-sval; return val; -@@ -144,8 +164,9 @@ static u64 hist_field_unary_minus(struct +@@ -144,8 +164,9 @@ static u64 hist_field_unary_minus(struct hist_field *hist_field, void *event, #define DEFINE_HIST_FIELD_FN(type) \ static u64 hist_field_##type(struct hist_field *hist_field, \ @@ -185,7 +188,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hist_trigger_data *hist_data = hist_field->hist_data; struct trace_array *tr = hist_data->event_file->tr; -@@ -1570,7 +1593,7 @@ static void hist_trigger_elt_update(stru +@@ -1570,7 +1593,7 @@ static void hist_trigger_elt_update(struct hist_trigger_data *hist_data, for_each_hist_val_field(i, hist_data) { hist_field = hist_data->fields[i]; @@ -194,7 +197,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_field->flags & HIST_FIELD_FL_VAR) { var_idx = hist_field->var.idx; tracing_map_set_var(elt, var_idx, hist_val); -@@ -1582,7 +1605,7 @@ static void hist_trigger_elt_update(stru +@@ -1582,7 +1605,7 @@ static void hist_trigger_elt_update(struct hist_trigger_data *hist_data, for_each_hist_key_field(i, hist_data) { hist_field = hist_data->fields[i]; if (hist_field->flags & HIST_FIELD_FL_VAR) { @@ -203,7 +206,7 @@ Signed-off-by: Sebastian Andrzej Siewior var_idx = hist_field->var.idx; tracing_map_set_var(elt, var_idx, hist_val); } -@@ -1620,9 +1643,9 @@ static void event_hist_trigger(struct ev +@@ -1620,9 +1643,9 @@ static void event_hist_trigger(struct event_trigger_data *data, void *rec, bool use_compound_key = (hist_data->n_keys > 1); unsigned long entries[HIST_STACKTRACE_DEPTH]; char compound_key[HIST_KEY_SIZE_MAX]; @@ -214,7 +217,7 @@ Signed-off-by: Sebastian Andrzej Siewior u64 field_contents; void *key = NULL; unsigned int i; -@@ -1643,7 +1666,7 @@ static void event_hist_trigger(struct ev +@@ -1643,7 +1666,7 @@ static void event_hist_trigger(struct event_trigger_data *data, void *rec, key = entries; } else { @@ -223,3 +226,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (key_field->flags & HIST_FIELD_FL_STRING) { key = (void *)(unsigned long)field_contents; use_compound_key = true; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0100-0029-tracing-Add-hist_field-type-field.patch b/kernel/patches-4.14.x-rt/0100-0100-tracing-Add-hist_field-type-field.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0100-0029-tracing-Add-hist_field-type-field.patch rename to kernel/patches-4.14.x-rt/0100-0100-tracing-Add-hist_field-type-field.patch index 8b4ed0015..8aac22b78 100644 --- a/kernel/patches-4.14.x-rt/0100-0029-tracing-Add-hist_field-type-field.patch +++ b/kernel/patches-4.14.x-rt/0100-0100-tracing-Add-hist_field-type-field.patch @@ -1,6 +1,7 @@ +From 67cf948ef86a7ae12b4244dd52a19b6c363686a3 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:55 -0600 -Subject: [PATCH 29/48] tracing: Add hist_field 'type' field +Subject: [PATCH 100/414] tracing: Add hist_field 'type' field Future support for synthetic events requires hist_field 'type' information, so add a field for that. @@ -15,9 +16,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit d544a468f82526e97cc80c18a019708eb203b00a) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 33 +++++++++++++++++++++++++++++++++ + kernel/trace/trace_events_hist.c | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index becf37b2b0da..6e60cb794dcd 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -54,6 +54,7 @@ struct hist_field { @@ -28,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct hist_field *operands[HIST_FIELD_OPERANDS_MAX]; struct hist_trigger_data *hist_data; struct hist_var var; -@@ -717,6 +718,7 @@ static void destroy_hist_field(struct hi +@@ -717,6 +718,7 @@ static void destroy_hist_field(struct hist_field *hist_field, kfree(hist_field->var.name); kfree(hist_field->name); @@ -36,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_field); } -@@ -742,6 +744,10 @@ static struct hist_field *create_hist_fi +@@ -742,6 +744,10 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; @@ -47,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; } -@@ -755,12 +761,18 @@ static struct hist_field *create_hist_fi +@@ -755,12 +761,18 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, hist_field->fn = hist_field_log2; hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); hist_field->size = hist_field->operands[0]->size; @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; } -@@ -770,6 +782,11 @@ static struct hist_field *create_hist_fi +@@ -770,6 +782,11 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, if (is_string_field(field)) { flags |= HIST_FIELD_FL_STRING; @@ -78,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field->filter_type == FILTER_STATIC_STRING) hist_field->fn = hist_field_string; else if (field->filter_type == FILTER_DYN_STRING) -@@ -777,6 +794,12 @@ static struct hist_field *create_hist_fi +@@ -777,6 +794,12 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, else hist_field->fn = hist_field_pstring; } else { @@ -91,7 +94,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_field->fn = select_value_fn(field->size, field->is_signed); if (!hist_field->fn) { -@@ -949,6 +972,11 @@ static struct hist_field *parse_unary(st +@@ -949,6 +972,11 @@ static struct hist_field *parse_unary(struct hist_trigger_data *hist_data, expr->operands[0] = operand1; expr->operator = FIELD_OP_UNARY_MINUS; expr->name = expr_str(expr, 0); @@ -103,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior return expr; free: -@@ -1042,6 +1070,11 @@ static struct hist_field *parse_expr(str +@@ -1042,6 +1070,11 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, expr->operands[1] = operand2; expr->operator = field_op; expr->name = expr_str(expr, 0); @@ -115,3 +118,6 @@ Signed-off-by: Sebastian Andrzej Siewior switch (field_op) { case FIELD_OP_MINUS: +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0101-0030-tracing-Add-variable-reference-handling-to-hist-trig.patch b/kernel/patches-4.14.x-rt/0101-0101-tracing-Add-variable-reference-handling-to-hist-trig.patch similarity index 90% rename from kernel/patches-4.14.x-rt/0101-0030-tracing-Add-variable-reference-handling-to-hist-trig.patch rename to kernel/patches-4.14.x-rt/0101-0101-tracing-Add-variable-reference-handling-to-hist-trig.patch index 04e707ec9..1539dff4c 100644 --- a/kernel/patches-4.14.x-rt/0101-0030-tracing-Add-variable-reference-handling-to-hist-trig.patch +++ b/kernel/patches-4.14.x-rt/0101-0101-tracing-Add-variable-reference-handling-to-hist-trig.patch @@ -1,6 +1,7 @@ +From bbfd0d17d764e76d6bce236898eb6d80a73d9763 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:56 -0600 -Subject: [PATCH 30/48] tracing: Add variable reference handling to hist +Subject: [PATCH 101/414] tracing: Add variable reference handling to hist triggers Add the necessary infrastructure to allow the variables defined on one @@ -28,15 +29,17 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 434c1d5831194e72e6eb30d46534d75b5a985eb7) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace.c | 2 - kernel/trace/trace.h | 3 - kernel/trace/trace_events_hist.c | 661 +++++++++++++++++++++++++++++++++++- - kernel/trace/trace_events_trigger.c | 6 + kernel/trace/trace.c | 2 + + kernel/trace/trace.h | 3 + + kernel/trace/trace_events_hist.c | 661 +++++++++++++++++++++++++++- + kernel/trace/trace_events_trigger.c | 6 + 4 files changed, 656 insertions(+), 16 deletions(-) +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 6aef03230842..d92f6bb417ea 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -7788,6 +7788,7 @@ static int instance_mkdir(const char *na +@@ -7788,6 +7788,7 @@ static int instance_mkdir(const char *name) INIT_LIST_HEAD(&tr->systems); INIT_LIST_HEAD(&tr->events); @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (allocate_trace_buffers(tr, trace_buf_size) < 0) goto out_free_tr; -@@ -8538,6 +8539,7 @@ ssize_t trace_parse_run_command(struct f +@@ -8538,6 +8539,7 @@ __init static int tracer_alloc_buffers(void) INIT_LIST_HEAD(&global_trace.systems); INIT_LIST_HEAD(&global_trace.events); @@ -52,6 +55,8 @@ Signed-off-by: Sebastian Andrzej Siewior list_add(&global_trace.list, &ftrace_trace_arrays); apply_trace_boot_options(); +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 64ba9e1d4c38..25d1fa15eb99 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -274,6 +274,7 @@ struct trace_array { @@ -62,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; enum { -@@ -1550,6 +1551,8 @@ extern void pause_named_trigger(struct e +@@ -1550,6 +1551,8 @@ extern void pause_named_trigger(struct event_trigger_data *data); extern void unpause_named_trigger(struct event_trigger_data *data); extern void set_named_trigger_data(struct event_trigger_data *data, struct event_trigger_data *named_data); @@ -71,6 +76,8 @@ Signed-off-by: Sebastian Andrzej Siewior extern int register_event_command(struct event_command *cmd); extern int unregister_event_command(struct event_command *cmd); extern int register_trigger_hist_enable_disable_cmds(void); +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 6e60cb794dcd..2bc1f76915ef 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -59,7 +59,12 @@ struct hist_field { @@ -103,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_timestamp(struct hist_field *hist_field, -@@ -271,6 +279,214 @@ static u64 hist_field_timestamp(struct h +@@ -271,6 +279,214 @@ static u64 hist_field_timestamp(struct hist_field *hist_field, return ts; } @@ -318,7 +325,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, const char *var_name) { -@@ -313,10 +529,137 @@ static struct hist_field *find_var(struc +@@ -313,10 +529,137 @@ static struct hist_field *find_var(struct hist_trigger_data *hist_data, return NULL; } @@ -456,7 +463,7 @@ Signed-off-by: Sebastian Andrzej Siewior static const char *hist_field_name(struct hist_field *field, unsigned int level) { -@@ -331,8 +674,20 @@ static const char *hist_field_name(struc +@@ -331,8 +674,20 @@ static const char *hist_field_name(struct hist_field *field, field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) field_name = "common_timestamp"; @@ -479,7 +486,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field_name == NULL) field_name = ""; -@@ -612,6 +967,9 @@ static const char *get_hist_field_flags( +@@ -612,6 +967,9 @@ static const char *get_hist_field_flags(struct hist_field *hist_field) static void expr_field_str(struct hist_field *field, char *expr) { @@ -489,7 +496,7 @@ Signed-off-by: Sebastian Andrzej Siewior strcat(expr, hist_field_name(field, 0)); if (field->flags) { -@@ -742,6 +1100,11 @@ static struct hist_field *create_hist_fi +@@ -742,6 +1100,11 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, if (flags & HIST_FIELD_FL_EXPR) goto out; /* caller will populate */ @@ -501,7 +508,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; hist_field->size = sizeof(u64); -@@ -835,6 +1198,144 @@ static void destroy_hist_fields(struct h +@@ -835,6 +1198,144 @@ static void destroy_hist_fields(struct hist_trigger_data *hist_data) } } @@ -646,7 +653,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct ftrace_event_field * parse_field(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *field_str, unsigned long *flags) -@@ -891,10 +1392,40 @@ static struct hist_field *parse_atom(str +@@ -891,10 +1392,40 @@ static struct hist_field *parse_atom(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *str, unsigned long *flags, char *var_name) { @@ -687,7 +694,7 @@ Signed-off-by: Sebastian Andrzej Siewior field = parse_field(hist_data, file, str, flags); if (IS_ERR(field)) { ret = PTR_ERR(field); -@@ -1066,6 +1597,9 @@ static struct hist_field *parse_expr(str +@@ -1066,6 +1597,9 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, goto free; } @@ -697,7 +704,7 @@ Signed-off-by: Sebastian Andrzej Siewior expr->operands[0] = operand1; expr->operands[1] = operand2; expr->operator = field_op; -@@ -1238,6 +1772,12 @@ static int create_key_field(struct hist_ +@@ -1238,6 +1772,12 @@ static int create_key_field(struct hist_trigger_data *hist_data, goto out; } @@ -750,7 +757,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_hist_val_field(i, hist_data) { hist_field = hist_data->fields[i]; hist_val = hist_field->fn(hist_field, elt, rbe, rec); -@@ -1675,6 +2215,7 @@ static void event_hist_trigger(struct ev +@@ -1675,6 +2215,7 @@ static void event_hist_trigger(struct event_trigger_data *data, void *rec, struct hist_trigger_data *hist_data = data->private_data; bool use_compound_key = (hist_data->n_keys > 1); unsigned long entries[HIST_STACKTRACE_DEPTH]; @@ -758,7 +765,7 @@ Signed-off-by: Sebastian Andrzej Siewior char compound_key[HIST_KEY_SIZE_MAX]; struct tracing_map_elt *elt = NULL; struct stack_trace stacktrace; -@@ -1714,9 +2255,15 @@ static void event_hist_trigger(struct ev +@@ -1714,9 +2255,15 @@ static void event_hist_trigger(struct event_trigger_data *data, void *rec, if (use_compound_key) key = compound_key; @@ -776,7 +783,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void hist_trigger_stacktrace_print(struct seq_file *m, -@@ -1933,8 +2480,11 @@ static void hist_field_print(struct seq_ +@@ -1933,8 +2480,11 @@ static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) seq_puts(m, "common_timestamp"); @@ -789,7 +796,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_field->flags) { const char *flags_str = get_hist_field_flags(hist_field); -@@ -2074,7 +2624,11 @@ static void event_hist_trigger_free(stru +@@ -2074,7 +2624,11 @@ static void event_hist_trigger_free(struct event_trigger_ops *ops, if (!data->ref) { if (data->name) del_named_trigger(data); @@ -801,7 +808,7 @@ Signed-off-by: Sebastian Andrzej Siewior destroy_hist_data(hist_data); } } -@@ -2287,23 +2841,55 @@ static int hist_register_trigger(char *g +@@ -2287,23 +2841,55 @@ static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, goto out; } @@ -861,7 +868,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops, struct event_trigger_data *data, struct trace_event_file *file) -@@ -2336,11 +2922,30 @@ static void hist_unregister_trigger(char +@@ -2336,11 +2922,30 @@ static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops, } } @@ -892,7 +899,7 @@ Signed-off-by: Sebastian Andrzej Siewior list_for_each_entry_safe(test, n, &file->triggers, list) { if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { hist_data = test->private_data; -@@ -2416,6 +3021,11 @@ static int event_hist_trigger_func(struc +@@ -2416,6 +3021,11 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, } if (remove) { @@ -904,7 +911,7 @@ Signed-off-by: Sebastian Andrzej Siewior cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); ret = 0; goto out_free; -@@ -2433,14 +3043,33 @@ static int event_hist_trigger_func(struc +@@ -2433,14 +3043,33 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, goto out_free; } else if (ret < 0) goto out_free; @@ -938,9 +945,11 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(trigger_data); destroy_hist_data(hist_data); +diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c +index 9b0fe3198932..a7a5bed9ce06 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c -@@ -909,6 +909,12 @@ void set_named_trigger_data(struct event +@@ -909,6 +909,12 @@ void set_named_trigger_data(struct event_trigger_data *data, data->named_data = named_data; } @@ -953,3 +962,6 @@ Signed-off-by: Sebastian Andrzej Siewior static void traceon_trigger(struct event_trigger_data *data, void *rec, struct ring_buffer_event *event) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0102-0031-tracing-Add-hist-trigger-action-hook.patch b/kernel/patches-4.14.x-rt/0102-0102-tracing-Add-hist-trigger-action-hook.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0102-0031-tracing-Add-hist-trigger-action-hook.patch rename to kernel/patches-4.14.x-rt/0102-0102-tracing-Add-hist-trigger-action-hook.patch index 203bf614c..5f7697a0b 100644 --- a/kernel/patches-4.14.x-rt/0102-0031-tracing-Add-hist-trigger-action-hook.patch +++ b/kernel/patches-4.14.x-rt/0102-0102-tracing-Add-hist-trigger-action-hook.patch @@ -1,6 +1,7 @@ +From e77672ca241c7e563c80bfffcd0a4b6967166130 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:57 -0600 -Subject: [PATCH 31/48] tracing: Add hist trigger action hook +Subject: [PATCH 102/414] tracing: Add hist trigger action hook Add a hook for executing extra actions whenever a histogram entry is added or updated. @@ -20,12 +21,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit b91ae245c2f781e6da0532d8545f51a0f1291cc0) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 106 ++++++++++++++++++++++++++++++++++++++- + kernel/trace/trace_events_hist.c | 106 ++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 2bc1f76915ef..e5fea3cf60e9 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -33,6 +33,7 @@ typedef u64 (*hist_field_fn_t) (struct h +@@ -33,6 +33,7 @@ typedef u64 (*hist_field_fn_t) (struct hist_field *field, #define HIST_FIELD_OPERANDS_MAX 2 #define HIST_FIELDS_MAX (TRACING_MAP_FIELDS_MAX + TRACING_MAP_VARS_MAX) @@ -65,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_timestamp(struct hist_field *hist_field, -@@ -764,6 +783,9 @@ static void destroy_hist_trigger_attrs(s +@@ -764,6 +783,9 @@ static void destroy_hist_trigger_attrs(struct hist_trigger_attrs *attrs) for (i = 0; i < attrs->n_assignments; i++) kfree(attrs->assignment_str[i]); @@ -75,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(attrs->name); kfree(attrs->sort_key_str); kfree(attrs->keys_str); -@@ -771,6 +793,16 @@ static void destroy_hist_trigger_attrs(s +@@ -771,6 +793,16 @@ static void destroy_hist_trigger_attrs(struct hist_trigger_attrs *attrs) kfree(attrs); } @@ -92,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int parse_assignment(char *str, struct hist_trigger_attrs *attrs) { int ret = 0; -@@ -854,8 +886,9 @@ static struct hist_trigger_attrs *parse_ +@@ -854,8 +886,9 @@ static struct hist_trigger_attrs *parse_hist_trigger_attrs(char *trigger_str) else if (strcmp(str, "clear") == 0) attrs->clear = true; else { @@ -104,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -2047,11 +2080,55 @@ static int create_sort_keys(struct hist_ +@@ -2047,11 +2080,55 @@ static int create_sort_keys(struct hist_trigger_data *hist_data) return ret; } @@ -171,7 +174,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = create_hist_fields(hist_data, file); if (ret) goto free; -@@ -2209,6 +2290,20 @@ static inline void add_to_key(char *comp +@@ -2209,6 +2290,20 @@ static inline void add_to_key(char *compound_key, void *key, memcpy(compound_key + key_field->offset, key, size); } @@ -192,7 +195,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void event_hist_trigger(struct event_trigger_data *data, void *rec, struct ring_buffer_event *rbe) { -@@ -2264,6 +2359,9 @@ static void event_hist_trigger(struct ev +@@ -2264,6 +2359,9 @@ static void event_hist_trigger(struct event_trigger_data *data, void *rec, return; hist_trigger_elt_update(hist_data, elt, rec, rbe, var_ref_vals); @@ -202,7 +205,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void hist_trigger_stacktrace_print(struct seq_file *m, -@@ -3050,6 +3148,10 @@ static int event_hist_trigger_func(struc +@@ -3050,6 +3148,10 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, if (has_hist_vars(hist_data)) save_hist_vars(hist_data); @@ -213,3 +216,6 @@ Signed-off-by: Sebastian Andrzej Siewior ret = tracing_map_init(hist_data->map); if (ret) goto out_unreg; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0103-0032-tracing-Add-support-for-synthetic-events.patch b/kernel/patches-4.14.x-rt/0103-0103-tracing-Add-support-for-synthetic-events.patch similarity index 96% rename from kernel/patches-4.14.x-rt/0103-0032-tracing-Add-support-for-synthetic-events.patch rename to kernel/patches-4.14.x-rt/0103-0103-tracing-Add-support-for-synthetic-events.patch index 1873064cd..3e2151287 100644 --- a/kernel/patches-4.14.x-rt/0103-0032-tracing-Add-support-for-synthetic-events.patch +++ b/kernel/patches-4.14.x-rt/0103-0103-tracing-Add-support-for-synthetic-events.patch @@ -1,6 +1,7 @@ +From c5f7ae6e4f9b0a3f8cd60c0127fbee8e42d51327 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:58 -0600 -Subject: [PATCH 32/48] tracing: Add support for 'synthetic' events +Subject: [PATCH 103/414] tracing: Add support for 'synthetic' events Synthetic events are user-defined events generated from hist trigger variables saved from one or more other events. @@ -53,9 +54,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit cc9371f8641efd7ce6c8d4e1fd44eae249deadb4) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 895 ++++++++++++++++++++++++++++++++++++++- + kernel/trace/trace_events_hist.c | 895 ++++++++++++++++++++++++++++++- 1 file changed, 893 insertions(+), 2 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index e5fea3cf60e9..ababc289835c 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -20,10 +20,16 @@ @@ -893,7 +896,7 @@ Signed-off-by: Sebastian Andrzej Siewior static u64 hist_field_timestamp(struct hist_field *hist_field, struct tracing_map_elt *elt, struct ring_buffer_event *rbe, -@@ -2965,6 +3775,28 @@ static int hist_trigger_enable(struct ev +@@ -2965,6 +3775,28 @@ static int hist_trigger_enable(struct event_trigger_data *data, return ret; } @@ -922,7 +925,7 @@ Signed-off-by: Sebastian Andrzej Siewior static bool hist_trigger_check_refs(struct event_trigger_data *data, struct trace_event_file *file) { -@@ -3040,6 +3872,8 @@ static void hist_unreg_all(struct trace_ +@@ -3040,6 +3872,8 @@ static void hist_unreg_all(struct trace_event_file *file) { struct event_trigger_data *test, *n; struct hist_trigger_data *hist_data; @@ -931,7 +934,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_file_check_refs(file)) return; -@@ -3049,6 +3883,14 @@ static void hist_unreg_all(struct trace_ +@@ -3049,6 +3883,14 @@ static void hist_unreg_all(struct trace_event_file *file) hist_data = test->private_data; list_del_rcu(&test->list); trace_event_trigger_enable_disable(file, 0); @@ -946,7 +949,7 @@ Signed-off-by: Sebastian Andrzej Siewior update_cond_flag(file); if (hist_data->enable_timestamps) tracing_set_time_stamp_abs(file->tr, false); -@@ -3067,6 +3909,8 @@ static int event_hist_trigger_func(struc +@@ -3067,6 +3909,8 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, struct hist_trigger_attrs *attrs; struct event_trigger_ops *trigger_ops; struct hist_trigger_data *hist_data; @@ -955,7 +958,7 @@ Signed-off-by: Sebastian Andrzej Siewior bool remove = false; char *trigger; int ret = 0; -@@ -3097,10 +3941,11 @@ static int event_hist_trigger_func(struc +@@ -3097,10 +3941,11 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, trigger_ops = cmd_ops->get_trigger_ops(cmd, trigger); @@ -969,7 +972,7 @@ Signed-off-by: Sebastian Andrzej Siewior trigger_data->count = -1; trigger_data->ops = trigger_ops; -@@ -3119,12 +3964,23 @@ static int event_hist_trigger_func(struc +@@ -3119,12 +3964,23 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, } if (remove) { @@ -993,7 +996,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = 0; goto out_free; } -@@ -3160,6 +4016,13 @@ static int event_hist_trigger_func(struc +@@ -3160,6 +4016,13 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, if (ret) goto out_unreg; @@ -1007,7 +1010,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Just return zero, not the number of registered triggers */ ret = 0; out: -@@ -3332,3 +4195,31 @@ static __init void unregister_trigger_hi +@@ -3332,3 +4195,31 @@ __init int register_trigger_hist_enable_disable_cmds(void) return ret; } @@ -1039,3 +1042,6 @@ Signed-off-by: Sebastian Andrzej Siewior +} + +fs_initcall(trace_events_hist_init); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0104-0033-tracing-Add-support-for-field-variables.patch b/kernel/patches-4.14.x-rt/0104-0104-tracing-Add-support-for-field-variables.patch similarity index 93% rename from kernel/patches-4.14.x-rt/0104-0033-tracing-Add-support-for-field-variables.patch rename to kernel/patches-4.14.x-rt/0104-0104-tracing-Add-support-for-field-variables.patch index a155f63b7..a3e0bab29 100644 --- a/kernel/patches-4.14.x-rt/0104-0033-tracing-Add-support-for-field-variables.patch +++ b/kernel/patches-4.14.x-rt/0104-0104-tracing-Add-support-for-field-variables.patch @@ -1,6 +1,7 @@ +From b34fe7b2dde5aa450ec543d99a01aff523e8e37d Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:51:59 -0600 -Subject: [PATCH 33/48] tracing: Add support for 'field variables' +Subject: [PATCH 104/414] tracing: Add support for 'field variables' Users should be able to directly specify event fields in hist trigger 'actions' rather than being forced to explicitly create a variable for @@ -44,9 +45,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 5fcd8c6efab39371cb3ce51b8b391a43e83a94de) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 531 ++++++++++++++++++++++++++++++++++++++- + kernel/trace/trace_events_hist.c | 531 ++++++++++++++++++++++++++++++- 1 file changed, 530 insertions(+), 1 deletion(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index ababc289835c..0cf7cc32dee4 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -255,6 +255,16 @@ struct hist_trigger_attrs { @@ -79,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct synth_field { -@@ -1427,6 +1443,7 @@ static struct hist_field *find_event_var +@@ -1427,6 +1443,7 @@ static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, struct hist_elt_data { char *comm; u64 *var_ref_vals; @@ -87,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_var_ref(struct hist_field *hist_field, -@@ -1731,6 +1748,11 @@ static inline void save_comm(char *comm, +@@ -1731,6 +1748,11 @@ static inline void save_comm(char *comm, struct task_struct *task) static void hist_elt_data_free(struct hist_elt_data *elt_data) { @@ -99,7 +102,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(elt_data->comm); kfree(elt_data); } -@@ -1748,7 +1770,7 @@ static int hist_trigger_elt_data_alloc(s +@@ -1748,7 +1770,7 @@ static int hist_trigger_elt_data_alloc(struct tracing_map_elt *elt) unsigned int size = TASK_COMM_LEN; struct hist_elt_data *elt_data; struct hist_field *key_field; @@ -108,7 +111,7 @@ Signed-off-by: Sebastian Andrzej Siewior elt_data = kzalloc(sizeof(*elt_data), GFP_KERNEL); if (!elt_data) -@@ -1767,6 +1789,18 @@ static int hist_trigger_elt_data_alloc(s +@@ -1767,6 +1789,18 @@ static int hist_trigger_elt_data_alloc(struct tracing_map_elt *elt) } } @@ -127,7 +130,7 @@ Signed-off-by: Sebastian Andrzej Siewior elt->private_data = elt_data; return 0; -@@ -2473,6 +2507,470 @@ static struct hist_field *parse_expr(str +@@ -2473,6 +2507,470 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, return ERR_PTR(ret); } @@ -598,7 +601,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = -@@ -2928,6 +3426,16 @@ static int create_actions(struct hist_tr +@@ -2928,6 +3426,16 @@ static int create_actions(struct hist_trigger_data *hist_data, return ret; } @@ -615,7 +618,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_hist_data(struct hist_trigger_data *hist_data) { if (!hist_data) -@@ -2938,6 +3446,8 @@ static void destroy_hist_data(struct his +@@ -2938,6 +3446,8 @@ static void destroy_hist_data(struct hist_trigger_data *hist_data) tracing_map_destroy(hist_data->map); destroy_actions(hist_data); @@ -624,7 +627,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_data); } -@@ -3074,6 +3584,8 @@ static void hist_trigger_elt_update(stru +@@ -3074,6 +3584,8 @@ static void hist_trigger_elt_update(struct hist_trigger_data *hist_data, tracing_map_set_var(elt, var_idx, hist_val); } } @@ -633,7 +636,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline void add_to_key(char *compound_key, void *key, -@@ -3520,6 +4032,21 @@ static int event_hist_trigger_init(struc +@@ -3520,6 +4032,21 @@ static int event_hist_trigger_init(struct event_trigger_ops *ops, return 0; } @@ -655,7 +658,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void event_hist_trigger_free(struct event_trigger_ops *ops, struct event_trigger_data *data) { -@@ -3537,6 +4064,8 @@ static void event_hist_trigger_free(stru +@@ -3537,6 +4064,8 @@ static void event_hist_trigger_free(struct event_trigger_ops *ops, remove_hist_vars(hist_data); @@ -664,3 +667,6 @@ Signed-off-by: Sebastian Andrzej Siewior destroy_hist_data(hist_data); } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0105-0034-tracing-Add-onmatch-hist-trigger-action-support.patch b/kernel/patches-4.14.x-rt/0105-0105-tracing-Add-onmatch-hist-trigger-action-support.patch similarity index 91% rename from kernel/patches-4.14.x-rt/0105-0034-tracing-Add-onmatch-hist-trigger-action-support.patch rename to kernel/patches-4.14.x-rt/0105-0105-tracing-Add-onmatch-hist-trigger-action-support.patch index 04b6a43e0..5e6436f4c 100644 --- a/kernel/patches-4.14.x-rt/0105-0034-tracing-Add-onmatch-hist-trigger-action-support.patch +++ b/kernel/patches-4.14.x-rt/0105-0105-tracing-Add-onmatch-hist-trigger-action-support.patch @@ -1,6 +1,7 @@ +From e334b24a4cdeb77d5d17051949b6c122bf8fa9c3 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:00 -0600 -Subject: [PATCH 34/48] tracing: Add 'onmatch' hist trigger action support +Subject: [PATCH 105/414] tracing: Add 'onmatch' hist trigger action support Add an 'onmatch(matching.event).(param list)' hist trigger action which is invoked with the set of variables or @@ -46,9 +47,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit ea82307e63ec125d8612d8cedd2618669f674226) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 488 +++++++++++++++++++++++++++++++++++++-- + kernel/trace/trace_events_hist.c | 488 ++++++++++++++++++++++++++++++- 1 file changed, 475 insertions(+), 13 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 0cf7cc32dee4..34be7af7cc1f 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -285,6 +285,8 @@ struct hist_trigger_data { @@ -60,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct field_var *field_vars[SYNTH_FIELDS_MAX]; unsigned int n_field_vars; unsigned int n_field_var_str; -@@ -321,7 +323,18 @@ typedef void (*action_fn_t) (struct hist +@@ -321,7 +323,18 @@ typedef void (*action_fn_t) (struct hist_trigger_data *hist_data, struct action_data { action_fn_t fn; @@ -80,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static LIST_HEAD(synth_event_list); -@@ -887,6 +900,21 @@ static struct synth_event *alloc_synth_e +@@ -887,6 +900,21 @@ static struct synth_event *alloc_synth_event(char *event_name, int n_fields, return event; } @@ -102,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void add_or_delete_synth_event(struct synth_event *event, int delete) { if (delete) -@@ -1124,11 +1152,6 @@ static u64 hist_field_timestamp(struct h +@@ -1124,11 +1152,6 @@ static u64 hist_field_timestamp(struct hist_field *hist_field, return ts; } @@ -114,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field * check_field_for_var_ref(struct hist_field *hist_field, struct hist_trigger_data *var_data, -@@ -1194,6 +1217,14 @@ static struct hist_field *find_var_ref(s +@@ -1194,6 +1217,14 @@ static struct hist_field *find_var_ref(struct hist_trigger_data *hist_data, return found; } @@ -129,7 +132,7 @@ Signed-off-by: Sebastian Andrzej Siewior return found; } -@@ -1422,6 +1453,37 @@ static struct hist_field *find_file_var( +@@ -1422,6 +1453,37 @@ static struct hist_field *find_file_var(struct trace_event_file *file, return NULL; } @@ -167,7 +170,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, char *system, char *event_name, -@@ -1431,6 +1493,14 @@ static struct hist_field *find_event_var +@@ -1431,6 +1493,14 @@ static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, struct hist_field *hist_field = NULL; struct trace_event_file *file; @@ -182,7 +185,7 @@ Signed-off-by: Sebastian Andrzej Siewior file = find_var_file(tr, system, event_name, var_name); if (!file) return NULL; -@@ -1622,11 +1692,21 @@ static void destroy_hist_trigger_attrs(s +@@ -1622,11 +1692,21 @@ static void destroy_hist_trigger_attrs(struct hist_trigger_attrs *attrs) static int parse_action(char *str, struct hist_trigger_attrs *attrs) { @@ -205,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2635,7 +2715,7 @@ find_synthetic_field_var(struct hist_tri +@@ -2635,7 +2715,7 @@ find_synthetic_field_var(struct hist_trigger_data *target_hist_data, * * Return: The variable created for the field. */ @@ -214,7 +217,7 @@ Signed-off-by: Sebastian Andrzej Siewior create_field_var_hist(struct hist_trigger_data *target_hist_data, char *subsys_name, char *event_name, char *field_name) { -@@ -2748,7 +2828,7 @@ create_field_var_hist(struct hist_trigge +@@ -2748,7 +2828,7 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data, return event_var; } @@ -223,7 +226,7 @@ Signed-off-by: Sebastian Andrzej Siewior find_target_event_var(struct hist_trigger_data *hist_data, char *subsys_name, char *event_name, char *var_name) { -@@ -2919,7 +2999,7 @@ static struct field_var *create_field_va +@@ -2919,7 +2999,7 @@ static struct field_var *create_field_var(struct hist_trigger_data *hist_data, * * Return: The variable created for the field. */ @@ -232,7 +235,7 @@ Signed-off-by: Sebastian Andrzej Siewior create_target_field_var(struct hist_trigger_data *target_hist_data, char *subsys_name, char *event_name, char *var_name) { -@@ -2943,6 +3023,27 @@ create_target_field_var(struct hist_trig +@@ -2943,6 +3023,27 @@ create_target_field_var(struct hist_trigger_data *target_hist_data, return create_field_var(target_hist_data, file, var_name); } @@ -260,7 +263,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_field_var(struct field_var *field_var) { if (!field_var) -@@ -2962,8 +3063,8 @@ static void destroy_field_vars(struct hi +@@ -2962,8 +3063,8 @@ static void destroy_field_vars(struct hist_trigger_data *hist_data) destroy_field_var(hist_data->field_vars[i]); } @@ -271,7 +274,7 @@ Signed-off-by: Sebastian Andrzej Siewior { hist_data->field_vars[hist_data->n_field_vars++] = field_var; -@@ -2971,6 +3072,304 @@ void save_field_var(struct hist_trigger_ +@@ -2971,6 +3072,304 @@ void save_field_var(struct hist_trigger_data *hist_data, hist_data->n_field_var_str++; } @@ -576,7 +579,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = -@@ -3395,18 +3794,39 @@ static void destroy_actions(struct hist_ +@@ -3395,18 +3794,39 @@ static void destroy_actions(struct hist_trigger_data *hist_data) for (i = 0; i < hist_data->n_actions; i++) { struct action_data *data = hist_data->actions[i]; @@ -617,7 +620,7 @@ Signed-off-by: Sebastian Andrzej Siewior } return ret; -@@ -3421,11 +3841,50 @@ static int create_actions(struct hist_tr +@@ -3421,11 +3841,50 @@ static int create_actions(struct hist_trigger_data *hist_data, for (i = 0; i < hist_data->attrs->n_actions; i++) { data = hist_data->actions[i]; @@ -668,7 +671,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_field_var_hists(struct hist_trigger_data *hist_data) { unsigned int i; -@@ -3448,6 +3907,7 @@ static void destroy_hist_data(struct his +@@ -3448,6 +3907,7 @@ static void destroy_hist_data(struct hist_trigger_data *hist_data) destroy_actions(hist_data); destroy_field_vars(hist_data); destroy_field_var_hists(hist_data); @@ -676,7 +679,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_data); } -@@ -4006,6 +4466,8 @@ static int event_hist_trigger_print(stru +@@ -4006,6 +4466,8 @@ static int event_hist_trigger_print(struct seq_file *m, } seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits)); @@ -685,3 +688,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (data->filter_str) seq_printf(m, " if %s", data->filter_str); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0106-0035-tracing-Add-onmax-hist-trigger-action-support.patch b/kernel/patches-4.14.x-rt/0106-0106-tracing-Add-onmax-hist-trigger-action-support.patch similarity index 92% rename from kernel/patches-4.14.x-rt/0106-0035-tracing-Add-onmax-hist-trigger-action-support.patch rename to kernel/patches-4.14.x-rt/0106-0106-tracing-Add-onmax-hist-trigger-action-support.patch index 57f3d28ef..fb073a32a 100644 --- a/kernel/patches-4.14.x-rt/0106-0035-tracing-Add-onmax-hist-trigger-action-support.patch +++ b/kernel/patches-4.14.x-rt/0106-0106-tracing-Add-onmax-hist-trigger-action-support.patch @@ -1,6 +1,7 @@ +From e7741c22a08be2d40aa16c5445ce7c69ea699230 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:01 -0600 -Subject: [PATCH 35/48] tracing: Add 'onmax' hist trigger action support +Subject: [PATCH 106/414] tracing: Add 'onmax' hist trigger action support Add an 'onmax(var).save(field,...)' hist trigger action which is invoked whenever an event exceeds the current maximum. @@ -58,9 +59,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 4e30c922f0a19496ff424edd5c473666e1690601) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 331 ++++++++++++++++++++++++++++++++++----- + kernel/trace/trace_events_hist.c | 331 +++++++++++++++++++++++++++---- 1 file changed, 296 insertions(+), 35 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 34be7af7cc1f..0803b843623c 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -292,6 +292,10 @@ struct hist_trigger_data { @@ -89,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; }; -@@ -1697,7 +1709,8 @@ static int parse_action(char *str, struc +@@ -1697,7 +1709,8 @@ static int parse_action(char *str, struct hist_trigger_attrs *attrs) if (attrs->n_actions >= HIST_ACTIONS_MAX) return ret; @@ -99,7 +102,7 @@ Signed-off-by: Sebastian Andrzej Siewior attrs->action_str[attrs->n_actions] = kstrdup(str, GFP_KERNEL); if (!attrs->action_str[attrs->n_actions]) { ret = -ENOMEM; -@@ -1869,7 +1882,7 @@ static int hist_trigger_elt_data_alloc(s +@@ -1869,7 +1882,7 @@ static int hist_trigger_elt_data_alloc(struct tracing_map_elt *elt) } } @@ -108,7 +111,7 @@ Signed-off-by: Sebastian Andrzej Siewior size = STR_VAR_LEN_MAX; -@@ -2894,6 +2907,15 @@ static void update_field_vars(struct his +@@ -2894,6 +2907,15 @@ static void update_field_vars(struct hist_trigger_data *hist_data, hist_data->n_field_vars, 0); } @@ -124,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field *create_var(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *name, int size, const char *type) -@@ -3023,6 +3045,227 @@ create_target_field_var(struct hist_trig +@@ -3023,6 +3045,227 @@ create_target_field_var(struct hist_trigger_data *target_hist_data, return create_field_var(target_hist_data, file, var_name); } @@ -352,7 +355,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void onmatch_destroy(struct action_data *data) { unsigned int i; -@@ -3107,39 +3350,6 @@ static int check_synth_field(struct synt +@@ -3107,39 +3350,6 @@ static int check_synth_field(struct synth_event *event, return 0; } @@ -392,7 +395,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field * onmatch_find_var(struct hist_trigger_data *hist_data, struct action_data *data, char *system, char *event, char *var) -@@ -3796,6 +4006,8 @@ static void destroy_actions(struct hist_ +@@ -3796,6 +4006,8 @@ static void destroy_actions(struct hist_trigger_data *hist_data) if (data->fn == action_trace) onmatch_destroy(data); @@ -401,7 +404,7 @@ Signed-off-by: Sebastian Andrzej Siewior else kfree(data); } -@@ -3821,6 +4033,15 @@ static int parse_actions(struct hist_tri +@@ -3821,6 +4033,15 @@ static int parse_actions(struct hist_trigger_data *hist_data) break; } data->fn = action_trace; @@ -417,7 +420,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else { ret = -EINVAL; break; -@@ -3846,12 +4067,48 @@ static int create_actions(struct hist_tr +@@ -3846,12 +4067,48 @@ static int create_actions(struct hist_trigger_data *hist_data, ret = onmatch_create(hist_data, file, data); if (ret) return ret; @@ -466,7 +469,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void print_onmatch_spec(struct seq_file *m, struct hist_trigger_data *hist_data, struct action_data *data) -@@ -3882,6 +4139,8 @@ static void print_actions_spec(struct se +@@ -3882,6 +4139,8 @@ static void print_actions_spec(struct seq_file *m, if (data->fn == action_trace) print_onmatch_spec(m, hist_data, data); @@ -475,7 +478,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -4263,6 +4522,8 @@ hist_trigger_entry_print(struct seq_file +@@ -4263,6 +4522,8 @@ hist_trigger_entry_print(struct seq_file *m, } } @@ -484,3 +487,6 @@ Signed-off-by: Sebastian Andrzej Siewior seq_puts(m, "\n"); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0107-0036-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch b/kernel/patches-4.14.x-rt/0107-0107-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0107-0036-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch rename to kernel/patches-4.14.x-rt/0107-0107-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch index 3d306b171..572dd05cf 100644 --- a/kernel/patches-4.14.x-rt/0107-0036-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch +++ b/kernel/patches-4.14.x-rt/0107-0107-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch @@ -1,6 +1,7 @@ +From 8cd514fab04b97ab449cb404675253c638094ad6 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:02 -0600 -Subject: [PATCH 36/48] tracing: Allow whitespace to surround hist trigger +Subject: [PATCH 107/414] tracing: Allow whitespace to surround hist trigger filter The existing code only allows for one space before and after the 'if' @@ -17,12 +18,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit ab257ec0f8eb50c58fafd50b1cb5352553f31ccf) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 37 ++++++++++++++++++++++++++++++++----- + kernel/trace/trace_events_hist.c | 37 +++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 0803b843623c..0b73852f6923 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -5164,7 +5164,7 @@ static int event_hist_trigger_func(struc +@@ -5164,7 +5164,7 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, struct synth_event *se; const char *se_name; bool remove = false; @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior int ret = 0; if (!param) -@@ -5173,10 +5173,37 @@ static int event_hist_trigger_func(struc +@@ -5173,10 +5173,37 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, if (glob[0] == '!') remove = true; @@ -73,3 +76,6 @@ Signed-off-by: Sebastian Andrzej Siewior attrs = parse_hist_trigger_attrs(trigger); if (IS_ERR(attrs)) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0108-0037-tracing-Add-cpu-field-for-hist-triggers.patch b/kernel/patches-4.14.x-rt/0108-0108-tracing-Add-cpu-field-for-hist-triggers.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0108-0037-tracing-Add-cpu-field-for-hist-triggers.patch rename to kernel/patches-4.14.x-rt/0108-0108-tracing-Add-cpu-field-for-hist-triggers.patch index 80f1abacf..ae83c300b 100644 --- a/kernel/patches-4.14.x-rt/0108-0037-tracing-Add-cpu-field-for-hist-triggers.patch +++ b/kernel/patches-4.14.x-rt/0108-0108-tracing-Add-cpu-field-for-hist-triggers.patch @@ -1,6 +1,7 @@ +From 3775fd3850e712de87dbec398ef5f2849e846f47 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:03 -0600 -Subject: [PATCH 37/48] tracing: Add cpu field for hist triggers +Subject: [PATCH 108/414] tracing: Add cpu field for hist triggers A common key to use in a histogram is the cpuid - add a new cpu 'synthetic' field named 'cpu' for that purpose. @@ -12,10 +13,12 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 4bfaa88f0e0e98e706d57647452e4d37afd78d00) Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 15 +++++++++++++++ - kernel/trace/trace_events_hist.c | 28 +++++++++++++++++++++++++++- + Documentation/trace/histogram.txt | 15 +++++++++++++++ + kernel/trace/trace_events_hist.c | 28 +++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) +diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt +index 25c94730d3fe..be612ca79455 100644 --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt @@ -172,6 +172,21 @@ @@ -40,6 +43,8 @@ Signed-off-by: Sebastian Andrzej Siewior 6.2 'hist' trigger examples --------------------------- +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 0b73852f6923..34a2e8d0a052 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -227,6 +227,7 @@ enum hist_field_flags { @@ -50,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct var_defs { -@@ -1164,6 +1165,16 @@ static u64 hist_field_timestamp(struct h +@@ -1164,6 +1165,16 @@ static u64 hist_field_timestamp(struct hist_field *hist_field, return ts; } @@ -67,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field * check_field_for_var_ref(struct hist_field *hist_field, struct hist_trigger_data *var_data, -@@ -1602,6 +1613,8 @@ static const char *hist_field_name(struc +@@ -1602,6 +1613,8 @@ static const char *hist_field_name(struct hist_field *field, field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) field_name = "common_timestamp"; @@ -76,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior else if (field->flags & HIST_FIELD_FL_EXPR || field->flags & HIST_FIELD_FL_VAR_REF) { if (field->system) { -@@ -2109,6 +2122,15 @@ static struct hist_field *create_hist_fi +@@ -2109,6 +2122,15 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, goto out; } @@ -92,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON_ONCE(!field)) goto out; -@@ -2345,7 +2367,9 @@ parse_field(struct hist_trigger_data *hi +@@ -2345,7 +2367,9 @@ parse_field(struct hist_trigger_data *hist_data, struct trace_event_file *file, hist_data->enable_timestamps = true; if (*flags & HIST_FIELD_FL_TIMESTAMP_USECS) hist_data->attrs->ts_in_usecs = true; @@ -103,7 +108,7 @@ Signed-off-by: Sebastian Andrzej Siewior field = trace_find_event_field(file->event_call, field_name); if (!field || !field->size) { field = ERR_PTR(-EINVAL); -@@ -4621,6 +4645,8 @@ static void hist_field_print(struct seq_ +@@ -4621,6 +4645,8 @@ static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) seq_puts(m, "common_timestamp"); @@ -112,3 +117,6 @@ Signed-off-by: Sebastian Andrzej Siewior else if (field_name) { if (hist_field->flags & HIST_FIELD_FL_VAR_REF) seq_putc(m, '$'); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0109-0038-tracing-Add-hist-trigger-support-for-variable-refere.patch b/kernel/patches-4.14.x-rt/0109-0109-tracing-Add-hist-trigger-support-for-variable-refere.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0109-0038-tracing-Add-hist-trigger-support-for-variable-refere.patch rename to kernel/patches-4.14.x-rt/0109-0109-tracing-Add-hist-trigger-support-for-variable-refere.patch index f1a34d221..2da4f5dbf 100644 --- a/kernel/patches-4.14.x-rt/0109-0038-tracing-Add-hist-trigger-support-for-variable-refere.patch +++ b/kernel/patches-4.14.x-rt/0109-0109-tracing-Add-hist-trigger-support-for-variable-refere.patch @@ -1,6 +1,7 @@ +From 07c2f31bfb845cf9f7aff932a4382d62198d66c0 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:04 -0600 -Subject: [PATCH 38/48] tracing: Add hist trigger support for variable +Subject: [PATCH 109/414] tracing: Add hist trigger support for variable reference aliases Add support for alias=$somevar where alias can be used as @@ -27,9 +28,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 53c5a4f99f1a5f6ba304453716da571f3e51bc79) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 74 +++++++++++++++++++++++++++++++++++---- + kernel/trace/trace_events_hist.c | 74 +++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 7 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 34a2e8d0a052..c8cfc56ff3ae 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -228,6 +228,7 @@ enum hist_field_flags { @@ -40,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct var_defs { -@@ -1609,7 +1610,8 @@ static const char *hist_field_name(struc +@@ -1609,7 +1610,8 @@ static const char *hist_field_name(struct hist_field *field, if (field->field) field_name = field->field->name; @@ -50,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) field_name = "common_timestamp"; -@@ -2080,7 +2082,7 @@ static struct hist_field *create_hist_fi +@@ -2080,7 +2082,7 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, hist_field->hist_data = hist_data; @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; /* caller will populate */ if (flags & HIST_FIELD_FL_VAR_REF) { -@@ -2217,10 +2219,18 @@ static int init_var_ref(struct hist_fiel +@@ -2217,10 +2219,18 @@ static int init_var_ref(struct hist_field *ref_field, } } @@ -82,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior } ref_field->type = kstrdup(var_field->type, GFP_KERNEL); -@@ -2382,6 +2392,28 @@ parse_field(struct hist_trigger_data *hi +@@ -2382,6 +2392,28 @@ parse_field(struct hist_trigger_data *hist_data, struct trace_event_file *file, return field; } @@ -111,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field *parse_atom(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *str, unsigned long *flags, char *var_name) -@@ -2415,6 +2447,13 @@ static struct hist_field *parse_atom(str +@@ -2415,6 +2447,13 @@ static struct hist_field *parse_atom(struct hist_trigger_data *hist_data, if (hist_field) { hist_data->var_refs[hist_data->n_var_refs] = hist_field; hist_field->var_ref_idx = hist_data->n_var_refs++; @@ -125,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior return hist_field; } } else -@@ -2515,6 +2554,26 @@ static int check_expr_operands(struct hi +@@ -2515,6 +2554,26 @@ static int check_expr_operands(struct hist_field *operand1, unsigned long operand1_flags = operand1->flags; unsigned long operand2_flags = operand2->flags; @@ -152,7 +155,7 @@ Signed-off-by: Sebastian Andrzej Siewior if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) != (operand2_flags & HIST_FIELD_FL_TIMESTAMP_USECS)) return -EINVAL; -@@ -4648,7 +4707,8 @@ static void hist_field_print(struct seq_ +@@ -4648,7 +4707,8 @@ static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) else if (hist_field->flags & HIST_FIELD_FL_CPU) seq_puts(m, "cpu"); else if (field_name) { @@ -162,3 +165,6 @@ Signed-off-by: Sebastian Andrzej Siewior seq_putc(m, '$'); seq_printf(m, "%s", field_name); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0110-0039-tracing-Add-last-error-error-facility-for-hist-trigg.patch b/kernel/patches-4.14.x-rt/0110-0110-tracing-Add-last-error-error-facility-for-hist-trigg.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0110-0039-tracing-Add-last-error-error-facility-for-hist-trigg.patch rename to kernel/patches-4.14.x-rt/0110-0110-tracing-Add-last-error-error-facility-for-hist-trigg.patch index 1d99c35cb..777fb3e24 100644 --- a/kernel/patches-4.14.x-rt/0110-0039-tracing-Add-last-error-error-facility-for-hist-trigg.patch +++ b/kernel/patches-4.14.x-rt/0110-0110-tracing-Add-last-error-error-facility-for-hist-trigg.patch @@ -1,6 +1,7 @@ +From 899779d78073a613fa925a4609df88908baeb7b8 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:05 -0600 -Subject: [PATCH 39/48] tracing: Add 'last error' error facility for hist +Subject: [PATCH 110/414] tracing: Add 'last error' error facility for hist triggers With the addition of variables and actions, it's become necessary to @@ -29,10 +30,12 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 215016863b5ec1ee5db5e20f32ffe015a497209f) Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 20 ++++ - kernel/trace/trace_events_hist.c | 164 ++++++++++++++++++++++++++++++++++---- + Documentation/trace/histogram.txt | 20 ++++ + kernel/trace/trace_events_hist.c | 164 +++++++++++++++++++++++++++--- 2 files changed, 170 insertions(+), 14 deletions(-) +diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt +index be612ca79455..0aec2d8e166b 100644 --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt @@ -188,6 +188,26 @@ @@ -62,6 +65,8 @@ Signed-off-by: Sebastian Andrzej Siewior 6.2 'hist' trigger examples --------------------------- +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index c8cfc56ff3ae..3856f173559a 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -351,6 +351,65 @@ struct action_data { @@ -130,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior static LIST_HEAD(synth_event_list); static DEFINE_MUTEX(synth_event_mutex); -@@ -1448,8 +1507,10 @@ static struct trace_event_file *find_var +@@ -1448,8 +1507,10 @@ static struct trace_event_file *find_var_file(struct trace_array *tr, continue; if (find_var_field(var_hist_data, var_name)) { @@ -142,7 +147,7 @@ Signed-off-by: Sebastian Andrzej Siewior found = file; } -@@ -1498,6 +1559,7 @@ find_match_var(struct hist_trigger_data +@@ -1498,6 +1559,7 @@ find_match_var(struct hist_trigger_data *hist_data, char *var_name) hist_field = find_file_var(file, var_name); if (hist_field) { if (found) { @@ -150,7 +155,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ERR_PTR(-EINVAL); } -@@ -1781,6 +1843,7 @@ static int parse_assignment(char *str, s +@@ -1781,6 +1843,7 @@ static int parse_assignment(char *str, struct hist_trigger_attrs *attrs) char *assignment; if (attrs->n_assignments == TRACING_MAP_VARS_MAX) { @@ -158,7 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -2335,6 +2398,10 @@ static struct hist_field *parse_var_ref( +@@ -2335,6 +2398,10 @@ static struct hist_field *parse_var_ref(struct hist_trigger_data *hist_data, if (var_field) ref_field = create_var_ref(var_field, system, event_name); @@ -169,7 +174,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ref_field; } -@@ -2494,6 +2561,7 @@ static struct hist_field *parse_unary(st +@@ -2494,6 +2561,7 @@ static struct hist_field *parse_unary(struct hist_trigger_data *hist_data, // we support only -(xxx) i.e. explicit parens required if (level > 3) { @@ -177,7 +182,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto free; } -@@ -2575,8 +2643,10 @@ static int check_expr_operands(struct hi +@@ -2575,8 +2643,10 @@ static int check_expr_operands(struct hist_field *operand1, } if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) != @@ -189,7 +194,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -2591,8 +2661,10 @@ static struct hist_field *parse_expr(str +@@ -2591,8 +2661,10 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, int field_op, ret = -EINVAL; char *sep, *operand1_str; @@ -201,7 +206,7 @@ Signed-off-by: Sebastian Andrzej Siewior field_op = contains_operator(str); -@@ -2826,12 +2898,17 @@ create_field_var_hist(struct hist_trigge +@@ -2826,12 +2898,17 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data, char *cmd; int ret; @@ -220,7 +225,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = PTR_ERR(file); return ERR_PTR(ret); } -@@ -2843,8 +2920,11 @@ create_field_var_hist(struct hist_trigge +@@ -2843,8 +2920,11 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data, * yet a registered histogram so we can't use that. */ hist_data = find_compatible_hist(target_hist_data, file); @@ -233,7 +238,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* See if a synthetic field variable has already been created */ event_var = find_synthetic_field_var(target_hist_data, subsys_name, -@@ -2903,6 +2983,8 @@ create_field_var_hist(struct hist_trigge +@@ -2903,6 +2983,8 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data, kfree(cmd); kfree(var_hist->cmd); kfree(var_hist); @@ -242,7 +247,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ERR_PTR(ret); } -@@ -2914,6 +2996,8 @@ create_field_var_hist(struct hist_trigge +@@ -2914,6 +2996,8 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data, if (IS_ERR_OR_NULL(event_var)) { kfree(var_hist->cmd); kfree(var_hist); @@ -251,7 +256,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ERR_PTR(-EINVAL); } -@@ -3050,18 +3134,21 @@ static struct field_var *create_field_va +@@ -3050,18 +3134,21 @@ static struct field_var *create_field_var(struct hist_trigger_data *hist_data, int ret = 0; if (hist_data->n_field_vars >= SYNTH_FIELDS_MAX) { @@ -273,7 +278,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(val); ret = PTR_ERR(var); goto err; -@@ -3204,13 +3291,17 @@ static int onmax_create(struct hist_trig +@@ -3204,13 +3291,17 @@ static int onmax_create(struct hist_trigger_data *hist_data, int ret = 0; onmax_var_str = data->onmax.var_str; @@ -293,7 +298,7 @@ Signed-off-by: Sebastian Andrzej Siewior flags = HIST_FIELD_FL_VAR_REF; ref_field = create_hist_field(hist_data, NULL, flags, NULL); -@@ -3230,6 +3321,7 @@ static int onmax_create(struct hist_trig +@@ -3230,6 +3321,7 @@ static int onmax_create(struct hist_trigger_data *hist_data, data->onmax.max_var_ref_idx = var_ref_idx; max_var = create_var(hist_data, file, "max", sizeof(u64), "u64"); if (IS_ERR(max_var)) { @@ -301,7 +306,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = PTR_ERR(max_var); goto out; } -@@ -3244,6 +3336,7 @@ static int onmax_create(struct hist_trig +@@ -3244,6 +3336,7 @@ static int onmax_create(struct hist_trigger_data *hist_data, field_var = create_target_field_var(hist_data, NULL, NULL, param); if (IS_ERR(field_var)) { @@ -309,7 +314,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = PTR_ERR(field_var); kfree(param); goto out; -@@ -3276,6 +3369,7 @@ static int parse_action_params(char *par +@@ -3276,6 +3369,7 @@ static int parse_action_params(char *params, struct action_data *data) param = strstrip(param); if (strlen(param) < 2) { @@ -317,7 +322,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -3451,6 +3545,9 @@ onmatch_find_var(struct hist_trigger_dat +@@ -3451,6 +3545,9 @@ onmatch_find_var(struct hist_trigger_data *hist_data, struct action_data *data, hist_field = find_event_var(hist_data, system, event, var); } @@ -327,7 +332,7 @@ Signed-off-by: Sebastian Andrzej Siewior return hist_field; } -@@ -3518,6 +3615,7 @@ static int onmatch_create(struct hist_tr +@@ -3518,6 +3615,7 @@ static int onmatch_create(struct hist_trigger_data *hist_data, mutex_lock(&synth_event_mutex); event = find_synth_event(data->onmatch.synth_event_name); if (!event) { @@ -335,7 +340,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_unlock(&synth_event_mutex); return -EINVAL; } -@@ -3577,12 +3675,15 @@ static int onmatch_create(struct hist_tr +@@ -3577,12 +3675,15 @@ static int onmatch_create(struct hist_trigger_data *hist_data, continue; } @@ -351,7 +356,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto err; } -@@ -3612,15 +3713,22 @@ static struct action_data *onmatch_parse +@@ -3612,15 +3713,22 @@ static struct action_data *onmatch_parse(struct trace_array *tr, char *str) return ERR_PTR(-ENOMEM); match_event = strsep(&str, ")"); @@ -377,7 +382,7 @@ Signed-off-by: Sebastian Andrzej Siewior data->onmatch.match_event = kstrdup(match_event, GFP_KERNEL); if (!data->onmatch.match_event) { -@@ -3635,12 +3743,16 @@ static struct action_data *onmatch_parse +@@ -3635,12 +3743,16 @@ static struct action_data *onmatch_parse(struct trace_array *tr, char *str) } strsep(&str, "."); @@ -396,7 +401,7 @@ Signed-off-by: Sebastian Andrzej Siewior data->onmatch.synth_event_name = kstrdup(synth_event_name, GFP_KERNEL); if (!data->onmatch.synth_event_name) { -@@ -3649,8 +3761,10 @@ static struct action_data *onmatch_parse +@@ -3649,8 +3761,10 @@ static struct action_data *onmatch_parse(struct trace_array *tr, char *str) } params = strsep(&str, ")"); @@ -408,7 +413,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = parse_action_params(params, data); if (ret) -@@ -3725,7 +3839,9 @@ static int create_var_field(struct hist_ +@@ -3725,7 +3839,9 @@ static int create_var_field(struct hist_trigger_data *hist_data, if (WARN_ON(val_idx >= TRACING_MAP_VALS_MAX + TRACING_MAP_VARS_MAX)) return -EINVAL; @@ -418,7 +423,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; } -@@ -3806,6 +3922,7 @@ static int create_key_field(struct hist_ +@@ -3806,6 +3922,7 @@ static int create_key_field(struct hist_trigger_data *hist_data, } if (hist_field->flags & HIST_FIELD_FL_VAR_REF) { @@ -426,7 +431,7 @@ Signed-off-by: Sebastian Andrzej Siewior destroy_hist_field(hist_field, 0); ret = -EINVAL; goto out; -@@ -3919,11 +4036,13 @@ static int parse_var_defs(struct hist_tr +@@ -3919,11 +4036,13 @@ static int parse_var_defs(struct hist_trigger_data *hist_data) var_name = strsep(&field_str, "="); if (!var_name || !field_str) { @@ -440,7 +445,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto free; } -@@ -4677,6 +4796,11 @@ static int hist_show(struct seq_file *m, +@@ -4677,6 +4796,11 @@ static int hist_show(struct seq_file *m, void *v) hist_trigger_show(m, data, n++); } @@ -452,7 +457,7 @@ Signed-off-by: Sebastian Andrzej Siewior out_unlock: mutex_unlock(&event_mutex); -@@ -5041,6 +5165,7 @@ static int hist_register_trigger(char *g +@@ -5041,6 +5165,7 @@ static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, if (named_data) { if (!hist_trigger_match(data, named_data, named_data, true)) { @@ -460,7 +465,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -5060,13 +5185,16 @@ static int hist_register_trigger(char *g +@@ -5060,13 +5185,16 @@ static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, test->paused = false; else if (hist_data->attrs->clear) hist_clear(test); @@ -478,7 +483,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -ENOENT; goto out; } -@@ -5253,6 +5381,11 @@ static int event_hist_trigger_func(struc +@@ -5253,6 +5381,11 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, char *trigger, *p; int ret = 0; @@ -490,7 +495,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!param) return -EINVAL; -@@ -5391,6 +5524,9 @@ static int event_hist_trigger_func(struc +@@ -5391,6 +5524,9 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, /* Just return zero, not the number of registered triggers */ ret = 0; out: @@ -500,3 +505,6 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; out_unreg: cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0111-0040-tracing-Add-inter-event-hist-trigger-Documentation.patch b/kernel/patches-4.14.x-rt/0111-0111-tracing-Add-inter-event-hist-trigger-Documentation.patch similarity index 98% rename from kernel/patches-4.14.x-rt/0111-0040-tracing-Add-inter-event-hist-trigger-Documentation.patch rename to kernel/patches-4.14.x-rt/0111-0111-tracing-Add-inter-event-hist-trigger-Documentation.patch index 362cb9490..08e12e03c 100644 --- a/kernel/patches-4.14.x-rt/0111-0040-tracing-Add-inter-event-hist-trigger-Documentation.patch +++ b/kernel/patches-4.14.x-rt/0111-0111-tracing-Add-inter-event-hist-trigger-Documentation.patch @@ -1,6 +1,7 @@ +From 8789dfae62580dee7dc26b8c5f1fe1562f1c6042 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:06 -0600 -Subject: [PATCH 40/48] tracing: Add inter-event hist trigger Documentation +Subject: [PATCH 111/414] tracing: Add inter-event hist trigger Documentation Add background and details on inter-event hist triggers, including hist variables, synthetic events, and actions. @@ -13,9 +14,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 7d5f30af5e39e572f6984c1083fe79fd7dc34d04) Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 381 ++++++++++++++++++++++++++++++++++++++ + Documentation/trace/histogram.txt | 381 ++++++++++++++++++++++++++++++ 1 file changed, 381 insertions(+) +diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt +index 0aec2d8e166b..df08882d091c 100644 --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt @@ -1603,3 +1603,384 @@ @@ -403,3 +406,6 @@ Signed-off-by: Sebastian Andrzej Siewior + Hits: 12970 + Entries: 2 + Dropped: 0 +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0112-0041-tracing-Make-tracing_set_clock-non-static.patch b/kernel/patches-4.14.x-rt/0112-0112-tracing-Make-tracing_set_clock-non-static.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0112-0041-tracing-Make-tracing_set_clock-non-static.patch rename to kernel/patches-4.14.x-rt/0112-0112-tracing-Make-tracing_set_clock-non-static.patch index ac2cbeace..621d795c3 100644 --- a/kernel/patches-4.14.x-rt/0112-0041-tracing-Make-tracing_set_clock-non-static.patch +++ b/kernel/patches-4.14.x-rt/0112-0112-tracing-Make-tracing_set_clock-non-static.patch @@ -1,6 +1,7 @@ +From 3b48e2409800518749ee6abae9d9b2203d923649 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:07 -0600 -Subject: [PATCH 41/48] tracing: Make tracing_set_clock() non-static +Subject: [PATCH 112/414] tracing: Make tracing_set_clock() non-static Allow tracing code outside of trace.c to access tracing_set_clock(). @@ -16,13 +17,15 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit f8913a56885a33eda24452c1839102c305bf7df5) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace.c | 2 +- - kernel/trace/trace.h | 1 + + kernel/trace/trace.c | 2 +- + kernel/trace/trace.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index d92f6bb417ea..7f779b99501b 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -6219,7 +6219,7 @@ static int tracing_clock_show(struct seq +@@ -6219,7 +6219,7 @@ static int tracing_clock_show(struct seq_file *m, void *v) return 0; } @@ -31,9 +34,11 @@ Signed-off-by: Sebastian Andrzej Siewior { int i; +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 25d1fa15eb99..40f2130b3047 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h -@@ -289,6 +289,7 @@ extern int trace_array_get(struct trace_ +@@ -289,6 +289,7 @@ extern int trace_array_get(struct trace_array *tr); extern void trace_array_put(struct trace_array *tr); extern int tracing_set_time_stamp_abs(struct trace_array *tr, bool abs); @@ -41,3 +46,6 @@ Signed-off-by: Sebastian Andrzej Siewior extern bool trace_clock_in_ns(struct trace_array *tr); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0113-0042-tracing-Add-a-clock-attribute-for-hist-triggers.patch b/kernel/patches-4.14.x-rt/0113-0113-tracing-Add-a-clock-attribute-for-hist-triggers.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0113-0042-tracing-Add-a-clock-attribute-for-hist-triggers.patch rename to kernel/patches-4.14.x-rt/0113-0113-tracing-Add-a-clock-attribute-for-hist-triggers.patch index c91bd41cb..e3b3332d8 100644 --- a/kernel/patches-4.14.x-rt/0113-0042-tracing-Add-a-clock-attribute-for-hist-triggers.patch +++ b/kernel/patches-4.14.x-rt/0113-0113-tracing-Add-a-clock-attribute-for-hist-triggers.patch @@ -1,6 +1,7 @@ +From 54398d6c3195d28e620be6159c575c69d78257eb Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:08 -0600 -Subject: [PATCH 42/48] tracing: Add a clock attribute for hist triggers +Subject: [PATCH 113/414] tracing: Add a clock attribute for hist triggers The default clock if timestamps are used in a histogram is "global". If timestamps aren't used, the clock is irrelevant. @@ -16,13 +17,15 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 77e7689e0b182465cfcd7c328061b70eecdcde31) Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 11 +++++++++ - kernel/trace/trace_events_hist.c | 42 +++++++++++++++++++++++++++++++++++--- + Documentation/trace/histogram.txt | 11 +++++++- + kernel/trace/trace_events_hist.c | 42 ++++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) +diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt +index df08882d091c..6e05510afc28 100644 --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt -@@ -1671,7 +1671,16 @@ specification. In support of this overa +@@ -1671,7 +1671,16 @@ features have been added to the hist trigger support: it is in units of nanoseconds; appending '.usecs' to a common_timestamp field changes the units to microseconds. @@ -40,6 +43,8 @@ Signed-off-by: Sebastian Andrzej Siewior 2.2.1 Histogram Variables ------------------------- +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 3856f173559a..e47b56632367 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -242,6 +242,7 @@ struct hist_trigger_attrs { @@ -50,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior bool pause; bool cont; bool clear; -@@ -1776,6 +1777,7 @@ static void destroy_hist_trigger_attrs(s +@@ -1776,6 +1777,7 @@ static void destroy_hist_trigger_attrs(struct hist_trigger_attrs *attrs) kfree(attrs->sort_key_str); kfree(attrs->keys_str); kfree(attrs->vals_str); @@ -58,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(attrs); } -@@ -1831,6 +1833,19 @@ static int parse_assignment(char *str, s +@@ -1831,6 +1833,19 @@ static int parse_assignment(char *str, struct hist_trigger_attrs *attrs) ret = -ENOMEM; goto out; } @@ -78,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else if (strncmp(str, "size=", strlen("size=")) == 0) { int map_bits = parse_map_size(str); -@@ -1895,6 +1910,14 @@ static struct hist_trigger_attrs *parse_ +@@ -1895,6 +1910,14 @@ static struct hist_trigger_attrs *parse_hist_trigger_attrs(char *trigger_str) goto free; } @@ -93,7 +98,7 @@ Signed-off-by: Sebastian Andrzej Siewior return attrs; free: destroy_hist_trigger_attrs(attrs); -@@ -4936,6 +4959,8 @@ static int event_hist_trigger_print(stru +@@ -4936,6 +4959,8 @@ static int event_hist_trigger_print(struct seq_file *m, seq_puts(m, ".descending"); } seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits)); @@ -102,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior print_actions_spec(m, hist_data); -@@ -5203,7 +5228,6 @@ static int hist_register_trigger(char *g +@@ -5203,7 +5228,6 @@ static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, data->paused = true; if (named_data) { @@ -110,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior data->private_data = named_data->private_data; set_named_trigger_data(data, named_data); data->ops = &event_hist_trigger_named_ops; -@@ -5215,10 +5239,22 @@ static int hist_register_trigger(char *g +@@ -5215,10 +5239,22 @@ static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, goto out; } @@ -135,3 +140,6 @@ Signed-off-by: Sebastian Andrzej Siewior out: return ret; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0114-0043-ring-buffer-Bring-back-context-level-recursive-check.patch b/kernel/patches-4.14.x-rt/0114-0114-ring-buffer-Bring-back-context-level-recursive-check.patch similarity index 89% rename from kernel/patches-4.14.x-rt/0114-0043-ring-buffer-Bring-back-context-level-recursive-check.patch rename to kernel/patches-4.14.x-rt/0114-0114-ring-buffer-Bring-back-context-level-recursive-check.patch index c0916b3b9..98c2f25ec 100644 --- a/kernel/patches-4.14.x-rt/0114-0043-ring-buffer-Bring-back-context-level-recursive-check.patch +++ b/kernel/patches-4.14.x-rt/0114-0114-ring-buffer-Bring-back-context-level-recursive-check.patch @@ -1,6 +1,8 @@ +From a55d4241b1d99ae75af5f0b09bacf01249b0cd0b Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" Date: Mon, 15 Jan 2018 10:47:09 -0500 -Subject: [PATCH 43/48] ring-buffer: Bring back context level recursive checks +Subject: [PATCH 114/414] ring-buffer: Bring back context level recursive + checks Commit 1a149d7d3f45 ("ring-buffer: Rewrite trace_recursive_(un)lock() to be simpler") replaced the context level recursion checks with a simple counter. @@ -34,12 +36,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit a0e3a18f4baf8e3754ac1e56f0ade924d0c0c721) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/ring_buffer.c | 64 ++++++++++++++++++++++++++++++++------------- - 1 file changed, 46 insertions(+), 18 deletions(-) + kernel/trace/ring_buffer.c | 62 +++++++++++++++++++++++++++----------- + 1 file changed, 45 insertions(+), 17 deletions(-) +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index e48989ff0427..3621164c234b 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c -@@ -2588,29 +2588,59 @@ rb_wakeups(struct ring_buffer *buffer, s +@@ -2588,29 +2588,59 @@ rb_wakeups(struct ring_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer) * The lock and unlock are done within a preempt disable section. * The current_context per_cpu variable can only be modified * by the current task between lock and unlock. But it can @@ -55,16 +59,15 @@ Signed-off-by: Sebastian Andrzej Siewior - * SoftIRQ context - * IRQ context - * NMI context -- * -- * If for some reason the ring buffer starts to recurse, we -- * only allow that to happen at most 4 times (one for each -- * context). If it happens 5 times, then we consider this a -- * recusive loop and do not let it go further. + * bit 0 = NMI context + * bit 1 = IRQ context + * bit 2 = SoftIRQ context + * bit 3 = normal context. -+ * + * +- * If for some reason the ring buffer starts to recurse, we +- * only allow that to happen at most 4 times (one for each +- * context). If it happens 5 times, then we consider this a +- * recusive loop and do not let it go further. + * This works because this is the order of contexts that can + * preempt other contexts. A SoftIRQ never preempts an IRQ + * context. @@ -114,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -2618,9 +2648,7 @@ trace_recursive_lock(struct ring_buffer_ +@@ -2618,9 +2648,7 @@ trace_recursive_lock(struct ring_buffer_per_cpu *cpu_buffer) static __always_inline void trace_recursive_unlock(struct ring_buffer_per_cpu *cpu_buffer) { @@ -125,3 +128,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /** +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0115-0044-ring-buffer-Fix-duplicate-results-in-mapping-context.patch b/kernel/patches-4.14.x-rt/0115-0115-ring-buffer-Fix-duplicate-results-in-mapping-context.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0115-0044-ring-buffer-Fix-duplicate-results-in-mapping-context.patch rename to kernel/patches-4.14.x-rt/0115-0115-ring-buffer-Fix-duplicate-results-in-mapping-context.patch index 86acc2fae..5625d4d16 100644 --- a/kernel/patches-4.14.x-rt/0115-0044-ring-buffer-Fix-duplicate-results-in-mapping-context.patch +++ b/kernel/patches-4.14.x-rt/0115-0115-ring-buffer-Fix-duplicate-results-in-mapping-context.patch @@ -1,6 +1,7 @@ +From c9c04b93f7a5c7efc87e6b5b4119e4c4502a2d64 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" Date: Thu, 18 Jan 2018 15:42:09 -0500 -Subject: [PATCH 44/48] ring-buffer: Fix duplicate results in mapping context +Subject: [PATCH 115/414] ring-buffer: Fix duplicate results in mapping context to bits in recursive lock In bringing back the context checks, the code checks first if its normal @@ -19,12 +20,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 0164e0d7e803af3ee1c63770978c728f8778ad01) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/ring_buffer.c | 3 +-- + kernel/trace/ring_buffer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index 3621164c234b..cad398ba3009 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c -@@ -2633,8 +2633,7 @@ trace_recursive_lock(struct ring_buffer_ +@@ -2633,8 +2633,7 @@ trace_recursive_lock(struct ring_buffer_per_cpu *cpu_buffer) bit = RB_CTX_NORMAL; else bit = pc & NMI_MASK ? RB_CTX_NMI : @@ -34,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (unlikely(val & (1 << bit))) return 1; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0116-0045-ring-buffer-Add-nesting-for-adding-events-within-eve.patch b/kernel/patches-4.14.x-rt/0116-0116-ring-buffer-Add-nesting-for-adding-events-within-eve.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0116-0045-ring-buffer-Add-nesting-for-adding-events-within-eve.patch rename to kernel/patches-4.14.x-rt/0116-0116-ring-buffer-Add-nesting-for-adding-events-within-eve.patch index 1f65c53ab..9d2121e21 100644 --- a/kernel/patches-4.14.x-rt/0116-0045-ring-buffer-Add-nesting-for-adding-events-within-eve.patch +++ b/kernel/patches-4.14.x-rt/0116-0116-ring-buffer-Add-nesting-for-adding-events-within-eve.patch @@ -1,6 +1,7 @@ +From c82828011cb72e84bec212256001e84a7bc4cf77 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" Date: Wed, 7 Feb 2018 17:26:32 -0500 -Subject: [PATCH 45/48] ring-buffer: Add nesting for adding events within +Subject: [PATCH 116/414] ring-buffer: Add nesting for adding events within events The ring-buffer code has recusion protection in case tracing ends up tracing @@ -19,13 +20,15 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit f932ff1d98c482716b4b71a5d76b2aa3d65f66f0) Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/ring_buffer.h | 3 ++ - kernel/trace/ring_buffer.c | 57 +++++++++++++++++++++++++++++++++++++++++--- + include/linux/ring_buffer.h | 3 ++ + kernel/trace/ring_buffer.c | 57 +++++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 3 deletions(-) +diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h +index b37a5df05e81..467db0a7b82d 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h -@@ -117,6 +117,9 @@ int ring_buffer_unlock_commit(struct rin +@@ -117,6 +117,9 @@ int ring_buffer_unlock_commit(struct ring_buffer *buffer, int ring_buffer_write(struct ring_buffer *buffer, unsigned long length, void *data); @@ -35,6 +38,8 @@ Signed-off-by: Sebastian Andrzej Siewior struct ring_buffer_event * ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts, unsigned long *lost_events); +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index cad398ba3009..1866b28e58ea 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -477,6 +477,7 @@ struct ring_buffer_per_cpu { @@ -45,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_t entries_bytes; local_t entries; local_t overrun; -@@ -2635,10 +2636,10 @@ trace_recursive_lock(struct ring_buffer_ +@@ -2635,10 +2636,10 @@ trace_recursive_lock(struct ring_buffer_per_cpu *cpu_buffer) bit = pc & NMI_MASK ? RB_CTX_NMI : pc & HARDIRQ_MASK ? RB_CTX_IRQ : RB_CTX_SOFTIRQ; @@ -58,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior cpu_buffer->current_context = val; return 0; -@@ -2647,7 +2648,57 @@ trace_recursive_lock(struct ring_buffer_ +@@ -2647,7 +2648,57 @@ trace_recursive_lock(struct ring_buffer_per_cpu *cpu_buffer) static __always_inline void trace_recursive_unlock(struct ring_buffer_per_cpu *cpu_buffer) { @@ -117,3 +122,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /** +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0117-0046-tracing-Use-the-ring-buffer-nesting-to-allow-synthet.patch b/kernel/patches-4.14.x-rt/0117-0117-tracing-Use-the-ring-buffer-nesting-to-allow-synthet.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0117-0046-tracing-Use-the-ring-buffer-nesting-to-allow-synthet.patch rename to kernel/patches-4.14.x-rt/0117-0117-tracing-Use-the-ring-buffer-nesting-to-allow-synthet.patch index 006fb2afb..e2f461d66 100644 --- a/kernel/patches-4.14.x-rt/0117-0046-tracing-Use-the-ring-buffer-nesting-to-allow-synthet.patch +++ b/kernel/patches-4.14.x-rt/0117-0117-tracing-Use-the-ring-buffer-nesting-to-allow-synthet.patch @@ -1,7 +1,8 @@ +From 6b2e8c7fa90d7c279a504dcce8f8d9506ff6eb23 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" Date: Wed, 7 Feb 2018 17:29:46 -0500 -Subject: [PATCH 46/48] tracing: Use the ring-buffer nesting to allow synthetic - events to be traced +Subject: [PATCH 117/414] tracing: Use the ring-buffer nesting to allow + synthetic events to be traced Synthetic events can be done within the recording of other events. Notify the ring buffer via ring_buffer_nest_start() and ring_buffer_nest_end() that @@ -11,12 +12,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 92c571543120ffed5e725f5b57b9de0b535e9d0a) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 12 +++++++++++- + kernel/trace/trace_events_hist.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index e47b56632367..49afef3cc384 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -640,6 +640,7 @@ static notrace void trace_event_raw_even +@@ -640,6 +640,7 @@ static notrace void trace_event_raw_event_synth(void *__data, struct trace_event_file *trace_file = __data; struct synth_trace_event *entry; struct trace_event_buffer fbuffer; @@ -24,7 +27,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct synth_event *event; unsigned int i, n_u64; int fields_size = 0; -@@ -651,10 +652,17 @@ static notrace void trace_event_raw_even +@@ -651,10 +652,17 @@ static notrace void trace_event_raw_event_synth(void *__data, fields_size = event->n_u64 * sizeof(u64); @@ -43,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0, n_u64 = 0; i < event->n_fields; i++) { if (event->fields[i]->is_string) { -@@ -670,6 +678,8 @@ static notrace void trace_event_raw_even +@@ -670,6 +678,8 @@ static notrace void trace_event_raw_event_synth(void *__data, } trace_event_buffer_commit(&fbuffer); @@ -52,3 +55,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static void free_synth_event_print_fmt(struct trace_event_call *call) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0118-0047-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch b/kernel/patches-4.14.x-rt/0118-0118-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0118-0047-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch rename to kernel/patches-4.14.x-rt/0118-0118-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch index 77f9db7c2..3aec621e4 100644 --- a/kernel/patches-4.14.x-rt/0118-0047-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch +++ b/kernel/patches-4.14.x-rt/0118-0118-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch @@ -1,7 +1,8 @@ +From 31b721519a6cf4d79ed810074811d64b1b843c56 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 15 Jan 2018 20:52:10 -0600 -Subject: [PATCH 47/48] tracing: Add inter-event blurb to HIST_TRIGGERS config - option +Subject: [PATCH 118/414] tracing: Add inter-event blurb to HIST_TRIGGERS + config option So that users know that inter-event tracing is supported as part of the HIST_TRIGGERS option, include text to that effect in the help @@ -14,9 +15,11 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 02942764c4fd12caeb29868822b7744fa91a9ad0) Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/Kconfig | 5 ++++- + kernel/trace/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig +index 4ad6f6ca18c1..55d39a3fbdf7 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -585,7 +585,10 @@ config HIST_TRIGGERS @@ -31,3 +34,6 @@ Signed-off-by: Sebastian Andrzej Siewior If in doubt, say N. config MMIOTRACE_TEST +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0119-0048-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch b/kernel/patches-4.14.x-rt/0119-0119-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0119-0048-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch rename to kernel/patches-4.14.x-rt/0119-0119-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch index 98ac79d36..4b50ac2b3 100644 --- a/kernel/patches-4.14.x-rt/0119-0048-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch +++ b/kernel/patches-4.14.x-rt/0119-0119-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch @@ -1,6 +1,7 @@ +From 099e9e937843cb556031561953678b766e55022c Mon Sep 17 00:00:00 2001 From: Rajvi Jingar Date: Mon, 15 Jan 2018 20:52:11 -0600 -Subject: [PATCH 48/48] selftests: ftrace: Add inter-event hist triggers +Subject: [PATCH 119/414] selftests: ftrace: Add inter-event hist triggers testcases This adds inter-event hist triggers testcases which covers following: @@ -33,14 +34,14 @@ Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit fb08b656dc9caee4a097bc4d8e050e2ead59bc24) Signed-off-by: Sebastian Andrzej Siewior --- - tools/testing/selftests/ftrace/test.d/functions | 7 + - tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc | 39 ++++++ - tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc | 54 +++++++++ - tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc | 58 ++++++++++ - tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc | 50 ++++++++ - tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc | 50 ++++++++ - tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc | 48 ++++++++ - tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc | 54 +++++++++ + .../testing/selftests/ftrace/test.d/functions | 7 +++ + .../trigger-extended-error-support.tc | 39 +++++++++++++ + .../trigger-field-variable-support.tc | 54 +++++++++++++++++ + .../trigger-inter-event-combined-hist.tc | 58 +++++++++++++++++++ + .../trigger-onmatch-action-hist.tc | 50 ++++++++++++++++ + .../trigger-onmatch-onmax-action-hist.tc | 50 ++++++++++++++++ + .../inter-event/trigger-onmax-action-hist.tc | 48 +++++++++++++++ + .../trigger-synthetic-event-createremove.tc | 54 +++++++++++++++++ 8 files changed, 360 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc @@ -50,6 +51,8 @@ Signed-off-by: Sebastian Andrzej Siewior create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc +diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions +index f2019b37370d..17afa65c0b41 100644 --- a/tools/testing/selftests/ftrace/test.d/functions +++ b/tools/testing/selftests/ftrace/test.d/functions @@ -55,6 +55,13 @@ disable_events() { @@ -66,6 +69,9 @@ Signed-off-by: Sebastian Andrzej Siewior initialize_ftrace() { # Reset ftrace to initial-state # As the initial state, ftrace will be set to nop tracer, # no events, no triggers, no filters, no function filters, +diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc +new file mode 100644 +index 000000000000..786dce7e48be --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc @@ -0,0 +1,39 @@ @@ -108,6 +114,9 @@ Signed-off-by: Sebastian Andrzej Siewior +do_reset + +exit 0 +diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc +new file mode 100644 +index 000000000000..7fd5b4a8f060 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc @@ -0,0 +1,54 @@ @@ -165,6 +174,9 @@ Signed-off-by: Sebastian Andrzej Siewior +do_reset + +exit 0 +diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc +new file mode 100644 +index 000000000000..c93dbe38b5df --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc @@ -0,0 +1,58 @@ @@ -226,6 +238,9 @@ Signed-off-by: Sebastian Andrzej Siewior +do_reset + +exit 0 +diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc +new file mode 100644 +index 000000000000..e84e7d048566 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc @@ -0,0 +1,50 @@ @@ -279,6 +294,9 @@ Signed-off-by: Sebastian Andrzej Siewior +do_reset + +exit 0 +diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc +new file mode 100644 +index 000000000000..7907d8aacde3 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc @@ -0,0 +1,50 @@ @@ -332,6 +350,9 @@ Signed-off-by: Sebastian Andrzej Siewior +do_reset + +exit 0 +diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc +new file mode 100644 +index 000000000000..38b7ed6242b2 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc @@ -0,0 +1,48 @@ @@ -383,6 +404,9 @@ Signed-off-by: Sebastian Andrzej Siewior +do_reset + +exit 0 +diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc +new file mode 100644 +index 000000000000..cef11377dcbd --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc @@ -0,0 +1,54 @@ @@ -440,3 +464,6 @@ Signed-off-by: Sebastian Andrzej Siewior +do_reset + +exit 0 +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0120-0001-tracing-Fix-display-of-hist-trigger-expressions-cont.patch b/kernel/patches-4.14.x-rt/0120-0120-tracing-Fix-display-of-hist-trigger-expressions-cont.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0120-0001-tracing-Fix-display-of-hist-trigger-expressions-cont.patch rename to kernel/patches-4.14.x-rt/0120-0120-tracing-Fix-display-of-hist-trigger-expressions-cont.patch index cc46244df..f543ba3c3 100644 --- a/kernel/patches-4.14.x-rt/0120-0001-tracing-Fix-display-of-hist-trigger-expressions-cont.patch +++ b/kernel/patches-4.14.x-rt/0120-0120-tracing-Fix-display-of-hist-trigger-expressions-cont.patch @@ -1,6 +1,7 @@ +From b547e01a7780ce9dfbdbe69ed830ab84bf0d72a9 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Wed, 28 Mar 2018 15:10:53 -0500 -Subject: [PATCH 1/4] tracing: Fix display of hist trigger expressions +Subject: [PATCH 120/414] tracing: Fix display of hist trigger expressions containing timestamps When displaying hist triggers, variable references that have the @@ -23,12 +24,14 @@ After: Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 19 +++++-------------- + kernel/trace/trace_events_hist.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 49afef3cc384..85b032a04b29 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -1686,8 +1686,6 @@ static const char *hist_field_name(struc +@@ -1686,8 +1686,6 @@ static const char *hist_field_name(struct hist_field *field, else if (field->flags & HIST_FIELD_FL_LOG2 || field->flags & HIST_FIELD_FL_ALIAS) field_name = hist_field_name(field->operands[0], ++level); @@ -37,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior else if (field->flags & HIST_FIELD_FL_CPU) field_name = "cpu"; else if (field->flags & HIST_FIELD_FL_EXPR || -@@ -1703,7 +1701,8 @@ static const char *hist_field_name(struc +@@ -1703,7 +1701,8 @@ static const char *hist_field_name(struct hist_field *field, field_name = full_name; } else field_name = field->name; @@ -47,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field_name == NULL) field_name = ""; -@@ -4859,23 +4858,15 @@ static void hist_field_print(struct seq_ +@@ -4859,23 +4858,15 @@ static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) if (hist_field->var.name) seq_printf(m, "%s=", hist_field->var.name); @@ -74,3 +77,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static int event_hist_trigger_print(struct seq_file *m, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0121-0002-tracing-Don-t-add-flag-strings-when-displaying-varia.patch b/kernel/patches-4.14.x-rt/0121-0121-tracing-Don-t-add-flag-strings-when-displaying-varia.patch similarity index 67% rename from kernel/patches-4.14.x-rt/0121-0002-tracing-Don-t-add-flag-strings-when-displaying-varia.patch rename to kernel/patches-4.14.x-rt/0121-0121-tracing-Don-t-add-flag-strings-when-displaying-varia.patch index 4a0b95f6c..8170be5e1 100644 --- a/kernel/patches-4.14.x-rt/0121-0002-tracing-Don-t-add-flag-strings-when-displaying-varia.patch +++ b/kernel/patches-4.14.x-rt/0121-0121-tracing-Don-t-add-flag-strings-when-displaying-varia.patch @@ -1,7 +1,8 @@ +From 842b08fc337b837b6a7b89c8363285bfbe8add08 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Wed, 28 Mar 2018 15:10:54 -0500 -Subject: [PATCH 2/4] tracing: Don't add flag strings when displaying variable - references +Subject: [PATCH 121/414] tracing: Don't add flag strings when displaying + variable references Variable references should never have flags appended when displayed - prevent that from happening. @@ -18,12 +19,14 @@ After: Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 2 +- + kernel/trace/trace_events_hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 85b032a04b29..9def33acb5eb 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -2052,7 +2052,7 @@ static void expr_field_str(struct hist_f +@@ -2052,7 +2052,7 @@ static void expr_field_str(struct hist_field *field, char *expr) strcat(expr, hist_field_name(field, 0)); @@ -32,3 +35,6 @@ Signed-off-by: Sebastian Andrzej Siewior const char *flags_str = get_hist_field_flags(field); if (flags_str) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0122-0003-tracing-Add-action-comparisons-when-testing-matching.patch b/kernel/patches-4.14.x-rt/0122-0122-tracing-Add-action-comparisons-when-testing-matching.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0122-0003-tracing-Add-action-comparisons-when-testing-matching.patch rename to kernel/patches-4.14.x-rt/0122-0122-tracing-Add-action-comparisons-when-testing-matching.patch index 0fa19086f..02e947374 100644 --- a/kernel/patches-4.14.x-rt/0122-0003-tracing-Add-action-comparisons-when-testing-matching.patch +++ b/kernel/patches-4.14.x-rt/0122-0122-tracing-Add-action-comparisons-when-testing-matching.patch @@ -1,6 +1,7 @@ +From 2316198bef7dc2be605559de7d3b28575c23ed9f Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Wed, 28 Mar 2018 15:10:55 -0500 -Subject: [PATCH 3/4] tracing: Add action comparisons when testing matching +Subject: [PATCH 122/414] tracing: Add action comparisons when testing matching hist triggers Actions also need to be considered when checking for matching triggers @@ -13,12 +14,14 @@ Add and call an actions_match() function to address that. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 50 +++++++++++++++++++++++++++++++++++++++ + kernel/trace/trace_events_hist.c | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 9def33acb5eb..514ec0b31eed 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -4363,6 +4363,53 @@ static void print_onmatch_spec(struct se +@@ -4363,6 +4363,53 @@ static void print_onmatch_spec(struct seq_file *m, seq_puts(m, ")"); } @@ -72,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void print_actions_spec(struct seq_file *m, struct hist_trigger_data *hist_data) { -@@ -5175,6 +5222,9 @@ static bool hist_trigger_match(struct ev +@@ -5175,6 +5222,9 @@ static bool hist_trigger_match(struct event_trigger_data *data, (strcmp(data->filter_str, data_test->filter_str) != 0)) return false; @@ -82,3 +85,6 @@ Signed-off-by: Sebastian Andrzej Siewior return true; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0123-0004-tracing-Make-sure-variable-string-fields-are-NULL-te.patch b/kernel/patches-4.14.x-rt/0123-0123-tracing-Make-sure-variable-string-fields-are-NULL-te.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0123-0004-tracing-Make-sure-variable-string-fields-are-NULL-te.patch rename to kernel/patches-4.14.x-rt/0123-0123-tracing-Make-sure-variable-string-fields-are-NULL-te.patch index 47e2c5a55..0adee2297 100644 --- a/kernel/patches-4.14.x-rt/0123-0004-tracing-Make-sure-variable-string-fields-are-NULL-te.patch +++ b/kernel/patches-4.14.x-rt/0123-0123-tracing-Make-sure-variable-string-fields-are-NULL-te.patch @@ -1,6 +1,7 @@ +From 6e6ee580df5f14d3dd8d686876f70a438612cf4d Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Wed, 28 Mar 2018 15:10:56 -0500 -Subject: [PATCH 4/4] tracing: Make sure variable string fields are +Subject: [PATCH 123/414] tracing: Make sure variable string fields are NULL-terminated The strncpy() currently being used for variable string fields can @@ -11,12 +12,14 @@ termination. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 4 ++-- + kernel/trace/trace_events_hist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index 514ec0b31eed..37db86145c8b 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -669,7 +669,7 @@ static notrace void trace_event_raw_even +@@ -669,7 +669,7 @@ static notrace void trace_event_raw_event_synth(void *__data, char *str_val = (char *)(long)var_ref_vals[var_ref_idx + i]; char *str_field = (char *)&entry->fields[n_u64]; @@ -25,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior n_u64 += STR_VAR_LEN_MAX / sizeof(u64); } else { entry->fields[n_u64] = var_ref_vals[var_ref_idx + i]; -@@ -3090,7 +3090,7 @@ static inline void __update_field_vars(s +@@ -3090,7 +3090,7 @@ static inline void __update_field_vars(struct tracing_map_elt *elt, char *str = elt_data->field_var_str[j++]; char *val_str = (char *)(uintptr_t)var_val; @@ -34,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior var_val = (u64)(uintptr_t)str; } tracing_map_set_var(elt, var_idx, var_val); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0124-block-shorten-interrupt-disabled-regions.patch b/kernel/patches-4.14.x-rt/0124-0124-block-Shorten-interrupt-disabled-regions.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0124-block-shorten-interrupt-disabled-regions.patch rename to kernel/patches-4.14.x-rt/0124-0124-block-Shorten-interrupt-disabled-regions.patch index 32e7506a6..a3a3abdb2 100644 --- a/kernel/patches-4.14.x-rt/0124-block-shorten-interrupt-disabled-regions.patch +++ b/kernel/patches-4.14.x-rt/0124-0124-block-Shorten-interrupt-disabled-regions.patch @@ -1,6 +1,7 @@ -Subject: block: Shorten interrupt disabled regions +From 680da6e9261571728655b9addf042079a63ef813 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 22 Jun 2011 19:47:02 +0200 +Subject: [PATCH 124/414] block: Shorten interrupt disabled regions Moving the blk_sched_flush_plug() call out of the interrupt/preempt disabled region in the scheduler allows us to replace @@ -42,12 +43,14 @@ Cc: Jens Axboe Cc: Linus Torvalds Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de --- - block/blk-core.c | 12 ++---------- + block/blk-core.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) +diff --git a/block/blk-core.c b/block/blk-core.c +index 1feeb1a8aad9..b4dd598666b9 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -3307,7 +3307,7 @@ static void queue_unplugged(struct reque +@@ -3307,7 +3307,7 @@ static void queue_unplugged(struct request_queue *q, unsigned int depth, blk_run_queue_async(q); else __blk_run_queue(q); @@ -64,7 +67,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de struct request *rq; LIST_HEAD(list); unsigned int depth; -@@ -3375,11 +3374,6 @@ void blk_flush_plug_list(struct blk_plug +@@ -3375,11 +3374,6 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) q = NULL; depth = 0; @@ -76,7 +79,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de while (!list_empty(&list)) { rq = list_entry_rq(list.next); list_del_init(&rq->queuelist); -@@ -3392,7 +3386,7 @@ void blk_flush_plug_list(struct blk_plug +@@ -3392,7 +3386,7 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) queue_unplugged(q, depth, from_schedule); q = rq->q; depth = 0; @@ -85,7 +88,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de } /* -@@ -3419,8 +3413,6 @@ void blk_flush_plug_list(struct blk_plug +@@ -3419,8 +3413,6 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) */ if (q) queue_unplugged(q, depth, from_schedule); @@ -94,3 +97,6 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de } void blk_finish_plug(struct blk_plug *plug) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0125-timekeeping-split-jiffies-lock.patch b/kernel/patches-4.14.x-rt/0125-0125-timekeeping-Split-jiffies-seqlock.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0125-timekeeping-split-jiffies-lock.patch rename to kernel/patches-4.14.x-rt/0125-0125-timekeeping-Split-jiffies-seqlock.patch index 4cb9ceef7..6652a1ddf 100644 --- a/kernel/patches-4.14.x-rt/0125-timekeeping-split-jiffies-lock.patch +++ b/kernel/patches-4.14.x-rt/0125-0125-timekeeping-Split-jiffies-seqlock.patch @@ -1,22 +1,25 @@ -Subject: timekeeping: Split jiffies seqlock +From bd75fa06ddb8eaf35c1f52c42a46b44b2a97bb77 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 14 Feb 2013 22:36:59 +0100 +Subject: [PATCH 125/414] 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. Signed-off-by: Thomas Gleixner --- - kernel/time/jiffies.c | 7 ++++--- - kernel/time/tick-common.c | 10 ++++++---- - kernel/time/tick-sched.c | 19 ++++++++++++------- - kernel/time/timekeeping.c | 6 ++++-- - kernel/time/timekeeping.h | 3 ++- + kernel/time/jiffies.c | 7 ++++--- + kernel/time/tick-common.c | 10 ++++++---- + kernel/time/tick-sched.c | 19 ++++++++++++------- + kernel/time/timekeeping.c | 6 ++++-- + kernel/time/timekeeping.h | 3 ++- 5 files changed, 28 insertions(+), 17 deletions(-) +diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c +index 497719127bf9..62acb8914c9e 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c -@@ -74,7 +74,8 @@ static struct clocksource clocksource_ji +@@ -74,7 +74,8 @@ static struct clocksource clocksource_jiffies = { .max_cycles = 10, }; @@ -38,6 +41,8 @@ Signed-off-by: Thomas Gleixner return ret; } EXPORT_SYMBOL(get_jiffies_64); +diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c +index 49edc1c4f3e6..7f5a26c3a8ee 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -79,13 +79,15 @@ int tick_is_oneshot_available(void) @@ -58,7 +63,7 @@ Signed-off-by: Thomas Gleixner update_wall_time(); } -@@ -157,9 +159,9 @@ void tick_setup_periodic(struct clock_ev +@@ -157,9 +159,9 @@ void tick_setup_periodic(struct clock_event_device *dev, int broadcast) ktime_t next; do { @@ -70,9 +75,11 @@ Signed-off-by: Thomas Gleixner clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT); +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index 9a372e16791c..d8d91b06f057 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -66,7 +66,8 @@ static void tick_do_update_jiffies64(kti +@@ -66,7 +66,8 @@ static void tick_do_update_jiffies64(ktime_t now) return; /* Reevaluate with jiffies_lock held */ @@ -82,7 +89,7 @@ Signed-off-by: Thomas Gleixner delta = ktime_sub(now, last_jiffies_update); if (delta >= tick_period) { -@@ -89,10 +90,12 @@ static void tick_do_update_jiffies64(kti +@@ -89,10 +90,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 { @@ -97,7 +104,7 @@ Signed-off-by: Thomas Gleixner update_wall_time(); } -@@ -103,12 +106,14 @@ static ktime_t tick_init_jiffy_update(vo +@@ -103,12 +106,14 @@ static ktime_t tick_init_jiffy_update(void) { ktime_t period; @@ -114,7 +121,7 @@ Signed-off-by: Thomas Gleixner return period; } -@@ -689,10 +694,10 @@ static ktime_t tick_nohz_stop_sched_tick +@@ -689,10 +694,10 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, /* Read jiffies and the time when jiffies were updated last */ do { @@ -127,6 +134,8 @@ Signed-off-by: Thomas Gleixner ts->last_jiffies = basejiff; /* +diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c +index 2cafb49aa65e..2720f2c29a6d 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -2326,8 +2326,10 @@ EXPORT_SYMBOL(hardpps); @@ -142,6 +151,8 @@ Signed-off-by: Thomas Gleixner + raw_spin_unlock(&jiffies_lock); update_wall_time(); } +diff --git a/kernel/time/timekeeping.h b/kernel/time/timekeeping.h +index c9f9af339914..0c0f52bf1927 100644 --- a/kernel/time/timekeeping.h +++ b/kernel/time/timekeeping.h @@ -18,7 +18,8 @@ extern void timekeeping_resume(void); @@ -154,3 +165,6 @@ Signed-off-by: Thomas Gleixner #define CS_NAME_LEN 32 +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0126-tracing-account-for-preempt-off-in-preempt_schedule.patch b/kernel/patches-4.14.x-rt/0126-0126-tracing-Account-for-preempt-off-in-preempt_schedule.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0126-tracing-account-for-preempt-off-in-preempt_schedule.patch rename to kernel/patches-4.14.x-rt/0126-0126-tracing-Account-for-preempt-off-in-preempt_schedule.patch index d52134f1e..98a1f2c82 100644 --- a/kernel/patches-4.14.x-rt/0126-tracing-account-for-preempt-off-in-preempt_schedule.patch +++ b/kernel/patches-4.14.x-rt/0126-0126-tracing-Account-for-preempt-off-in-preempt_schedule.patch @@ -1,6 +1,8 @@ +From 90bde2fed39ef39c430846efdd831b8cc140b5f8 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Thu, 29 Sep 2011 12:24:30 -0500 -Subject: tracing: Account for preempt off in preempt_schedule() +Subject: [PATCH 126/414] tracing: Account for preempt off in + preempt_schedule() The preempt_schedule() uses the preempt_disable_notrace() version because it can cause infinite recursion by the function tracer as @@ -22,12 +24,14 @@ Signed-off-by: Steven Rostedt Signed-off-by: Clark Williams Signed-off-by: Thomas Gleixner --- - kernel/sched/core.c | 9 +++++++++ + kernel/sched/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 1d8f359903c2..c07c1bb0e1c6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3605,7 +3605,16 @@ asmlinkage __visible void __sched notrac +@@ -3605,7 +3605,16 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) * an infinite recursion. */ prev_ctx = exception_enter(); @@ -44,3 +48,6 @@ Signed-off-by: Thomas Gleixner exception_exit(prev_ctx); preempt_latency_stop(1); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0127-signal-revert-ptrace-preempt-magic.patch b/kernel/patches-4.14.x-rt/0127-0127-signal-Revert-ptrace-preempt-magic.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0127-signal-revert-ptrace-preempt-magic.patch rename to kernel/patches-4.14.x-rt/0127-0127-signal-Revert-ptrace-preempt-magic.patch index ea9b8fce1..195785843 100644 --- a/kernel/patches-4.14.x-rt/0127-signal-revert-ptrace-preempt-magic.patch +++ b/kernel/patches-4.14.x-rt/0127-0127-signal-Revert-ptrace-preempt-magic.patch @@ -1,6 +1,7 @@ -Subject: signal: Revert ptrace preempt magic +From 31345d229167f9853a7edba87d31c35c00a18509 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 21 Sep 2011 19:57:12 +0200 +Subject: [PATCH 127/414] 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 @@ -8,12 +9,14 @@ correctness issue, it's merily a cosmetic bandaid. Signed-off-by: Thomas Gleixner --- - kernel/signal.c | 8 -------- + kernel/signal.c | 8 -------- 1 file changed, 8 deletions(-) +diff --git a/kernel/signal.c b/kernel/signal.c +index 6895f6bb98a7..55826c814da1 100644 --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1875,15 +1875,7 @@ static void ptrace_stop(int exit_code, i +@@ -1875,15 +1875,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); @@ -29,3 +32,6 @@ Signed-off-by: Thomas Gleixner freezable_schedule(); } else { /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0128-arm-convert-boot-lock-to-raw.patch b/kernel/patches-4.14.x-rt/0128-0128-arm-Convert-arm-boot_lock-to-raw.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0128-arm-convert-boot-lock-to-raw.patch rename to kernel/patches-4.14.x-rt/0128-0128-arm-Convert-arm-boot_lock-to-raw.patch index b1d6c1caa..f2ee33493 100644 --- a/kernel/patches-4.14.x-rt/0128-arm-convert-boot-lock-to-raw.patch +++ b/kernel/patches-4.14.x-rt/0128-0128-arm-Convert-arm-boot_lock-to-raw.patch @@ -1,6 +1,7 @@ +From 3f6651d27e72df5cde28a9171b5f155c00dfe58c Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Mon, 19 Sep 2011 14:51:14 -0700 -Subject: arm: Convert arm boot_lock to raw +Subject: [PATCH 128/414] 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. @@ -19,16 +20,18 @@ Signed-off-by: Frank Rowand Link: http://lkml.kernel.org/r/4E77B952.3010606@am.sony.com Signed-off-by: Thomas Gleixner --- - arch/arm/mach-exynos/platsmp.c | 12 ++++++------ - arch/arm/mach-hisi/platmcpm.c | 22 +++++++++++----------- - arch/arm/mach-omap2/omap-smp.c | 10 +++++----- - arch/arm/mach-prima2/platsmp.c | 10 +++++----- - arch/arm/mach-qcom/platsmp.c | 10 +++++----- - arch/arm/mach-spear/platsmp.c | 10 +++++----- - arch/arm/mach-sti/platsmp.c | 10 +++++----- - arch/arm/plat-versatile/platsmp.c | 10 +++++----- + arch/arm/mach-exynos/platsmp.c | 12 ++++++------ + arch/arm/mach-hisi/platmcpm.c | 22 +++++++++++----------- + arch/arm/mach-omap2/omap-smp.c | 10 +++++----- + arch/arm/mach-prima2/platsmp.c | 10 +++++----- + arch/arm/mach-qcom/platsmp.c | 10 +++++----- + arch/arm/mach-spear/platsmp.c | 10 +++++----- + arch/arm/mach-sti/platsmp.c | 10 +++++----- + arch/arm/plat-versatile/platsmp.c | 10 +++++----- 8 files changed, 47 insertions(+), 47 deletions(-) +diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c +index 5a03bffe7226..3080ea833d19 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -229,7 +229,7 @@ static void __iomem *scu_base_addr(void) @@ -40,7 +43,7 @@ Signed-off-by: Thomas Gleixner static void exynos_secondary_init(unsigned int cpu) { -@@ -242,8 +242,8 @@ static void exynos_secondary_init(unsign +@@ -242,8 +242,8 @@ static void exynos_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -51,7 +54,7 @@ Signed-off-by: Thomas Gleixner } int exynos_set_boot_addr(u32 core_id, unsigned long boot_addr) -@@ -307,7 +307,7 @@ static int exynos_boot_secondary(unsigne +@@ -307,7 +307,7 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) * Set synchronisation state between this boot processor * and the secondary one */ @@ -60,7 +63,7 @@ Signed-off-by: Thomas Gleixner /* * The secondary processor is waiting to be released from -@@ -334,7 +334,7 @@ static int exynos_boot_secondary(unsigne +@@ -334,7 +334,7 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) if (timeout == 0) { printk(KERN_ERR "cpu1 power enable failed"); @@ -69,7 +72,7 @@ Signed-off-by: Thomas Gleixner return -ETIMEDOUT; } } -@@ -380,7 +380,7 @@ static int exynos_boot_secondary(unsigne +@@ -380,7 +380,7 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) * calibrations, then wait for it to finish */ fail: @@ -78,6 +81,8 @@ Signed-off-by: Thomas Gleixner return pen_release != -1 ? ret : 0; } +diff --git a/arch/arm/mach-hisi/platmcpm.c b/arch/arm/mach-hisi/platmcpm.c +index f66815c3dd07..00524abd963f 100644 --- a/arch/arm/mach-hisi/platmcpm.c +++ b/arch/arm/mach-hisi/platmcpm.c @@ -61,7 +61,7 @@ @@ -89,7 +94,7 @@ Signed-off-by: Thomas Gleixner static u32 fabric_phys_addr; /* * [0]: bootwrapper physical address -@@ -113,7 +113,7 @@ static int hip04_boot_secondary(unsigned +@@ -113,7 +113,7 @@ static int hip04_boot_secondary(unsigned int l_cpu, struct task_struct *idle) if (cluster >= HIP04_MAX_CLUSTERS || cpu >= HIP04_MAX_CPUS_PER_CLUSTER) return -EINVAL; @@ -98,7 +103,7 @@ Signed-off-by: Thomas Gleixner if (hip04_cpu_table[cluster][cpu]) goto out; -@@ -147,7 +147,7 @@ static int hip04_boot_secondary(unsigned +@@ -147,7 +147,7 @@ static int hip04_boot_secondary(unsigned int l_cpu, struct task_struct *idle) out: hip04_cpu_table[cluster][cpu]++; @@ -107,7 +112,7 @@ Signed-off-by: Thomas Gleixner return 0; } -@@ -162,11 +162,11 @@ static void hip04_cpu_die(unsigned int l +@@ -162,11 +162,11 @@ static void hip04_cpu_die(unsigned int l_cpu) cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); @@ -121,7 +126,7 @@ Signed-off-by: Thomas Gleixner return; } else if (hip04_cpu_table[cluster][cpu] > 1) { pr_err("Cluster %d CPU%d boots multiple times\n", cluster, cpu); -@@ -174,7 +174,7 @@ static void hip04_cpu_die(unsigned int l +@@ -174,7 +174,7 @@ static void hip04_cpu_die(unsigned int l_cpu) } last_man = hip04_cluster_is_down(cluster); @@ -130,7 +135,7 @@ Signed-off-by: Thomas Gleixner if (last_man) { /* Since it's Cortex A15, disable L2 prefetching. */ asm volatile( -@@ -203,7 +203,7 @@ static int hip04_cpu_kill(unsigned int l +@@ -203,7 +203,7 @@ static int hip04_cpu_kill(unsigned int l_cpu) cpu >= HIP04_MAX_CPUS_PER_CLUSTER); count = TIMEOUT_MSEC / POLL_MSEC; @@ -139,7 +144,7 @@ Signed-off-by: Thomas Gleixner for (tries = 0; tries < count; tries++) { if (hip04_cpu_table[cluster][cpu]) goto err; -@@ -211,10 +211,10 @@ static int hip04_cpu_kill(unsigned int l +@@ -211,10 +211,10 @@ static int hip04_cpu_kill(unsigned int l_cpu) data = readl_relaxed(sysctrl + SC_CPU_RESET_STATUS(cluster)); if (data & CORE_WFI_STATUS(cpu)) break; @@ -152,7 +157,7 @@ Signed-off-by: Thomas Gleixner } if (tries >= count) goto err; -@@ -231,10 +231,10 @@ static int hip04_cpu_kill(unsigned int l +@@ -231,10 +231,10 @@ static int hip04_cpu_kill(unsigned int l_cpu) goto err; if (hip04_cluster_is_down(cluster)) hip04_set_snoop_filter(cluster, 0); @@ -165,9 +170,11 @@ Signed-off-by: Thomas Gleixner return 0; } #endif +diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c +index 69df3620eca5..7cc060865c92 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c -@@ -69,7 +69,7 @@ static const struct omap_smp_config omap +@@ -69,7 +69,7 @@ static const struct omap_smp_config omap5_cfg __initconst = { .startup_addr = omap5_secondary_startup, }; @@ -176,7 +183,7 @@ Signed-off-by: Thomas Gleixner void __iomem *omap4_get_scu_base(void) { -@@ -136,8 +136,8 @@ static void omap4_secondary_init(unsigne +@@ -136,8 +136,8 @@ static void omap4_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -187,7 +194,7 @@ Signed-off-by: Thomas Gleixner } static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) -@@ -150,7 +150,7 @@ static int omap4_boot_secondary(unsigned +@@ -150,7 +150,7 @@ static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) * Set synchronisation state between this boot processor * and the secondary one */ @@ -196,7 +203,7 @@ Signed-off-by: Thomas Gleixner /* * Update the AuxCoreBoot0 with boot state for secondary core. -@@ -229,7 +229,7 @@ static int omap4_boot_secondary(unsigned +@@ -229,7 +229,7 @@ static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) * Now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -205,6 +212,8 @@ Signed-off-by: Thomas Gleixner return 0; } +diff --git a/arch/arm/mach-prima2/platsmp.c b/arch/arm/mach-prima2/platsmp.c +index 75ef5d4be554..c17c86e5d860 100644 --- a/arch/arm/mach-prima2/platsmp.c +++ b/arch/arm/mach-prima2/platsmp.c @@ -22,7 +22,7 @@ @@ -216,7 +225,7 @@ Signed-off-by: Thomas Gleixner static void sirfsoc_secondary_init(unsigned int cpu) { -@@ -36,8 +36,8 @@ static void sirfsoc_secondary_init(unsig +@@ -36,8 +36,8 @@ static void sirfsoc_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -227,7 +236,7 @@ Signed-off-by: Thomas Gleixner } static const struct of_device_id clk_ids[] = { -@@ -75,7 +75,7 @@ static int sirfsoc_boot_secondary(unsign +@@ -75,7 +75,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) /* make sure write buffer is drained */ mb(); @@ -236,7 +245,7 @@ Signed-off-by: Thomas Gleixner /* * The secondary processor is waiting to be released from -@@ -107,7 +107,7 @@ static int sirfsoc_boot_secondary(unsign +@@ -107,7 +107,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -245,6 +254,8 @@ Signed-off-by: Thomas Gleixner return pen_release != -1 ? -ENOSYS : 0; } +diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c +index 5494c9e0c909..e8ce157d3548 100644 --- a/arch/arm/mach-qcom/platsmp.c +++ b/arch/arm/mach-qcom/platsmp.c @@ -46,7 +46,7 @@ @@ -256,7 +267,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_HOTPLUG_CPU static void qcom_cpu_die(unsigned int cpu) -@@ -60,8 +60,8 @@ static void qcom_secondary_init(unsigned +@@ -60,8 +60,8 @@ static void qcom_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -267,7 +278,7 @@ Signed-off-by: Thomas Gleixner } static int scss_release_secondary(unsigned int cpu) -@@ -284,7 +284,7 @@ static int qcom_boot_secondary(unsigned +@@ -284,7 +284,7 @@ static int qcom_boot_secondary(unsigned int cpu, int (*func)(unsigned int)) * set synchronisation state between this boot processor * and the secondary one */ @@ -276,7 +287,7 @@ Signed-off-by: Thomas Gleixner /* * Send the secondary CPU a soft interrupt, thereby causing -@@ -297,7 +297,7 @@ static int qcom_boot_secondary(unsigned +@@ -297,7 +297,7 @@ static int qcom_boot_secondary(unsigned int cpu, int (*func)(unsigned int)) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -285,6 +296,8 @@ Signed-off-by: Thomas Gleixner return ret; } +diff --git a/arch/arm/mach-spear/platsmp.c b/arch/arm/mach-spear/platsmp.c +index 39038a03836a..6da5c93872bf 100644 --- a/arch/arm/mach-spear/platsmp.c +++ b/arch/arm/mach-spear/platsmp.c @@ -32,7 +32,7 @@ static void write_pen_release(int val) @@ -296,7 +309,7 @@ Signed-off-by: Thomas Gleixner static void __iomem *scu_base = IOMEM(VA_SCU_BASE); -@@ -47,8 +47,8 @@ static void spear13xx_secondary_init(uns +@@ -47,8 +47,8 @@ static void spear13xx_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -307,7 +320,7 @@ Signed-off-by: Thomas Gleixner } static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) -@@ -59,7 +59,7 @@ static int spear13xx_boot_secondary(unsi +@@ -59,7 +59,7 @@ static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) * set synchronisation state between this boot processor * and the secondary one */ @@ -316,7 +329,7 @@ Signed-off-by: Thomas Gleixner /* * The secondary processor is waiting to be released from -@@ -84,7 +84,7 @@ static int spear13xx_boot_secondary(unsi +@@ -84,7 +84,7 @@ static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -325,6 +338,8 @@ Signed-off-by: Thomas Gleixner return pen_release != -1 ? -ENOSYS : 0; } +diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/platsmp.c +index 231f19e17436..a3419b7003e6 100644 --- a/arch/arm/mach-sti/platsmp.c +++ b/arch/arm/mach-sti/platsmp.c @@ -35,7 +35,7 @@ static void write_pen_release(int val) @@ -336,7 +351,7 @@ Signed-off-by: Thomas Gleixner static void sti_secondary_init(unsigned int cpu) { -@@ -48,8 +48,8 @@ static void sti_secondary_init(unsigned +@@ -48,8 +48,8 @@ static void sti_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -347,7 +362,7 @@ Signed-off-by: Thomas Gleixner } static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle) -@@ -60,7 +60,7 @@ static int sti_boot_secondary(unsigned i +@@ -60,7 +60,7 @@ static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle) * set synchronisation state between this boot processor * and the secondary one */ @@ -356,7 +371,7 @@ Signed-off-by: Thomas Gleixner /* * The secondary processor is waiting to be released from -@@ -91,7 +91,7 @@ static int sti_boot_secondary(unsigned i +@@ -91,7 +91,7 @@ static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -365,6 +380,8 @@ Signed-off-by: Thomas Gleixner return pen_release != -1 ? -ENOSYS : 0; } +diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c +index c2366510187a..6b60f582b738 100644 --- a/arch/arm/plat-versatile/platsmp.c +++ b/arch/arm/plat-versatile/platsmp.c @@ -32,7 +32,7 @@ static void write_pen_release(int val) @@ -376,7 +393,7 @@ Signed-off-by: Thomas Gleixner void versatile_secondary_init(unsigned int cpu) { -@@ -45,8 +45,8 @@ void versatile_secondary_init(unsigned i +@@ -45,8 +45,8 @@ void versatile_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -387,7 +404,7 @@ Signed-off-by: Thomas Gleixner } int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) -@@ -57,7 +57,7 @@ int versatile_boot_secondary(unsigned in +@@ -57,7 +57,7 @@ int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) * Set synchronisation state between this boot processor * and the secondary one */ @@ -396,7 +413,7 @@ Signed-off-by: Thomas Gleixner /* * This is really belt and braces; we hold unintended secondary -@@ -87,7 +87,7 @@ int versatile_boot_secondary(unsigned in +@@ -87,7 +87,7 @@ int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -405,3 +422,6 @@ Signed-off-by: Thomas Gleixner return pen_release != -1 ? -ENOSYS : 0; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0129-arm-kprobe-replace-patch_lock-to-raw-lock.patch b/kernel/patches-4.14.x-rt/0129-0129-arm-kprobe-replace-patch_lock-to-raw-lock.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0129-arm-kprobe-replace-patch_lock-to-raw-lock.patch rename to kernel/patches-4.14.x-rt/0129-0129-arm-kprobe-replace-patch_lock-to-raw-lock.patch index 9a0fa6413..6b1695fb7 100644 --- a/kernel/patches-4.14.x-rt/0129-arm-kprobe-replace-patch_lock-to-raw-lock.patch +++ b/kernel/patches-4.14.x-rt/0129-0129-arm-kprobe-replace-patch_lock-to-raw-lock.patch @@ -1,6 +1,7 @@ +From c0261e92d3ba5973240a7f23e8dea7fac7845e9d Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Thu, 10 Nov 2016 16:17:55 -0800 -Subject: [PATCH] arm: kprobe: replace patch_lock to raw lock +Subject: [PATCH 129/414] arm: kprobe: replace patch_lock to raw lock When running kprobe on -rt kernel, the below bug is caught: @@ -35,9 +36,11 @@ to raw lock. Signed-off-by: Yang Shi Signed-off-by: Sebastian Andrzej Siewior --- - arch/arm/kernel/patch.c | 6 +++--- + arch/arm/kernel/patch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c +index a50dc00d79a2..d0a05a3bdb96 100644 --- a/arch/arm/kernel/patch.c +++ b/arch/arm/kernel/patch.c @@ -16,7 +16,7 @@ struct patch { @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) __acquires(&patch_lock) -@@ -33,7 +33,7 @@ static void __kprobes *patch_map(void *a +@@ -33,7 +33,7 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) return addr; if (flags) @@ -58,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior else __acquire(&patch_lock); -@@ -48,7 +48,7 @@ static void __kprobes patch_unmap(int fi +@@ -48,7 +48,7 @@ static void __kprobes patch_unmap(int fixmap, unsigned long *flags) clear_fixmap(fixmap); if (flags) @@ -67,3 +70,6 @@ Signed-off-by: Sebastian Andrzej Siewior else __release(&patch_lock); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0130-posix-timers-no-broadcast.patch b/kernel/patches-4.14.x-rt/0130-0130-posix-timers-Prevent-broadcast-signals.patch similarity index 64% rename from kernel/patches-4.14.x-rt/0130-posix-timers-no-broadcast.patch rename to kernel/patches-4.14.x-rt/0130-0130-posix-timers-Prevent-broadcast-signals.patch index 2ebea3a70..e237774b4 100644 --- a/kernel/patches-4.14.x-rt/0130-posix-timers-no-broadcast.patch +++ b/kernel/patches-4.14.x-rt/0130-0130-posix-timers-Prevent-broadcast-signals.patch @@ -1,19 +1,21 @@ +From c49c67d37a44bb28973199f4c47ae7e634f1159e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:29:20 -0500 -Subject: posix-timers: Prevent broadcast signals +Subject: [PATCH 130/414] posix-timers: Prevent broadcast signals Posix timers should not send broadcast signals and kernel only signals. Prevent it. Signed-off-by: Thomas Gleixner - --- - kernel/time/posix-timers.c | 4 +++- + kernel/time/posix-timers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) +diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c +index 708992708332..f5392262fb77 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c -@@ -434,6 +434,7 @@ static enum hrtimer_restart posix_timer_ +@@ -434,6 +434,7 @@ static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer) static struct pid *good_sigevent(sigevent_t * event) { struct task_struct *rtn = current->group_leader; @@ -21,7 +23,7 @@ Signed-off-by: Thomas Gleixner switch (event->sigev_notify) { case SIGEV_SIGNAL | SIGEV_THREAD_ID: -@@ -443,7 +444,8 @@ static struct pid *good_sigevent(sigeven +@@ -443,7 +444,8 @@ static struct pid *good_sigevent(sigevent_t * event) /* FALLTHRU */ case SIGEV_SIGNAL: case SIGEV_THREAD: @@ -31,3 +33,6 @@ Signed-off-by: Thomas Gleixner return NULL; /* FALLTHRU */ case SIGEV_NONE: +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0131-signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/kernel/patches-4.14.x-rt/0131-0131-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0131-signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch rename to kernel/patches-4.14.x-rt/0131-0131-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 63496d29d..ff8c2e3c7 100644 --- a/kernel/patches-4.14.x-rt/0131-signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/kernel/patches-4.14.x-rt/0131-0131-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,20 +1,22 @@ +From c41768ef6b917a5b0a78acb734bf78a6af81e718 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:56 -0500 -Subject: signals: Allow rt tasks to cache one sigqueue struct +Subject: [PATCH 131/414] signals: Allow rt tasks to cache one sigqueue struct To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. Signed-off-by: Thomas Gleixner - --- - include/linux/sched.h | 2 + - include/linux/signal.h | 1 - kernel/exit.c | 2 - - kernel/fork.c | 1 - kernel/signal.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++--- + include/linux/sched.h | 2 ++ + include/linux/signal.h | 1 + + kernel/exit.c | 2 +- + kernel/fork.c | 1 + + kernel/signal.c | 69 +++++++++++++++++++++++++++++++++++++++--- 5 files changed, 70 insertions(+), 5 deletions(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 0ab4cec5c7ec..985b88c49052 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -788,6 +788,8 @@ struct task_struct { @@ -26,9 +28,11 @@ Signed-off-by: Thomas Gleixner sigset_t blocked; sigset_t real_blocked; /* Restored if set_restore_sigmask() was used: */ +diff --git a/include/linux/signal.h b/include/linux/signal.h +index 042968dd98f0..a7d20f85cc0e 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h -@@ -243,6 +243,7 @@ static inline void init_sigpending(struc +@@ -243,6 +243,7 @@ static inline void init_sigpending(struct sigpending *sig) } extern void flush_sigqueue(struct sigpending *queue); @@ -36,9 +40,11 @@ Signed-off-by: Thomas Gleixner /* 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 e3a08761eb40..26f3b352b37a 100644 --- a/kernel/exit.c +++ b/kernel/exit.c -@@ -159,7 +159,7 @@ static void __exit_signal(struct task_st +@@ -159,7 +159,7 @@ static void __exit_signal(struct task_struct *tsk) * Do this under ->siglock, we can race with another thread * doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals. */ @@ -47,9 +53,11 @@ Signed-off-by: Thomas Gleixner tsk->sighand = NULL; spin_unlock(&sighand->siglock); +diff --git a/kernel/fork.c b/kernel/fork.c +index 04c3ebd7a9a9..7d23fd8ecd69 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1648,6 +1648,7 @@ static __latent_entropy struct task_stru +@@ -1648,6 +1648,7 @@ static __latent_entropy struct task_struct *copy_process( spin_lock_init(&p->alloc_lock); init_sigpending(&p->pending); @@ -57,6 +65,8 @@ Signed-off-by: Thomas Gleixner p->utime = p->stime = p->gtime = 0; #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME +diff --git a/kernel/signal.c b/kernel/signal.c +index 55826c814da1..8e39280f06b4 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -19,6 +19,7 @@ @@ -67,7 +77,7 @@ Signed-off-by: Thomas Gleixner #include #include #include -@@ -360,13 +361,30 @@ static bool task_participate_group_stop( +@@ -360,13 +361,30 @@ static bool task_participate_group_stop(struct task_struct *task) return false; } @@ -99,7 +109,7 @@ Signed-off-by: Thomas Gleixner { struct sigqueue *q = NULL; struct user_struct *user; -@@ -383,7 +401,10 @@ static struct sigqueue * +@@ -383,7 +401,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)) { @@ -111,7 +121,7 @@ Signed-off-by: Thomas Gleixner } else { print_dropped_signal(sig); } -@@ -400,6 +421,13 @@ static struct sigqueue * +@@ -400,6 +421,13 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi return q; } @@ -125,7 +135,7 @@ Signed-off-by: Thomas Gleixner static void __sigqueue_free(struct sigqueue *q) { if (q->flags & SIGQUEUE_PREALLOC) -@@ -409,6 +437,21 @@ static void __sigqueue_free(struct sigqu +@@ -409,6 +437,21 @@ static void __sigqueue_free(struct sigqueue *q) kmem_cache_free(sigqueue_cachep, q); } @@ -147,10 +157,11 @@ Signed-off-by: Thomas Gleixner void flush_sigqueue(struct sigpending *queue) { struct sigqueue *q; -@@ -422,6 +465,21 @@ void flush_sigqueue(struct sigpending *q +@@ -421,6 +464,21 @@ void flush_sigqueue(struct sigpending *queue) + } } - /* ++/* + * Called from __exit_signal. Flush tsk->pending and + * tsk->sigqueue_cache + */ @@ -165,11 +176,10 @@ Signed-off-by: Thomas Gleixner + kmem_cache_free(sigqueue_cachep, q); +} + -+/* + /* * Flush all pending signals for this kthread. */ - void flush_signals(struct task_struct *t) -@@ -542,7 +600,7 @@ static void collect_signal(int sig, stru +@@ -542,7 +600,7 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info, (info->si_code == SI_TIMER) && (info->si_sys_private); @@ -178,7 +188,7 @@ Signed-off-by: Thomas Gleixner } else { /* * Ok, it wasn't in the queue. This must be -@@ -578,6 +636,8 @@ int dequeue_signal(struct task_struct *t +@@ -578,6 +636,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) bool resched_timer = false; int signr; @@ -197,3 +207,6 @@ Signed-off-by: Thomas Gleixner if (q) q->flags |= SIGQUEUE_PREALLOC; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0132-drivers-random-reduce-preempt-disabled-region.patch b/kernel/patches-4.14.x-rt/0132-0132-drivers-random-Reduce-preempt-disabled-region.patch similarity index 56% rename from kernel/patches-4.14.x-rt/0132-drivers-random-reduce-preempt-disabled-region.patch rename to kernel/patches-4.14.x-rt/0132-0132-drivers-random-Reduce-preempt-disabled-region.patch index 292520e56..7d2c8b632 100644 --- a/kernel/patches-4.14.x-rt/0132-drivers-random-reduce-preempt-disabled-region.patch +++ b/kernel/patches-4.14.x-rt/0132-0132-drivers-random-Reduce-preempt-disabled-region.patch @@ -1,19 +1,21 @@ +From 4bcabeb385becd404d4f10c8c2d3b36cd6d6fbb3 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:30 -0500 -Subject: drivers: random: Reduce preempt disabled region +Subject: [PATCH 132/414] drivers: random: Reduce preempt disabled region No need to keep preemption disabled across the whole function. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - drivers/char/random.c | 3 --- + drivers/char/random.c | 3 --- 1 file changed, 3 deletions(-) +diff --git a/drivers/char/random.c b/drivers/char/random.c +index ddc493d976fd..106abdf67efd 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c -@@ -1122,8 +1122,6 @@ static void add_timer_randomness(struct +@@ -1122,8 +1122,6 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num) } sample; long delta, delta2, delta3; @@ -22,7 +24,7 @@ Signed-off-by: Thomas Gleixner sample.jiffies = jiffies; sample.cycles = random_get_entropy(); sample.num = num; -@@ -1164,7 +1162,6 @@ static void add_timer_randomness(struct +@@ -1164,7 +1162,6 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num) */ credit_entropy_bits(r, min_t(int, fls(delta>>1), 11)); } @@ -30,3 +32,6 @@ Signed-off-by: Thomas Gleixner } void add_input_randomness(unsigned int type, unsigned int code, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0133-arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch b/kernel/patches-4.14.x-rt/0133-0133-ARM-AT91-PIT-Remove-irq-handler-when-clock-event-is-.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0133-arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch rename to kernel/patches-4.14.x-rt/0133-0133-ARM-AT91-PIT-Remove-irq-handler-when-clock-event-is-.patch index 0c5f9d4e2..4baa04651 100644 --- a/kernel/patches-4.14.x-rt/0133-arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch +++ b/kernel/patches-4.14.x-rt/0133-0133-ARM-AT91-PIT-Remove-irq-handler-when-clock-event-is-.patch @@ -1,6 +1,11 @@ +From bc6c2e3500feb0a620a714e193f3dd7f7c0db15d Mon Sep 17 00:00:00 2001 From: Benedikt Spranger Date: Sat, 6 Mar 2010 17:47:10 +0100 -Subject: ARM: AT91: PIT: Remove irq handler when clock event is unused +Subject: [PATCH 133/414] ARM: AT91: PIT: Remove irq handler when clock event + is unused +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Setup and remove the interrupt handler in clock event mode selection. This avoids calling the (shared) interrupt handler when the device is @@ -13,13 +18,15 @@ commit 8fe82a55 ("ARM: at91: sparse irq support") which is included since v3.6. Patch based on what Sami Pietikäinen suggested]. Signed-off-by: Sebastian Andrzej Siewior --- - drivers/clocksource/timer-atmel-pit.c | 18 +++++++++--------- - drivers/clocksource/timer-atmel-st.c | 34 ++++++++++++++++++++++------------ + drivers/clocksource/timer-atmel-pit.c | 18 +++++++------- + drivers/clocksource/timer-atmel-st.c | 34 +++++++++++++++++---------- 2 files changed, 31 insertions(+), 21 deletions(-) +diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c +index ec8a4376f74f..d09cfb1dc12b 100644 --- a/drivers/clocksource/timer-atmel-pit.c +++ b/drivers/clocksource/timer-atmel-pit.c -@@ -96,15 +96,24 @@ static int pit_clkevt_shutdown(struct cl +@@ -96,15 +96,24 @@ static int pit_clkevt_shutdown(struct clock_event_device *dev) /* disable irq, leaving the clocksource active */ pit_write(data->base, AT91_PIT_MR, (data->cycle - 1) | AT91_PIT_PITEN); @@ -44,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* update clocksource counter */ data->cnt += data->cycle * PIT_PICNT(pit_read(data->base, AT91_PIT_PIVR)); -@@ -230,15 +239,6 @@ static int __init at91sam926x_pit_dt_ini +@@ -230,15 +239,6 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) return ret; } @@ -60,9 +67,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* Set up and register clockevents */ data->clkevt.name = "pit"; data->clkevt.features = CLOCK_EVT_FEAT_PERIODIC; +diff --git a/drivers/clocksource/timer-atmel-st.c b/drivers/clocksource/timer-atmel-st.c +index d2e660f475af..c63b96cfc23e 100644 --- a/drivers/clocksource/timer-atmel-st.c +++ b/drivers/clocksource/timer-atmel-st.c -@@ -115,18 +115,29 @@ static void clkdev32k_disable_and_flush_ +@@ -115,18 +115,29 @@ static void clkdev32k_disable_and_flush_irq(void) last_crtr = read_CRTR(); } @@ -92,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * ALM for oneshot irqs, set by next_event() * before 32 seconds have passed. -@@ -139,8 +150,16 @@ static int clkevt32k_set_oneshot(struct +@@ -139,8 +150,16 @@ static int clkevt32k_set_oneshot(struct clock_event_device *dev) static int clkevt32k_set_periodic(struct clock_event_device *dev) { @@ -109,7 +118,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* PIT for periodic irqs; fixed rate of 1/HZ */ irqmask = AT91_ST_PITS; regmap_write(regmap_st, AT91_ST_PIMR, timer_latch); -@@ -198,7 +217,7 @@ static int __init atmel_st_timer_init(st +@@ -198,7 +217,7 @@ static int __init atmel_st_timer_init(struct device_node *node) { struct clk *sclk; unsigned int sclk_rate, val; @@ -118,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior regmap_st = syscon_node_to_regmap(node); if (IS_ERR(regmap_st)) { -@@ -212,21 +231,12 @@ static int __init atmel_st_timer_init(st +@@ -212,21 +231,12 @@ static int __init atmel_st_timer_init(struct device_node *node) regmap_read(regmap_st, AT91_ST_SR, &val); /* Get the interrupts property */ @@ -142,3 +151,6 @@ Signed-off-by: Sebastian Andrzej Siewior sclk = of_clk_get(node, 0); if (IS_ERR(sclk)) { pr_err("Unable to get slow clock\n"); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0134-clockevents-drivers-timer-atmel-pit-fix-double-free_.patch b/kernel/patches-4.14.x-rt/0134-0134-clockevents-drivers-timer-atmel-pit-fix-double-free_.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0134-clockevents-drivers-timer-atmel-pit-fix-double-free_.patch rename to kernel/patches-4.14.x-rt/0134-0134-clockevents-drivers-timer-atmel-pit-fix-double-free_.patch index 9ffe99dbd..564166cab 100644 --- a/kernel/patches-4.14.x-rt/0134-clockevents-drivers-timer-atmel-pit-fix-double-free_.patch +++ b/kernel/patches-4.14.x-rt/0134-0134-clockevents-drivers-timer-atmel-pit-fix-double-free_.patch @@ -1,6 +1,8 @@ +From 5cfc0dab07141251b040692160c8321eeb88c426 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 17 Mar 2016 21:09:43 +0100 -Subject: [PATCH] clockevents/drivers/timer-atmel-pit: fix double free_irq +Subject: [PATCH 134/414] clockevents/drivers/timer-atmel-pit: fix double + free_irq clockevents_exchange_device() changes the state from detached to shutdown and so at that point the IRQ has not yet been requested. @@ -9,9 +11,11 @@ Acked-by: Nicolas Ferre Signed-off-by: Alexandre Belloni Signed-off-by: Sebastian Andrzej Siewior --- - drivers/clocksource/timer-atmel-pit.c | 8 +++++++- + drivers/clocksource/timer-atmel-pit.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) +diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c +index d09cfb1dc12b..d813ea388562 100644 --- a/drivers/clocksource/timer-atmel-pit.c +++ b/drivers/clocksource/timer-atmel-pit.c @@ -46,6 +46,7 @@ struct pit_data { @@ -22,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct clk *mck; }; -@@ -96,7 +97,10 @@ static int pit_clkevt_shutdown(struct cl +@@ -96,7 +97,10 @@ static int pit_clkevt_shutdown(struct clock_event_device *dev) /* disable irq, leaving the clocksource active */ pit_write(data->base, AT91_PIT_MR, (data->cycle - 1) | AT91_PIT_PITEN); @@ -34,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -115,6 +119,8 @@ static int pit_clkevt_set_periodic(struc +@@ -115,6 +119,8 @@ static int pit_clkevt_set_periodic(struct clock_event_device *dev) if (ret) panic(pr_fmt("Unable to setup IRQ\n")); @@ -43,3 +47,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* update clocksource counter */ data->cnt += data->cycle * PIT_PICNT(pit_read(data->base, AT91_PIT_PIVR)); pit_write(data->base, AT91_PIT_MR, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0135-clocksource-tclib-allow-higher-clockrates.patch b/kernel/patches-4.14.x-rt/0135-0135-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0135-clocksource-tclib-allow-higher-clockrates.patch rename to kernel/patches-4.14.x-rt/0135-0135-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch index 891ab76ba..bfe8acc12 100644 --- a/kernel/patches-4.14.x-rt/0135-clocksource-tclib-allow-higher-clockrates.patch +++ b/kernel/patches-4.14.x-rt/0135-0135-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch @@ -1,6 +1,11 @@ +From d54f0bc9a0cce91f1f92afb1e5decff0014b8fc4 Mon Sep 17 00:00:00 2001 From: Benedikt Spranger Date: Mon, 8 Mar 2010 18:57:04 +0100 -Subject: clocksource: TCLIB: Allow higher clock rates for clock events +Subject: [PATCH 135/414] clocksource: TCLIB: Allow higher clock rates for + clock events +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit As default the TCLIB uses the 32KiHz base clock rate for clock events. Add a compile time selection to allow higher clock resulution. @@ -10,10 +15,12 @@ Add a compile time selection to allow higher clock resulution. Signed-off-by: Benedikt Spranger Signed-off-by: Thomas Gleixner --- - drivers/clocksource/tcb_clksrc.c | 36 +++++++++++++++++++++--------------- - drivers/misc/Kconfig | 12 ++++++++++-- + drivers/clocksource/tcb_clksrc.c | 36 +++++++++++++++++++------------- + drivers/misc/Kconfig | 12 +++++++++-- 2 files changed, 31 insertions(+), 17 deletions(-) +diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c +index 4f45be268e52..05f4b88bb955 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -25,8 +25,7 @@ @@ -34,7 +41,7 @@ Signed-off-by: Thomas Gleixner void __iomem *regs; }; -@@ -135,13 +135,6 @@ static struct tc_clkevt_device *to_tc_cl +@@ -135,13 +135,6 @@ static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) return container_of(clkevt, struct tc_clkevt_device, clkevt); } @@ -48,7 +55,7 @@ Signed-off-by: Thomas Gleixner static u32 timer_clock; static void tc_clk_disable(struct clock_event_device *d) -@@ -191,7 +184,7 @@ static int tc_set_oneshot(struct clock_e +@@ -191,7 +184,7 @@ static int tc_set_oneshot(struct clock_event_device *d) tc_clk_enable(d); @@ -57,7 +64,7 @@ Signed-off-by: Thomas Gleixner writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, regs + ATMEL_TC_REG(2, CMR)); writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); -@@ -213,10 +206,10 @@ static int tc_set_periodic(struct clock_ +@@ -213,10 +206,10 @@ static int tc_set_periodic(struct clock_event_device *d) */ tc_clk_enable(d); @@ -70,7 +77,7 @@ Signed-off-by: Thomas Gleixner /* Enable clock and interrupts on RC compare */ writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); -@@ -243,7 +236,11 @@ static struct tc_clkevt_device clkevt = +@@ -243,7 +236,11 @@ static struct tc_clkevt_device clkevt = { .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, /* Should be lower than at91rm9200's system timer */ @@ -82,7 +89,7 @@ Signed-off-by: Thomas Gleixner .set_next_event = tc_next_event, .set_state_shutdown = tc_shutdown_clk_off, .set_state_periodic = tc_set_periodic, -@@ -265,8 +262,9 @@ static irqreturn_t ch2_irq(int irq, void +@@ -265,8 +262,9 @@ static irqreturn_t ch2_irq(int irq, void *handle) return IRQ_NONE; } @@ -93,7 +100,7 @@ Signed-off-by: Thomas Gleixner int ret; struct clk *t2_clk = tc->clk[2]; int irq = tc->irq[2]; -@@ -287,7 +285,11 @@ static int __init setup_clkevents(struct +@@ -287,7 +285,11 @@ static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) clkevt.regs = tc->regs; clkevt.clk = t2_clk; @@ -106,7 +113,7 @@ Signed-off-by: Thomas Gleixner clkevt.clkevt.cpumask = cpumask_of(0); -@@ -298,7 +300,7 @@ static int __init setup_clkevents(struct +@@ -298,7 +300,7 @@ static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) return ret; } @@ -127,6 +134,8 @@ Signed-off-by: Thomas Gleixner if (ret) goto err_unregister_clksrc; +diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig +index 8136dc7e863d..d2feb491e689 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -69,8 +69,7 @@ config ATMEL_TCB_CLKSRC @@ -155,3 +164,6 @@ Signed-off-by: Thomas Gleixner config DUMMY_IRQ tristate "Dummy IRQ handler" default n +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0136-drivers-net-8139-disable-irq-nosync.patch b/kernel/patches-4.14.x-rt/0136-0136-drivers-net-Use-disable_irq_nosync-in-8139too.patch similarity index 59% rename from kernel/patches-4.14.x-rt/0136-drivers-net-8139-disable-irq-nosync.patch rename to kernel/patches-4.14.x-rt/0136-0136-drivers-net-Use-disable_irq_nosync-in-8139too.patch index 3c01971e0..3310ee85b 100644 --- a/kernel/patches-4.14.x-rt/0136-drivers-net-8139-disable-irq-nosync.patch +++ b/kernel/patches-4.14.x-rt/0136-0136-drivers-net-Use-disable_irq_nosync-in-8139too.patch @@ -1,20 +1,22 @@ +From 71fd417c41b32cf71cdc1504597c0ef5a7203c99 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:24 -0500 -Subject: drivers/net: Use disable_irq_nosync() in 8139too +Subject: [PATCH 136/414] drivers/net: Use disable_irq_nosync() in 8139too Use disable_irq_nosync() instead of disable_irq() as this might be called in atomic context with netpoll. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - drivers/net/ethernet/realtek/8139too.c | 2 +- + drivers/net/ethernet/realtek/8139too.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c +index d24b47b8e0b2..d118da5a10a2 100644 --- a/drivers/net/ethernet/realtek/8139too.c +++ b/drivers/net/ethernet/realtek/8139too.c -@@ -2224,7 +2224,7 @@ static void rtl8139_poll_controller(stru +@@ -2224,7 +2224,7 @@ static void rtl8139_poll_controller(struct net_device *dev) struct rtl8139_private *tp = netdev_priv(dev); const int irq = tp->pci_dev->irq; @@ -23,3 +25,6 @@ Signed-off-by: Thomas Gleixner rtl8139_interrupt(irq, dev); enable_irq(irq); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0137-suspend-prevernt-might-sleep-splats.patch b/kernel/patches-4.14.x-rt/0137-0137-suspend-Prevent-might-sleep-splats.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0137-suspend-prevernt-might-sleep-splats.patch rename to kernel/patches-4.14.x-rt/0137-0137-suspend-Prevent-might-sleep-splats.patch index b2bd8af0d..b86522d21 100644 --- a/kernel/patches-4.14.x-rt/0137-suspend-prevernt-might-sleep-splats.patch +++ b/kernel/patches-4.14.x-rt/0137-0137-suspend-Prevent-might-sleep-splats.patch @@ -1,6 +1,7 @@ +From a716bd18c0e738c15cbb635ae7f57defb0f95581 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 15 Jul 2010 10:29:00 +0200 -Subject: suspend: Prevent might sleep splats +Subject: [PATCH 137/414] suspend: Prevent might sleep splats timekeeping suspend/resume calls read_persistant_clock() which takes rtc_lock. That results in might sleep warnings because at that point @@ -16,13 +17,14 @@ and restoring it to SYSTEM_RUNNING afer sysdev_resume(). Needs to be revisited. Signed-off-by: Thomas Gleixner - --- - include/linux/kernel.h | 1 + - kernel/power/hibernate.c | 7 +++++++ - kernel/power/suspend.c | 4 ++++ + include/linux/kernel.h | 1 + + kernel/power/hibernate.c | 7 +++++++ + kernel/power/suspend.c | 4 ++++ 3 files changed, 12 insertions(+) +diff --git a/include/linux/kernel.h b/include/linux/kernel.h +index 4b484ab9e163..f696993c052c 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -531,6 +531,7 @@ extern enum system_states { @@ -33,9 +35,11 @@ Signed-off-by: Thomas Gleixner } system_state; #define TAINT_PROPRIETARY_MODULE 0 +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index a5c36e9c56a6..7c7dbbf23f37 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c -@@ -287,6 +287,8 @@ static int create_image(int platform_mod +@@ -287,6 +287,8 @@ static int create_image(int platform_mode) local_irq_disable(); @@ -44,7 +48,7 @@ Signed-off-by: Thomas Gleixner error = syscore_suspend(); if (error) { pr_err("Some system devices failed to power down, aborting hibernation\n"); -@@ -317,6 +319,7 @@ static int create_image(int platform_mod +@@ -317,6 +319,7 @@ static int create_image(int platform_mode) syscore_resume(); Enable_irqs: @@ -52,7 +56,7 @@ Signed-off-by: Thomas Gleixner local_irq_enable(); Enable_cpus: -@@ -445,6 +448,7 @@ static int resume_target_kernel(bool pla +@@ -445,6 +448,7 @@ static int resume_target_kernel(bool platform_mode) goto Enable_cpus; local_irq_disable(); @@ -60,7 +64,7 @@ Signed-off-by: Thomas Gleixner error = syscore_suspend(); if (error) -@@ -478,6 +482,7 @@ static int resume_target_kernel(bool pla +@@ -478,6 +482,7 @@ static int resume_target_kernel(bool platform_mode) syscore_resume(); Enable_irqs: @@ -84,9 +88,11 @@ Signed-off-by: Thomas Gleixner local_irq_enable(); Enable_cpus: +diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c +index 0685c4499431..d74d04d49248 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c -@@ -428,6 +428,8 @@ static int suspend_enter(suspend_state_t +@@ -428,6 +428,8 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) arch_suspend_disable_irqs(); BUG_ON(!irqs_disabled()); @@ -95,7 +101,7 @@ Signed-off-by: Thomas Gleixner error = syscore_suspend(); if (!error) { *wakeup = pm_wakeup_pending(); -@@ -443,6 +445,8 @@ static int suspend_enter(suspend_state_t +@@ -443,6 +445,8 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) syscore_resume(); } @@ -104,3 +110,6 @@ Signed-off-by: Thomas Gleixner arch_suspend_enable_irqs(); BUG_ON(irqs_disabled()); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0138-net-prevent-abba-deadlock.patch b/kernel/patches-4.14.x-rt/0138-0138-net-flip-lock-dep-thingy.patch.patch similarity index 93% rename from kernel/patches-4.14.x-rt/0138-net-prevent-abba-deadlock.patch rename to kernel/patches-4.14.x-rt/0138-0138-net-flip-lock-dep-thingy.patch.patch index cf7b77af6..53be99c56 100644 --- a/kernel/patches-4.14.x-rt/0138-net-prevent-abba-deadlock.patch +++ b/kernel/patches-4.14.x-rt/0138-0138-net-flip-lock-dep-thingy.patch.patch @@ -1,6 +1,7 @@ -Subject: net-flip-lock-dep-thingy.patch +From e57e9f84e4f6a4a56559c91aef896c1ed3211358 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 28 Jun 2011 10:59:58 +0200 +Subject: [PATCH 138/414] net-flip-lock-dep-thingy.patch ======================================================= [ INFO: possible circular locking dependency detected ] @@ -90,12 +91,14 @@ Call Trace: Signed-off-by: Thomas Gleixner --- - net/core/sock.c | 3 +-- + net/core/sock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) +diff --git a/net/core/sock.c b/net/core/sock.c +index ec6eb546b228..9af877b4e3f7 100644 --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -2757,12 +2757,11 @@ void lock_sock_nested(struct sock *sk, i +@@ -2757,12 +2757,11 @@ void lock_sock_nested(struct sock *sk, int subclass) if (sk->sk_lock.owned) __lock_sock(sk); sk->sk_lock.owned = 1; @@ -109,3 +112,6 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(lock_sock_nested); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0139-net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch b/kernel/patches-4.14.x-rt/0139-0139-net-sched-Use-msleep-instead-of-yield.patch similarity index 89% rename from kernel/patches-4.14.x-rt/0139-net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch rename to kernel/patches-4.14.x-rt/0139-0139-net-sched-Use-msleep-instead-of-yield.patch index b79ae04b1..5007f3e77 100644 --- a/kernel/patches-4.14.x-rt/0139-net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch +++ b/kernel/patches-4.14.x-rt/0139-0139-net-sched-Use-msleep-instead-of-yield.patch @@ -1,6 +1,7 @@ +From c6d38433fbdbf6a66d8a359c73ce62b3a1de0d0c Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Wed, 5 Mar 2014 00:49:47 +0100 -Subject: net: sched: Use msleep() instead of yield() +Subject: [PATCH 139/414] 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 @@ -41,12 +42,14 @@ solution. Signed-off-by: Marc Kleine-Budde Signed-off-by: Sebastian Andrzej Siewior --- - net/sched/sch_generic.c | 2 +- + net/sched/sch_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c +index 79549baf5804..de0839491dd8 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -933,7 +933,7 @@ void dev_deactivate_many(struct list_hea +@@ -933,7 +933,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)) @@ -55,3 +58,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* The new qdisc is assigned at this point so we can safely * unwind stale skb lists and qdisc statistics */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0140-net_disable_NET_RX_BUSY_POLL.patch b/kernel/patches-4.14.x-rt/0140-0140-net-core-disable-NET_RX_BUSY_POLL.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0140-net_disable_NET_RX_BUSY_POLL.patch rename to kernel/patches-4.14.x-rt/0140-0140-net-core-disable-NET_RX_BUSY_POLL.patch index 75bf42ac7..3bf63fcbe 100644 --- a/kernel/patches-4.14.x-rt/0140-net_disable_NET_RX_BUSY_POLL.patch +++ b/kernel/patches-4.14.x-rt/0140-0140-net-core-disable-NET_RX_BUSY_POLL.patch @@ -1,6 +1,10 @@ +From a04d664062698b1ce702b06ca87d096f0389d5bb Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: net/core: disable NET_RX_BUSY_POLL +Subject: [PATCH 140/414] net/core: disable NET_RX_BUSY_POLL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit sk_busy_loop() does preempt_disable() followed by a few operations which can take sleeping locks and may get long. @@ -12,9 +16,11 @@ could be invoked again. Signed-off-by: Sebastian Andrzej Siewior --- - net/Kconfig | 2 +- + net/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/net/Kconfig b/net/Kconfig +index 9dba2715919d..9c7b38379c09 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -272,7 +272,7 @@ config CGROUP_NET_CLASSID @@ -26,3 +32,6 @@ Signed-off-by: Sebastian Andrzej Siewior config BQL bool +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0141-x86-io-apic-migra-no-unmask.patch b/kernel/patches-4.14.x-rt/0141-0141-x86-ioapic-Do-not-unmask-io_apic-when-interrupt-is-i.patch similarity index 63% rename from kernel/patches-4.14.x-rt/0141-x86-io-apic-migra-no-unmask.patch rename to kernel/patches-4.14.x-rt/0141-0141-x86-ioapic-Do-not-unmask-io_apic-when-interrupt-is-i.patch index d8e91ba27..20c145509 100644 --- a/kernel/patches-4.14.x-rt/0141-x86-io-apic-migra-no-unmask.patch +++ b/kernel/patches-4.14.x-rt/0141-0141-x86-ioapic-Do-not-unmask-io_apic-when-interrupt-is-i.patch @@ -1,21 +1,23 @@ +From 88e658e3096f23f68796ebad3101922f06cb1cde Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:27 -0500 -Subject: x86/ioapic: Do not unmask io_apic when interrupt is in progress +Subject: [PATCH 141/414] x86/ioapic: Do not unmask io_apic when interrupt is + in progress With threaded interrupts we might see an interrupt in progress on migration. Do not unmask it when this is the case. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- -xXx - arch/x86/kernel/apic/io_apic.c | 3 ++- + arch/x86/kernel/apic/io_apic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c +index 3b89b27945ff..9744fbb856af 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c -@@ -1690,7 +1690,8 @@ static bool io_apic_level_ack_pending(st +@@ -1690,7 +1690,8 @@ static bool io_apic_level_ack_pending(struct mp_chip_data *data) static inline bool ioapic_irqd_mask(struct irq_data *data) { /* If we are moving the irq we need to mask it */ @@ -25,3 +27,6 @@ xXx mask_ioapic_irq(data); return true; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0142-rcu-segcblist-include-rcupdate.h.patch b/kernel/patches-4.14.x-rt/0142-0142-rcu-segcblist-include-rcupdate.h.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0142-rcu-segcblist-include-rcupdate.h.patch rename to kernel/patches-4.14.x-rt/0142-0142-rcu-segcblist-include-rcupdate.h.patch index 3cfcdaf38..80b8c71f9 100644 --- a/kernel/patches-4.14.x-rt/0142-rcu-segcblist-include-rcupdate.h.patch +++ b/kernel/patches-4.14.x-rt/0142-0142-rcu-segcblist-include-rcupdate.h.patch @@ -1,15 +1,18 @@ +From 03e414c0099639384d6cc091481db6e1474a463c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 22 Sep 2017 15:01:46 +0200 -Subject: [PATCH] rcu/segcblist: include rcupdate.h +Subject: [PATCH 142/414] rcu/segcblist: include rcupdate.h The RT build on ARM complains about non-existing ULONG_CMP_LT. Since rcu_segcblist.c uses that macro it should include the header file. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/rcu_segcblist.c | 1 + + kernel/rcu/rcu_segcblist.c | 1 + 1 file changed, 1 insertion(+) +diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c +index 7649fcd2c4c7..88cba7c2956c 100644 --- a/kernel/rcu/rcu_segcblist.c +++ b/kernel/rcu/rcu_segcblist.c @@ -23,6 +23,7 @@ @@ -20,3 +23,6 @@ Signed-off-by: Sebastian Andrzej Siewior #include "rcu_segcblist.h" +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0143-printk-kill.patch b/kernel/patches-4.14.x-rt/0143-0143-printk-Add-a-printk-kill-switch.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0143-printk-kill.patch rename to kernel/patches-4.14.x-rt/0143-0143-printk-Add-a-printk-kill-switch.patch index b281b87b6..13f1b6df7 100644 --- a/kernel/patches-4.14.x-rt/0143-printk-kill.patch +++ b/kernel/patches-4.14.x-rt/0143-0143-printk-Add-a-printk-kill-switch.patch @@ -1,17 +1,20 @@ -Subject: printk: Add a printk kill switch +From 8940347344c0b1e3f7d86f816a757123e4735df3 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 22 Jul 2011 17:58:40 +0200 +Subject: [PATCH 143/414] 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. Signed-off-by: Thomas Gleixner --- - include/linux/printk.h | 2 + - kernel/printk/printk.c | 79 ++++++++++++++++++++++++++++++++++++------------- - kernel/watchdog_hld.c | 10 ++++++ + include/linux/printk.h | 2 ++ + kernel/printk/printk.c | 79 +++++++++++++++++++++++++++++++----------- + kernel/watchdog_hld.c | 10 ++++++ 3 files changed, 71 insertions(+), 20 deletions(-) +diff --git a/include/linux/printk.h b/include/linux/printk.h +index 335926039adc..2289a26bbf68 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -142,9 +142,11 @@ struct va_format { @@ -26,6 +29,8 @@ Signed-off-by: Thomas Gleixner #endif #ifdef CONFIG_PRINTK_NMI +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 512f7c2baedd..5b259bff7014 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -400,6 +400,58 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); @@ -87,7 +92,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_PRINTK DECLARE_WAIT_QUEUE_HEAD(log_wait); /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -1692,6 +1744,13 @@ asmlinkage int vprintk_emit(int facility +@@ -1692,6 +1744,13 @@ asmlinkage int vprintk_emit(int facility, int level, int printed_len; bool in_sched = false; @@ -101,7 +106,7 @@ Signed-off-by: Thomas Gleixner if (level == LOGLEVEL_SCHED) { level = LOGLEVEL_DEFAULT; in_sched = true; -@@ -1863,26 +1922,6 @@ static bool suppress_message_printing(in +@@ -1863,26 +1922,6 @@ static bool suppress_message_printing(int level) { return false; } #endif /* CONFIG_PRINTK */ @@ -128,9 +133,11 @@ Signed-off-by: Thomas Gleixner static int __add_preferred_console(char *name, int idx, char *options, char *brl_options) { +diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c +index e449a23e9d59..5cdc09411b85 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c -@@ -24,6 +24,8 @@ static DEFINE_PER_CPU(bool, hard_watchdo +@@ -24,6 +24,8 @@ static DEFINE_PER_CPU(bool, hard_watchdog_warn); static DEFINE_PER_CPU(bool, watchdog_nmi_touch); static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); static DEFINE_PER_CPU(struct perf_event *, dead_event); @@ -139,7 +146,7 @@ Signed-off-by: Thomas Gleixner static struct cpumask dead_events_mask; static unsigned long hardlockup_allcpu_dumped; -@@ -134,6 +136,13 @@ static void watchdog_overflow_callback(s +@@ -134,6 +136,13 @@ static void watchdog_overflow_callback(struct perf_event *event, /* only print hardlockups once */ if (__this_cpu_read(hard_watchdog_warn) == true) return; @@ -153,7 +160,7 @@ Signed-off-by: Thomas Gleixner pr_emerg("Watchdog detected hard LOCKUP on cpu %d", this_cpu); print_modules(); -@@ -151,6 +160,7 @@ static void watchdog_overflow_callback(s +@@ -151,6 +160,7 @@ static void watchdog_overflow_callback(struct perf_event *event, !test_and_set_bit(0, &hardlockup_allcpu_dumped)) trigger_allbutself_cpu_backtrace(); @@ -161,3 +168,6 @@ Signed-off-by: Thomas Gleixner if (hardlockup_panic) nmi_panic(regs, "Hard LOCKUP"); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0144-printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch b/kernel/patches-4.14.x-rt/0144-0144-printk-Add-force_early_printk-boot-param-to-help-wit.patch similarity index 63% rename from kernel/patches-4.14.x-rt/0144-printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch rename to kernel/patches-4.14.x-rt/0144-0144-printk-Add-force_early_printk-boot-param-to-help-wit.patch index a9a912fa5..80dc46edd 100644 --- a/kernel/patches-4.14.x-rt/0144-printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch +++ b/kernel/patches-4.14.x-rt/0144-0144-printk-Add-force_early_printk-boot-param-to-help-wit.patch @@ -1,6 +1,8 @@ -Subject: printk: Add "force_early_printk" boot param to help with debugging +From d627b2317582b8110392e7f22f03433d4927b67d Mon Sep 17 00:00:00 2001 From: Peter Zijlstra -Date: Fri, 02 Sep 2011 14:41:29 +0200 +Date: Fri, 2 Sep 2011 14:41:29 +0200 +Subject: [PATCH 144/414] printk: Add "force_early_printk" boot param to help + with debugging Gives me an option to screw printk and actually see what the machine says. @@ -10,12 +12,14 @@ Link: http://lkml.kernel.org/r/1314967289.1301.11.camel@twins Signed-off-by: Thomas Gleixner Link: http://lkml.kernel.org/n/tip-ykb97nsfmobq44xketrxs977@git.kernel.org --- - kernel/printk/printk.c | 7 +++++++ + kernel/printk/printk.c | 7 +++++++ 1 file changed, 7 insertions(+) +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 5b259bff7014..1da739f39a3d 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -430,6 +430,13 @@ asmlinkage void early_printk(const char +@@ -430,6 +430,13 @@ asmlinkage void early_printk(const char *fmt, ...) */ static bool __read_mostly printk_killswitch; @@ -29,3 +33,6 @@ Link: http://lkml.kernel.org/n/tip-ykb97nsfmobq44xketrxs977@git.kernel.org void printk_kill(void) { printk_killswitch = true; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0145-rt-preempt-base-config.patch b/kernel/patches-4.14.x-rt/0145-0145-rt-Provide-PREEMPT_RT_BASE-config-switch.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0145-rt-preempt-base-config.patch rename to kernel/patches-4.14.x-rt/0145-0145-rt-Provide-PREEMPT_RT_BASE-config-switch.patch index 3f962fb74..375d7473d 100644 --- a/kernel/patches-4.14.x-rt/0145-rt-preempt-base-config.patch +++ b/kernel/patches-4.14.x-rt/0145-0145-rt-Provide-PREEMPT_RT_BASE-config-switch.patch @@ -1,6 +1,7 @@ -Subject: rt: Provide PREEMPT_RT_BASE config switch +From c6e6c092533e978dae34fe7e7ee01c8aaba6a4eb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 17 Jun 2011 12:39:57 +0200 +Subject: [PATCH 145/414] 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 @@ -8,9 +9,11 @@ substitutions for testing. Signed-off-by: Thomas Gleixner --- - kernel/Kconfig.preempt | 19 +++++++++++++++++-- + kernel/Kconfig.preempt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) +diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt +index 3f9c97419f02..c669134982ec 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -1,3 +1,10 @@ @@ -51,3 +54,6 @@ Signed-off-by: Thomas Gleixner endchoice config PREEMPT_COUNT +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0146-kconfig-disable-a-few-options-rt.patch b/kernel/patches-4.14.x-rt/0146-0146-kconfig-Disable-config-options-which-are-not-RT-comp.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0146-kconfig-disable-a-few-options-rt.patch rename to kernel/patches-4.14.x-rt/0146-0146-kconfig-Disable-config-options-which-are-not-RT-comp.patch index eecb81a33..139f60fa5 100644 --- a/kernel/patches-4.14.x-rt/0146-kconfig-disable-a-few-options-rt.patch +++ b/kernel/patches-4.14.x-rt/0146-0146-kconfig-Disable-config-options-which-are-not-RT-comp.patch @@ -1,15 +1,19 @@ -Subject: kconfig: Disable config options which are not RT compatible +From 1f2c7ab3635c36c0ad0c416c44897e0f127432e5 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 24 Jul 2011 12:11:43 +0200 +Subject: [PATCH 146/414] kconfig: Disable config options which are not RT + compatible Disable stuff which is known to have issues on RT Signed-off-by: Thomas Gleixner --- - arch/Kconfig | 1 + - mm/Kconfig | 2 +- + arch/Kconfig | 1 + + mm/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) +diff --git a/arch/Kconfig b/arch/Kconfig +index 400b9e1b2f27..2f99c0d2166a 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -17,6 +17,7 @@ config OPROFILE @@ -20,6 +24,8 @@ Signed-off-by: Thomas Gleixner select RING_BUFFER select RING_BUFFER_ALLOW_SWAP help +diff --git a/mm/Kconfig b/mm/Kconfig +index 9c4bdddd80c2..854d5d37bcef 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -385,7 +385,7 @@ config NOMMU_INITIAL_TRIM_EXCESS @@ -31,3 +37,6 @@ Signed-off-by: Thomas Gleixner select COMPACTION select RADIX_TREE_MULTIORDER help +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0147-kconfig-preempt-rt-full.patch b/kernel/patches-4.14.x-rt/0147-0147-kconfig-Add-PREEMPT_RT_FULL.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0147-kconfig-preempt-rt-full.patch rename to kernel/patches-4.14.x-rt/0147-0147-kconfig-Add-PREEMPT_RT_FULL.patch index 9e5dfe30c..7d9fe7b32 100644 --- a/kernel/patches-4.14.x-rt/0147-kconfig-preempt-rt-full.patch +++ b/kernel/patches-4.14.x-rt/0147-0147-kconfig-Add-PREEMPT_RT_FULL.patch @@ -1,24 +1,29 @@ -Subject: kconfig: Add PREEMPT_RT_FULL +From 57685867bbe49b02d64f3285cfa1d00dc4ec3f24 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 14:58:57 +0200 +Subject: [PATCH 147/414] kconfig: Add PREEMPT_RT_FULL Introduce the final symbol for PREEMPT_RT_FULL. Signed-off-by: Thomas Gleixner --- - init/Makefile | 2 +- - kernel/Kconfig.preempt | 8 ++++++++ - scripts/mkcompile_h | 4 +++- + init/Makefile | 2 +- + kernel/Kconfig.preempt | 8 ++++++++ + scripts/mkcompile_h | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) +diff --git a/init/Makefile b/init/Makefile +index 1dbb23787290..eabf3f1b14be 100644 --- a/init/Makefile +++ b/init/Makefile -@@ -36,4 +36,4 @@ mounts-$(CONFIG_BLK_DEV_MD) += do_mounts +@@ -36,4 +36,4 @@ silent_chk_compile.h = : include/generated/compile.h: FORCE @$($(quiet)chk_compile.h) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ - "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)" + "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CONFIG_PREEMPT_RT_FULL)" "$(CC) $(KBUILD_CFLAGS)" +diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt +index c669134982ec..f8a2982bdbde 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -67,6 +67,14 @@ config PREEMPT_RTB @@ -36,6 +41,8 @@ Signed-off-by: Thomas Gleixner endchoice config PREEMPT_COUNT +diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h +index 959199c3147e..3e68004ed345 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -5,7 +5,8 @@ TARGET=$1 @@ -56,3 +63,6 @@ Signed-off-by: Thomas Gleixner UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP" # Truncate to maximum length +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0148-bug-rt-dependend-variants.patch b/kernel/patches-4.14.x-rt/0148-0148-bug-BUG_ON-WARN_ON-variants-dependend-on-RT-RT.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0148-bug-rt-dependend-variants.patch rename to kernel/patches-4.14.x-rt/0148-0148-bug-BUG_ON-WARN_ON-variants-dependend-on-RT-RT.patch index a8c591934..dad5b4298 100644 --- a/kernel/patches-4.14.x-rt/0148-bug-rt-dependend-variants.patch +++ b/kernel/patches-4.14.x-rt/0148-0148-bug-BUG_ON-WARN_ON-variants-dependend-on-RT-RT.patch @@ -1,19 +1,21 @@ +From 837b40e0e079821fd256e28571aec1fa73c7f8a6 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:58 -0500 -Subject: bug: BUG_ON/WARN_ON variants dependend on RT/!RT +Subject: [PATCH 148/414] bug: BUG_ON/WARN_ON variants dependend on RT/!RT Introduce RT/NON-RT WARN/BUG statements to avoid ifdefs in the code. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - include/asm-generic/bug.h | 14 ++++++++++++++ + include/asm-generic/bug.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) +diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h +index af2cc94a61bf..7e4346fef678 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h -@@ -233,6 +233,20 @@ void __warn(const char *file, int line, +@@ -233,6 +233,20 @@ void __warn(const char *file, int line, void *caller, unsigned taint, # define WARN_ON_SMP(x) ({0;}) #endif @@ -34,3 +36,6 @@ Signed-off-by: Thomas Gleixner #endif /* __ASSEMBLY__ */ #endif +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0149-iommu-amd--Use-WARN_ON_NORT.patch b/kernel/patches-4.14.x-rt/0149-0149-iommu-amd-Use-WARN_ON_NORT-in-__attach_device.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0149-iommu-amd--Use-WARN_ON_NORT.patch rename to kernel/patches-4.14.x-rt/0149-0149-iommu-amd-Use-WARN_ON_NORT-in-__attach_device.patch index ea2eefc66..25ab09e5f 100644 --- a/kernel/patches-4.14.x-rt/0149-iommu-amd--Use-WARN_ON_NORT.patch +++ b/kernel/patches-4.14.x-rt/0149-0149-iommu-amd-Use-WARN_ON_NORT-in-__attach_device.patch @@ -1,6 +1,7 @@ -Subject: iommu/amd: Use WARN_ON_NORT in __attach_device() +From d754eb418db6c0605e50549a6b5360febc8b32a7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 27 Feb 2016 10:22:23 +0100 +Subject: [PATCH 149/414] iommu/amd: Use WARN_ON_NORT in __attach_device() RT does not disable interrupts here, but the protection is still correct. Fixup the WARN_ON so it won't yell on RT. @@ -11,12 +12,14 @@ amd_iommu_devtable_lock is held. Reported-by: DIXLOR Signed-off-by: Thomas Gleixner --- - drivers/iommu/amd_iommu.c | 12 ++++++------ + drivers/iommu/amd_iommu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index f61c2dab5490..b96b8c11a586 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -1937,10 +1937,10 @@ static int __attach_device(struct iommu_ +@@ -1937,10 +1937,10 @@ static int __attach_device(struct iommu_dev_data *dev_data, int ret; /* @@ -30,7 +33,7 @@ Signed-off-by: Thomas Gleixner /* lock domain */ spin_lock(&domain->lock); -@@ -2108,10 +2108,10 @@ static void __detach_device(struct iommu +@@ -2108,10 +2108,10 @@ static void __detach_device(struct iommu_dev_data *dev_data) struct protection_domain *domain; /* @@ -44,3 +47,6 @@ Signed-off-by: Thomas Gleixner if (WARN_ON(!dev_data->domain)) return; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0150-local-irq-rt-depending-variants.patch b/kernel/patches-4.14.x-rt/0150-0150-rt-local_irq_-variants-depending-on-RT-RT.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0150-local-irq-rt-depending-variants.patch rename to kernel/patches-4.14.x-rt/0150-0150-rt-local_irq_-variants-depending-on-RT-RT.patch index f94a73892..2be507394 100644 --- a/kernel/patches-4.14.x-rt/0150-local-irq-rt-depending-variants.patch +++ b/kernel/patches-4.14.x-rt/0150-0150-rt-local_irq_-variants-depending-on-RT-RT.patch @@ -1,21 +1,23 @@ +From 81aa60b44f8dce7b3416ebc209d8874d3db4b66d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 21 Jul 2009 22:34:14 +0200 -Subject: rt: local_irq_* variants depending on RT/!RT +Subject: [PATCH 150/414] rt: local_irq_* variants depending on RT/!RT Add local_irq_*_(no)rt variant which are mainly used to break interrupt disabled sections on PREEMPT_RT or to explicitely disable interrupts on PREEMPT_RT. Signed-off-by: Thomas Gleixner - --- - include/linux/interrupt.h | 2 +- - include/linux/irqflags.h | 19 +++++++++++++++++++ + include/linux/interrupt.h | 2 +- + include/linux/irqflags.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index af15bfd89598..2957da07e967 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -207,7 +207,7 @@ extern void devm_free_irq(struct device +@@ -207,7 +207,7 @@ extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id); #ifdef CONFIG_LOCKDEP # define local_irq_enable_in_hardirq() do { } while (0) #else @@ -24,6 +26,8 @@ Signed-off-by: Thomas Gleixner #endif extern void disable_irq_nosync(unsigned int irq); +diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h +index 46cb57d5eb13..7834117a1ef5 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h @@ -165,4 +165,23 @@ do { \ @@ -50,3 +54,6 @@ Signed-off-by: Thomas Gleixner +#endif + #endif +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0151-preempt-nort-rt-variants.patch b/kernel/patches-4.14.x-rt/0151-0151-preempt-Provide-preempt_-_-no-rt-variants.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0151-preempt-nort-rt-variants.patch rename to kernel/patches-4.14.x-rt/0151-0151-preempt-Provide-preempt_-_-no-rt-variants.patch index c9a87c546..fd548772e 100644 --- a/kernel/patches-4.14.x-rt/0151-preempt-nort-rt-variants.patch +++ b/kernel/patches-4.14.x-rt/0151-0151-preempt-Provide-preempt_-_-no-rt-variants.patch @@ -1,16 +1,18 @@ +From 58b28be3ab9b74fe597a9514144f9f622a961fbd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 24 Jul 2009 12:38:56 +0200 -Subject: preempt: Provide preempt_*_(no)rt variants +Subject: [PATCH 151/414] preempt: Provide preempt_*_(no)rt variants RT needs a few preempt_disable/enable points which are not necessary otherwise. Implement variants to avoid #ifdeffery. Signed-off-by: Thomas Gleixner - --- - include/linux/preempt.h | 18 +++++++++++++++++- + include/linux/preempt.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 81c69aeab662..8681df8e1632 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -181,7 +181,11 @@ do { \ @@ -45,3 +47,6 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_PREEMPT_NOTIFIERS struct preempt_notifier; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0152-futex-workaround-migrate_disable-enable-in-different.patch b/kernel/patches-4.14.x-rt/0152-0152-futex-workaround-migrate_disable-enable-in-different.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0152-futex-workaround-migrate_disable-enable-in-different.patch rename to kernel/patches-4.14.x-rt/0152-0152-futex-workaround-migrate_disable-enable-in-different.patch index c6ea50626..289876303 100644 --- a/kernel/patches-4.14.x-rt/0152-futex-workaround-migrate_disable-enable-in-different.patch +++ b/kernel/patches-4.14.x-rt/0152-0152-futex-workaround-migrate_disable-enable-in-different.patch @@ -1,6 +1,8 @@ +From 9e2e26b66416c6e6b036fe59da5d554f2090df87 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 8 Mar 2017 14:23:35 +0100 -Subject: [PATCH] futex: workaround migrate_disable/enable in different context +Subject: [PATCH 152/414] futex: workaround migrate_disable/enable in different + context migrate_disable()/migrate_enable() takes a different path in atomic() vs !atomic() context. These little hacks ensure that we don't underflow / overflow @@ -10,12 +12,14 @@ enabled and unlock it with interrupts disabled. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/futex.c | 19 +++++++++++++++++++ + kernel/futex.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) +diff --git a/kernel/futex.c b/kernel/futex.c +index 046cd780d057..e70b5b516371 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2816,9 +2816,18 @@ static int futex_lock_pi(u32 __user *uad +@@ -2816,9 +2816,18 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, * lock handoff sequence. */ raw_spin_lock_irq(&q.pi_state->pi_mutex.wait_lock); @@ -34,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (ret) { if (ret == 1) -@@ -2965,11 +2974,21 @@ static int futex_unlock_pi(u32 __user *u +@@ -2965,11 +2974,21 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) * observed. */ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); @@ -56,3 +60,6 @@ Signed-off-by: Sebastian Andrzej Siewior put_pi_state(pi_state); /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0153-rt-local-irq-lock.patch b/kernel/patches-4.14.x-rt/0153-0153-rt-Add-local-irq-locks.patch similarity index 94% rename from kernel/patches-4.14.x-rt/0153-rt-local-irq-lock.patch rename to kernel/patches-4.14.x-rt/0153-0153-rt-Add-local-irq-locks.patch index c27d96204..c4848d8a6 100644 --- a/kernel/patches-4.14.x-rt/0153-rt-local-irq-lock.patch +++ b/kernel/patches-4.14.x-rt/0153-0153-rt-Add-local-irq-locks.patch @@ -1,6 +1,7 @@ -Subject: rt: Add local irq locks +From 4cb7179cb69289b4554614db9cc8b2d0ae6147db Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 20 Jun 2011 09:03:47 +0200 +Subject: [PATCH 153/414] 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 @@ -12,10 +13,14 @@ is held and the owner is preempted. Signed-off-by: Thomas Gleixner --- - include/linux/locallock.h | 271 ++++++++++++++++++++++++++++++++++++++++++++++ - include/linux/percpu.h | 29 ++++ + include/linux/locallock.h | 271 ++++++++++++++++++++++++++++++++++++++ + include/linux/percpu.h | 29 ++++ 2 files changed, 300 insertions(+) + create mode 100644 include/linux/locallock.h +diff --git a/include/linux/locallock.h b/include/linux/locallock.h +new file mode 100644 +index 000000000000..d658c2552601 --- /dev/null +++ b/include/linux/locallock.h @@ -0,0 +1,271 @@ @@ -290,6 +295,8 @@ Signed-off-by: Thomas Gleixner +#endif + +#endif +diff --git a/include/linux/percpu.h b/include/linux/percpu.h +index 296bbe49d5d1..4414796e3941 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -19,6 +19,35 @@ @@ -328,3 +335,6 @@ Signed-off-by: Thomas Gleixner /* minimum unit size, also is the maximum supported allocation size */ #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0154-ata-disable-interrupts-if-non-rt.patch b/kernel/patches-4.14.x-rt/0154-0154-ata-Do-not-disable-interrupts-in-ide-code-for-preemp.patch similarity index 60% rename from kernel/patches-4.14.x-rt/0154-ata-disable-interrupts-if-non-rt.patch rename to kernel/patches-4.14.x-rt/0154-0154-ata-Do-not-disable-interrupts-in-ide-code-for-preemp.patch index 6de60f7f8..ca5a5ae4a 100644 --- a/kernel/patches-4.14.x-rt/0154-ata-disable-interrupts-if-non-rt.patch +++ b/kernel/patches-4.14.x-rt/0154-0154-ata-Do-not-disable-interrupts-in-ide-code-for-preemp.patch @@ -1,20 +1,23 @@ +From 3b499b50a83ec131f3d1e6370eae6efb8f537e6a Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Fri, 3 Jul 2009 08:44:29 -0500 -Subject: ata: Do not disable interrupts in ide code for preempt-rt +Subject: [PATCH 154/414] ata: Do not disable interrupts in ide code for + preempt-rt Use the local_irq_*_nort variants. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - drivers/ata/libata-sff.c | 4 ++-- + drivers/ata/libata-sff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c +index cc2f2e35f4c2..0f0bc86e02df 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c -@@ -679,9 +679,9 @@ unsigned int ata_sff_data_xfer_noirq(str +@@ -679,9 +679,9 @@ unsigned int ata_sff_data_xfer_noirq(struct ata_queued_cmd *qc, unsigned char *b unsigned long flags; unsigned int consumed; @@ -26,3 +29,6 @@ Signed-off-by: Thomas Gleixner return consumed; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0155-ide-use-nort-local-irq-variants.patch b/kernel/patches-4.14.x-rt/0155-0155-ide-Do-not-disable-interrupts-for-PREEMPT-RT.patch similarity index 60% rename from kernel/patches-4.14.x-rt/0155-ide-use-nort-local-irq-variants.patch rename to kernel/patches-4.14.x-rt/0155-0155-ide-Do-not-disable-interrupts-for-PREEMPT-RT.patch index 974d1c716..67c77e555 100644 --- a/kernel/patches-4.14.x-rt/0155-ide-use-nort-local-irq-variants.patch +++ b/kernel/patches-4.14.x-rt/0155-0155-ide-Do-not-disable-interrupts-for-PREEMPT-RT.patch @@ -1,25 +1,27 @@ +From 7af7b47482c9071a09e9f2231ae5a932f0b44925 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:16 -0500 -Subject: ide: Do not disable interrupts for PREEMPT-RT +Subject: [PATCH 155/414] ide: Do not disable interrupts for PREEMPT-RT Use the local_irq_*_nort variants. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - drivers/ide/alim15x3.c | 4 ++-- - drivers/ide/hpt366.c | 4 ++-- - drivers/ide/ide-io-std.c | 8 ++++---- - drivers/ide/ide-io.c | 2 +- - drivers/ide/ide-iops.c | 4 ++-- - drivers/ide/ide-probe.c | 4 ++-- - drivers/ide/ide-taskfile.c | 6 +++--- + drivers/ide/alim15x3.c | 4 ++-- + drivers/ide/hpt366.c | 4 ++-- + drivers/ide/ide-io-std.c | 8 ++++---- + drivers/ide/ide-io.c | 2 +- + drivers/ide/ide-iops.c | 4 ++-- + drivers/ide/ide-probe.c | 4 ++-- + drivers/ide/ide-taskfile.c | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) +diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c +index 36f76e28a0bf..394f142f90c7 100644 --- a/drivers/ide/alim15x3.c +++ b/drivers/ide/alim15x3.c -@@ -234,7 +234,7 @@ static int init_chipset_ali15x3(struct p +@@ -234,7 +234,7 @@ static int init_chipset_ali15x3(struct pci_dev *dev) isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); @@ -28,7 +30,7 @@ Signed-off-by: Thomas Gleixner if (m5229_revision < 0xC2) { /* -@@ -325,7 +325,7 @@ static int init_chipset_ali15x3(struct p +@@ -325,7 +325,7 @@ static int init_chipset_ali15x3(struct pci_dev *dev) } pci_dev_put(north); pci_dev_put(isa_dev); @@ -37,9 +39,11 @@ Signed-off-by: Thomas Gleixner return 0; } +diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c +index 4b5dc0162e67..590cc7d64622 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c -@@ -1236,7 +1236,7 @@ static int init_dma_hpt366(ide_hwif_t *h +@@ -1236,7 +1236,7 @@ static int init_dma_hpt366(ide_hwif_t *hwif, dma_old = inb(base + 2); @@ -48,7 +52,7 @@ Signed-off-by: Thomas Gleixner dma_new = dma_old; pci_read_config_byte(dev, hwif->channel ? 0x4b : 0x43, &masterdma); -@@ -1247,7 +1247,7 @@ static int init_dma_hpt366(ide_hwif_t *h +@@ -1247,7 +1247,7 @@ static int init_dma_hpt366(ide_hwif_t *hwif, if (dma_new != dma_old) outb(dma_new, base + 2); @@ -57,9 +61,11 @@ Signed-off-by: Thomas Gleixner printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name, base, base + 7); +diff --git a/drivers/ide/ide-io-std.c b/drivers/ide/ide-io-std.c +index 19763977568c..4169433faab5 100644 --- a/drivers/ide/ide-io-std.c +++ b/drivers/ide/ide-io-std.c -@@ -175,7 +175,7 @@ void ide_input_data(ide_drive_t *drive, +@@ -175,7 +175,7 @@ void ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf, unsigned long uninitialized_var(flags); if ((io_32bit & 2) && !mmio) { @@ -68,7 +74,7 @@ Signed-off-by: Thomas Gleixner ata_vlb_sync(io_ports->nsect_addr); } -@@ -186,7 +186,7 @@ void ide_input_data(ide_drive_t *drive, +@@ -186,7 +186,7 @@ void ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf, insl(data_addr, buf, words); if ((io_32bit & 2) && !mmio) @@ -77,7 +83,7 @@ Signed-off-by: Thomas Gleixner if (((len + 1) & 3) < 2) return; -@@ -219,7 +219,7 @@ void ide_output_data(ide_drive_t *drive, +@@ -219,7 +219,7 @@ void ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf, unsigned long uninitialized_var(flags); if ((io_32bit & 2) && !mmio) { @@ -86,7 +92,7 @@ Signed-off-by: Thomas Gleixner ata_vlb_sync(io_ports->nsect_addr); } -@@ -230,7 +230,7 @@ void ide_output_data(ide_drive_t *drive, +@@ -230,7 +230,7 @@ void ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf, outsl(data_addr, buf, words); if ((io_32bit & 2) && !mmio) @@ -95,9 +101,11 @@ Signed-off-by: Thomas Gleixner if (((len + 1) & 3) < 2) return; +diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c +index 3a234701d92c..420e4e645856 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c -@@ -660,7 +660,7 @@ void ide_timer_expiry (unsigned long dat +@@ -660,7 +660,7 @@ void ide_timer_expiry (unsigned long data) /* disable_irq_nosync ?? */ disable_irq(hwif->irq); /* local CPU only, as if we were handling an interrupt */ @@ -106,9 +114,11 @@ Signed-off-by: Thomas Gleixner if (hwif->polling) { startstop = handler(drive); } else if (drive_is_ready(drive)) { +diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c +index 210a0887dd29..7bf05b6147e8 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c -@@ -129,12 +129,12 @@ int __ide_wait_stat(ide_drive_t *drive, +@@ -129,12 +129,12 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, if ((stat & ATA_BUSY) == 0) break; @@ -123,9 +133,11 @@ Signed-off-by: Thomas Gleixner } /* * Allow status to settle, then read it again. +diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c +index eaf39e5db08b..be4c941eaa83 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c -@@ -196,10 +196,10 @@ static void do_identify(ide_drive_t *dri +@@ -196,10 +196,10 @@ static void do_identify(ide_drive_t *drive, u8 cmd, u16 *id) int bswap = 1; /* local CPU only; some systems need this */ @@ -138,9 +150,11 @@ Signed-off-by: Thomas Gleixner drive->dev_flags |= IDE_DFLAG_ID_READ; #ifdef DEBUG +diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c +index 4efe4c6e956c..7eae3aa1def7 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c -@@ -251,7 +251,7 @@ void ide_pio_bytes(ide_drive_t *drive, s +@@ -251,7 +251,7 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd, page_is_high = PageHighMem(page); if (page_is_high) @@ -149,7 +163,7 @@ Signed-off-by: Thomas Gleixner buf = kmap_atomic(page) + offset; -@@ -272,7 +272,7 @@ void ide_pio_bytes(ide_drive_t *drive, s +@@ -272,7 +272,7 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd, kunmap_atomic(buf); if (page_is_high) @@ -158,7 +172,7 @@ Signed-off-by: Thomas Gleixner len -= nr_bytes; } -@@ -415,7 +415,7 @@ static ide_startstop_t pre_task_out_intr +@@ -415,7 +415,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, } if ((drive->dev_flags & IDE_DFLAG_UNMASK) == 0) @@ -167,3 +181,6 @@ Signed-off-by: Thomas Gleixner ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0156-infiniband-mellanox-ib-use-nort-irq.patch b/kernel/patches-4.14.x-rt/0156-0156-infiniband-Mellanox-IB-driver-patch-use-_nort-primit.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0156-infiniband-mellanox-ib-use-nort-irq.patch rename to kernel/patches-4.14.x-rt/0156-0156-infiniband-Mellanox-IB-driver-patch-use-_nort-primit.patch index 9f6234127..3eb1c5fc9 100644 --- a/kernel/patches-4.14.x-rt/0156-infiniband-mellanox-ib-use-nort-irq.patch +++ b/kernel/patches-4.14.x-rt/0156-0156-infiniband-Mellanox-IB-driver-patch-use-_nort-primit.patch @@ -1,6 +1,8 @@ +From 9e9152c9d8ec0244e5617a0d85ea3a72567e04b2 Mon Sep 17 00:00:00 2001 From: Sven-Thorsten Dietrich Date: Fri, 3 Jul 2009 08:30:35 -0500 -Subject: infiniband: Mellanox IB driver patch use _nort() primitives +Subject: [PATCH 156/414] infiniband: Mellanox IB driver patch use _nort() + primitives Fixes in_atomic stack-dump, when Mellanox module is loaded into the RT Kernel. @@ -13,14 +15,15 @@ changes." Signed-off-by: Sven-Thorsten Dietrich Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 4 ++-- + drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +index 9b3f47ae2016..8327b598d909 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c -@@ -898,7 +898,7 @@ void ipoib_mcast_restart_task(struct wor +@@ -898,7 +898,7 @@ void ipoib_mcast_restart_task(struct work_struct *work) ipoib_dbg_mcast(priv, "restarting multicast task\n"); @@ -29,7 +32,7 @@ Signed-off-by: Thomas Gleixner netif_addr_lock(dev); spin_lock(&priv->lock); -@@ -980,7 +980,7 @@ void ipoib_mcast_restart_task(struct wor +@@ -980,7 +980,7 @@ void ipoib_mcast_restart_task(struct work_struct *work) spin_unlock(&priv->lock); netif_addr_unlock(dev); @@ -38,3 +41,6 @@ Signed-off-by: Thomas Gleixner ipoib_mcast_remove_list(&remove_list); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0157-inpt-gameport-use-local-irq-nort.patch b/kernel/patches-4.14.x-rt/0157-0157-input-gameport-Do-not-disable-interrupts-on-PREEMPT_.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0157-inpt-gameport-use-local-irq-nort.patch rename to kernel/patches-4.14.x-rt/0157-0157-input-gameport-Do-not-disable-interrupts-on-PREEMPT_.patch index 94f34ce39..7d4ac5bb1 100644 --- a/kernel/patches-4.14.x-rt/0157-inpt-gameport-use-local-irq-nort.patch +++ b/kernel/patches-4.14.x-rt/0157-0157-input-gameport-Do-not-disable-interrupts-on-PREEMPT_.patch @@ -1,19 +1,22 @@ +From 5d7695977ed2b1f13800d9aac63f944eeb58c1fd Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:16 -0500 -Subject: input: gameport: Do not disable interrupts on PREEMPT_RT +Subject: [PATCH 157/414] input: gameport: Do not disable interrupts on + PREEMPT_RT Use the _nort() primitives. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - drivers/input/gameport/gameport.c | 12 ++++++------ + drivers/input/gameport/gameport.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) +diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c +index cedc665364cd..4a4fdef151aa 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c -@@ -91,13 +91,13 @@ static int gameport_measure_speed(struct +@@ -91,13 +91,13 @@ static int gameport_measure_speed(struct gameport *gameport) tx = ~0; for (i = 0; i < 50; i++) { @@ -29,7 +32,7 @@ Signed-off-by: Thomas Gleixner udelay(i * 10); t = (t2 - t1) - (t3 - t2); if (t < tx) -@@ -124,12 +124,12 @@ static int old_gameport_measure_speed(st +@@ -124,12 +124,12 @@ static int old_gameport_measure_speed(struct gameport *gameport) tx = 1 << 30; for(i = 0; i < 50; i++) { @@ -44,7 +47,7 @@ Signed-off-by: Thomas Gleixner udelay(i * 10); if ((t = DELTA(t2,t1) - DELTA(t3,t2)) < tx) tx = t; } -@@ -148,11 +148,11 @@ static int old_gameport_measure_speed(st +@@ -148,11 +148,11 @@ static int old_gameport_measure_speed(struct gameport *gameport) tx = 1 << 30; for(i = 0; i < 50; i++) { @@ -58,3 +61,6 @@ Signed-off-by: Thomas Gleixner udelay(i * 10); if (t2 - t1 < tx) tx = t2 - t1; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0158-user-use-local-irq-nort.patch b/kernel/patches-4.14.x-rt/0158-0158-core-Do-not-disable-interrupts-on-RT-in-kernel-users.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0158-user-use-local-irq-nort.patch rename to kernel/patches-4.14.x-rt/0158-0158-core-Do-not-disable-interrupts-on-RT-in-kernel-users.patch index 70bc0c583..5ddd0332a 100644 --- a/kernel/patches-4.14.x-rt/0158-user-use-local-irq-nort.patch +++ b/kernel/patches-4.14.x-rt/0158-0158-core-Do-not-disable-interrupts-on-RT-in-kernel-users.patch @@ -1,16 +1,19 @@ +From 9b110e3c9efe9038d464d3772d5d85fa7eaceef8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 21 Jul 2009 23:06:05 +0200 -Subject: core: Do not disable interrupts on RT in kernel/users.c +Subject: [PATCH 158/414] core: Do not disable interrupts on RT in + kernel/users.c Use the local_irq_*_nort variants to reduce latencies in RT. The code is serialized by the locks. No need to disable interrupts. Signed-off-by: Thomas Gleixner - --- - kernel/user.c | 4 ++-- + kernel/user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/kernel/user.c b/kernel/user.c +index 00281add65b2..f4cf1841f2fd 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -162,11 +162,11 @@ void free_uid(struct user_struct *up) @@ -27,3 +30,6 @@ Signed-off-by: Thomas Gleixner } struct user_struct *alloc_uid(kuid_t uid) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0159-usb-use-_nort-in-giveback.patch b/kernel/patches-4.14.x-rt/0159-0159-usb-Use-_nort-in-giveback-function.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0159-usb-use-_nort-in-giveback.patch rename to kernel/patches-4.14.x-rt/0159-0159-usb-Use-_nort-in-giveback-function.patch index c05d4d70c..03d555ae0 100644 --- a/kernel/patches-4.14.x-rt/0159-usb-use-_nort-in-giveback.patch +++ b/kernel/patches-4.14.x-rt/0159-0159-usb-Use-_nort-in-giveback-function.patch @@ -1,6 +1,7 @@ +From e11a4e6c02d4a04e21d28d0bbbbdfa4001417770 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 8 Nov 2013 17:34:54 +0100 -Subject: usb: Use _nort in giveback function +Subject: [PATCH 159/414] usb: Use _nort in giveback function Since commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet context") I see @@ -38,12 +39,14 @@ on -RT we run threaded so no need to disable interrupts. Signed-off-by: Sebastian Andrzej Siewior --- - drivers/usb/core/hcd.c | 4 ++-- + drivers/usb/core/hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c +index d0b2e0ed9bab..91f4f2bd55b0 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c -@@ -1775,9 +1775,9 @@ static void __usb_hcd_giveback_urb(struc +@@ -1775,9 +1775,9 @@ static void __usb_hcd_giveback_urb(struct urb *urb) * and no one may trigger the above deadlock situation when * running complete() in tasklet. */ @@ -55,3 +58,6 @@ Signed-off-by: Sebastian Andrzej Siewior usb_anchor_resume_wakeups(anchor); atomic_dec(&urb->use_count); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0160-mm-scatterlist-dont-disable-irqs-on-RT.patch b/kernel/patches-4.14.x-rt/0160-0160-mm-scatterlist-Do-not-disable-irqs-on-RT.patch similarity index 62% rename from kernel/patches-4.14.x-rt/0160-mm-scatterlist-dont-disable-irqs-on-RT.patch rename to kernel/patches-4.14.x-rt/0160-0160-mm-scatterlist-Do-not-disable-irqs-on-RT.patch index 2072310b6..3b9cb3914 100644 --- a/kernel/patches-4.14.x-rt/0160-mm-scatterlist-dont-disable-irqs-on-RT.patch +++ b/kernel/patches-4.14.x-rt/0160-0160-mm-scatterlist-Do-not-disable-irqs-on-RT.patch @@ -1,18 +1,21 @@ +From 55ad91e4db2c8bfa5a579abfc80a238e5871c55a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:34 -0500 -Subject: mm/scatterlist: Do not disable irqs on RT +Subject: [PATCH 160/414] mm/scatterlist: Do not disable irqs on RT For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). Signed-off-by: Thomas Gleixner --- - lib/scatterlist.c | 2 +- + lib/scatterlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/lib/scatterlist.c b/lib/scatterlist.c +index be7b4dd6b68d..d06c15d3d186 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c -@@ -620,7 +620,7 @@ void sg_miter_stop(struct sg_mapping_ite +@@ -620,7 +620,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter) flush_kernel_dcache_page(miter->page); if (miter->__flags & SG_MITER_ATOMIC) { @@ -21,3 +24,6 @@ Signed-off-by: Thomas Gleixner kunmap_atomic(miter->addr); } else kunmap(miter->page); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0161-mm-workingset-do-not-protect-workingset_shadow_nodes.patch b/kernel/patches-4.14.x-rt/0161-0161-mm-workingset-Do-not-protect-workingset_shadow_nodes.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0161-mm-workingset-do-not-protect-workingset_shadow_nodes.patch rename to kernel/patches-4.14.x-rt/0161-0161-mm-workingset-Do-not-protect-workingset_shadow_nodes.patch index 800d0d213..0e15a60a2 100644 --- a/kernel/patches-4.14.x-rt/0161-mm-workingset-do-not-protect-workingset_shadow_nodes.patch +++ b/kernel/patches-4.14.x-rt/0161-0161-mm-workingset-Do-not-protect-workingset_shadow_nodes.patch @@ -1,6 +1,8 @@ +From 91283c599859a8481f06ae5f630ebfc186876814 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 17:19:44 +0100 -Subject: mm/workingset: Do not protect workingset_shadow_nodes with irq off +Subject: [PATCH 161/414] mm/workingset: Do not protect workingset_shadow_nodes + with irq off workingset_shadow_nodes is protected by local_irq_disable(). Some users use spin_lock_irq(). @@ -9,12 +11,14 @@ so I catch users of it which will be introduced later. Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/swap.h | 4 +++- - mm/filemap.c | 9 +++++++-- - mm/truncate.c | 4 +++- - mm/workingset.c | 31 ++++++++++++++++--------------- + include/linux/swap.h | 4 +++- + mm/filemap.c | 9 +++++++-- + mm/truncate.c | 4 +++- + mm/workingset.c | 31 ++++++++++++++++--------------- 4 files changed, 29 insertions(+), 19 deletions(-) +diff --git a/include/linux/swap.h b/include/linux/swap.h +index f02fb5db8914..aff4f8309f6b 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -12,6 +12,7 @@ @@ -35,6 +39,8 @@ Signed-off-by: Sebastian Andrzej Siewior /* linux/mm/page_alloc.c */ extern unsigned long totalram_pages; +diff --git a/mm/filemap.c b/mm/filemap.c +index e2e738cc08b1..c47070dae8b9 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -110,6 +110,7 @@ @@ -45,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int page_cache_tree_insert(struct address_space *mapping, struct page *page, void **shadowp) -@@ -133,8 +134,10 @@ static int page_cache_tree_insert(struct +@@ -133,8 +134,10 @@ static int page_cache_tree_insert(struct address_space *mapping, if (shadowp) *shadowp = p; } @@ -57,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior mapping->nrpages++; return 0; } -@@ -151,6 +154,7 @@ static void page_cache_tree_delete(struc +@@ -151,6 +154,7 @@ static void page_cache_tree_delete(struct address_space *mapping, VM_BUG_ON_PAGE(PageTail(page), page); VM_BUG_ON_PAGE(nr != 1 && shadow, page); @@ -65,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < nr; i++) { struct radix_tree_node *node; void **slot; -@@ -162,8 +166,9 @@ static void page_cache_tree_delete(struc +@@ -162,8 +166,9 @@ static void page_cache_tree_delete(struct address_space *mapping, radix_tree_clear_tags(&mapping->page_tree, node, slot); __radix_tree_replace(&mapping->page_tree, node, slot, shadow, @@ -76,9 +82,11 @@ Signed-off-by: Sebastian Andrzej Siewior if (shadow) { mapping->nrexceptional += nr; +diff --git a/mm/truncate.c b/mm/truncate.c +index 2330223841fb..d0c8e6c8fef5 100644 --- a/mm/truncate.c +++ b/mm/truncate.c -@@ -41,8 +41,10 @@ static void clear_shadow_entry(struct ad +@@ -41,8 +41,10 @@ static void clear_shadow_entry(struct address_space *mapping, pgoff_t index, goto unlock; if (*slot != entry) goto unlock; @@ -90,9 +98,11 @@ Signed-off-by: Sebastian Andrzej Siewior mapping->nrexceptional--; unlock: spin_unlock_irq(&mapping->tree_lock); +diff --git a/mm/workingset.c b/mm/workingset.c +index b997c9de28f6..e252cc69a3d4 100644 --- a/mm/workingset.c +++ b/mm/workingset.c -@@ -338,9 +338,10 @@ void workingset_activation(struct page * +@@ -338,9 +338,10 @@ void workingset_activation(struct page *page) * point where they would still be useful. */ @@ -105,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct address_space *mapping = private; -@@ -358,10 +359,10 @@ void workingset_update_node(struct radix +@@ -358,10 +359,10 @@ void workingset_update_node(struct radix_tree_node *node, void *private) */ if (node->count && node->count == node->exceptional) { if (list_empty(&node->private_list)) @@ -118,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -373,9 +374,9 @@ static unsigned long count_shadow_nodes( +@@ -373,9 +374,9 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker, unsigned long cache; /* list_lru lock nests inside IRQ-safe mapping->tree_lock */ @@ -131,7 +141,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Approximate a reasonable limit for the radix tree nodes -@@ -475,15 +476,15 @@ static enum lru_status shadow_lru_isolat +@@ -475,15 +476,15 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, goto out_invalid; inc_lruvec_page_state(virt_to_page(node), WORKINGSET_NODERECLAIM); __radix_tree_delete_node(&mapping->page_tree, node, @@ -150,7 +160,7 @@ Signed-off-by: Sebastian Andrzej Siewior spin_lock(lru_lock); return ret; } -@@ -494,9 +495,9 @@ static unsigned long scan_shadow_nodes(s +@@ -494,9 +495,9 @@ static unsigned long scan_shadow_nodes(struct shrinker *shrinker, unsigned long ret; /* list_lru lock nests inside IRQ-safe mapping->tree_lock */ @@ -181,3 +191,6 @@ Signed-off-by: Sebastian Andrzej Siewior err: return ret; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0162-signal-fix-up-rcu-wreckage.patch b/kernel/patches-4.14.x-rt/0162-0162-signal-Make-__lock_task_sighand-RT-aware.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0162-signal-fix-up-rcu-wreckage.patch rename to kernel/patches-4.14.x-rt/0162-0162-signal-Make-__lock_task_sighand-RT-aware.patch index 2358a49fd..cbdd7eb8b 100644 --- a/kernel/patches-4.14.x-rt/0162-signal-fix-up-rcu-wreckage.patch +++ b/kernel/patches-4.14.x-rt/0162-0162-signal-Make-__lock_task_sighand-RT-aware.patch @@ -1,18 +1,21 @@ -Subject: signal: Make __lock_task_sighand() RT aware +From 2778f72be014a437093c4f1dcc82949beebaad92 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 22 Jul 2011 08:07:08 +0200 +Subject: [PATCH 162/414] signal: Make __lock_task_sighand() RT aware local_irq_save() + spin_lock(&sighand->siglock) does not work on -RT. Use the nort variants. Signed-off-by: Thomas Gleixner --- - kernel/signal.c | 6 +++--- + kernel/signal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +diff --git a/kernel/signal.c b/kernel/signal.c +index 8e39280f06b4..389ae1235254 100644 --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1301,12 +1301,12 @@ struct sighand_struct *__lock_task_sigha +@@ -1301,12 +1301,12 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, * Disable interrupts early to avoid deadlocks. * See rcu_read_unlock() comment header for details. */ @@ -27,7 +30,7 @@ Signed-off-by: Thomas Gleixner break; } /* -@@ -1327,7 +1327,7 @@ struct sighand_struct *__lock_task_sigha +@@ -1327,7 +1327,7 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, } spin_unlock(&sighand->siglock); rcu_read_unlock(); @@ -36,3 +39,6 @@ Signed-off-by: Thomas Gleixner } return sighand; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0163-oleg-signal-rt-fix.patch b/kernel/patches-4.14.x-rt/0163-0163-signal-x86-Delay-calling-signals-in-atomic.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0163-oleg-signal-rt-fix.patch rename to kernel/patches-4.14.x-rt/0163-0163-signal-x86-Delay-calling-signals-in-atomic.patch index 9aa4e94d7..734a6025a 100644 --- a/kernel/patches-4.14.x-rt/0163-oleg-signal-rt-fix.patch +++ b/kernel/patches-4.14.x-rt/0163-0163-signal-x86-Delay-calling-signals-in-atomic.patch @@ -1,6 +1,7 @@ +From 4ce59a9661d81415bdecd841fd1085ce8f53b093 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: signal/x86: Delay calling signals in atomic +Subject: [PATCH 163/414] 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 @@ -29,16 +30,17 @@ Signed-off-by: Oleg Nesterov Signed-off-by: Steven Rostedt Signed-off-by: Thomas Gleixner --- - - arch/x86/entry/common.c | 7 +++++++ - arch/x86/include/asm/signal.h | 13 +++++++++++++ - include/linux/sched.h | 4 ++++ - kernel/signal.c | 37 +++++++++++++++++++++++++++++++++++-- + arch/x86/entry/common.c | 7 +++++++ + arch/x86/include/asm/signal.h | 13 ++++++++++++ + include/linux/sched.h | 4 ++++ + kernel/signal.c | 37 +++++++++++++++++++++++++++++++++-- 4 files changed, 59 insertions(+), 2 deletions(-) +diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c +index 60e21ccfb6d6..121f804a9dcb 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -151,6 +151,13 @@ static void exit_to_usermode_loop(struct +@@ -151,6 +151,13 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) if (cached_flags & _TIF_NEED_RESCHED) schedule(); @@ -52,6 +54,8 @@ Signed-off-by: Thomas Gleixner if (cached_flags & _TIF_UPROBE) uprobe_notify_resume(regs); +diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h +index 5f9012ff52ed..7c7846cbab45 100644 --- a/arch/x86/include/asm/signal.h +++ b/arch/x86/include/asm/signal.h @@ -28,6 +28,19 @@ typedef struct { @@ -74,6 +78,8 @@ Signed-off-by: Thomas Gleixner #ifndef CONFIG_COMPAT typedef sigset_t compat_sigset_t; #endif +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 985b88c49052..b1ff98fb6dd3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -795,6 +795,10 @@ struct task_struct { @@ -87,9 +93,11 @@ Signed-off-by: Thomas Gleixner unsigned long sas_ss_sp; size_t sas_ss_size; unsigned int sas_ss_flags; +diff --git a/kernel/signal.c b/kernel/signal.c +index 389ae1235254..354dfd87dff9 100644 --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1237,8 +1237,8 @@ int do_send_sig_info(int sig, struct sig +@@ -1237,8 +1237,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. */ @@ -100,7 +108,7 @@ Signed-off-by: Thomas Gleixner { unsigned long int flags; int ret, blocked, ignored; -@@ -1267,6 +1267,39 @@ force_sig_info(int sig, struct siginfo * +@@ -1267,6 +1267,39 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) return ret; } @@ -140,3 +148,6 @@ Signed-off-by: Thomas Gleixner /* * Nuke all other threads in the group. */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0164-x86-signal-delay-calling-signals-on-32bit.patch b/kernel/patches-4.14.x-rt/0164-0164-x86-signal-delay-calling-signals-on-32bit.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0164-x86-signal-delay-calling-signals-on-32bit.patch rename to kernel/patches-4.14.x-rt/0164-0164-x86-signal-delay-calling-signals-on-32bit.patch index e41ae9db7..493d801a4 100644 --- a/kernel/patches-4.14.x-rt/0164-x86-signal-delay-calling-signals-on-32bit.patch +++ b/kernel/patches-4.14.x-rt/0164-0164-x86-signal-delay-calling-signals-on-32bit.patch @@ -1,6 +1,7 @@ +From 7a39438513557e30f567e08393d0bee8e66fcc8c Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Thu, 10 Dec 2015 10:58:51 -0800 -Subject: x86/signal: delay calling signals on 32bit +Subject: [PATCH 164/414] x86/signal: delay calling signals on 32bit When running some ptrace single step tests on x86-32 machine, the below problem is triggered: @@ -26,9 +27,11 @@ from IST context") which was merged in v4.1-rc1. Signed-off-by: Yang Shi Signed-off-by: Sebastian Andrzej Siewior --- - arch/x86/include/asm/signal.h | 2 +- + arch/x86/include/asm/signal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h +index 7c7846cbab45..39117e57caf2 100644 --- a/arch/x86/include/asm/signal.h +++ b/arch/x86/include/asm/signal.h @@ -37,7 +37,7 @@ typedef struct { @@ -40,3 +43,6 @@ Signed-off-by: Sebastian Andrzej Siewior #define ARCH_RT_DELAYS_SIGNAL_SEND #endif +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0165-net-wireless-warn-nort.patch b/kernel/patches-4.14.x-rt/0165-0165-net-wireless-Use-WARN_ON_NORT.patch similarity index 61% rename from kernel/patches-4.14.x-rt/0165-net-wireless-warn-nort.patch rename to kernel/patches-4.14.x-rt/0165-0165-net-wireless-Use-WARN_ON_NORT.patch index 372babe8e..8e51bbfba 100644 --- a/kernel/patches-4.14.x-rt/0165-net-wireless-warn-nort.patch +++ b/kernel/patches-4.14.x-rt/0165-0165-net-wireless-Use-WARN_ON_NORT.patch @@ -1,18 +1,21 @@ -Subject: net/wireless: Use WARN_ON_NORT() +From 64cd415630401e8e9a2734886ede46827da9fb69 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 21 Jul 2011 21:05:33 +0200 +Subject: [PATCH 165/414] net/wireless: Use WARN_ON_NORT() The softirq counter is meaningless on RT, so the check triggers a false positive. Signed-off-by: Thomas Gleixner --- - net/mac80211/rx.c | 2 +- + net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c +index 4daafb07602f..56ec7863d456 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -4252,7 +4252,7 @@ void ieee80211_rx_napi(struct ieee80211_ +@@ -4252,7 +4252,7 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta, struct ieee80211_supported_band *sband; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); @@ -21,3 +24,6 @@ Signed-off-by: Thomas Gleixner if (WARN_ON(status->band >= NUM_NL80211_BANDS)) goto drop; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0166-fs-replace-bh_uptodate_lock-for-rt.patch b/kernel/patches-4.14.x-rt/0166-0166-buffer_head-Replace-bh_uptodate_lock-for-rt.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0166-fs-replace-bh_uptodate_lock-for-rt.patch rename to kernel/patches-4.14.x-rt/0166-0166-buffer_head-Replace-bh_uptodate_lock-for-rt.patch index 0145a2000..9f847275e 100644 --- a/kernel/patches-4.14.x-rt/0166-fs-replace-bh_uptodate_lock-for-rt.patch +++ b/kernel/patches-4.14.x-rt/0166-0166-buffer_head-Replace-bh_uptodate_lock-for-rt.patch @@ -1,22 +1,25 @@ +From 833fa1b6e2980370a3ccca70c291afe4fc4a5d41 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 18 Mar 2011 09:18:52 +0100 -Subject: buffer_head: Replace bh_uptodate_lock for -rt +Subject: [PATCH 166/414] 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. Signed-off-by: Thomas Gleixner --- - fs/buffer.c | 21 +++++++-------------- - fs/ext4/page-io.c | 6 ++---- - fs/ntfs/aops.c | 10 +++------- - fs/xfs/xfs_aops.c | 6 ++---- - include/linux/buffer_head.h | 34 ++++++++++++++++++++++++++++++++++ + fs/buffer.c | 21 +++++++-------------- + fs/ext4/page-io.c | 6 ++---- + fs/ntfs/aops.c | 10 +++------- + fs/xfs/xfs_aops.c | 6 ++---- + include/linux/buffer_head.h | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 48 insertions(+), 29 deletions(-) +diff --git a/fs/buffer.c b/fs/buffer.c +index b96f3b98a6ef..4ca5f222537a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c -@@ -302,8 +302,7 @@ static void end_buffer_async_read(struct +@@ -302,8 +302,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) * decide that the page is now completely done. */ first = page_buffers(page); @@ -26,7 +29,7 @@ Signed-off-by: Thomas Gleixner clear_buffer_async_read(bh); unlock_buffer(bh); tmp = bh; -@@ -316,8 +315,7 @@ static void end_buffer_async_read(struct +@@ -316,8 +315,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) } tmp = tmp->b_this_page; } while (tmp != bh); @@ -36,7 +39,7 @@ Signed-off-by: Thomas Gleixner /* * If none of the buffers had errors and they are all -@@ -329,9 +327,7 @@ static void end_buffer_async_read(struct +@@ -329,9 +327,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) return; still_busy: @@ -47,7 +50,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -358,8 +354,7 @@ void end_buffer_async_write(struct buffe +@@ -358,8 +354,7 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) } first = page_buffers(page); @@ -57,7 +60,7 @@ Signed-off-by: Thomas Gleixner clear_buffer_async_write(bh); unlock_buffer(bh); -@@ -371,15 +366,12 @@ void end_buffer_async_write(struct buffe +@@ -371,15 +366,12 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) } tmp = tmp->b_this_page; } @@ -75,7 +78,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(end_buffer_async_write); -@@ -3417,6 +3409,7 @@ struct buffer_head *alloc_buffer_head(gf +@@ -3417,6 +3409,7 @@ struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags); if (ret) { INIT_LIST_HEAD(&ret->b_assoc_buffers); @@ -83,9 +86,11 @@ Signed-off-by: Thomas Gleixner preempt_disable(); __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 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c -@@ -95,8 +95,7 @@ static void ext4_finish_bio(struct bio * +@@ -95,8 +95,7 @@ static void ext4_finish_bio(struct bio *bio) * We check all buffers in the page under BH_Uptodate_Lock * to avoid races with other end io clearing async_write flags */ @@ -95,7 +100,7 @@ Signed-off-by: Thomas Gleixner do { if (bh_offset(bh) < bio_start || bh_offset(bh) + bh->b_size > bio_end) { -@@ -108,8 +107,7 @@ static void ext4_finish_bio(struct bio * +@@ -108,8 +107,7 @@ static void ext4_finish_bio(struct bio *bio) if (bio->bi_status) buffer_io_error(bh); } while ((bh = bh->b_this_page) != head); @@ -105,9 +110,11 @@ Signed-off-by: Thomas Gleixner if (!under_io) { #ifdef CONFIG_EXT4_FS_ENCRYPTION if (data_page) +diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c +index cc91856b5e2d..e11411997769 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c -@@ -108,8 +108,7 @@ static void ntfs_end_buffer_async_read(s +@@ -108,8 +108,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) "0x%llx.", (unsigned long long)bh->b_blocknr); } first = page_buffers(page); @@ -117,7 +124,7 @@ Signed-off-by: Thomas Gleixner clear_buffer_async_read(bh); unlock_buffer(bh); tmp = bh; -@@ -124,8 +123,7 @@ static void ntfs_end_buffer_async_read(s +@@ -124,8 +123,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) } tmp = tmp->b_this_page; } while (tmp != bh); @@ -127,7 +134,7 @@ Signed-off-by: Thomas Gleixner /* * If none of the buffers had errors then we can set the page uptodate, * but we first have to perform the post read mst fixups, if the -@@ -160,9 +158,7 @@ static void ntfs_end_buffer_async_read(s +@@ -160,9 +158,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) unlock_page(page); return; still_busy: @@ -138,6 +145,8 @@ Signed-off-by: Thomas Gleixner } /** +diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c +index b0cccf8a81a8..eaa4383defec 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -120,8 +120,7 @@ xfs_finish_page_writeback( @@ -160,6 +169,8 @@ Signed-off-by: Thomas Gleixner if (!busy) end_page_writeback(bvec->bv_page); +diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h +index afa37f807f12..d0bd1957e8b6 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -76,8 +76,42 @@ struct buffer_head { @@ -205,3 +216,6 @@ Signed-off-by: Thomas Gleixner /* * macro tricks to expand the set_buffer_foo(), clear_buffer_foo() * and buffer_foo() functions. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0167-fs-jbd-replace-bh_state-lock.patch b/kernel/patches-4.14.x-rt/0167-0167-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0167-fs-jbd-replace-bh_state-lock.patch rename to kernel/patches-4.14.x-rt/0167-0167-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch index a56bc6909..0896888c3 100644 --- a/kernel/patches-4.14.x-rt/0167-fs-jbd-replace-bh_state-lock.patch +++ b/kernel/patches-4.14.x-rt/0167-0167-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch @@ -1,6 +1,8 @@ +From 8e65c67b92069ee80738256fa83b74d241c8784f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 18 Mar 2011 10:11:25 +0100 -Subject: fs: jbd/jbd2: Make state lock and journal head lock rt safe +Subject: [PATCH 167/414] fs: jbd/jbd2: Make state lock and journal head lock + rt safe bit_spin_locks break under RT. @@ -10,7 +12,13 @@ Signed-off-by: Thomas Gleixner include/linux/buffer_head.h | 8 ++++++++ include/linux/jbd2.h | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) +--- + include/linux/buffer_head.h | 8 ++++++++ + include/linux/jbd2.h | 24 ++++++++++++++++++++++++ + 2 files changed, 32 insertions(+) +diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h +index d0bd1957e8b6..48505fade7e1 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -78,6 +78,10 @@ struct buffer_head { @@ -24,7 +32,7 @@ Signed-off-by: Thomas Gleixner #endif }; -@@ -109,6 +113,10 @@ static inline void buffer_head_init_lock +@@ -109,6 +113,10 @@ static inline void buffer_head_init_locks(struct buffer_head *bh) { #ifdef CONFIG_PREEMPT_RT_BASE spin_lock_init(&bh->b_uptodate_lock); @@ -35,9 +43,11 @@ Signed-off-by: Thomas Gleixner #endif } +diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h +index 29290bfb94a8..32379bfab9f0 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h -@@ -347,32 +347,56 @@ static inline struct journal_head *bh2jh +@@ -347,32 +347,56 @@ static inline struct journal_head *bh2jh(struct buffer_head *bh) static inline void jbd_lock_bh_state(struct buffer_head *bh) { @@ -94,3 +104,6 @@ Signed-off-by: Thomas Gleixner } #define J_ASSERT(assert) BUG_ON(!(assert)) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0168-list_bl.h-make-list-head-locking-RT-safe.patch b/kernel/patches-4.14.x-rt/0168-0168-list_bl-Make-list-head-locking-RT-safe.patch similarity index 90% rename from kernel/patches-4.14.x-rt/0168-list_bl.h-make-list-head-locking-RT-safe.patch rename to kernel/patches-4.14.x-rt/0168-0168-list_bl-Make-list-head-locking-RT-safe.patch index 9ea1a600d..561579756 100644 --- a/kernel/patches-4.14.x-rt/0168-list_bl.h-make-list-head-locking-RT-safe.patch +++ b/kernel/patches-4.14.x-rt/0168-0168-list_bl-Make-list-head-locking-RT-safe.patch @@ -1,6 +1,7 @@ +From f71f838cda965b8fec85efa17a009edb3e5a4e0d Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Fri, 21 Jun 2013 15:07:25 -0400 -Subject: list_bl: Make list head locking RT safe +Subject: [PATCH 168/414] 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 @@ -47,9 +48,11 @@ concern. Signed-off-by: Paul Gortmaker Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/list_bl.h | 28 ++++++++++++++++++++++++++-- + include/linux/list_bl.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) +diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h +index 3fc2cc57ba1b..69b659259bac 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h @@ -3,6 +3,7 @@ @@ -85,7 +88,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) { -@@ -119,12 +129,26 @@ static inline void hlist_bl_del_init(str +@@ -119,12 +129,26 @@ static inline void hlist_bl_del_init(struct hlist_bl_node *n) static inline void hlist_bl_lock(struct hlist_bl_head *b) { @@ -112,3 +115,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline bool hlist_bl_is_locked(struct hlist_bl_head *b) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0169-list_bl-fixup-bogus-lockdep-warning.patch b/kernel/patches-4.14.x-rt/0169-0169-list_bl-fixup-bogus-lockdep-warning.patch similarity index 90% rename from kernel/patches-4.14.x-rt/0169-list_bl-fixup-bogus-lockdep-warning.patch rename to kernel/patches-4.14.x-rt/0169-0169-list_bl-fixup-bogus-lockdep-warning.patch index 43ebad4b9..cfe84425d 100644 --- a/kernel/patches-4.14.x-rt/0169-list_bl-fixup-bogus-lockdep-warning.patch +++ b/kernel/patches-4.14.x-rt/0169-0169-list_bl-fixup-bogus-lockdep-warning.patch @@ -1,6 +1,7 @@ +From f3ac9ade545afe51f9011a688b6d1d3e4a054fd3 Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 31 Mar 2016 00:04:25 -0500 -Subject: [PATCH] list_bl: fixup bogus lockdep warning +Subject: [PATCH 169/414] list_bl: fixup bogus lockdep warning At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). @@ -69,9 +70,11 @@ Tested-by: Luis Claudio R. Goncalves Signed-off-by: Josh Cartwright Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/list_bl.h | 12 +++++++----- + include/linux/list_bl.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) +diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h +index 69b659259bac..0b5de7d9ffcf 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h @@ -43,13 +43,15 @@ struct hlist_bl_node { @@ -95,3 +98,6 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0170-genirq-disable-irqpoll-on-rt.patch b/kernel/patches-4.14.x-rt/0170-0170-genirq-Disable-irqpoll-on-rt.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0170-genirq-disable-irqpoll-on-rt.patch rename to kernel/patches-4.14.x-rt/0170-0170-genirq-Disable-irqpoll-on-rt.patch index e696a2cd8..a2641262a 100644 --- a/kernel/patches-4.14.x-rt/0170-genirq-disable-irqpoll-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0170-0170-genirq-Disable-irqpoll-on-rt.patch @@ -1,19 +1,21 @@ +From 74dd781983f8a8901f81e94dfa01c29e375345ae Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:57 -0500 -Subject: genirq: Disable irqpoll on -rt +Subject: [PATCH 170/414] genirq: Disable irqpoll on -rt Creates long latencies for no value Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - kernel/irq/spurious.c | 8 ++++++++ + kernel/irq/spurious.c | 8 ++++++++ 1 file changed, 8 insertions(+) +diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c +index 987d7bca4864..75347fb1dfea 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c -@@ -445,6 +445,10 @@ MODULE_PARM_DESC(noirqdebug, "Disable ir +@@ -445,6 +445,10 @@ MODULE_PARM_DESC(noirqdebug, "Disable irq lockup detection when true"); static int __init irqfixup_setup(char *str) { @@ -35,3 +37,6 @@ Signed-off-by: Thomas Gleixner irqfixup = 2; printk(KERN_WARNING "Misrouted IRQ fixup and polling support " "enabled\n"); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0171-genirq-force-threading.patch b/kernel/patches-4.14.x-rt/0171-0171-genirq-Force-interrupt-thread-on-RT.patch similarity index 61% rename from kernel/patches-4.14.x-rt/0171-genirq-force-threading.patch rename to kernel/patches-4.14.x-rt/0171-0171-genirq-Force-interrupt-thread-on-RT.patch index 9fddc86f9..167b3039f 100644 --- a/kernel/patches-4.14.x-rt/0171-genirq-force-threading.patch +++ b/kernel/patches-4.14.x-rt/0171-0171-genirq-Force-interrupt-thread-on-RT.patch @@ -1,19 +1,22 @@ -Subject: genirq: Force interrupt thread on RT +From 8627b649b835af06098dd93db5bf4b7155360f10 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Sun, 03 Apr 2011 11:57:29 +0200 +Date: Sun, 3 Apr 2011 11:57:29 +0200 +Subject: [PATCH 171/414] genirq: Force interrupt thread on RT Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. Signed-off-by: Thomas Gleixner --- - include/linux/interrupt.h | 6 +++++- - kernel/irq/manage.c | 2 ++ + include/linux/interrupt.h | 6 +++++- + kernel/irq/manage.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 2957da07e967..2395ebb443b9 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -429,9 +429,13 @@ extern int irq_set_irqchip_state(unsigne +@@ -429,9 +429,13 @@ extern int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, bool state); #ifdef CONFIG_IRQ_FORCED_THREADING @@ -28,6 +31,8 @@ Signed-off-by: Thomas Gleixner #endif #ifndef __ARCH_SET_SOFTIRQ_PENDING +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index b02caa442776..6d1f321152d0 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -24,6 +24,7 @@ @@ -38,7 +43,7 @@ Signed-off-by: Thomas Gleixner __read_mostly bool force_irqthreads; static int __init setup_forced_irqthreads(char *arg) -@@ -32,6 +33,7 @@ static int __init setup_forced_irqthread +@@ -32,6 +33,7 @@ static int __init setup_forced_irqthreads(char *arg) return 0; } early_param("threadirqs", setup_forced_irqthreads); @@ -46,3 +51,6 @@ Signed-off-by: Thomas Gleixner #endif static void __synchronize_hardirq(struct irq_desc *desc) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0172-drivers-net-vortex-fix-locking-issues.patch b/kernel/patches-4.14.x-rt/0172-0172-drivers-net-vortex-fix-locking-issues.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0172-drivers-net-vortex-fix-locking-issues.patch rename to kernel/patches-4.14.x-rt/0172-0172-drivers-net-vortex-fix-locking-issues.patch index 54eb60b05..f8208c813 100644 --- a/kernel/patches-4.14.x-rt/0172-drivers-net-vortex-fix-locking-issues.patch +++ b/kernel/patches-4.14.x-rt/0172-0172-drivers-net-vortex-fix-locking-issues.patch @@ -1,6 +1,7 @@ +From 930cd4e6b20e30aa12fa6219f000ecb30cbe38c5 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Fri, 3 Jul 2009 08:30:00 -0500 -Subject: drivers/net: vortex fix locking issues +Subject: [PATCH 172/414] drivers/net: vortex fix locking issues Argh, cut and paste wasn't enough... @@ -16,10 +17,15 @@ Signed-off-by: Thomas Gleixner 1 file changed, 4 insertions(+), 4 deletions(-) Signed-off-by: Ingo Molnar +--- + drivers/net/ethernet/3com/3c59x.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c +index 402d9090ad29..9bc02563b853 100644 --- a/drivers/net/ethernet/3com/3c59x.c +++ b/drivers/net/ethernet/3com/3c59x.c -@@ -842,9 +842,9 @@ static void poll_vortex(struct net_devic +@@ -842,9 +842,9 @@ static void poll_vortex(struct net_device *dev) { struct vortex_private *vp = netdev_priv(dev); unsigned long flags; @@ -31,7 +37,7 @@ Signed-off-by: Ingo Molnar } #endif -@@ -1908,12 +1908,12 @@ static void vortex_tx_timeout(struct net +@@ -1908,12 +1908,12 @@ static void vortex_tx_timeout(struct net_device *dev) * Block interrupts because vortex_interrupt does a bare spin_lock() */ unsigned long flags; @@ -46,3 +52,6 @@ Signed-off-by: Ingo Molnar } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0173-delayacct-use-raw_spinlocks.patch b/kernel/patches-4.14.x-rt/0173-0173-delayacct-use-raw_spinlocks.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0173-delayacct-use-raw_spinlocks.patch rename to kernel/patches-4.14.x-rt/0173-0173-delayacct-use-raw_spinlocks.patch index 9ca3e774b..14a1de3fe 100644 --- a/kernel/patches-4.14.x-rt/0173-delayacct-use-raw_spinlocks.patch +++ b/kernel/patches-4.14.x-rt/0173-0173-delayacct-use-raw_spinlocks.patch @@ -1,6 +1,7 @@ +From dba55fa5949311370df5147dd0e2b4662f5403f0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sat, 20 May 2017 12:32:23 +0200 -Subject: [PATCH] delayacct: use raw_spinlocks +Subject: [PATCH 173/414] delayacct: use raw_spinlocks try_to_wake_up() might invoke delayacct_blkio_end() while holding the pi_lock. The lock is only held for a short amount of time so it should @@ -8,10 +9,12 @@ be safe to make it raw. Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/delayacct.h | 2 +- - kernel/delayacct.c | 16 ++++++++-------- + include/linux/delayacct.h | 2 +- + kernel/delayacct.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) +diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h +index 5e335b6203f4..e6c0448ebcc7 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h @@ -29,7 +29,7 @@ @@ -23,9 +26,11 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned int flags; /* Private per-task flags */ /* For each stat XXX, add following, aligned appropriately +diff --git a/kernel/delayacct.c b/kernel/delayacct.c +index e2764d767f18..0c1b7025950f 100644 --- a/kernel/delayacct.c +++ b/kernel/delayacct.c -@@ -44,23 +44,23 @@ void __delayacct_tsk_init(struct task_st +@@ -44,23 +44,23 @@ void __delayacct_tsk_init(struct task_struct *tsk) { tsk->delays = kmem_cache_zalloc(delayacct_cache, GFP_KERNEL); if (tsk->delays) @@ -53,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -127,7 +127,7 @@ int __delayacct_add_tsk(struct taskstats +@@ -127,7 +127,7 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk) /* zero XXX_total, non-zero XXX_count implies XXX stat overflowed */ @@ -62,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior tmp = d->blkio_delay_total + tsk->delays->blkio_delay; d->blkio_delay_total = (tmp < d->blkio_delay_total) ? 0 : tmp; tmp = d->swapin_delay_total + tsk->delays->swapin_delay; -@@ -137,7 +137,7 @@ int __delayacct_add_tsk(struct taskstats +@@ -137,7 +137,7 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk) d->blkio_count += tsk->delays->blkio_count; d->swapin_count += tsk->delays->swapin_count; d->freepages_count += tsk->delays->freepages_count; @@ -71,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -147,10 +147,10 @@ int __delayacct_add_tsk(struct taskstats +@@ -147,10 +147,10 @@ __u64 __delayacct_blkio_ticks(struct task_struct *tsk) __u64 ret; unsigned long flags; @@ -84,3 +89,6 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0174-mm-page_alloc-rt-friendly-per-cpu-pages.patch b/kernel/patches-4.14.x-rt/0174-0174-mm-page_alloc-rt-friendly-per-cpu-pages.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0174-mm-page_alloc-rt-friendly-per-cpu-pages.patch rename to kernel/patches-4.14.x-rt/0174-0174-mm-page_alloc-rt-friendly-per-cpu-pages.patch index 4419b5e89..2269cce93 100644 --- a/kernel/patches-4.14.x-rt/0174-mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/kernel/patches-4.14.x-rt/0174-0174-mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,6 +1,7 @@ +From 1cd4c2aa5611c70d3707d3e35c6b5867584227f5 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:37 -0500 -Subject: mm: page_alloc: rt-friendly per-cpu pages +Subject: [PATCH 174/414] 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. @@ -12,9 +13,11 @@ Contains fixes from: Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- - mm/page_alloc.c | 55 +++++++++++++++++++++++++++++++++++++++---------------- + mm/page_alloc.c | 55 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 16 deletions(-) +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index 1d7693c35424..4beed2c1b82f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -61,6 +61,7 @@ @@ -44,7 +47,7 @@ Signed-off-by: Thomas Gleixner int page_group_by_mobility_disabled __read_mostly; #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT -@@ -1257,10 +1270,10 @@ static void __free_pages_ok(struct page +@@ -1257,10 +1270,10 @@ static void __free_pages_ok(struct page *page, unsigned int order) return; migratetype = get_pfnblock_migratetype(page, pfn); @@ -57,7 +60,7 @@ Signed-off-by: Thomas Gleixner } static void __init __free_pages_boot_core(struct page *page, unsigned int order) -@@ -2380,14 +2393,14 @@ void drain_zone_pages(struct zone *zone, +@@ -2380,14 +2393,14 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) unsigned long flags; int to_drain, batch; @@ -74,7 +77,7 @@ Signed-off-by: Thomas Gleixner } #endif -@@ -2404,7 +2417,7 @@ static void drain_pages_zone(unsigned in +@@ -2404,7 +2417,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) struct per_cpu_pageset *pset; struct per_cpu_pages *pcp; @@ -83,7 +86,7 @@ Signed-off-by: Thomas Gleixner pset = per_cpu_ptr(zone->pageset, cpu); pcp = &pset->pcp; -@@ -2412,7 +2425,7 @@ static void drain_pages_zone(unsigned in +@@ -2412,7 +2425,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) free_pcppages_bulk(zone, pcp->count, pcp); pcp->count = 0; } @@ -92,7 +95,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2447,6 +2460,7 @@ void drain_local_pages(struct zone *zone +@@ -2447,6 +2460,7 @@ void drain_local_pages(struct zone *zone) drain_pages(cpu); } @@ -100,7 +103,7 @@ Signed-off-by: Thomas Gleixner static void drain_local_pages_wq(struct work_struct *work) { /* -@@ -2460,6 +2474,7 @@ static void drain_local_pages_wq(struct +@@ -2460,6 +2474,7 @@ static void drain_local_pages_wq(struct work_struct *work) drain_local_pages(NULL); preempt_enable(); } @@ -132,7 +135,7 @@ Signed-off-by: Thomas Gleixner mutex_unlock(&pcpu_drain_mutex); } -@@ -2610,7 +2633,7 @@ void free_hot_cold_page(struct page *pag +@@ -2610,7 +2633,7 @@ void free_hot_cold_page(struct page *page, bool cold) migratetype = get_pfnblock_migratetype(page, pfn); set_pcppage_migratetype(page, migratetype); @@ -141,7 +144,7 @@ Signed-off-by: Thomas Gleixner __count_vm_event(PGFREE); /* -@@ -2641,7 +2664,7 @@ void free_hot_cold_page(struct page *pag +@@ -2641,7 +2664,7 @@ void free_hot_cold_page(struct page *page, bool cold) } out: @@ -150,7 +153,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2789,7 +2812,7 @@ static struct page *rmqueue_pcplist(stru +@@ -2789,7 +2812,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, struct page *page; unsigned long flags; @@ -159,7 +162,7 @@ Signed-off-by: Thomas Gleixner pcp = &this_cpu_ptr(zone->pageset)->pcp; list = &pcp->lists[migratetype]; page = __rmqueue_pcplist(zone, migratetype, cold, pcp, list); -@@ -2797,7 +2820,7 @@ static struct page *rmqueue_pcplist(stru +@@ -2797,7 +2820,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); } @@ -168,7 +171,7 @@ Signed-off-by: Thomas Gleixner return page; } -@@ -2824,7 +2847,7 @@ struct page *rmqueue(struct zone *prefer +@@ -2824,7 +2847,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)); @@ -177,7 +180,7 @@ Signed-off-by: Thomas Gleixner do { page = NULL; -@@ -2844,14 +2867,14 @@ struct page *rmqueue(struct zone *prefer +@@ -2844,14 +2867,14 @@ struct page *rmqueue(struct zone *preferred_zone, __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); @@ -212,3 +215,6 @@ Signed-off-by: Thomas Gleixner } #ifdef CONFIG_MEMORY_HOTREMOVE +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0175-mm-page_alloc-reduce-lock-sections-further.patch b/kernel/patches-4.14.x-rt/0175-0175-mm-page_alloc-Reduce-lock-sections-further.patch similarity index 88% rename from kernel/patches-4.14.x-rt/0175-mm-page_alloc-reduce-lock-sections-further.patch rename to kernel/patches-4.14.x-rt/0175-0175-mm-page_alloc-Reduce-lock-sections-further.patch index e99b0a910..786146abc 100644 --- a/kernel/patches-4.14.x-rt/0175-mm-page_alloc-reduce-lock-sections-further.patch +++ b/kernel/patches-4.14.x-rt/0175-0175-mm-page_alloc-Reduce-lock-sections-further.patch @@ -1,6 +1,7 @@ +From 49397b59f5b3bb6372fc6684d9914286f425c970 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra -Date: Fri Jul 3 08:44:37 2009 -0500 -Subject: mm: page_alloc: Reduce lock sections further +Date: Fri, 3 Jul 2009 08:44:37 -0500 +Subject: [PATCH 175/414] mm: page_alloc: Reduce lock sections further Split out the pages which are to be freed into a separate list and call free_pages_bulk() outside of the percpu page allocator locks. @@ -8,12 +9,14 @@ call free_pages_bulk() outside of the percpu page allocator locks. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner --- - mm/page_alloc.c | 93 +++++++++++++++++++++++++++++++++++++++----------------- + mm/page_alloc.c | 93 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 28 deletions(-) +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index 4beed2c1b82f..9e57c6f19309 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1107,7 +1107,7 @@ static bool bulkfree_pcp_prepare(struct +@@ -1107,7 +1107,7 @@ static bool bulkfree_pcp_prepare(struct page *page) #endif /* CONFIG_DEBUG_VM */ /* @@ -22,7 +25,7 @@ Signed-off-by: Thomas Gleixner * Assumes all pages on list are in same zone, and of same order. * count is the number of pages to free. * -@@ -1118,15 +1118,53 @@ static bool bulkfree_pcp_prepare(struct +@@ -1118,15 +1118,53 @@ static bool bulkfree_pcp_prepare(struct page *page) * pinned" detection logic. */ static void free_pcppages_bulk(struct zone *zone, int count, @@ -80,7 +83,7 @@ Signed-off-by: Thomas Gleixner while (count) { struct page *page; struct list_head *list; -@@ -1142,7 +1180,7 @@ static void free_pcppages_bulk(struct zo +@@ -1142,7 +1180,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, batch_free++; if (++migratetype == MIGRATE_PCPTYPES) migratetype = 0; @@ -89,7 +92,7 @@ Signed-off-by: Thomas Gleixner } while (list_empty(list)); /* This is the only non-empty list. Free them all. */ -@@ -1150,27 +1188,12 @@ static void free_pcppages_bulk(struct zo +@@ -1150,27 +1188,12 @@ static void free_pcppages_bulk(struct zone *zone, int count, batch_free = count; do { @@ -118,7 +121,7 @@ Signed-off-by: Thomas Gleixner } static void free_one_page(struct zone *zone, -@@ -1178,13 +1201,15 @@ static void free_one_page(struct zone *z +@@ -1178,13 +1201,15 @@ static void free_one_page(struct zone *zone, unsigned int order, int migratetype) { @@ -136,7 +139,7 @@ Signed-off-by: Thomas Gleixner } static void __meminit __init_single_page(struct page *page, unsigned long pfn, -@@ -2391,16 +2416,18 @@ static int rmqueue_bulk(struct zone *zon +@@ -2391,16 +2416,18 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order, void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) { unsigned long flags; @@ -156,7 +159,7 @@ Signed-off-by: Thomas Gleixner } #endif -@@ -2416,16 +2443,21 @@ static void drain_pages_zone(unsigned in +@@ -2416,16 +2443,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; @@ -180,7 +183,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2659,8 +2691,13 @@ void free_hot_cold_page(struct page *pag +@@ -2659,8 +2691,13 @@ void free_hot_cold_page(struct page *page, bool cold) pcp->count++; if (pcp->count >= pcp->high) { unsigned long batch = READ_ONCE(pcp->batch); @@ -195,3 +198,6 @@ Signed-off-by: Thomas Gleixner } out: +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0176-mm-convert-swap-to-percpu-locked.patch b/kernel/patches-4.14.x-rt/0176-0176-mm-swap-Convert-to-percpu-locked.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0176-mm-convert-swap-to-percpu-locked.patch rename to kernel/patches-4.14.x-rt/0176-0176-mm-swap-Convert-to-percpu-locked.patch index efe2b1966..d0ddfe2c7 100644 --- a/kernel/patches-4.14.x-rt/0176-mm-convert-swap-to-percpu-locked.patch +++ b/kernel/patches-4.14.x-rt/0176-0176-mm-swap-Convert-to-percpu-locked.patch @@ -1,23 +1,25 @@ +From cb696f82bba2d4372f69230313b40eeb3f8e5add Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:51 -0500 -Subject: mm/swap: Convert to percpu locked +Subject: [PATCH 176/414] 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". Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - include/linux/swap.h | 1 + - mm/compaction.c | 6 ++++-- - mm/page_alloc.c | 3 ++- - mm/swap.c | 38 ++++++++++++++++++++++---------------- + include/linux/swap.h | 1 + + mm/compaction.c | 6 ++++-- + mm/page_alloc.c | 3 ++- + mm/swap.c | 38 ++++++++++++++++++++++---------------- 4 files changed, 29 insertions(+), 19 deletions(-) +diff --git a/include/linux/swap.h b/include/linux/swap.h +index aff4f8309f6b..6c775168df67 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h -@@ -312,6 +312,7 @@ extern unsigned long nr_free_pagecache_p +@@ -312,6 +312,7 @@ extern unsigned long nr_free_pagecache_pages(void); /* linux/mm/swap.c */ @@ -25,9 +27,11 @@ Signed-off-by: Thomas Gleixner extern void lru_cache_add(struct page *); 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 85395dc6eb13..d6c8ed009e93 100644 --- a/mm/compaction.c +++ b/mm/compaction.c -@@ -1634,10 +1634,12 @@ static enum compact_result compact_zone( +@@ -1634,10 +1634,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) { @@ -42,9 +46,11 @@ Signed-off-by: Thomas Gleixner /* No more flushing until we migrate again */ cc->last_migrated_pfn = 0; } +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index 9e57c6f19309..64cec431b6e9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -6839,8 +6839,9 @@ void __init free_area_init(unsigned long +@@ -6839,8 +6839,9 @@ void __init free_area_init(unsigned long *zones_size) static int page_alloc_cpu_dead(unsigned int cpu) { @@ -55,6 +61,8 @@ Signed-off-by: Thomas Gleixner drain_pages(cpu); /* +diff --git a/mm/swap.c b/mm/swap.c +index a77d68f2c1b6..c63d649fb3a9 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -32,6 +32,7 @@ @@ -65,7 +73,7 @@ Signed-off-by: Thomas Gleixner #include #include -@@ -50,6 +51,8 @@ static DEFINE_PER_CPU(struct pagevec, lr +@@ -50,6 +51,8 @@ static DEFINE_PER_CPU(struct pagevec, lru_lazyfree_pvecs); #ifdef CONFIG_SMP static DEFINE_PER_CPU(struct pagevec, activate_page_pvecs); #endif @@ -74,7 +82,7 @@ Signed-off-by: Thomas Gleixner /* * This path almost never happens for VM activity - pages are normally -@@ -252,11 +255,11 @@ void rotate_reclaimable_page(struct page +@@ -252,11 +255,11 @@ void rotate_reclaimable_page(struct page *page) unsigned long flags; get_page(page); @@ -113,7 +121,7 @@ Signed-off-by: Thomas Gleixner int i; /* -@@ -360,7 +364,7 @@ static void __lru_cache_activate_page(st +@@ -360,7 +364,7 @@ static void __lru_cache_activate_page(struct page *page) } } @@ -149,7 +157,7 @@ Signed-off-by: Thomas Gleixner } pvec = &per_cpu(lru_deactivate_file_pvecs, cpu); -@@ -647,11 +651,12 @@ void deactivate_file_page(struct page *p +@@ -647,11 +651,12 @@ void deactivate_file_page(struct page *page) return; if (likely(get_page_unless_zero(page))) { @@ -164,7 +172,7 @@ Signed-off-by: Thomas Gleixner } } -@@ -666,19 +671,20 @@ void mark_page_lazyfree(struct page *pag +@@ -666,19 +671,20 @@ void mark_page_lazyfree(struct page *page) { if (PageLRU(page) && PageAnon(page) && PageSwapBacked(page) && !PageSwapCache(page) && !PageUnevictable(page)) { @@ -189,3 +197,6 @@ Signed-off-by: Thomas Gleixner } static void lru_add_drain_per_cpu(struct work_struct *dummy) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0177-mm-perform-lru_add_drain_all-remotely.patch b/kernel/patches-4.14.x-rt/0177-0177-mm-perform-lru_add_drain_all-remotely.patch similarity index 89% rename from kernel/patches-4.14.x-rt/0177-mm-perform-lru_add_drain_all-remotely.patch rename to kernel/patches-4.14.x-rt/0177-0177-mm-perform-lru_add_drain_all-remotely.patch index a223409eb..2e2075ffe 100644 --- a/kernel/patches-4.14.x-rt/0177-mm-perform-lru_add_drain_all-remotely.patch +++ b/kernel/patches-4.14.x-rt/0177-0177-mm-perform-lru_add_drain_all-remotely.patch @@ -1,6 +1,7 @@ +From 7b12536894736db86813a5861a06fef92dd6b42b Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 27 May 2016 15:03:28 +0200 -Subject: [PATCH] mm: perform lru_add_drain_all() remotely +Subject: [PATCH 177/414] 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 @@ -19,9 +20,11 @@ Signed-off-by: Rik van Riel Signed-off-by: Luiz Capitulino Signed-off-by: Sebastian Andrzej Siewior --- - mm/swap.c | 36 ++++++++++++++++++++++++++++++------ + mm/swap.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) +diff --git a/mm/swap.c b/mm/swap.c +index c63d649fb3a9..30d62efe001b 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -617,9 +617,15 @@ void lru_add_drain_cpu(int cpu) @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void lru_add_drain_per_cpu(struct work_struct *dummy) { lru_add_drain(); -@@ -694,6 +710,16 @@ static void lru_add_drain_per_cpu(struct +@@ -694,6 +710,16 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy) static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work); @@ -100,3 +103,6 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_unlock(&lock); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0178-mm-make-vmstat-rt-aware.patch b/kernel/patches-4.14.x-rt/0178-0178-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch similarity index 63% rename from kernel/patches-4.14.x-rt/0178-mm-make-vmstat-rt-aware.patch rename to kernel/patches-4.14.x-rt/0178-0178-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch index 7a45b97c0..b57abb14b 100644 --- a/kernel/patches-4.14.x-rt/0178-mm-make-vmstat-rt-aware.patch +++ b/kernel/patches-4.14.x-rt/0178-0178-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch @@ -1,6 +1,8 @@ +From d048841de7c756bc21e4fcc5536d2e9abff69d53 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:13 -0500 -Subject: mm/vmstat: Protect per cpu variables with preempt disable on RT +Subject: [PATCH 178/414] 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 IRQ-off regions while on -RT it is not. "preempt_disable" ensures that the @@ -8,15 +10,16 @@ same ressources is not updated in parallel due to preemption. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - include/linux/vmstat.h | 4 ++++ - mm/vmstat.c | 12 ++++++++++++ + include/linux/vmstat.h | 4 ++++ + mm/vmstat.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) +diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h +index 1e0cb72e0598..87ab0996a9b0 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h -@@ -33,7 +33,9 @@ DECLARE_PER_CPU(struct vm_event_state, v +@@ -33,7 +33,9 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states); */ static inline void __count_vm_event(enum vm_event_item item) { @@ -26,7 +29,7 @@ Signed-off-by: Thomas Gleixner } static inline void count_vm_event(enum vm_event_item item) -@@ -43,7 +45,9 @@ static inline void count_vm_event(enum v +@@ -43,7 +45,9 @@ static inline void count_vm_event(enum vm_event_item item) static inline void __count_vm_events(enum vm_event_item item, long delta) { @@ -36,9 +39,11 @@ Signed-off-by: Thomas Gleixner } static inline void count_vm_events(enum vm_event_item item, long delta) +diff --git a/mm/vmstat.c b/mm/vmstat.c +index 4bb13e72ac97..0d17b8faeac7 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -249,6 +249,7 @@ void __mod_zone_page_state(struct zone * +@@ -249,6 +249,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item, long x; long t; @@ -46,7 +51,7 @@ Signed-off-by: Thomas Gleixner x = delta + __this_cpu_read(*p); t = __this_cpu_read(pcp->stat_threshold); -@@ -258,6 +259,7 @@ void __mod_zone_page_state(struct zone * +@@ -258,6 +259,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item, x = 0; } __this_cpu_write(*p, x); @@ -54,7 +59,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__mod_zone_page_state); -@@ -269,6 +271,7 @@ void __mod_node_page_state(struct pglist +@@ -269,6 +271,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item, long x; long t; @@ -62,7 +67,7 @@ Signed-off-by: Thomas Gleixner x = delta + __this_cpu_read(*p); t = __this_cpu_read(pcp->stat_threshold); -@@ -278,6 +281,7 @@ void __mod_node_page_state(struct pglist +@@ -278,6 +281,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item, x = 0; } __this_cpu_write(*p, x); @@ -70,7 +75,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__mod_node_page_state); -@@ -310,6 +314,7 @@ void __inc_zone_state(struct zone *zone, +@@ -310,6 +314,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat_item item) s8 __percpu *p = pcp->vm_stat_diff + item; s8 v, t; @@ -78,7 +83,7 @@ Signed-off-by: Thomas Gleixner v = __this_cpu_inc_return(*p); t = __this_cpu_read(pcp->stat_threshold); if (unlikely(v > t)) { -@@ -318,6 +323,7 @@ void __inc_zone_state(struct zone *zone, +@@ -318,6 +323,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat_item item) zone_page_state_add(v + overstep, zone, item); __this_cpu_write(*p, -overstep); } @@ -86,7 +91,7 @@ Signed-off-by: Thomas Gleixner } void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) -@@ -326,6 +332,7 @@ void __inc_node_state(struct pglist_data +@@ -326,6 +332,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) s8 __percpu *p = pcp->vm_node_stat_diff + item; s8 v, t; @@ -94,7 +99,7 @@ Signed-off-by: Thomas Gleixner v = __this_cpu_inc_return(*p); t = __this_cpu_read(pcp->stat_threshold); if (unlikely(v > t)) { -@@ -334,6 +341,7 @@ void __inc_node_state(struct pglist_data +@@ -334,6 +341,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) node_page_state_add(v + overstep, pgdat, item); __this_cpu_write(*p, -overstep); } @@ -102,7 +107,7 @@ Signed-off-by: Thomas Gleixner } void __inc_zone_page_state(struct page *page, enum zone_stat_item item) -@@ -354,6 +362,7 @@ void __dec_zone_state(struct zone *zone, +@@ -354,6 +362,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat_item item) s8 __percpu *p = pcp->vm_stat_diff + item; s8 v, t; @@ -110,7 +115,7 @@ Signed-off-by: Thomas Gleixner v = __this_cpu_dec_return(*p); t = __this_cpu_read(pcp->stat_threshold); if (unlikely(v < - t)) { -@@ -362,6 +371,7 @@ void __dec_zone_state(struct zone *zone, +@@ -362,6 +371,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat_item item) zone_page_state_add(v - overstep, zone, item); __this_cpu_write(*p, overstep); } @@ -118,7 +123,7 @@ Signed-off-by: Thomas Gleixner } void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) -@@ -370,6 +380,7 @@ void __dec_node_state(struct pglist_data +@@ -370,6 +380,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) s8 __percpu *p = pcp->vm_node_stat_diff + item; s8 v, t; @@ -126,7 +131,7 @@ Signed-off-by: Thomas Gleixner v = __this_cpu_dec_return(*p); t = __this_cpu_read(pcp->stat_threshold); if (unlikely(v < - t)) { -@@ -378,6 +389,7 @@ void __dec_node_state(struct pglist_data +@@ -378,6 +389,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) node_page_state_add(v - overstep, pgdat, item); __this_cpu_write(*p, overstep); } @@ -134,3 +139,6 @@ Signed-off-by: Thomas Gleixner } void __dec_zone_page_state(struct page *page, enum zone_stat_item item) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0179-re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/kernel/patches-4.14.x-rt/0179-0179-ARM-Initialize-split-page-table-locks-for-vector-pag.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0179-re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch rename to kernel/patches-4.14.x-rt/0179-0179-ARM-Initialize-split-page-table-locks-for-vector-pag.patch index 6c857ac9a..5b71a6242 100644 --- a/kernel/patches-4.14.x-rt/0179-re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch +++ b/kernel/patches-4.14.x-rt/0179-0179-ARM-Initialize-split-page-table-locks-for-vector-pag.patch @@ -1,6 +1,8 @@ -Subject: ARM: Initialize split page table locks for vector page +From 169b1654fe0f0e306a986c0405c2ea0a0a52c96c Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Sat, 1 Oct 2011 18:58:13 -0700 +Subject: [PATCH 179/414] 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 @@ -30,12 +32,14 @@ Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/4E87C535.2030907@am.sony.com Signed-off-by: Thomas Gleixner --- - arch/arm/kernel/process.c | 24 ++++++++++++++++++++++++ + arch/arm/kernel/process.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) +diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c +index d96714e1858c..cf4e1452d4b4 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c -@@ -325,6 +325,30 @@ unsigned long arch_randomize_brk(struct +@@ -325,6 +325,30 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) } #ifdef CONFIG_MMU @@ -66,3 +70,6 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_KUSER_HELPERS /* * The vectors page is always readable from user space for the +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0180-mm-bounce-local-irq-save-nort.patch b/kernel/patches-4.14.x-rt/0180-0180-mm-bounce-Use-local_irq_save_nort.patch similarity index 58% rename from kernel/patches-4.14.x-rt/0180-mm-bounce-local-irq-save-nort.patch rename to kernel/patches-4.14.x-rt/0180-0180-mm-bounce-Use-local_irq_save_nort.patch index e7719b494..04ba5109f 100644 --- a/kernel/patches-4.14.x-rt/0180-mm-bounce-local-irq-save-nort.patch +++ b/kernel/patches-4.14.x-rt/0180-0180-mm-bounce-Use-local_irq_save_nort.patch @@ -1,17 +1,20 @@ -Subject: mm: bounce: Use local_irq_save_nort +From 5dd40164acd375c4406f9863283f52fc1f70260e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Wed, 09 Jan 2013 10:33:09 +0100 +Date: Wed, 9 Jan 2013 10:33:09 +0100 +Subject: [PATCH 180/414] mm: bounce: Use local_irq_save_nort kmap_atomic() is preemptible on RT. Signed-off-by: Thomas Gleixner --- - block/bounce.c | 4 ++-- + block/bounce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/block/bounce.c b/block/bounce.c +index 1d05c422c932..0101ffefddc4 100644 --- a/block/bounce.c +++ b/block/bounce.c -@@ -66,11 +66,11 @@ static void bounce_copy_vec(struct bio_v +@@ -66,11 +66,11 @@ static void bounce_copy_vec(struct bio_vec *to, unsigned char *vfrom) unsigned long flags; unsigned char *vto; @@ -25,3 +28,6 @@ Signed-off-by: Thomas Gleixner } #else /* CONFIG_HIGHMEM */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0181-mm-disable-sloub-rt.patch b/kernel/patches-4.14.x-rt/0181-0181-mm-Allow-only-slub-on-RT.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0181-mm-disable-sloub-rt.patch rename to kernel/patches-4.14.x-rt/0181-0181-mm-Allow-only-slub-on-RT.patch index d5f5b2b35..2f426f52c 100644 --- a/kernel/patches-4.14.x-rt/0181-mm-disable-sloub-rt.patch +++ b/kernel/patches-4.14.x-rt/0181-0181-mm-Allow-only-slub-on-RT.patch @@ -1,16 +1,18 @@ +From e4f55273a2de40e21b430f6ad5d376fe04ea868a Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:44:03 -0500 -Subject: mm: Allow only slub on RT +Subject: [PATCH 181/414] mm: Allow only slub on RT Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - init/Kconfig | 2 ++ + init/Kconfig | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/init/Kconfig b/init/Kconfig +index 46075327c165..0fa1ade4351a 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1533,6 +1533,7 @@ choice @@ -29,3 +31,6 @@ Signed-off-by: Thomas Gleixner help SLOB replaces the stock allocator with a drastically simpler allocator. SLOB is generally more space efficient but +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0182-mm-enable-slub.patch b/kernel/patches-4.14.x-rt/0182-0182-mm-Enable-SLUB-for-RT.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0182-mm-enable-slub.patch rename to kernel/patches-4.14.x-rt/0182-0182-mm-Enable-SLUB-for-RT.patch index 9e0505a1f..d4500ccb7 100644 --- a/kernel/patches-4.14.x-rt/0182-mm-enable-slub.patch +++ b/kernel/patches-4.14.x-rt/0182-0182-mm-Enable-SLUB-for-RT.patch @@ -1,19 +1,22 @@ -Subject: mm: Enable SLUB for RT +From 7a6c550a4bdc63fbeed35edcc8466330f0d370a5 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 25 Oct 2012 10:32:35 +0100 +Subject: [PATCH 182/414] mm: Enable SLUB for RT Make SLUB RT aware by converting locks to raw and using free lists to move the freeing out of the lock held region. Signed-off-by: Thomas Gleixner --- - mm/slab.h | 4 + - mm/slub.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++++-------------- + mm/slab.h | 4 ++ + mm/slub.c | 136 ++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 110 insertions(+), 30 deletions(-) +diff --git a/mm/slab.h b/mm/slab.h +index 485d9fbb8802..f3b06c48bf39 100644 --- a/mm/slab.h +++ b/mm/slab.h -@@ -451,7 +451,11 @@ static inline void slab_post_alloc_hook( +@@ -451,7 +451,11 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s, gfp_t flags, * The slab lists for all objects. */ struct kmem_cache_node { @@ -25,9 +28,11 @@ Signed-off-by: Thomas Gleixner #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 41c01690d116..1ceb0403223c 100644 --- a/mm/slub.c +++ b/mm/slub.c -@@ -1179,7 +1179,7 @@ static noinline int free_debug_processin +@@ -1179,7 +1179,7 @@ static noinline int free_debug_processing( unsigned long uninitialized_var(flags); int ret = 0; @@ -36,7 +41,7 @@ Signed-off-by: Thomas Gleixner slab_lock(page); if (s->flags & SLAB_CONSISTENCY_CHECKS) { -@@ -1214,7 +1214,7 @@ static noinline int free_debug_processin +@@ -1214,7 +1214,7 @@ static noinline int free_debug_processing( bulk_cnt, cnt); slab_unlock(page); @@ -45,7 +50,7 @@ Signed-off-by: Thomas Gleixner if (!ret) slab_fix(s, "Object at 0x%p not freed", object); return ret; -@@ -1342,6 +1342,12 @@ static inline void dec_slabs_node(struct +@@ -1342,6 +1342,12 @@ static inline void dec_slabs_node(struct kmem_cache *s, int node, #endif /* CONFIG_SLUB_DEBUG */ @@ -58,7 +63,7 @@ Signed-off-by: Thomas Gleixner /* * Hooks for other subsystems that check memory allocations. In a typical * production configuration these hooks all should produce no code at all. -@@ -1564,7 +1570,11 @@ static struct page *allocate_slab(struct +@@ -1564,7 +1570,11 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) flags &= gfp_allowed_mask; @@ -70,7 +75,7 @@ Signed-off-by: Thomas Gleixner local_irq_enable(); flags |= s->allocflags; -@@ -1623,7 +1633,11 @@ static struct page *allocate_slab(struct +@@ -1623,7 +1633,11 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) page->frozen = 1; out: @@ -82,7 +87,7 @@ Signed-off-by: Thomas Gleixner local_irq_disable(); if (!page) return NULL; -@@ -1681,6 +1695,16 @@ static void __free_slab(struct kmem_cach +@@ -1681,6 +1695,16 @@ static void __free_slab(struct kmem_cache *s, struct page *page) __free_pages(page, order); } @@ -99,7 +104,7 @@ Signed-off-by: Thomas Gleixner #define need_reserve_slab_rcu \ (sizeof(((struct page *)NULL)->lru) < sizeof(struct rcu_head)) -@@ -1712,6 +1736,12 @@ static void free_slab(struct kmem_cache +@@ -1712,6 +1736,12 @@ static void free_slab(struct kmem_cache *s, struct page *page) } call_rcu(head, rcu_free_slab); @@ -112,7 +117,7 @@ Signed-off-by: Thomas Gleixner } else __free_slab(s, page); } -@@ -1819,7 +1849,7 @@ static void *get_partial_node(struct kme +@@ -1819,7 +1849,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, if (!n || !n->nr_partial) return NULL; @@ -121,7 +126,7 @@ Signed-off-by: Thomas Gleixner list_for_each_entry_safe(page, page2, &n->partial, lru) { void *t; -@@ -1844,7 +1874,7 @@ static void *get_partial_node(struct kme +@@ -1844,7 +1874,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, break; } @@ -130,7 +135,7 @@ Signed-off-by: Thomas Gleixner return object; } -@@ -2090,7 +2120,7 @@ static void deactivate_slab(struct kmem_ +@@ -2090,7 +2120,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, * that acquire_slab() will see a slab page that * is frozen */ @@ -139,7 +144,7 @@ Signed-off-by: Thomas Gleixner } } else { m = M_FULL; -@@ -2101,7 +2131,7 @@ static void deactivate_slab(struct kmem_ +@@ -2101,7 +2131,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, * slabs from diagnostic functions will not see * any frozen slabs. */ @@ -148,7 +153,7 @@ Signed-off-by: Thomas Gleixner } } -@@ -2136,7 +2166,7 @@ static void deactivate_slab(struct kmem_ +@@ -2136,7 +2166,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, goto redo; if (lock) @@ -157,7 +162,7 @@ Signed-off-by: Thomas Gleixner if (m == M_FREE) { stat(s, DEACTIVATE_EMPTY); -@@ -2171,10 +2201,10 @@ static void unfreeze_partials(struct kme +@@ -2171,10 +2201,10 @@ static void unfreeze_partials(struct kmem_cache *s, n2 = get_node(s, page_to_nid(page)); if (n != n2) { if (n) @@ -170,7 +175,7 @@ Signed-off-by: Thomas Gleixner } do { -@@ -2203,7 +2233,7 @@ static void unfreeze_partials(struct kme +@@ -2203,7 +2233,7 @@ static void unfreeze_partials(struct kmem_cache *s, } if (n) @@ -179,7 +184,7 @@ Signed-off-by: Thomas Gleixner while (discard_page) { page = discard_page; -@@ -2242,14 +2272,21 @@ static void put_cpu_partial(struct kmem_ +@@ -2242,14 +2272,21 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) pobjects = oldpage->pobjects; pages = oldpage->pages; if (drain && pobjects > s->cpu_partial) { @@ -201,7 +206,7 @@ Signed-off-by: Thomas Gleixner oldpage = NULL; pobjects = 0; pages = 0; -@@ -2319,7 +2356,22 @@ static bool has_cpu_slab(int cpu, void * +@@ -2319,7 +2356,22 @@ static bool has_cpu_slab(int cpu, void *info) static void flush_all(struct kmem_cache *s) { @@ -224,7 +229,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2374,10 +2426,10 @@ static unsigned long count_partial(struc +@@ -2374,10 +2426,10 @@ static unsigned long count_partial(struct kmem_cache_node *n, unsigned long x = 0; struct page *page; @@ -237,7 +242,7 @@ Signed-off-by: Thomas Gleixner return x; } #endif /* CONFIG_SLUB_DEBUG || CONFIG_SYSFS */ -@@ -2515,8 +2567,10 @@ static inline void *get_freelist(struct +@@ -2515,8 +2567,10 @@ static inline void *get_freelist(struct kmem_cache *s, struct page *page) * already disabled (which is the case for bulk allocation). */ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, @@ -249,7 +254,7 @@ Signed-off-by: Thomas Gleixner void *freelist; struct page *page; -@@ -2572,6 +2626,13 @@ static void *___slab_alloc(struct kmem_c +@@ -2572,6 +2626,13 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, VM_BUG_ON(!c->page->frozen); c->freelist = get_freepointer(s, freelist); c->tid = next_tid(c->tid); @@ -263,7 +268,7 @@ Signed-off-by: Thomas Gleixner return freelist; new_slab: -@@ -2587,7 +2648,7 @@ static void *___slab_alloc(struct kmem_c +@@ -2587,7 +2648,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, if (unlikely(!freelist)) { slab_out_of_memory(s, gfpflags, node); @@ -272,7 +277,7 @@ Signed-off-by: Thomas Gleixner } page = c->page; -@@ -2600,7 +2661,7 @@ static void *___slab_alloc(struct kmem_c +@@ -2600,7 +2661,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, goto new_slab; /* Slab failed checks. Next slab needed */ deactivate_slab(s, page, get_freepointer(s, freelist), c); @@ -281,7 +286,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2612,6 +2673,7 @@ static void *__slab_alloc(struct kmem_ca +@@ -2612,6 +2673,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, { void *p; unsigned long flags; @@ -289,7 +294,7 @@ Signed-off-by: Thomas Gleixner local_irq_save(flags); #ifdef CONFIG_PREEMPT -@@ -2623,8 +2685,9 @@ static void *__slab_alloc(struct kmem_ca +@@ -2623,8 +2685,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, c = this_cpu_ptr(s->cpu_slab); #endif @@ -300,7 +305,7 @@ Signed-off-by: Thomas Gleixner return p; } -@@ -2810,7 +2873,7 @@ static void __slab_free(struct kmem_cach +@@ -2810,7 +2873,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, do { if (unlikely(n)) { @@ -309,7 +314,7 @@ Signed-off-by: Thomas Gleixner n = NULL; } prior = page->freelist; -@@ -2842,7 +2905,7 @@ static void __slab_free(struct kmem_cach +@@ -2842,7 +2905,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, * Otherwise the list_lock will synchronize with * other processors updating the list of slabs. */ @@ -318,7 +323,7 @@ Signed-off-by: Thomas Gleixner } } -@@ -2884,7 +2947,7 @@ static void __slab_free(struct kmem_cach +@@ -2884,7 +2947,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, add_partial(n, page, DEACTIVATE_TO_TAIL); stat(s, FREE_ADD_PARTIAL); } @@ -327,7 +332,7 @@ Signed-off-by: Thomas Gleixner return; slab_empty: -@@ -2899,7 +2962,7 @@ static void __slab_free(struct kmem_cach +@@ -2899,7 +2962,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, remove_full(s, n, page); } @@ -336,7 +341,7 @@ Signed-off-by: Thomas Gleixner stat(s, FREE_SLAB); discard_slab(s, page); } -@@ -3104,6 +3167,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca +@@ -3104,6 +3167,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, void **p) { struct kmem_cache_cpu *c; @@ -344,7 +349,7 @@ Signed-off-by: Thomas Gleixner int i; /* memcg and kmem_cache debug support */ -@@ -3127,7 +3191,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca +@@ -3127,7 +3191,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, * of re-populating per CPU c->freelist */ p[i] = ___slab_alloc(s, flags, NUMA_NO_NODE, @@ -353,7 +358,7 @@ Signed-off-by: Thomas Gleixner if (unlikely(!p[i])) goto error; -@@ -3139,6 +3203,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca +@@ -3139,6 +3203,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, } c->tid = next_tid(c->tid); local_irq_enable(); @@ -370,7 +375,7 @@ Signed-off-by: Thomas Gleixner INIT_LIST_HEAD(&n->partial); #ifdef CONFIG_SLUB_DEBUG atomic_long_set(&n->nr_slabs, 0); -@@ -3640,6 +3705,10 @@ static void list_slab_objects(struct kme +@@ -3640,6 +3705,10 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, const char *text) { #ifdef CONFIG_SLUB_DEBUG @@ -381,7 +386,7 @@ Signed-off-by: Thomas Gleixner void *addr = page_address(page); void *p; unsigned long *map = kzalloc(BITS_TO_LONGS(page->objects) * -@@ -3660,6 +3729,7 @@ static void list_slab_objects(struct kme +@@ -3660,6 +3729,7 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, slab_unlock(page); kfree(map); #endif @@ -389,7 +394,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -3673,7 +3743,7 @@ static void free_partial(struct kmem_cac +@@ -3673,7 +3743,7 @@ static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) struct page *page, *h; BUG_ON(irqs_disabled()); @@ -398,7 +403,7 @@ Signed-off-by: Thomas Gleixner list_for_each_entry_safe(page, h, &n->partial, lru) { if (!page->inuse) { remove_partial(n, page); -@@ -3683,7 +3753,7 @@ static void free_partial(struct kmem_cac +@@ -3683,7 +3753,7 @@ static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) "Objects remaining in %s on __kmem_cache_shutdown()"); } } @@ -407,7 +412,7 @@ Signed-off-by: Thomas Gleixner list_for_each_entry_safe(page, h, &discard, lru) discard_slab(s, page); -@@ -3927,7 +3997,7 @@ int __kmem_cache_shrink(struct kmem_cach +@@ -3927,7 +3997,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) for (i = 0; i < SHRINK_PROMOTE_MAX; i++) INIT_LIST_HEAD(promote + i); @@ -416,7 +421,7 @@ Signed-off-by: Thomas Gleixner /* * Build lists of slabs to discard or promote. -@@ -3958,7 +4028,7 @@ int __kmem_cache_shrink(struct kmem_cach +@@ -3958,7 +4028,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) for (i = SHRINK_PROMOTE_MAX - 1; i >= 0; i--) list_splice(promote + i, &n->partial); @@ -438,7 +443,7 @@ Signed-off-by: Thomas Gleixner if (debug_guardpage_minorder()) slub_max_order = 0; -@@ -4379,7 +4455,7 @@ static int validate_slab_node(struct kme +@@ -4379,7 +4455,7 @@ static int validate_slab_node(struct kmem_cache *s, struct page *page; unsigned long flags; @@ -447,7 +452,7 @@ Signed-off-by: Thomas Gleixner list_for_each_entry(page, &n->partial, lru) { validate_slab_slab(s, page, map); -@@ -4401,7 +4477,7 @@ static int validate_slab_node(struct kme +@@ -4401,7 +4477,7 @@ static int validate_slab_node(struct kmem_cache *s, s->name, count, atomic_long_read(&n->nr_slabs)); out: @@ -456,7 +461,7 @@ Signed-off-by: Thomas Gleixner return count; } -@@ -4589,12 +4665,12 @@ static int list_locations(struct kmem_ca +@@ -4589,12 +4665,12 @@ static int list_locations(struct kmem_cache *s, char *buf, if (!atomic_long_read(&n->nr_slabs)) continue; @@ -471,3 +476,6 @@ Signed-off-by: Thomas Gleixner } for (i = 0; i < t.count; i++) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0183-mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch b/kernel/patches-4.14.x-rt/0183-0183-mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch similarity index 63% rename from kernel/patches-4.14.x-rt/0183-mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch rename to kernel/patches-4.14.x-rt/0183-0183-mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch index 226f37cf0..a73ae2498 100644 --- a/kernel/patches-4.14.x-rt/0183-mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch +++ b/kernel/patches-4.14.x-rt/0183-0183-mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch @@ -1,6 +1,7 @@ +From 5a6a8112c6d6f941900feb5ddd4d79425516076c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Dec 2017 12:44:14 +0100 -Subject: [PATCH] mm/slub: close possible memory-leak in +Subject: [PATCH 183/414] mm/slub: close possible memory-leak in kmem_cache_alloc_bulk() Under certain circumstances we could leak elements which were moved to @@ -10,12 +11,14 @@ any users here. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - mm/slub.c | 1 + + mm/slub.c | 1 + 1 file changed, 1 insertion(+) +diff --git a/mm/slub.c b/mm/slub.c +index 1ceb0403223c..8f96aa380e50 100644 --- a/mm/slub.c +++ b/mm/slub.c -@@ -3218,6 +3218,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca +@@ -3218,6 +3218,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, return i; error: local_irq_enable(); @@ -23,3 +26,6 @@ Signed-off-by: Sebastian Andrzej Siewior slab_post_alloc_hook(s, flags, i, p); __kmem_cache_free_bulk(s, i, p); return 0; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0184-slub-enable-irqs-for-no-wait.patch b/kernel/patches-4.14.x-rt/0184-0184-slub-Enable-irqs-for-__GFP_WAIT.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0184-slub-enable-irqs-for-no-wait.patch rename to kernel/patches-4.14.x-rt/0184-0184-slub-Enable-irqs-for-__GFP_WAIT.patch index d48c855c4..4cba6e8e9 100644 --- a/kernel/patches-4.14.x-rt/0184-slub-enable-irqs-for-no-wait.patch +++ b/kernel/patches-4.14.x-rt/0184-0184-slub-Enable-irqs-for-__GFP_WAIT.patch @@ -1,18 +1,21 @@ -Subject: slub: Enable irqs for __GFP_WAIT +From a044da8d76cc91c1b5aae18e0c7a44d9edb6c598 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Wed, 09 Jan 2013 12:08:15 +0100 +Date: Wed, 9 Jan 2013 12:08:15 +0100 +Subject: [PATCH 184/414] 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. Signed-off-by: Thomas Gleixner --- - mm/slub.c | 13 ++++++------- + mm/slub.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) +diff --git a/mm/slub.c b/mm/slub.c +index 8f96aa380e50..9ce21fa2c64c 100644 --- a/mm/slub.c +++ b/mm/slub.c -@@ -1567,14 +1567,17 @@ static struct page *allocate_slab(struct +@@ -1567,14 +1567,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) void *start, *p; int idx, order; bool shuffle; @@ -32,7 +35,7 @@ Signed-off-by: Thomas Gleixner local_irq_enable(); flags |= s->allocflags; -@@ -1633,11 +1636,7 @@ static struct page *allocate_slab(struct +@@ -1633,11 +1636,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) page->frozen = 1; out: @@ -45,3 +48,6 @@ Signed-off-by: Thomas Gleixner local_irq_disable(); if (!page) return NULL; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0185-slub-disable-SLUB_CPU_PARTIAL.patch b/kernel/patches-4.14.x-rt/0185-0185-slub-Disable-SLUB_CPU_PARTIAL.patch similarity index 88% rename from kernel/patches-4.14.x-rt/0185-slub-disable-SLUB_CPU_PARTIAL.patch rename to kernel/patches-4.14.x-rt/0185-0185-slub-Disable-SLUB_CPU_PARTIAL.patch index 08db81110..c5e842a6e 100644 --- a/kernel/patches-4.14.x-rt/0185-slub-disable-SLUB_CPU_PARTIAL.patch +++ b/kernel/patches-4.14.x-rt/0185-0185-slub-Disable-SLUB_CPU_PARTIAL.patch @@ -1,6 +1,7 @@ +From 5d84a1dfe562725b5cf35596725e86cd99adfd9e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 15 Apr 2015 19:00:47 +0200 -Subject: slub: Disable SLUB_CPU_PARTIAL +Subject: [PATCH 185/414] 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 @@ -31,9 +32,11 @@ Subject: slub: Disable SLUB_CPU_PARTIAL Signed-off-by: Sebastian Andrzej Siewior --- - init/Kconfig | 2 +- + init/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/init/Kconfig b/init/Kconfig +index 0fa1ade4351a..bec5b4b82585 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1596,7 +1596,7 @@ config SLAB_FREELIST_HARDENED @@ -45,3 +48,6 @@ Signed-off-by: Sebastian Andrzej Siewior bool "SLUB per cpu partial cache" help Per cpu partial caches accellerate objects allocation and freeing +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0186-mm-page-alloc-use-local-lock-on-target-cpu.patch b/kernel/patches-4.14.x-rt/0186-0186-mm-page_alloc-Use-local_lock_on-instead-of-plain-spi.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0186-mm-page-alloc-use-local-lock-on-target-cpu.patch rename to kernel/patches-4.14.x-rt/0186-0186-mm-page_alloc-Use-local_lock_on-instead-of-plain-spi.patch index 7e3e0389a..913c6bf71 100644 --- a/kernel/patches-4.14.x-rt/0186-mm-page-alloc-use-local-lock-on-target-cpu.patch +++ b/kernel/patches-4.14.x-rt/0186-0186-mm-page_alloc-Use-local_lock_on-instead-of-plain-spi.patch @@ -1,16 +1,19 @@ -Subject: mm: page_alloc: Use local_lock_on() instead of plain spinlock +From 0b65d6e98f56bb5fb205cabadcb38f2ea763cdf8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 27 Sep 2012 11:11:46 +0200 +Subject: [PATCH 186/414] mm: page_alloc: Use local_lock_on() instead of plain + spinlock The plain spinlock while sufficient does not update the local_lock internals. Use a proper local_lock function instead to ease debugging. Signed-off-by: Thomas Gleixner - --- - mm/page_alloc.c | 4 ++-- + mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index 64cec431b6e9..15d6e8022168 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -291,9 +291,9 @@ static DEFINE_LOCAL_IRQ_LOCK(pa_lock); @@ -25,3 +28,6 @@ Signed-off-by: Thomas Gleixner #else # define cpu_lock_irqsave(cpu, flags) local_irq_save(flags) # define cpu_unlock_irqrestore(cpu, flags) local_irq_restore(flags) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0187-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/kernel/patches-4.14.x-rt/0187-0187-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0187-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch rename to kernel/patches-4.14.x-rt/0187-0187-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index 52ddca411..e05360e97 100644 --- a/kernel/patches-4.14.x-rt/0187-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/kernel/patches-4.14.x-rt/0187-0187-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,6 +1,8 @@ +From f5713fb5acd93e08e17f4ca885747491e2e4222d Mon Sep 17 00:00:00 2001 From: Yang Shi -Subject: mm/memcontrol: Don't call schedule_work_on in preemption disabled context Date: Wed, 30 Oct 2013 11:48:33 -0700 +Subject: [PATCH 187/414] mm/memcontrol: Don't call schedule_work_on in + preemption disabled context The following trace is triggered when running ltp oom test cases: @@ -42,13 +44,14 @@ replace the pair of get/put_cpu() to get/put_cpu_light(). Signed-off-by: Yang Shi Signed-off-by: Sebastian Andrzej Siewior --- - - mm/memcontrol.c | 4 ++-- + mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index 66e7efabf0a1..11d8acdda6d0 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -1831,7 +1831,7 @@ static void drain_all_stock(struct mem_c +@@ -1831,7 +1831,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. */ @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_online_cpu(cpu) { struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); struct mem_cgroup *memcg; -@@ -1851,7 +1851,7 @@ static void drain_all_stock(struct mem_c +@@ -1851,7 +1851,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) } css_put(&memcg->css); } @@ -66,3 +69,6 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_unlock(&percpu_charge_mutex); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0188-mm-memcontrol-do_not_disable_irq.patch b/kernel/patches-4.14.x-rt/0188-0188-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0188-mm-memcontrol-do_not_disable_irq.patch rename to kernel/patches-4.14.x-rt/0188-0188-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch index da36000c6..019683db2 100644 --- a/kernel/patches-4.14.x-rt/0188-mm-memcontrol-do_not_disable_irq.patch +++ b/kernel/patches-4.14.x-rt/0188-0188-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch @@ -1,15 +1,19 @@ +From 4649291ec5f3ea1443ccc822aa8a073fe1ea518b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior -Subject: mm/memcontrol: Replace local_irq_disable with local locks Date: Wed, 28 Jan 2015 17:14:16 +0100 +Subject: [PATCH 188/414] mm/memcontrol: Replace local_irq_disable with local + locks There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. Signed-off-by: Sebastian Andrzej Siewior --- - mm/memcontrol.c | 24 ++++++++++++++++-------- + mm/memcontrol.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index 11d8acdda6d0..b2fb2903137e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -69,6 +69,7 @@ @@ -29,7 +33,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Whether legacy memory+swap accounting is active */ static bool do_memsw_account(void) { -@@ -4621,12 +4624,12 @@ static int mem_cgroup_move_account(struc +@@ -4621,12 +4624,12 @@ static int mem_cgroup_move_account(struct page *page, ret = 0; @@ -44,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior out_unlock: unlock_page(page); out: -@@ -5569,10 +5572,10 @@ void mem_cgroup_commit_charge(struct pag +@@ -5569,10 +5572,10 @@ void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, commit_charge(page, memcg, lrucare); @@ -57,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (do_memsw_account() && PageSwapCache(page)) { swp_entry_t entry = { .val = page_private(page) }; -@@ -5641,7 +5644,7 @@ static void uncharge_batch(const struct +@@ -5641,7 +5644,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) memcg_oom_recover(ug->memcg); } @@ -66,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior __this_cpu_sub(ug->memcg->stat->count[MEMCG_RSS], ug->nr_anon); __this_cpu_sub(ug->memcg->stat->count[MEMCG_CACHE], ug->nr_file); __this_cpu_sub(ug->memcg->stat->count[MEMCG_RSS_HUGE], ug->nr_huge); -@@ -5649,7 +5652,7 @@ static void uncharge_batch(const struct +@@ -5649,7 +5652,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) __this_cpu_add(ug->memcg->stat->events[PGPGOUT], ug->pgpgout); __this_cpu_add(ug->memcg->stat->nr_page_events, nr_pages); memcg_check_events(ug->memcg, ug->dummy_page); @@ -75,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!mem_cgroup_is_root(ug->memcg)) css_put_many(&ug->memcg->css, nr_pages); -@@ -5812,10 +5815,10 @@ void mem_cgroup_migrate(struct page *old +@@ -5812,10 +5815,10 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) commit_charge(newpage, memcg, false); @@ -88,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior } DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); -@@ -6007,6 +6010,7 @@ void mem_cgroup_swapout(struct page *pag +@@ -6007,6 +6010,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; @@ -96,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior VM_BUG_ON_PAGE(PageLRU(page), page); VM_BUG_ON_PAGE(page_count(page), page); -@@ -6052,13 +6056,17 @@ void mem_cgroup_swapout(struct page *pag +@@ -6052,13 +6056,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 udpating the per-CPU variables. */ @@ -114,3 +118,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /** +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0189-mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch b/kernel/patches-4.14.x-rt/0189-0189-mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0189-mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch rename to kernel/patches-4.14.x-rt/0189-0189-mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch index 1b4eb21d1..9b8d20365 100644 --- a/kernel/patches-4.14.x-rt/0189-mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch +++ b/kernel/patches-4.14.x-rt/0189-0189-mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch @@ -1,6 +1,8 @@ +From 9009ea1445380eb327226d213e8c92d91813ddbc Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 5 Feb 2016 12:17:14 +0100 -Subject: mm: backing-dev: don't disable IRQs in wb_congested_put() +Subject: [PATCH 189/414] mm: backing-dev: don't disable IRQs in + wb_congested_put() it triggers: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:930 @@ -22,12 +24,14 @@ due to cgwb_lock beeing taken with spin_lock_irqsave() usually. Signed-off-by: Sebastian Andrzej Siewior --- - mm/backing-dev.c | 4 ++-- + mm/backing-dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/mm/backing-dev.c b/mm/backing-dev.c +index e19606bb41a0..3ed752abde48 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c -@@ -482,9 +482,9 @@ void wb_congested_put(struct bdi_writeba +@@ -482,9 +482,9 @@ void wb_congested_put(struct bdi_writeback_congested *congested) { unsigned long flags; @@ -39,3 +43,6 @@ Signed-off-by: Sebastian Andrzej Siewior return; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0190-mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/kernel/patches-4.14.x-rt/0190-0190-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0190-mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch rename to kernel/patches-4.14.x-rt/0190-0190-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch index 578138506..8d4f123ff 100644 --- a/kernel/patches-4.14.x-rt/0190-mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch +++ b/kernel/patches-4.14.x-rt/0190-0190-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch @@ -1,6 +1,7 @@ +From e2e2f60518ab6e0b19851a35fb3430fa4be3a37e Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Tue, 22 Mar 2016 11:16:09 +0100 -Subject: [PATCH] mm/zsmalloc: copy with get_cpu_var() and locking +Subject: [PATCH 190/414] 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(). @@ -12,9 +13,11 @@ Signed-off-by: Mike Galbraith fixed the size magic] Signed-off-by: Sebastian Andrzej Siewior --- - mm/zsmalloc.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- + mm/zsmalloc.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 6 deletions(-) +diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c +index 685049a9048d..8d1489fd1dbc 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -53,6 +53,7 @@ @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Object location (, ) is encoded as * as single (unsigned long) handle value. -@@ -320,7 +334,7 @@ static void SetZsPageMovable(struct zs_p +@@ -320,7 +334,7 @@ static void SetZsPageMovable(struct zs_pool *pool, struct zspage *zspage) {} static int create_cache(struct zs_pool *pool) { @@ -58,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior 0, 0, NULL); if (!pool->handle_cachep) return 1; -@@ -344,10 +358,27 @@ static void destroy_cache(struct zs_pool +@@ -344,10 +358,27 @@ static void destroy_cache(struct zs_pool *pool) static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp) { @@ -88,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior 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_ +@@ -366,12 +397,18 @@ static void cache_free_zspage(struct zs_pool *pool, struct zspage *zspage) static void record_obj(unsigned long handle, unsigned long obj) { @@ -115,7 +118,7 @@ Signed-off-by: Sebastian Andrzej Siewior static bool is_zspage_isolated(struct zspage *zspage) { -@@ -898,7 +936,13 @@ static unsigned long location_to_obj(str +@@ -898,7 +936,13 @@ static unsigned long location_to_obj(struct page *page, unsigned int obj_idx) static unsigned long handle_to_obj(unsigned long handle) { @@ -129,7 +132,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static unsigned long obj_to_head(struct page *page, void *obj) -@@ -912,22 +956,46 @@ static unsigned long obj_to_head(struct +@@ -912,22 +956,46 @@ static unsigned long obj_to_head(struct page *page, void *obj) static inline int testpin_tag(unsigned long handle) { @@ -176,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void reset_page(struct page *page) -@@ -1365,7 +1433,7 @@ void *zs_map_object(struct zs_pool *pool +@@ -1365,7 +1433,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; @@ -185,7 +188,7 @@ Signed-off-by: Sebastian Andrzej Siewior area->vm_mm = mm; if (off + class->size <= PAGE_SIZE) { /* this object is contained entirely within a page */ -@@ -1419,7 +1487,7 @@ void zs_unmap_object(struct zs_pool *poo +@@ -1419,7 +1487,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) __zs_unmap_object(area, pages, off, class->size); } @@ -194,3 +197,6 @@ Signed-off-by: Sebastian Andrzej Siewior migrate_read_unlock(zspage); unpin_tag(handle); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0191-radix-tree-use-local-locks.patch b/kernel/patches-4.14.x-rt/0191-0191-radix-tree-use-local-locks.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0191-radix-tree-use-local-locks.patch rename to kernel/patches-4.14.x-rt/0191-0191-radix-tree-use-local-locks.patch index 271b7a0ad..1b2649849 100644 --- a/kernel/patches-4.14.x-rt/0191-radix-tree-use-local-locks.patch +++ b/kernel/patches-4.14.x-rt/0191-0191-radix-tree-use-local-locks.patch @@ -1,6 +1,7 @@ +From 2625c0cd1652c92e7cf2854083d304fc20756057 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 25 Jan 2017 16:34:27 +0100 -Subject: [PATCH] radix-tree: use local locks +Subject: [PATCH 191/414] 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 @@ -11,14 +12,16 @@ Cc: stable-rt@vger.kernel.org Reported-and-debugged-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/idr.h | 5 +---- - include/linux/radix-tree.h | 7 ++----- - lib/radix-tree.c | 32 +++++++++++++++++++++++--------- + include/linux/idr.h | 5 +---- + include/linux/radix-tree.h | 7 ++----- + lib/radix-tree.c | 32 +++++++++++++++++++++++--------- 3 files changed, 26 insertions(+), 18 deletions(-) +diff --git a/include/linux/idr.h b/include/linux/idr.h +index 7c3a365f7e12..a922d984d9b6 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h -@@ -167,10 +167,7 @@ static inline bool idr_is_empty(const st +@@ -167,10 +167,7 @@ static inline bool idr_is_empty(const struct idr *idr) * Each idr_preload() should be matched with an invocation of this * function. See idr_preload() for details. */ @@ -30,9 +33,11 @@ Signed-off-by: Sebastian Andrzej Siewior /** * idr_find - return pointer for given id +diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h +index 567ebb5eaab0..9da7ea957399 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h -@@ -328,6 +328,8 @@ unsigned int radix_tree_gang_lookup_slot +@@ -328,6 +328,8 @@ unsigned int radix_tree_gang_lookup_slot(const struct radix_tree_root *, int radix_tree_preload(gfp_t gfp_mask); int radix_tree_maybe_preload(gfp_t gfp_mask); int radix_tree_maybe_preload_order(gfp_t gfp_mask, int order); @@ -41,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior void radix_tree_init(void); void *radix_tree_tag_set(struct radix_tree_root *, unsigned long index, unsigned int tag); -@@ -347,11 +349,6 @@ unsigned int radix_tree_gang_lookup_tag_ +@@ -347,11 +349,6 @@ unsigned int radix_tree_gang_lookup_tag_slot(const struct radix_tree_root *, unsigned int max_items, unsigned int tag); int radix_tree_tagged(const struct radix_tree_root *, unsigned int tag); @@ -53,6 +58,8 @@ Signed-off-by: Sebastian Andrzej Siewior int radix_tree_split_preload(unsigned old_order, unsigned new_order, gfp_t); 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 8b1feca1230a..758213a8a0d9 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -37,7 +37,7 @@ @@ -72,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline struct radix_tree_node *entry_to_node(void *ptr) { -@@ -404,12 +405,13 @@ radix_tree_node_alloc(gfp_t gfp_mask, st +@@ -404,12 +405,13 @@ radix_tree_node_alloc(gfp_t gfp_mask, struct radix_tree_node *parent, * succeed in getting a node here (and never reach * kmem_cache_alloc) */ @@ -87,7 +94,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Update the allocation stack trace as this is more useful * for debugging. -@@ -475,14 +477,14 @@ static __must_check int __radix_tree_pre +@@ -475,14 +477,14 @@ static __must_check int __radix_tree_preload(gfp_t gfp_mask, unsigned nr) */ gfp_mask &= ~__GFP_ACCOUNT; @@ -105,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior rtp = this_cpu_ptr(&radix_tree_preloads); if (rtp->nr < nr) { node->parent = rtp->nodes; -@@ -524,7 +526,7 @@ int radix_tree_maybe_preload(gfp_t gfp_m +@@ -524,7 +526,7 @@ int radix_tree_maybe_preload(gfp_t gfp_mask) if (gfpflags_allow_blocking(gfp_mask)) return __radix_tree_preload(gfp_mask, RADIX_TREE_PRELOAD_SIZE); /* Preloading doesn't help anything with this gfp mask, skip it */ @@ -114,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } EXPORT_SYMBOL(radix_tree_maybe_preload); -@@ -562,7 +564,7 @@ int radix_tree_maybe_preload_order(gfp_t +@@ -562,7 +564,7 @@ int radix_tree_maybe_preload_order(gfp_t gfp_mask, int order) /* Preloading doesn't help anything with this gfp mask, skip it */ if (!gfpflags_allow_blocking(gfp_mask)) { @@ -123,7 +130,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -596,6 +598,12 @@ int radix_tree_maybe_preload_order(gfp_t +@@ -596,6 +598,12 @@ int radix_tree_maybe_preload_order(gfp_t gfp_mask, int order) return __radix_tree_preload(gfp_mask, nr_nodes); } @@ -154,7 +161,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * ida_pre_get - reserve resources for ida allocation * @ida: ida handle -@@ -2125,7 +2139,7 @@ int ida_pre_get(struct ida *ida, gfp_t g +@@ -2125,7 +2139,7 @@ int ida_pre_get(struct ida *ida, gfp_t gfp) * to return to the ida_pre_get() step. */ if (!__radix_tree_preload(gfp, IDA_PRELOAD_SIZE)) @@ -163,3 +170,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (!this_cpu_read(ida_bitmap)) { struct ida_bitmap *bitmap = kmalloc(sizeof(*bitmap), gfp); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0192-panic-disable-random-on-rt.patch b/kernel/patches-4.14.x-rt/0192-0192-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0192-panic-disable-random-on-rt.patch rename to kernel/patches-4.14.x-rt/0192-0192-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch index c21c7d016..0dec3edd3 100644 --- a/kernel/patches-4.14.x-rt/0192-panic-disable-random-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0192-0192-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch @@ -1,15 +1,19 @@ +From eb11369a311172d25161f18127b468af9f108989 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: panic: skip get_random_bytes for RT_FULL in init_oops_id +Subject: [PATCH 192/414] 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 to acquire the sleeping lock. Signed-off-by: Thomas Gleixner --- - kernel/panic.c | 2 ++ + kernel/panic.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/kernel/panic.c b/kernel/panic.c +index bdd18afa19a4..5da649633795 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -482,9 +482,11 @@ static u64 oops_id; @@ -24,3 +28,6 @@ Signed-off-by: Thomas Gleixner oops_id++; return 0; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0193-timers-prepare-for-full-preemption.patch b/kernel/patches-4.14.x-rt/0193-0193-timers-Prepare-for-full-preemption.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0193-timers-prepare-for-full-preemption.patch rename to kernel/patches-4.14.x-rt/0193-0193-timers-Prepare-for-full-preemption.patch index f6d247e5f..cde622fa6 100644 --- a/kernel/patches-4.14.x-rt/0193-timers-prepare-for-full-preemption.patch +++ b/kernel/patches-4.14.x-rt/0193-0193-timers-Prepare-for-full-preemption.patch @@ -1,6 +1,7 @@ +From 585b6173c014d02895265dfd562aa2275ea5e281 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 -Subject: timers: Prepare for full preemption +Subject: [PATCH 193/414] 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 @@ -8,16 +9,17 @@ callback. Add a waitqueue to resolve that. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - include/linux/timer.h | 2 +- - kernel/sched/core.c | 9 +++++++-- - kernel/time/timer.c | 45 +++++++++++++++++++++++++++++++++++++++++---- + include/linux/timer.h | 2 +- + kernel/sched/core.c | 9 +++++++-- + kernel/time/timer.c | 45 +++++++++++++++++++++++++++++++++++++++---- 3 files changed, 49 insertions(+), 7 deletions(-) +diff --git a/include/linux/timer.h b/include/linux/timer.h +index e0ea1fe87572..df3085ddf662 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h -@@ -213,7 +213,7 @@ extern void add_timer(struct timer_list +@@ -213,7 +213,7 @@ extern void add_timer(struct timer_list *timer); extern int try_to_del_timer_sync(struct timer_list *timer); @@ -26,6 +28,8 @@ Signed-off-by: Thomas Gleixner extern int del_timer_sync(struct timer_list *timer); #else # define del_timer_sync(t) del_timer(t) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index c07c1bb0e1c6..405a493a11b3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -523,11 +523,14 @@ void resched_cpu(int cpu) @@ -54,6 +58,8 @@ Signed-off-by: Thomas Gleixner return cpu; } +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 34415f2b3f04..3866d537f109 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -44,6 +44,7 @@ @@ -74,7 +80,7 @@ Signed-off-by: Thomas Gleixner unsigned long clk; unsigned long next_expiry; unsigned int cpu; -@@ -1140,6 +1144,33 @@ void add_timer_on(struct timer_list *tim +@@ -1140,6 +1144,33 @@ void add_timer_on(struct timer_list *timer, int cpu) } EXPORT_SYMBOL_GPL(add_timer_on); @@ -108,7 +114,7 @@ Signed-off-by: Thomas Gleixner /** * del_timer - deactivate a timer. * @timer: the timer to be deactivated -@@ -1195,7 +1226,7 @@ int try_to_del_timer_sync(struct timer_l +@@ -1195,7 +1226,7 @@ int try_to_del_timer_sync(struct timer_list *timer) } EXPORT_SYMBOL(try_to_del_timer_sync); @@ -117,7 +123,7 @@ Signed-off-by: Thomas Gleixner /** * del_timer_sync - deactivate a timer and wait for the handler to finish. * @timer: the timer to be deactivated -@@ -1255,7 +1286,7 @@ int del_timer_sync(struct timer_list *ti +@@ -1255,7 +1286,7 @@ int del_timer_sync(struct timer_list *timer) int ret = try_to_del_timer_sync(timer); if (ret >= 0) return ret; @@ -126,7 +132,7 @@ Signed-off-by: Thomas Gleixner } } EXPORT_SYMBOL(del_timer_sync); -@@ -1319,13 +1350,16 @@ static void expire_timers(struct timer_b +@@ -1319,13 +1350,16 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head) fn = timer->function; data = timer->data; @@ -144,7 +150,7 @@ Signed-off-by: Thomas Gleixner raw_spin_lock_irq(&base->lock); } } -@@ -1627,8 +1661,8 @@ static inline void __run_timers(struct t +@@ -1627,8 +1661,8 @@ static inline void __run_timers(struct timer_base *base) while (levels--) expire_timers(base, heads + levels); } @@ -154,7 +160,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1874,6 +1908,9 @@ static void __init init_timer_cpu(int cp +@@ -1874,6 +1908,9 @@ static void __init init_timer_cpu(int cpu) base->cpu = cpu; raw_spin_lock_init(&base->lock); base->clk = jiffies; @@ -164,3 +170,6 @@ Signed-off-by: Thomas Gleixner } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0194-timer-delay-waking-softirqs-from-the-jiffy-tick.patch b/kernel/patches-4.14.x-rt/0194-0194-timer-delay-waking-softirqs-from-the-jiffy-tick.patch similarity index 90% rename from kernel/patches-4.14.x-rt/0194-timer-delay-waking-softirqs-from-the-jiffy-tick.patch rename to kernel/patches-4.14.x-rt/0194-0194-timer-delay-waking-softirqs-from-the-jiffy-tick.patch index 29c0215d0..81c7391b0 100644 --- a/kernel/patches-4.14.x-rt/0194-timer-delay-waking-softirqs-from-the-jiffy-tick.patch +++ b/kernel/patches-4.14.x-rt/0194-0194-timer-delay-waking-softirqs-from-the-jiffy-tick.patch @@ -1,6 +1,7 @@ +From 5beea11f3cf7c720ebf76bbdc4bb72a6269a7660 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Fri, 21 Aug 2009 11:56:45 +0200 -Subject: timer: delay waking softirqs from the jiffy tick +Subject: [PATCH 194/414] timer: delay waking softirqs from the jiffy tick People were complaining about broken balancing with the recent -rt series. @@ -51,11 +52,12 @@ behaviour. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner - --- - kernel/time/timer.c | 2 +- + kernel/time/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 3866d537f109..464aee26ef2b 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1628,13 +1628,13 @@ void update_process_times(int user_tick) @@ -73,3 +75,6 @@ Signed-off-by: Thomas Gleixner if (IS_ENABLED(CONFIG_POSIX_TIMERS)) run_posix_cpu_timers(p); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0195-nohz-Prevent-erroneous-tick-stop-invocations.patch b/kernel/patches-4.14.x-rt/0195-0195-nohz-Prevent-erroneous-tick-stop-invocations.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0195-nohz-Prevent-erroneous-tick-stop-invocations.patch rename to kernel/patches-4.14.x-rt/0195-0195-nohz-Prevent-erroneous-tick-stop-invocations.patch index 975d15f86..f097259bc 100644 --- a/kernel/patches-4.14.x-rt/0195-nohz-Prevent-erroneous-tick-stop-invocations.patch +++ b/kernel/patches-4.14.x-rt/0195-0195-nohz-Prevent-erroneous-tick-stop-invocations.patch @@ -1,6 +1,7 @@ +From a62f432777382806fff34aba0e2745431a4dca48 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 22 Dec 2017 15:51:13 +0100 -Subject: [PATCH 2/4] nohz: Prevent erroneous tick stop invocations +Subject: [PATCH 195/414] nohz: Prevent erroneous tick stop invocations The conditions in irq_exit() to invoke tick_nohz_irq_exit() are: @@ -31,9 +32,11 @@ Signed-off-by: Thomas Gleixner keep it RT only ] Signed-off-by: Sebastian Andrzej Siewior --- - kernel/softirq.c | 8 +++++++- + kernel/softirq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 359cec869172..0f84f2a8f564 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -381,7 +381,13 @@ static inline void tick_irq_exit(void) @@ -51,3 +54,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (!in_interrupt()) tick_nohz_irq_exit(); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0196-x86-kvm-require-const-tsc-for-rt.patch b/kernel/patches-4.14.x-rt/0196-0196-x86-kvm-Require-const-tsc-for-RT.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0196-x86-kvm-require-const-tsc-for-rt.patch rename to kernel/patches-4.14.x-rt/0196-0196-x86-kvm-Require-const-tsc-for-RT.patch index d95780c8c..d9efb5529 100644 --- a/kernel/patches-4.14.x-rt/0196-x86-kvm-require-const-tsc-for-rt.patch +++ b/kernel/patches-4.14.x-rt/0196-0196-x86-kvm-Require-const-tsc-for-RT.patch @@ -1,6 +1,7 @@ -Subject: x86: kvm Require const tsc for RT +From ebbf6799af4e73987d96276f9569ecadc325dfcf Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Sun, 06 Nov 2011 12:26:18 +0100 +Date: Sun, 6 Nov 2011 12:26:18 +0100 +Subject: [PATCH 196/414] 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 @@ -9,9 +10,11 @@ a guest on top of a RT host. Signed-off-by: Thomas Gleixner --- - arch/x86/kvm/x86.c | 7 +++++++ + arch/x86/kvm/x86.c | 7 +++++++ 1 file changed, 7 insertions(+) +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c +index 3b2c3aa2cd07..ba5b6693fbe7 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6150,6 +6150,13 @@ int kvm_arch_init(void *opaque) @@ -28,3 +31,6 @@ Signed-off-by: Thomas Gleixner r = kvm_mmu_module_init(); if (r) goto out_free_percpu; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0197-wait.h-include-atomic.h.patch b/kernel/patches-4.14.x-rt/0197-0197-wait.h-include-atomic.h.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0197-wait.h-include-atomic.h.patch rename to kernel/patches-4.14.x-rt/0197-0197-wait.h-include-atomic.h.patch index 0a04f7859..37d009ee5 100644 --- a/kernel/patches-4.14.x-rt/0197-wait.h-include-atomic.h.patch +++ b/kernel/patches-4.14.x-rt/0197-0197-wait.h-include-atomic.h.patch @@ -1,6 +1,10 @@ +From 42fb3f6d580a54b0055dde592e04168ab8d9b213 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 28 Oct 2013 12:19:57 +0100 -Subject: wait.h: include atomic.h +Subject: [PATCH 197/414] wait.h: include atomic.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit | CC init/main.o |In file included from include/linux/mmzone.h:9:0, @@ -17,9 +21,11 @@ This pops up on ARM. Non-RT gets its atomic.h include from spinlock.h Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/wait.h | 1 + + include/linux/wait.h | 1 + 1 file changed, 1 insertion(+) +diff --git a/include/linux/wait.h b/include/linux/wait.h +index 158715445ffb..49543ae3dc5f 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -10,6 +10,7 @@ @@ -30,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct wait_queue_entry wait_queue_entry_t; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0198-work-simple-Simple-work-queue-implemenation.patch b/kernel/patches-4.14.x-rt/0198-0198-work-simple-Simple-work-queue-implemenation.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0198-work-simple-Simple-work-queue-implemenation.patch rename to kernel/patches-4.14.x-rt/0198-0198-work-simple-Simple-work-queue-implemenation.patch index b73fc3929..d5ce94c7f 100644 --- a/kernel/patches-4.14.x-rt/0198-work-simple-Simple-work-queue-implemenation.patch +++ b/kernel/patches-4.14.x-rt/0198-0198-work-simple-Simple-work-queue-implemenation.patch @@ -1,6 +1,7 @@ +From 99c47f9ccf16188ae39bec2ecf4fb32dddaf16ad Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 11 Jul 2014 15:26:11 +0200 -Subject: work-simple: Simple work queue implemenation +Subject: [PATCH 198/414] 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. @@ -10,11 +11,16 @@ Bases on wait-simple. Cc: Sebastian Andrzej Siewior Signed-off-by: Daniel Wagner --- - include/linux/swork.h | 24 ++++++ - kernel/sched/Makefile | 2 - kernel/sched/swork.c | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++ + include/linux/swork.h | 24 ++++++ + kernel/sched/Makefile | 2 +- + kernel/sched/swork.c | 173 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 198 insertions(+), 1 deletion(-) + create mode 100644 include/linux/swork.h + create mode 100644 kernel/sched/swork.c +diff --git a/include/linux/swork.h b/include/linux/swork.h +new file mode 100644 +index 000000000000..f175fa9a6016 --- /dev/null +++ b/include/linux/swork.h @@ -0,0 +1,24 @@ @@ -42,6 +48,8 @@ Signed-off-by: Daniel Wagner +void swork_put(void); + +#endif /* _LINUX_SWORK_H */ +diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile +index a9ee16bbc693..9943019095e9 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -18,7 +18,7 @@ endif @@ -53,6 +61,9 @@ Signed-off-by: Daniel Wagner obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o topology.o stop_task.o obj-$(CONFIG_SCHED_AUTOGROUP) += autogroup.o obj-$(CONFIG_SCHEDSTATS) += stats.o +diff --git a/kernel/sched/swork.c b/kernel/sched/swork.c +new file mode 100644 +index 000000000000..1950f40ca725 --- /dev/null +++ b/kernel/sched/swork.c @@ -0,0 +1,173 @@ @@ -229,3 +240,6 @@ Signed-off-by: Daniel Wagner + mutex_unlock(&worker_mutex); +} +EXPORT_SYMBOL_GPL(swork_put); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0199-completion-use-simple-wait-queues.patch b/kernel/patches-4.14.x-rt/0199-0199-completion-Use-simple-wait-queues.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0199-completion-use-simple-wait-queues.patch rename to kernel/patches-4.14.x-rt/0199-0199-completion-Use-simple-wait-queues.patch index b47f83d8b..2dcec6f78 100644 --- a/kernel/patches-4.14.x-rt/0199-completion-use-simple-wait-queues.patch +++ b/kernel/patches-4.14.x-rt/0199-0199-completion-Use-simple-wait-queues.patch @@ -1,6 +1,7 @@ -Subject: completion: Use simple wait queues +From f485c427ac38ae06d4929f6ea245e88c70d31f6f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 11 Jan 2013 11:23:51 +0100 +Subject: [PATCH 199/414] 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 @@ -8,22 +9,24 @@ contention on the waitqueue lock. Signed-off-by: Thomas Gleixner --- - drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 2 - - drivers/usb/gadget/function/f_fs.c | 2 - - drivers/usb/gadget/legacy/inode.c | 4 +- - include/linux/completion.h | 10 ++--- - include/linux/suspend.h | 6 +++ - include/linux/swait.h | 1 - kernel/power/hibernate.c | 7 ++++ - kernel/power/suspend.c | 4 ++ - kernel/sched/completion.c | 34 ++++++++++---------- - kernel/sched/core.c | 10 ++++- - kernel/sched/swait.c | 20 +++++++++++ + .../wireless/intersil/orinoco/orinoco_usb.c | 2 +- + drivers/usb/gadget/function/f_fs.c | 2 +- + drivers/usb/gadget/legacy/inode.c | 4 +-- + include/linux/completion.h | 10 +++--- + include/linux/suspend.h | 6 ++++ + include/linux/swait.h | 1 + + kernel/power/hibernate.c | 7 ++++ + kernel/power/suspend.c | 4 +++ + kernel/sched/completion.c | 34 +++++++++---------- + kernel/sched/core.c | 10 ++++-- + kernel/sched/swait.c | 20 +++++++++++ 11 files changed, 72 insertions(+), 28 deletions(-) +diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +index 56f6e3b71f48..a50350d01a80 100644 --- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c -@@ -697,7 +697,7 @@ static void ezusb_req_ctx_wait(struct ez +@@ -697,7 +697,7 @@ static void ezusb_req_ctx_wait(struct ezusb_priv *upriv, while (!ctx->done.done && msecs--) udelay(1000); } else { @@ -32,9 +35,11 @@ Signed-off-by: Thomas Gleixner ctx->done.done); } break; +diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c +index 0904cb6ce4de..6505561ed0e0 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c -@@ -1609,7 +1609,7 @@ static void ffs_data_put(struct ffs_data +@@ -1609,7 +1609,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) || @@ -43,9 +48,11 @@ Signed-off-by: Thomas Gleixner waitqueue_active(&ffs->wait)); destroy_workqueue(ffs->io_completion_wq); kfree(ffs->dev_name); +diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c +index 5c28bee327e1..ed49dba4704d 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c -@@ -347,7 +347,7 @@ ep_io (struct ep_data *epdata, void *buf +@@ -347,7 +347,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len) spin_unlock_irq (&epdata->dev->lock); if (likely (value == 0)) { @@ -54,7 +61,7 @@ Signed-off-by: Thomas Gleixner if (value != 0) { spin_lock_irq (&epdata->dev->lock); if (likely (epdata->ep != NULL)) { -@@ -356,7 +356,7 @@ ep_io (struct ep_data *epdata, void *buf +@@ -356,7 +356,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len) usb_ep_dequeue (epdata->ep, epdata->req); spin_unlock_irq (&epdata->dev->lock); @@ -63,6 +70,8 @@ Signed-off-by: Thomas Gleixner if (epdata->status == -ECONNRESET) epdata->status = -EINTR; } else { +diff --git a/include/linux/completion.h b/include/linux/completion.h +index 7828451e161a..f5838b10cf84 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -9,7 +9,7 @@ @@ -83,7 +92,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_LOCKDEP_COMPLETIONS struct lockdep_map_cross map; #endif -@@ -67,11 +67,11 @@ static inline void complete_release_comm +@@ -67,11 +67,11 @@ static inline void complete_release_commit(struct completion *x) {} #ifdef CONFIG_LOCKDEP_COMPLETIONS #define COMPLETION_INITIALIZER(work) \ @@ -97,7 +106,7 @@ Signed-off-by: Thomas Gleixner #endif #define COMPLETION_INITIALIZER_ONSTACK(work) \ -@@ -117,7 +117,7 @@ static inline void complete_release_comm +@@ -117,7 +117,7 @@ static inline void complete_release_commit(struct completion *x) {} static inline void __init_completion(struct completion *x) { x->done = 0; @@ -106,6 +115,8 @@ Signed-off-by: Thomas Gleixner } /** +diff --git a/include/linux/suspend.h b/include/linux/suspend.h +index 8544357d92d0..616ea66cd283 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -196,6 +196,12 @@ struct platform_s2idle_ops { @@ -121,9 +132,11 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_SUSPEND extern suspend_state_t mem_sleep_current; extern suspend_state_t mem_sleep_default; +diff --git a/include/linux/swait.h b/include/linux/swait.h +index 84f9745365ff..853f3e61a9f4 100644 --- a/include/linux/swait.h +++ b/include/linux/swait.h -@@ -148,6 +148,7 @@ static inline bool swq_has_sleeper(struc +@@ -148,6 +148,7 @@ static inline bool swq_has_sleeper(struct swait_queue_head *wq) extern void swake_up(struct swait_queue_head *q); extern void swake_up_all(struct swait_queue_head *q); extern void swake_up_locked(struct swait_queue_head *q); @@ -131,6 +144,8 @@ Signed-off-by: Thomas Gleixner extern void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait); extern void prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait, int state); +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index 7c7dbbf23f37..a4b83cb0c6e5 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -679,6 +679,10 @@ static int load_image_and_restore(void) @@ -161,9 +176,11 @@ Signed-off-by: Thomas Gleixner pr_info("hibernation exit\n"); return error; +diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c +index d74d04d49248..44e17d70154f 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c -@@ -593,6 +593,8 @@ static int enter_state(suspend_state_t s +@@ -593,6 +593,8 @@ static int enter_state(suspend_state_t state) return error; } @@ -188,6 +205,8 @@ Signed-off-by: Thomas Gleixner return error; } EXPORT_SYMBOL(pm_suspend); +diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c +index 2ddaec40956f..0fe2982e46a0 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -32,7 +32,7 @@ void complete(struct completion *x) @@ -250,7 +269,7 @@ Signed-off-by: Thomas Gleixner if (!x->done) return timeout; } -@@ -108,9 +108,9 @@ static inline long __sched +@@ -108,9 +108,9 @@ __wait_for_common(struct completion *x, complete_acquire(x); @@ -262,7 +281,7 @@ Signed-off-by: Thomas Gleixner complete_release(x); -@@ -299,12 +299,12 @@ bool try_wait_for_completion(struct comp +@@ -299,12 +299,12 @@ bool try_wait_for_completion(struct completion *x) if (!READ_ONCE(x->done)) return 0; @@ -277,7 +296,7 @@ Signed-off-by: Thomas Gleixner return ret; } EXPORT_SYMBOL(try_wait_for_completion); -@@ -330,8 +330,8 @@ bool completion_done(struct completion * +@@ -330,8 +330,8 @@ bool completion_done(struct completion *x) * otherwise we can end up freeing the completion before complete() * is done referencing it. */ @@ -288,6 +307,8 @@ Signed-off-by: Thomas Gleixner return true; } EXPORT_SYMBOL(completion_done); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 405a493a11b3..0188bbccefc7 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6817,7 +6817,10 @@ void migrate_disable(void) @@ -314,6 +335,8 @@ Signed-off-by: Thomas Gleixner #endif WARN_ON_ONCE(p->migrate_disable <= 0); +diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c +index 9ff1555341ed..7006375949c2 100644 --- a/kernel/sched/swait.c +++ b/kernel/sched/swait.c @@ -1,6 +1,7 @@ @@ -324,7 +347,7 @@ Signed-off-by: Thomas Gleixner void __init_swait_queue_head(struct swait_queue_head *q, const char *name, struct lock_class_key *key) -@@ -30,6 +31,25 @@ void swake_up_locked(struct swait_queue_ +@@ -30,6 +31,25 @@ void swake_up_locked(struct swait_queue_head *q) } EXPORT_SYMBOL(swake_up_locked); @@ -350,3 +373,6 @@ Signed-off-by: Thomas Gleixner void swake_up(struct swait_queue_head *q) { unsigned long flags; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0200-fs-aio-simple-simple-work.patch b/kernel/patches-4.14.x-rt/0200-0200-fs-aio-simple-simple-work.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0200-fs-aio-simple-simple-work.patch rename to kernel/patches-4.14.x-rt/0200-0200-fs-aio-simple-simple-work.patch index 671f2032b..3773102fd 100644 --- a/kernel/patches-4.14.x-rt/0200-fs-aio-simple-simple-work.patch +++ b/kernel/patches-4.14.x-rt/0200-0200-fs-aio-simple-simple-work.patch @@ -1,6 +1,7 @@ +From dac0164eb557e7751d1452ec595131934fd2334b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 16 Feb 2015 18:49:10 +0100 -Subject: fs/aio: simple simple work +Subject: [PATCH 200/414] 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 @@ -24,9 +25,11 @@ Reported-By: Mike Galbraith Suggested-by: Benjamin LaHaise Signed-off-by: Sebastian Andrzej Siewior --- - fs/aio.c | 15 +++++++++++++-- + fs/aio.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) +diff --git a/fs/aio.c b/fs/aio.c +index c3ace7833a03..360e60944540 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -40,6 +40,7 @@ @@ -53,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior aio_mnt = kern_mount(&aio_fs); if (IS_ERR(aio_mnt)) panic("Failed to create aio fs mount."); -@@ -633,9 +636,9 @@ static void free_ioctx_reqs(struct percp +@@ -633,9 +636,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. */ @@ -65,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct aio_kiocb *req; spin_lock_irq(&ctx->ctx_lock); -@@ -654,6 +657,14 @@ static void free_ioctx_users(struct perc +@@ -654,6 +657,14 @@ static void free_ioctx_users(struct percpu_ref *ref) percpu_ref_put(&ctx->reqs); } @@ -80,3 +83,6 @@ Signed-off-by: Sebastian Andrzej Siewior static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) { unsigned i, new_nr; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0201-genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch b/kernel/patches-4.14.x-rt/0201-0201-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0201-genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch rename to kernel/patches-4.14.x-rt/0201-0201-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch index 5bb2d24ea..fd3ee5538 100644 --- a/kernel/patches-4.14.x-rt/0201-genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/kernel/patches-4.14.x-rt/0201-0201-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,6 +1,8 @@ +From 8bed8c5ef0f45b863b92d0ad33f16594d70960a3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 21 Aug 2013 17:48:46 +0200 -Subject: genirq: Do not invoke the affinity callback via a workqueue on RT +Subject: [PATCH 201/414] genirq: Do not invoke the affinity callback via a + workqueue on RT Joe Korty reported, that __irq_set_affinity_locked() schedules a workqueue while holding a rawlock which results in a might_sleep() @@ -9,10 +11,12 @@ This patch uses swork_queue() instead. Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/interrupt.h | 6 ++++++ - kernel/irq/manage.c | 43 ++++++++++++++++++++++++++++++++++++++++--- + include/linux/interrupt.h | 6 ++++++ + kernel/irq/manage.c | 43 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 3 deletions(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 2395ebb443b9..172376b9a049 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -15,6 +15,7 @@ @@ -43,9 +47,11 @@ Signed-off-by: Sebastian Andrzej Siewior void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); void (*release)(struct kref *ref); }; +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index 6d1f321152d0..5007ea8ac740 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -226,7 +226,12 @@ int irq_set_affinity_locked(struct irq_d +@@ -226,7 +226,12 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, if (desc->affinity_notify) { kref_get(&desc->affinity_notify->kref); @@ -58,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior } irqd_set(data, IRQD_AFFINITY_SET); -@@ -264,10 +269,8 @@ int irq_set_affinity_hint(unsigned int i +@@ -264,10 +269,8 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) } EXPORT_SYMBOL_GPL(irq_set_affinity_hint); @@ -70,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct irq_desc *desc = irq_to_desc(notify->irq); cpumask_var_t cpumask; unsigned long flags; -@@ -289,6 +292,35 @@ static void irq_affinity_notify(struct w +@@ -289,6 +292,35 @@ static void irq_affinity_notify(struct work_struct *work) kref_put(¬ify->kref, notify->release); } @@ -106,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * irq_set_affinity_notifier - control notification of IRQ affinity changes * @irq: Interrupt for which to enable/disable notification -@@ -317,7 +349,12 @@ irq_set_affinity_notifier(unsigned int i +@@ -317,7 +349,12 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) if (notify) { notify->irq = irq; kref_init(¬ify->kref); @@ -119,3 +125,6 @@ Signed-off-by: Sebastian Andrzej Siewior } raw_spin_lock_irqsave(&desc->lock, flags); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0202-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch b/kernel/patches-4.14.x-rt/0202-0202-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0202-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch rename to kernel/patches-4.14.x-rt/0202-0202-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch index 01818c08a..9467e2117 100644 --- a/kernel/patches-4.14.x-rt/0202-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +++ b/kernel/patches-4.14.x-rt/0202-0202-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch @@ -1,18 +1,22 @@ +From 37f9541325e7be6549dcab300b50b39e86ec30b3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 15 Nov 2017 17:29:51 +0100 -Subject: [PATCH] time/hrtimer: avoid schedule_work() with interrupts disabled +Subject: [PATCH 202/414] time/hrtimer: avoid schedule_work() with interrupts + disabled The NOHZ code tries to schedule a workqueue with interrupts disabled. Since this does not work -RT I am switching it to swork instead. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/timer.c | 15 +++++++++++---- + kernel/time/timer.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 464aee26ef2b..ced791c0b47b 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -217,8 +217,7 @@ static DEFINE_PER_CPU(struct timer_base, +@@ -217,8 +217,7 @@ static DEFINE_PER_CPU(struct timer_base, timer_bases[NR_BASES]); static DEFINE_STATIC_KEY_FALSE(timers_nohz_active); static DEFINE_MUTEX(timer_keys_mutex); @@ -22,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_SMP unsigned int sysctl_timer_migration = 1; -@@ -238,7 +237,7 @@ static void timers_update_migration(void +@@ -238,7 +237,7 @@ static void timers_update_migration(void) static inline void timers_update_migration(void) { } #endif /* !CONFIG_SMP */ @@ -31,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior { mutex_lock(&timer_keys_mutex); timers_update_migration(); -@@ -248,9 +247,17 @@ static void timer_update_keys(struct wor +@@ -248,9 +247,17 @@ static void timer_update_keys(struct work_struct *work) void timers_update_nohz(void) { @@ -50,3 +54,6 @@ Signed-off-by: Sebastian Andrzej Siewior int timer_migration_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0203-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/kernel/patches-4.14.x-rt/0203-0203-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0203-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch rename to kernel/patches-4.14.x-rt/0203-0203-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index ad8b530c1..8815d7c82 100644 --- a/kernel/patches-4.14.x-rt/0203-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/kernel/patches-4.14.x-rt/0203-0203-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -1,7 +1,8 @@ +From d3ecc0fcfd976e379a534bfc4545f9631a7f9770 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 4 Sep 2017 18:31:50 +0200 -Subject: [PATCH] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() - calls +Subject: [PATCH 203/414] hrtimer: consolidate hrtimer_init() + + hrtimer_init_sleeper() calls hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of the @@ -9,17 +10,19 @@ hrtimer object part of hrtimer_init_sleeper(). Signed-off-by: Sebastian Andrzej Siewior --- - block/blk-mq.c | 3 +-- - include/linux/hrtimer.h | 19 ++++++++++++++++--- - include/linux/wait.h | 4 ++-- - kernel/futex.c | 19 ++++++++----------- - kernel/time/hrtimer.c | 46 ++++++++++++++++++++++++++++++++++++---------- - net/core/pktgen.c | 4 ++-- + block/blk-mq.c | 3 +-- + include/linux/hrtimer.h | 19 ++++++++++++++--- + include/linux/wait.h | 4 ++-- + kernel/futex.c | 19 +++++++---------- + kernel/time/hrtimer.c | 46 ++++++++++++++++++++++++++++++++--------- + net/core/pktgen.c | 4 ++-- 6 files changed, 65 insertions(+), 30 deletions(-) +diff --git a/block/blk-mq.c b/block/blk-mq.c +index 007f96611364..de6cbc13a0d9 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -2845,10 +2845,9 @@ static bool blk_mq_poll_hybrid_sleep(str +@@ -2845,10 +2845,9 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, kt = nsecs; mode = HRTIMER_MODE_REL; @@ -31,9 +34,11 @@ Signed-off-by: Sebastian Andrzej Siewior do { if (test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags)) break; +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index c7902ca7c9f4..1f2002260208 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -364,10 +364,17 @@ DECLARE_PER_CPU(struct tick_device, tick +@@ -364,10 +364,17 @@ DECLARE_PER_CPU(struct tick_device, tick_cpu_device); /* Initialize timers: */ extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, enum hrtimer_mode mode); @@ -51,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern void destroy_hrtimer_on_stack(struct hrtimer *timer); #else -@@ -377,6 +384,15 @@ static inline void hrtimer_init_on_stack +@@ -377,6 +384,15 @@ static inline void hrtimer_init_on_stack(struct hrtimer *timer, { hrtimer_init(timer, which_clock, mode); } @@ -67,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } #endif -@@ -479,9 +495,6 @@ extern long hrtimer_nanosleep(const stru +@@ -479,9 +495,6 @@ extern long hrtimer_nanosleep(const struct timespec64 *rqtp, const enum hrtimer_mode mode, const clockid_t clockid); @@ -77,6 +82,8 @@ Signed-off-by: Sebastian Andrzej Siewior extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta, const enum hrtimer_mode mode); extern int schedule_hrtimeout_range_clock(ktime_t *expires, +diff --git a/include/linux/wait.h b/include/linux/wait.h +index 49543ae3dc5f..3451706a3074 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -487,8 +487,8 @@ do { \ @@ -90,9 +97,11 @@ Signed-off-by: Sebastian Andrzej Siewior if ((timeout) != KTIME_MAX) \ hrtimer_start_range_ns(&__t.timer, timeout, \ current->timer_slack_ns, \ +diff --git a/kernel/futex.c b/kernel/futex.c +index e70b5b516371..1d87da84b2a2 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2642,10 +2642,9 @@ static int futex_wait(u32 __user *uaddr, +@@ -2642,10 +2642,9 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, if (abs_time) { to = &timeout; @@ -106,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires_range_ns(&to->timer, *abs_time, current->timer_slack_ns); } -@@ -2744,9 +2743,8 @@ static int futex_lock_pi(u32 __user *uad +@@ -2744,9 +2743,8 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, if (time) { to = &timeout; @@ -118,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires(&to->timer, *time); } -@@ -3162,10 +3160,9 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3162,10 +3160,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, if (abs_time) { to = &timeout; @@ -132,9 +141,11 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires_range_ns(&to->timer, *abs_time, current->timer_slack_ns); } +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 9947480ad731..c2e8503f20cb 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1603,13 +1603,44 @@ static enum hrtimer_restart hrtimer_wake +@@ -1603,13 +1603,44 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer) return HRTIMER_NORESTART; } @@ -180,7 +191,7 @@ Signed-off-by: Sebastian Andrzej Siewior int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) { switch(restart->nanosleep.type) { -@@ -1633,8 +1664,6 @@ static int __sched do_nanosleep(struct h +@@ -1633,8 +1664,6 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod { struct restart_block *restart; @@ -189,7 +200,7 @@ Signed-off-by: Sebastian Andrzej Siewior do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t->timer, mode); -@@ -1671,10 +1700,9 @@ static long __sched hrtimer_nanosleep_re +@@ -1671,10 +1700,9 @@ static long __sched hrtimer_nanosleep_restart(struct restart_block *restart) struct hrtimer_sleeper t; int ret; @@ -202,7 +213,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = do_nanosleep(&t, HRTIMER_MODE_ABS); destroy_hrtimer_on_stack(&t.timer); return ret; -@@ -1692,7 +1720,7 @@ long hrtimer_nanosleep(const struct time +@@ -1692,7 +1720,7 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp, if (dl_task(current) || rt_task(current)) slack = 0; @@ -211,7 +222,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); ret = do_nanosleep(&t, mode); if (ret != -ERESTART_RESTARTBLOCK) -@@ -1887,11 +1915,9 @@ schedule_hrtimeout_range_clock(ktime_t * +@@ -1887,11 +1915,9 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, return -EINTR; } @@ -224,9 +235,11 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_start_expires(&t.timer, mode); if (likely(t.task)) +diff --git a/net/core/pktgen.c b/net/core/pktgen.c +index 6e1e10ff433a..c1ae4075e0ed 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c -@@ -2252,7 +2252,8 @@ static void spin(struct pktgen_dev *pkt_ +@@ -2252,7 +2252,8 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until) s64 remaining; struct hrtimer_sleeper t; @@ -236,7 +249,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires(&t.timer, spin_until); remaining = ktime_to_ns(hrtimer_expires_remaining(&t.timer)); -@@ -2267,7 +2268,6 @@ static void spin(struct pktgen_dev *pkt_ +@@ -2267,7 +2268,6 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until) } while (ktime_compare(end_time, spin_until) < 0); } else { /* see do_nanosleep */ @@ -244,3 +257,6 @@ Signed-off-by: Sebastian Andrzej Siewior do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0204-hrtimers-prepare-full-preemption.patch b/kernel/patches-4.14.x-rt/0204-0204-hrtimers-Prepare-full-preemption.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0204-hrtimers-prepare-full-preemption.patch rename to kernel/patches-4.14.x-rt/0204-0204-hrtimers-Prepare-full-preemption.patch index 5e7bec86a..649074faa 100644 --- a/kernel/patches-4.14.x-rt/0204-hrtimers-prepare-full-preemption.patch +++ b/kernel/patches-4.14.x-rt/0204-0204-hrtimers-Prepare-full-preemption.patch @@ -1,20 +1,22 @@ +From e0e9291f131c45dc4ddb8bf94992ab546bb5bcae Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 -Subject: hrtimers: Prepare full preemption +Subject: [PATCH 204/414] hrtimers: Prepare full preemption Make cancellation of a running callback in softirq context safe against preemption. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - include/linux/hrtimer.h | 13 ++++++++++++- - kernel/time/hrtimer.c | 33 ++++++++++++++++++++++++++++++++- - kernel/time/itimer.c | 1 + - kernel/time/posix-timers.c | 33 +++++++++++++++++++++++++++++++++ + include/linux/hrtimer.h | 13 ++++++++++++- + kernel/time/hrtimer.c | 33 ++++++++++++++++++++++++++++++++- + kernel/time/itimer.c | 1 + + kernel/time/posix-timers.c | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 2 deletions(-) +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 1f2002260208..3de1b8cf4d2a 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -22,6 +22,7 @@ @@ -35,7 +37,7 @@ Signed-off-by: Thomas Gleixner struct hrtimer *softirq_next_timer; struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; } ____cacheline_aligned; -@@ -433,6 +437,13 @@ static inline void hrtimer_restart(struc +@@ -433,6 +437,13 @@ static inline void hrtimer_restart(struct hrtimer *timer) hrtimer_start_expires(timer, HRTIMER_MODE_ABS); } @@ -49,7 +51,7 @@ Signed-off-by: Thomas Gleixner /* Query timers: */ extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust); -@@ -457,7 +468,7 @@ static inline int hrtimer_is_queued(stru +@@ -457,7 +468,7 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) * Helper function to check, whether the timer is running the callback * function */ @@ -58,9 +60,11 @@ Signed-off-by: Thomas Gleixner { return timer->base->running == timer; } +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index c2e8503f20cb..8c3c0dff5184 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -926,6 +926,33 @@ u64 hrtimer_forward(struct hrtimer *time +@@ -926,6 +926,33 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) } EXPORT_SYMBOL_GPL(hrtimer_forward); @@ -94,7 +98,7 @@ Signed-off-by: Thomas Gleixner /* * enqueue_hrtimer - internal function to (re)start a timer * -@@ -1158,7 +1185,7 @@ int hrtimer_cancel(struct hrtimer *timer +@@ -1158,7 +1185,7 @@ int hrtimer_cancel(struct hrtimer *timer) if (ret >= 0) return ret; @@ -103,7 +107,7 @@ Signed-off-by: Thomas Gleixner } } EXPORT_SYMBOL_GPL(hrtimer_cancel); -@@ -1431,6 +1458,7 @@ static __latent_entropy void hrtimer_run +@@ -1431,6 +1458,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); @@ -111,7 +115,7 @@ Signed-off-by: Thomas Gleixner } #ifdef CONFIG_HIGH_RES_TIMERS -@@ -1797,6 +1825,9 @@ int hrtimers_prepare_cpu(unsigned int cp +@@ -1797,6 +1825,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; @@ -121,9 +125,11 @@ Signed-off-by: Thomas Gleixner return 0; } +diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c +index f26acef5d7b4..760f38528365 100644 --- a/kernel/time/itimer.c +++ b/kernel/time/itimer.c -@@ -214,6 +214,7 @@ int do_setitimer(int which, struct itime +@@ -214,6 +214,7 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue) /* We are sharing ->siglock with it_real_fn() */ if (hrtimer_try_to_cancel(timer) < 0) { spin_unlock_irq(&tsk->sighand->siglock); @@ -131,9 +137,11 @@ Signed-off-by: Thomas Gleixner goto again; } expires = timeval_to_ktime(value->it_value); +diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c +index f5392262fb77..f357877f0cb7 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c -@@ -797,6 +797,20 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_ +@@ -797,6 +797,20 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id) return overrun; } @@ -154,7 +162,7 @@ Signed-off-by: Thomas Gleixner static void common_hrtimer_arm(struct k_itimer *timr, ktime_t expires, bool absolute, bool sigev_none) { -@@ -891,6 +905,7 @@ static int do_timer_settime(timer_t time +@@ -891,6 +905,7 @@ static int do_timer_settime(timer_t timer_id, int flags, if (!timr) return -EINVAL; @@ -162,7 +170,7 @@ Signed-off-by: Thomas Gleixner kc = timr->kclock; if (WARN_ON_ONCE(!kc || !kc->timer_set)) error = -EINVAL; -@@ -899,9 +914,12 @@ static int do_timer_settime(timer_t time +@@ -899,9 +914,12 @@ static int do_timer_settime(timer_t timer_id, int flags, unlock_timer(timr, flag); if (error == TIMER_RETRY) { @@ -175,7 +183,7 @@ Signed-off-by: Thomas Gleixner return error; } -@@ -983,10 +1001,15 @@ SYSCALL_DEFINE1(timer_delete, timer_t, t +@@ -983,10 +1001,15 @@ SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) if (!timer) return -EINVAL; @@ -191,7 +199,7 @@ Signed-off-by: Thomas Gleixner spin_lock(¤t->sighand->siglock); list_del(&timer->list); -@@ -1012,8 +1035,18 @@ static void itimer_delete(struct k_itime +@@ -1012,8 +1035,18 @@ static void itimer_delete(struct k_itimer *timer) retry_delete: spin_lock_irqsave(&timer->it_lock, flags); @@ -210,3 +218,6 @@ Signed-off-by: Thomas Gleixner goto retry_delete; } list_del(&timer->list); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0205-hrtimer-by-timers-by-default-into-the-softirq-context.patch b/kernel/patches-4.14.x-rt/0205-0205-hrtimer-by-timers-by-default-into-the-softirq-contex.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0205-hrtimer-by-timers-by-default-into-the-softirq-context.patch rename to kernel/patches-4.14.x-rt/0205-0205-hrtimer-by-timers-by-default-into-the-softirq-contex.patch index 63b403f87..61575565d 100644 --- a/kernel/patches-4.14.x-rt/0205-hrtimer-by-timers-by-default-into-the-softirq-context.patch +++ b/kernel/patches-4.14.x-rt/0205-0205-hrtimer-by-timers-by-default-into-the-softirq-contex.patch @@ -1,6 +1,8 @@ +From 5895e72801c17d54a4260ea4794bfe8113c040a4 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 3 Jul 2009 08:44:31 -0500 -Subject: hrtimer: by timers by default into the softirq context +Subject: [PATCH 205/414] hrtimer: by timers by default into the softirq + context We can't have hrtimers callbacks running in hardirq context on RT. Therefore the timers are deferred to the softirq context by default. @@ -12,21 +14,23 @@ Those are: Signed-off-by: Sebastian Andrzej Siewior --- - arch/x86/kvm/lapic.c | 2 +- - include/linux/hrtimer.h | 6 ++++++ - kernel/events/core.c | 4 ++-- - kernel/sched/core.c | 2 +- - kernel/sched/deadline.c | 2 +- - kernel/sched/rt.c | 4 ++-- - kernel/time/hrtimer.c | 34 ++++++++++++++++++++++++++++++++-- - kernel/time/tick-broadcast-hrtimer.c | 2 +- - kernel/time/tick-sched.c | 2 +- - kernel/watchdog.c | 2 +- + arch/x86/kvm/lapic.c | 2 +- + include/linux/hrtimer.h | 6 +++++ + kernel/events/core.c | 4 ++-- + kernel/sched/core.c | 2 +- + kernel/sched/deadline.c | 2 +- + kernel/sched/rt.c | 4 ++-- + kernel/time/hrtimer.c | 34 ++++++++++++++++++++++++++-- + kernel/time/tick-broadcast-hrtimer.c | 2 +- + kernel/time/tick-sched.c | 2 +- + kernel/watchdog.c | 2 +- 10 files changed, 48 insertions(+), 12 deletions(-) +diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c +index 8cfdb6484fd0..6866c863318d 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c -@@ -2097,7 +2097,7 @@ int kvm_create_lapic(struct kvm_vcpu *vc +@@ -2097,7 +2097,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) apic->vcpu = vcpu; hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC, @@ -35,6 +39,8 @@ Signed-off-by: Sebastian Andrzej Siewior apic->lapic_timer.timer.function = apic_timer_fn; /* +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 3de1b8cf4d2a..3bd606859b0a 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -42,6 +42,7 @@ enum hrtimer_mode { @@ -57,9 +63,11 @@ Signed-off-by: Sebastian Andrzej Siewior }; /* +diff --git a/kernel/events/core.c b/kernel/events/core.c +index cb8274d7824f..0274a44f8fb0 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c -@@ -1042,7 +1042,7 @@ static void __perf_mux_hrtimer_init(stru +@@ -1042,7 +1042,7 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_context *cpuctx, int cpu) cpuctx->hrtimer_interval = ns_to_ktime(NSEC_PER_MSEC * interval); raw_spin_lock_init(&cpuctx->hrtimer_lock); @@ -68,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior timer->function = perf_mux_hrtimer_handler; } -@@ -8714,7 +8714,7 @@ static void perf_swevent_init_hrtimer(st +@@ -8714,7 +8714,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event) if (!is_sampling_event(event)) return; @@ -77,9 +85,11 @@ Signed-off-by: Sebastian Andrzej Siewior hwc->hrtimer.function = perf_swevent_hrtimer; /* +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 0188bbccefc7..657fbdefc73c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -341,7 +341,7 @@ static void init_rq_hrtick(struct rq *rq +@@ -341,7 +341,7 @@ static void init_rq_hrtick(struct rq *rq) rq->hrtick_csd.info = rq; #endif @@ -88,9 +98,11 @@ Signed-off-by: Sebastian Andrzej Siewior rq->hrtick_timer.function = hrtick; } #else /* CONFIG_SCHED_HRTICK */ +diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c +index 72a396253dc0..cf671fe21478 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -1020,7 +1020,7 @@ void init_dl_task_timer(struct sched_dl_ +@@ -1020,7 +1020,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se) { struct hrtimer *timer = &dl_se->dl_timer; @@ -99,9 +111,11 @@ Signed-off-by: Sebastian Andrzej Siewior timer->function = dl_task_timer; } +diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c +index a892c5e0ed41..dc85b469e7f5 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c -@@ -47,8 +47,8 @@ void init_rt_bandwidth(struct rt_bandwid +@@ -47,8 +47,8 @@ void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime) raw_spin_lock_init(&rt_b->rt_runtime_lock); @@ -112,9 +126,11 @@ Signed-off-by: Sebastian Andrzej Siewior rt_b->rt_period_timer.function = sched_rt_period_timer; } +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 8c3c0dff5184..ec9f271aa437 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1122,7 +1122,9 @@ void hrtimer_start_range_ns(struct hrtim +@@ -1122,7 +1122,9 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft * match. */ @@ -124,7 +140,7 @@ Signed-off-by: Sebastian Andrzej Siewior base = lock_hrtimer_base(timer, &flags); -@@ -1249,10 +1251,17 @@ static inline int hrtimer_clockid_to_bas +@@ -1249,10 +1251,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) { @@ -144,7 +160,7 @@ Signed-off-by: Sebastian Andrzej Siewior memset(timer, 0, sizeof(struct hrtimer)); cpu_base = raw_cpu_ptr(&hrtimer_bases); -@@ -1631,11 +1640,32 @@ static enum hrtimer_restart hrtimer_wake +@@ -1631,11 +1640,32 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer) return HRTIMER_NORESTART; } @@ -177,9 +193,11 @@ Signed-off-by: Sebastian Andrzej Siewior __hrtimer_init(&sl->timer, clock_id, mode); 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 58045eb976c3..f0a34afbc252 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(s +@@ -106,7 +106,7 @@ static enum hrtimer_restart bc_handler(struct hrtimer *t) void tick_setup_hrtimer_broadcast(void) { @@ -188,6 +206,8 @@ Signed-off-by: Sebastian Andrzej Siewior bctimer.function = bc_handler; clockevents_register_device(&ce_broadcast_hrtimer); } +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index d8d91b06f057..145dc49881e6 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1255,7 +1255,7 @@ void tick_setup_sched_timer(void) @@ -199,9 +219,11 @@ Signed-off-by: Sebastian Andrzej Siewior ts->sched_timer.function = tick_sched_timer; /* Get the next period (per-CPU) */ +diff --git a/kernel/watchdog.c b/kernel/watchdog.c +index c8e06703e44c..1c6188a15481 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c -@@ -462,7 +462,7 @@ static void watchdog_enable(unsigned int +@@ -462,7 +462,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. */ @@ -210,3 +232,6 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer->function = watchdog_timer_fn; hrtimer_start(hrtimer, ns_to_ktime(sample_period), HRTIMER_MODE_REL_PINNED); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0206-alarmtimer-Prevent-live-lock-in-alarm_cancel.patch b/kernel/patches-4.14.x-rt/0206-0206-alarmtimer-Prevent-live-lock-in-alarm_cancel.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0206-alarmtimer-Prevent-live-lock-in-alarm_cancel.patch rename to kernel/patches-4.14.x-rt/0206-0206-alarmtimer-Prevent-live-lock-in-alarm_cancel.patch index 6686e0ce1..2bed1e6b3 100644 --- a/kernel/patches-4.14.x-rt/0206-alarmtimer-Prevent-live-lock-in-alarm_cancel.patch +++ b/kernel/patches-4.14.x-rt/0206-0206-alarmtimer-Prevent-live-lock-in-alarm_cancel.patch @@ -1,6 +1,7 @@ +From 01c4d6110f15ea44ef14d8566fa53ef22736cae2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 27 Mar 2018 15:58:16 +0200 -Subject: [PATCH 1/3] alarmtimer: Prevent live lock in alarm_cancel() +Subject: [PATCH 206/414] alarmtimer: Prevent live lock in alarm_cancel() If alarm_try_to_cancel() requires a retry, then depending on the priority setting the retry loop might prevent timer callback completion @@ -10,9 +11,11 @@ non RT kernel. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/alarmtimer.c | 2 +- + kernel/time/alarmtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c +index 639321bf2e39..0c7227f89349 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -436,7 +436,7 @@ int alarm_cancel(struct alarm *alarm) @@ -24,3 +27,6 @@ Signed-off-by: Sebastian Andrzej Siewior } } EXPORT_SYMBOL_GPL(alarm_cancel); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0207-posix-timers-user-proper-timer-while-waiting-for-ala.patch b/kernel/patches-4.14.x-rt/0207-0207-posix-timers-user-proper-timer-while-waiting-for-ala.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0207-posix-timers-user-proper-timer-while-waiting-for-ala.patch rename to kernel/patches-4.14.x-rt/0207-0207-posix-timers-user-proper-timer-while-waiting-for-ala.patch index 46c8d5032..89d6e1d3e 100644 --- a/kernel/patches-4.14.x-rt/0207-posix-timers-user-proper-timer-while-waiting-for-ala.patch +++ b/kernel/patches-4.14.x-rt/0207-0207-posix-timers-user-proper-timer-while-waiting-for-ala.patch @@ -1,6 +1,7 @@ +From 78c6a58dde7694b057884656756df9cefbc8e591 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 28 Mar 2018 10:45:40 +0200 -Subject: [PATCH 2/3] posix-timers: user proper timer while waiting for +Subject: [PATCH 207/414] posix-timers: user proper timer while waiting for alarmtimer On RT the timer can be preempted while running and therefore we wait @@ -18,12 +19,14 @@ struct. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/posix-timers.c | 30 ++++++++++++++++-------------- + kernel/time/posix-timers.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) +diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c +index f357877f0cb7..f3371482fc6a 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c -@@ -797,20 +797,6 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_ +@@ -797,20 +797,6 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id) return overrun; } @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void common_hrtimer_arm(struct k_itimer *timr, ktime_t expires, bool absolute, bool sigev_none) { -@@ -841,6 +827,22 @@ static void common_hrtimer_arm(struct k_ +@@ -841,6 +827,22 @@ static void common_hrtimer_arm(struct k_itimer *timr, ktime_t expires, hrtimer_start_expires(timer, HRTIMER_MODE_ABS); } @@ -67,3 +70,6 @@ Signed-off-by: Sebastian Andrzej Siewior static int common_hrtimer_try_to_cancel(struct k_itimer *timr) { return hrtimer_try_to_cancel(&timr->it.real.timer); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0208-posix-timers-move-the-rcu-head-out-of-the-union.patch b/kernel/patches-4.14.x-rt/0208-0208-posix-timers-move-the-rcu-head-out-of-the-union.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0208-posix-timers-move-the-rcu-head-out-of-the-union.patch rename to kernel/patches-4.14.x-rt/0208-0208-posix-timers-move-the-rcu-head-out-of-the-union.patch index fef40df59..28facc943 100644 --- a/kernel/patches-4.14.x-rt/0208-posix-timers-move-the-rcu-head-out-of-the-union.patch +++ b/kernel/patches-4.14.x-rt/0208-0208-posix-timers-move-the-rcu-head-out-of-the-union.patch @@ -1,6 +1,7 @@ +From 322eacf7966007f2a6b3d694019af85164e1cf58 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 28 Mar 2018 11:15:19 +0200 -Subject: [PATCH 3/3] posix-timers: move the rcu head out of the union +Subject: [PATCH 208/414] posix-timers: move the rcu head out of the union On RT the timer can be preempted while running and therefore we wait with timer_wait_for_callback() for the timer to complete (instead of @@ -14,10 +15,12 @@ out of the union. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/posix-timers.h | 2 +- - kernel/time/posix-timers.c | 4 ++-- + include/linux/posix-timers.h | 2 +- + kernel/time/posix-timers.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) +diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h +index 672c4f32311e..4754eb4298b1 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -101,8 +101,8 @@ struct k_itimer { @@ -30,9 +33,11 @@ Signed-off-by: Sebastian Andrzej Siewior }; void run_posix_cpu_timers(struct task_struct *task); +diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c +index f3371482fc6a..c5866984f12d 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c -@@ -471,7 +471,7 @@ static struct k_itimer * alloc_posix_tim +@@ -471,7 +471,7 @@ static struct k_itimer * alloc_posix_timer(void) static void k_itimer_rcu_free(struct rcu_head *head) { @@ -41,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior kmem_cache_free(posix_timers_cache, tmr); } -@@ -488,7 +488,7 @@ static void release_posix_timer(struct k +@@ -488,7 +488,7 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set) } put_pid(tmr->it_pid); sigqueue_free(tmr->sigq); @@ -50,3 +55,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static int common_timer_create(struct k_itimer *new_timer) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0209-hrtimer-Move-schedule_work-call-to-helper-thread.patch b/kernel/patches-4.14.x-rt/0209-0209-hrtimer-Move-schedule_work-call-to-helper-thread.patch similarity index 90% rename from kernel/patches-4.14.x-rt/0209-hrtimer-Move-schedule_work-call-to-helper-thread.patch rename to kernel/patches-4.14.x-rt/0209-0209-hrtimer-Move-schedule_work-call-to-helper-thread.patch index c0246f092..94970bb0e 100644 --- a/kernel/patches-4.14.x-rt/0209-hrtimer-Move-schedule_work-call-to-helper-thread.patch +++ b/kernel/patches-4.14.x-rt/0209-0209-hrtimer-Move-schedule_work-call-to-helper-thread.patch @@ -1,6 +1,7 @@ +From 0555057a4309e02ff6027065ba298ad629fd9c06 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Mon, 16 Sep 2013 14:09:19 -0700 -Subject: hrtimer: Move schedule_work call to helper thread +Subject: [PATCH 209/414] hrtimer: Move schedule_work call to helper thread When run ltp leapsec_timer test, the following call trace is caught: @@ -46,9 +47,11 @@ Signed-off-by: Yang Shi [bigeasy: use swork_queue() instead a helper thread] Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 24 ++++++++++++++++++++++++ + kernel/time/hrtimer.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index ec9f271aa437..f824b9721ce7 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -715,6 +715,29 @@ static void hrtimer_switch_to_hres(void) @@ -89,3 +92,6 @@ Signed-off-by: Sebastian Andrzej Siewior #else +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0210-timer-fd-avoid-live-lock.patch b/kernel/patches-4.14.x-rt/0210-0210-timer-fd-Prevent-live-lock.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0210-timer-fd-avoid-live-lock.patch rename to kernel/patches-4.14.x-rt/0210-0210-timer-fd-Prevent-live-lock.patch index 31a9b1b5e..9d904996c 100644 --- a/kernel/patches-4.14.x-rt/0210-timer-fd-avoid-live-lock.patch +++ b/kernel/patches-4.14.x-rt/0210-0210-timer-fd-Prevent-live-lock.patch @@ -1,6 +1,7 @@ -Subject: timer-fd: Prevent live lock +From 9078533c3569fd55396debb15afa9f4da9876065 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 25 Jan 2012 11:08:40 +0100 +Subject: [PATCH 210/414] timer-fd: Prevent live lock If hrtimer_try_to_cancel() requires a retry, then depending on the priority setting te retry loop might prevent timer callback completion @@ -9,14 +10,15 @@ non RT kernel. Reported-by: Sankara Muthukrishnan Signed-off-by: Thomas Gleixner - --- - fs/timerfd.c | 5 ++++- + fs/timerfd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/fs/timerfd.c b/fs/timerfd.c +index 040612ec9598..b3d9d435926c 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c -@@ -471,7 +471,10 @@ static int do_timerfd_settime(int ufd, i +@@ -471,7 +471,10 @@ static int do_timerfd_settime(int ufd, int flags, break; } spin_unlock_irq(&ctx->wqh.lock); @@ -28,3 +30,6 @@ Signed-off-by: Thomas Gleixner } /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0211-posix-timers-thread-posix-cpu-timers-on-rt.patch b/kernel/patches-4.14.x-rt/0211-0211-posix-timers-Thread-posix-cpu-timers-on-rt.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0211-posix-timers-thread-posix-cpu-timers-on-rt.patch rename to kernel/patches-4.14.x-rt/0211-0211-posix-timers-Thread-posix-cpu-timers-on-rt.patch index 8a6d4ab94..1fee6cdc8 100644 --- a/kernel/patches-4.14.x-rt/0211-posix-timers-thread-posix-cpu-timers-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0211-0211-posix-timers-Thread-posix-cpu-timers-on-rt.patch @@ -1,6 +1,7 @@ +From 73a406a9b7850578fd5649ddca69c2d43e4f871a Mon Sep 17 00:00:00 2001 From: John Stultz Date: Fri, 3 Jul 2009 08:29:58 -0500 -Subject: posix-timers: Thread posix-cpu-timers on -rt +Subject: [PATCH 211/414] 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. @@ -9,14 +10,15 @@ context. Move it to a thread. Signed-off-by: John Stultz Signed-off-by: Thomas Gleixner - --- - include/linux/init_task.h | 7 + - include/linux/sched.h | 3 - kernel/fork.c | 3 - kernel/time/posix-cpu-timers.c | 157 +++++++++++++++++++++++++++++++++++++++-- + include/linux/init_task.h | 7 ++ + include/linux/sched.h | 3 + + kernel/fork.c | 3 + + kernel/time/posix-cpu-timers.c | 157 ++++++++++++++++++++++++++++++++- 4 files changed, 166 insertions(+), 4 deletions(-) +diff --git a/include/linux/init_task.h b/include/linux/init_task.h +index 53ee20e0b168..ee3ff961b84c 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -163,6 +163,12 @@ extern struct cred init_cred; @@ -40,6 +42,8 @@ Signed-off-by: Thomas Gleixner .pids = { \ [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ +diff --git a/include/linux/sched.h b/include/linux/sched.h +index b1ff98fb6dd3..976d5749b6b1 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -745,6 +745,9 @@ struct task_struct { @@ -52,9 +56,11 @@ Signed-off-by: Thomas Gleixner #endif /* Process credentials: */ +diff --git a/kernel/fork.c b/kernel/fork.c +index 7d23fd8ecd69..00c3a42d681b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1496,6 +1496,9 @@ static void rt_mutex_init_task(struct ta +@@ -1496,6 +1496,9 @@ static void rt_mutex_init_task(struct task_struct *p) */ static void posix_cpu_timers_init(struct task_struct *tsk) { @@ -64,6 +70,8 @@ Signed-off-by: Thomas Gleixner tsk->cputime_expires.prof_exp = 0; 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 5b117110b55b..47d063c4ed03 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -3,8 +3,10 @@ @@ -85,7 +93,7 @@ Signed-off-by: Thomas Gleixner #include "posix-timers.h" -@@ -603,7 +606,7 @@ static int posix_cpu_timer_set(struct k_ +@@ -603,7 +606,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, /* * Disarm any old timer after extracting its expiry time. */ @@ -94,7 +102,7 @@ Signed-off-by: Thomas Gleixner ret = 0; old_incr = timer->it.cpu.incr; -@@ -1034,7 +1037,7 @@ static void posix_cpu_timer_rearm(struct +@@ -1034,7 +1037,7 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer) /* * Now re-arm for the new expiry time. */ @@ -103,7 +111,7 @@ Signed-off-by: Thomas Gleixner arm_timer(timer); unlock: unlock_task_sighand(p, &flags); -@@ -1119,13 +1122,13 @@ static inline int fastpath_timer_check(s +@@ -1119,13 +1122,13 @@ 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. */ @@ -119,7 +127,7 @@ Signed-off-by: Thomas Gleixner /* * The fast path checks that there are no expired thread or thread -@@ -1179,6 +1182,152 @@ void run_posix_cpu_timers(struct task_st +@@ -1179,6 +1182,152 @@ void run_posix_cpu_timers(struct task_struct *tsk) } } @@ -272,3 +280,6 @@ Signed-off-by: Thomas Gleixner /* * Set one of the process-wide special case CPU timers or RLIMIT_CPU. * The tsk->sighand->siglock must be held by the caller. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0212-sched-delay-put-task.patch b/kernel/patches-4.14.x-rt/0212-0212-sched-Move-task_struct-cleanup-to-RCU.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0212-sched-delay-put-task.patch rename to kernel/patches-4.14.x-rt/0212-0212-sched-Move-task_struct-cleanup-to-RCU.patch index 5f8fcdb57..5003548c9 100644 --- a/kernel/patches-4.14.x-rt/0212-sched-delay-put-task.patch +++ b/kernel/patches-4.14.x-rt/0212-0212-sched-Move-task_struct-cleanup-to-RCU.patch @@ -1,17 +1,20 @@ -Subject: sched: Move task_struct cleanup to RCU +From 82c19f839e39fc45728edcf207c74e9ec10471cb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 31 May 2011 16:59:16 +0200 +Subject: [PATCH 212/414] 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. Signed-off-by: Thomas Gleixner --- - include/linux/sched.h | 3 +++ - include/linux/sched/task.h | 11 ++++++++++- - kernel/fork.c | 15 ++++++++++++++- + include/linux/sched.h | 3 +++ + include/linux/sched/task.h | 11 ++++++++++- + kernel/fork.c | 15 ++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 976d5749b6b1..fca11bcbcbae 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1093,6 +1093,9 @@ struct task_struct { @@ -24,6 +27,8 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change; #endif +diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h +index 05b8650f06f5..50513c8c002f 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h @@ -88,6 +88,15 @@ extern void sched_exec(void); @@ -42,7 +47,7 @@ Signed-off-by: Thomas Gleixner 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(struc +@@ -95,7 +104,7 @@ static inline void put_task_struct(struct task_struct *t) if (atomic_dec_and_test(&t->usage)) __put_task_struct(t); } @@ -51,9 +56,11 @@ Signed-off-by: Thomas Gleixner struct task_struct *task_rcu_dereference(struct task_struct **ptask); #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT +diff --git a/kernel/fork.c b/kernel/fork.c +index 00c3a42d681b..110d2d9b6421 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -408,7 +408,9 @@ static inline void put_signal_struct(str +@@ -408,7 +408,9 @@ static inline void put_signal_struct(struct signal_struct *sig) if (atomic_dec_and_test(&sig->sigcnt)) free_signal_struct(sig); } @@ -64,7 +71,7 @@ Signed-off-by: Thomas Gleixner void __put_task_struct(struct task_struct *tsk) { WARN_ON(!tsk->exit_state); -@@ -425,7 +427,18 @@ void __put_task_struct(struct task_struc +@@ -425,7 +427,18 @@ void __put_task_struct(struct task_struct *tsk) if (!profile_handoff_task(tsk)) free_task(tsk); } @@ -83,3 +90,6 @@ Signed-off-by: Thomas Gleixner void __init __weak arch_task_cache_init(void) { } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0213-sched-limit-nr-migrate.patch b/kernel/patches-4.14.x-rt/0213-0213-sched-Limit-the-number-of-task-migrations-per-batch.patch similarity index 61% rename from kernel/patches-4.14.x-rt/0213-sched-limit-nr-migrate.patch rename to kernel/patches-4.14.x-rt/0213-0213-sched-Limit-the-number-of-task-migrations-per-batch.patch index 18bdc4601..65d2af9cb 100644 --- a/kernel/patches-4.14.x-rt/0213-sched-limit-nr-migrate.patch +++ b/kernel/patches-4.14.x-rt/0213-0213-sched-Limit-the-number-of-task-migrations-per-batch.patch @@ -1,18 +1,21 @@ -Subject: sched: Limit the number of task migrations per batch +From 7ceb5c5c786c7bb2bcfdd2800ddac995ffec8441 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Mon, 06 Jun 2011 12:12:51 +0200 +Date: Mon, 6 Jun 2011 12:12:51 +0200 +Subject: [PATCH 213/414] 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. Signed-off-by: Thomas Gleixner --- - kernel/sched/core.c | 4 ++++ + kernel/sched/core.c | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 657fbdefc73c..a0c93c886d54 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -59,7 +59,11 @@ const_debug unsigned int sysctl_sched_fe +@@ -59,7 +59,11 @@ const_debug unsigned int sysctl_sched_features = * Number of tasks to iterate in a single balance run. * Limited because this is done with IRQs disabled. */ @@ -24,3 +27,6 @@ Signed-off-by: Thomas Gleixner /* * period over which we average the RT time consumption, measured +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0214-sched-mmdrop-delayed.patch b/kernel/patches-4.14.x-rt/0214-0214-sched-Move-mmdrop-to-RCU-on-RT.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0214-sched-mmdrop-delayed.patch rename to kernel/patches-4.14.x-rt/0214-0214-sched-Move-mmdrop-to-RCU-on-RT.patch index d6192782e..9ee196c38 100644 --- a/kernel/patches-4.14.x-rt/0214-sched-mmdrop-delayed.patch +++ b/kernel/patches-4.14.x-rt/0214-0214-sched-Move-mmdrop-to-RCU-on-RT.patch @@ -1,18 +1,21 @@ -Subject: sched: Move mmdrop to RCU on RT +From 0c4c4ca7ee5cf0ee4b91d4abc943e5112dc8db04 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Mon, 06 Jun 2011 12:20:33 +0200 +Date: Mon, 6 Jun 2011 12:20:33 +0200 +Subject: [PATCH 214/414] 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. Signed-off-by: Thomas Gleixner --- - include/linux/mm_types.h | 4 ++++ - include/linux/sched/mm.h | 11 +++++++++++ - kernel/fork.c | 13 +++++++++++++ - kernel/sched/core.c | 19 +++++++++++++++++-- + include/linux/mm_types.h | 4 ++++ + include/linux/sched/mm.h | 11 +++++++++++ + kernel/fork.c | 13 +++++++++++++ + kernel/sched/core.c | 19 +++++++++++++++++-- 4 files changed, 45 insertions(+), 2 deletions(-) +diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h +index 9f0bb908e2b5..5a716df466a0 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -12,6 +12,7 @@ @@ -33,9 +36,11 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_HUGETLB_PAGE atomic_long_t hugetlb_usage; #endif +diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h +index 3d49b91b674d..d8f2fa8f500c 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h -@@ -43,6 +43,17 @@ static inline void mmdrop(struct mm_stru +@@ -43,6 +43,17 @@ static inline void mmdrop(struct mm_struct *mm) __mmdrop(mm); } @@ -53,6 +58,8 @@ Signed-off-by: Thomas Gleixner static inline void mmdrop_async_fn(struct work_struct *work) { struct mm_struct *mm = container_of(work, struct mm_struct, async_put_work); +diff --git a/kernel/fork.c b/kernel/fork.c +index 110d2d9b6421..a55e0ac401ab 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -930,6 +930,19 @@ void __mmdrop(struct mm_struct *mm) @@ -75,9 +82,11 @@ Signed-off-by: Thomas Gleixner static inline void __mmput(struct mm_struct *mm) { VM_BUG_ON(atomic_read(&mm->mm_users)); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index a0c93c886d54..3fc5f41b4d74 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2696,8 +2696,12 @@ static struct rq *finish_task_switch(str +@@ -2696,8 +2696,12 @@ static struct rq *finish_task_switch(struct task_struct *prev) finish_arch_post_lock_switch(); fire_sched_in_preempt_notifiers(current); @@ -91,7 +100,7 @@ Signed-off-by: Thomas Gleixner if (unlikely(prev_state == TASK_DEAD)) { if (prev->sched_class->task_dead) prev->sched_class->task_dead(prev); -@@ -5434,6 +5438,8 @@ void sched_setnuma(struct task_struct *p +@@ -5434,6 +5438,8 @@ void sched_setnuma(struct task_struct *p, int nid) #endif /* CONFIG_NUMA_BALANCING */ #ifdef CONFIG_HOTPLUG_CPU @@ -125,3 +134,6 @@ Signed-off-by: Thomas Gleixner return 0; } #endif +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0215-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/kernel/patches-4.14.x-rt/0215-0215-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0215-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch rename to kernel/patches-4.14.x-rt/0215-0215-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index be104163a..44d9cf38c 100644 --- a/kernel/patches-4.14.x-rt/0215-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/kernel/patches-4.14.x-rt/0215-0215-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -1,6 +1,7 @@ +From d75476a46a4a64db5a6e4b3f6fc08c452252d421 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 21 Nov 2016 19:31:08 +0100 -Subject: [PATCH] kernel/sched: move stack + kprobe clean up to +Subject: [PATCH 215/414] kernel/sched: move stack + kprobe clean up to __put_task_struct() There is no need to free the stack before the task struct. This also @@ -10,10 +11,12 @@ region. Cc: stable-rt@vger.kernel.org #for kprobe_flush_task() Signed-off-by: Sebastian Andrzej Siewior --- - kernel/fork.c | 10 ++++++++++ - kernel/sched/core.c | 9 --------- + kernel/fork.c | 10 ++++++++++ + kernel/sched/core.c | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) +diff --git a/kernel/fork.c b/kernel/fork.c +index a55e0ac401ab..fe48256ed179 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -40,6 +40,7 @@ @@ -24,7 +27,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include #include -@@ -417,6 +418,15 @@ void __put_task_struct(struct task_struc +@@ -417,6 +418,15 @@ void __put_task_struct(struct task_struct *tsk) WARN_ON(atomic_read(&tsk->usage)); WARN_ON(tsk == current); @@ -40,9 +43,11 @@ Signed-off-by: Sebastian Andrzej Siewior cgroup_free(tsk); task_numa_free(tsk); security_task_free(tsk); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 3fc5f41b4d74..c104cddcf815 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2706,15 +2706,6 @@ static struct rq *finish_task_switch(str +@@ -2706,15 +2706,6 @@ static struct rq *finish_task_switch(struct task_struct *prev) if (prev->sched_class->task_dead) prev->sched_class->task_dead(prev); @@ -58,3 +63,6 @@ Signed-off-by: Sebastian Andrzej Siewior put_task_struct(prev); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0216-sched-rt-mutex-wakeup.patch b/kernel/patches-4.14.x-rt/0216-0216-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0216-sched-rt-mutex-wakeup.patch rename to kernel/patches-4.14.x-rt/0216-0216-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch index 16e061834..21d01e7c3 100644 --- a/kernel/patches-4.14.x-rt/0216-sched-rt-mutex-wakeup.patch +++ b/kernel/patches-4.14.x-rt/0216-0216-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch @@ -1,6 +1,8 @@ -Subject: sched: Add saved_state for tasks blocked on sleeping locks +From f8a1d249c1874e1f3bfbdde1b692a56f76f59f3a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 25 Jun 2011 09:21:04 +0200 +Subject: [PATCH 216/414] sched: Add saved_state for tasks blocked on sleeping + locks Spinlocks are state preserving in !RT. RT changes the state when a task gets blocked on a lock. So we need to remember the state before @@ -10,11 +12,13 @@ sleep is done, the saved state is restored. Signed-off-by: Thomas Gleixner --- - include/linux/sched.h | 3 +++ - kernel/sched/core.c | 31 ++++++++++++++++++++++++++++++- - kernel/sched/sched.h | 1 + + include/linux/sched.h | 3 +++ + kernel/sched/core.c | 31 ++++++++++++++++++++++++++++++- + kernel/sched/sched.h | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index fca11bcbcbae..258db7109aeb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -526,6 +526,8 @@ struct task_struct { @@ -26,7 +30,7 @@ Signed-off-by: Thomas Gleixner /* * This begins the randomizable portion of task_struct. Only -@@ -1507,6 +1509,7 @@ extern struct task_struct *find_task_by_ +@@ -1507,6 +1509,7 @@ extern struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *n extern int wake_up_state(struct task_struct *tsk, unsigned int state); extern int wake_up_process(struct task_struct *tsk); @@ -34,9 +38,11 @@ Signed-off-by: Thomas Gleixner extern void wake_up_new_task(struct task_struct *tsk); #ifdef CONFIG_SMP +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index c104cddcf815..cac7fd453826 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2016,8 +2016,25 @@ try_to_wake_up(struct task_struct *p, un +@@ -2016,8 +2016,25 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) */ raw_spin_lock_irqsave(&p->pi_lock, flags); smp_mb__after_spinlock(); @@ -63,7 +69,7 @@ Signed-off-by: Thomas Gleixner trace_sched_waking(p); -@@ -2181,6 +2198,18 @@ int wake_up_process(struct task_struct * +@@ -2181,6 +2198,18 @@ int wake_up_process(struct task_struct *p) } EXPORT_SYMBOL(wake_up_process); @@ -82,9 +88,11 @@ Signed-off-by: Thomas Gleixner int wake_up_state(struct task_struct *p, unsigned int state) { return try_to_wake_up(p, state, 0); +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index 307c35d33660..df2a22e591cc 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h -@@ -1354,6 +1354,7 @@ static inline void finish_lock_switch(st +@@ -1354,6 +1354,7 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev) #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 */ @@ -92,3 +100,6 @@ Signed-off-by: Thomas Gleixner /* * To aid in avoiding the subversion of "niceness" due to uneven distribution +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0217-sched-Prevent-task-state-corruption-by-spurious-lock.patch b/kernel/patches-4.14.x-rt/0217-0217-sched-Prevent-task-state-corruption-by-spurious-lock.patch similarity index 89% rename from kernel/patches-4.14.x-rt/0217-sched-Prevent-task-state-corruption-by-spurious-lock.patch rename to kernel/patches-4.14.x-rt/0217-0217-sched-Prevent-task-state-corruption-by-spurious-lock.patch index 93f554941..32efc11d5 100644 --- a/kernel/patches-4.14.x-rt/0217-sched-Prevent-task-state-corruption-by-spurious-lock.patch +++ b/kernel/patches-4.14.x-rt/0217-0217-sched-Prevent-task-state-corruption-by-spurious-lock.patch @@ -1,6 +1,8 @@ +From a74b607f2be6a1aa72343f6bad94e594acf27f76 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 6 Jun 2017 14:20:37 +0200 -Subject: sched: Prevent task state corruption by spurious lock wakeup +Subject: [PATCH 217/414] sched: Prevent task state corruption by spurious lock + wakeup Mathias and others reported GDB failures on RT. @@ -61,9 +63,11 @@ Reported-by: David Hauck Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/sched/core.c | 2 +- + 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 cac7fd453826..a73497dfbd3f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2207,7 +2207,7 @@ EXPORT_SYMBOL(wake_up_process); @@ -75,3 +79,6 @@ Signed-off-by: Sebastian Andrzej Siewior } int wake_up_state(struct task_struct *p, unsigned int state) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0218-sched-Remove-TASK_ALL.patch b/kernel/patches-4.14.x-rt/0218-0218-sched-Remove-TASK_ALL.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0218-sched-Remove-TASK_ALL.patch rename to kernel/patches-4.14.x-rt/0218-0218-sched-Remove-TASK_ALL.patch index 4844fb7e9..98db38e5a 100644 --- a/kernel/patches-4.14.x-rt/0218-sched-Remove-TASK_ALL.patch +++ b/kernel/patches-4.14.x-rt/0218-0218-sched-Remove-TASK_ALL.patch @@ -1,6 +1,7 @@ +From 4bf9fd71a95265a25c11e786576477d4221eba12 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Wed, 7 Jun 2017 10:12:45 +0200 -Subject: [PATCH] sched: Remove TASK_ALL +Subject: [PATCH 218/414] sched: Remove TASK_ALL It's unused: @@ -14,9 +15,11 @@ Acked-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/sched.h | 1 - + include/linux/sched.h | 1 - 1 file changed, 1 deletion(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 258db7109aeb..27f962abf4b3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -93,7 +93,6 @@ struct task_group; @@ -27,3 +30,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* get_task_state(): */ #define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0219-sched-might-sleep-do-not-account-rcu-depth.patch b/kernel/patches-4.14.x-rt/0219-0219-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0219-sched-might-sleep-do-not-account-rcu-depth.patch rename to kernel/patches-4.14.x-rt/0219-0219-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch index 20068ac44..8ccc443f9 100644 --- a/kernel/patches-4.14.x-rt/0219-sched-might-sleep-do-not-account-rcu-depth.patch +++ b/kernel/patches-4.14.x-rt/0219-0219-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch @@ -1,16 +1,20 @@ -Subject: sched: Do not account rcu_preempt_depth on RT in might_sleep() +From 2cfe068bfdeb2c5cb7ba9071fe9f4de10dfff640 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Tue, 07 Jun 2011 09:19:06 +0200 +Date: Tue, 7 Jun 2011 09:19:06 +0200 +Subject: [PATCH 219/414] 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 in might_sleep(). Signed-off-by: Thomas Gleixner --- - include/linux/rcupdate.h | 7 +++++++ - kernel/sched/core.c | 2 +- + include/linux/rcupdate.h | 7 +++++++ + kernel/sched/core.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) +diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h +index a6ddc42f87a5..dbadbdbc8643 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -74,6 +74,11 @@ void synchronize_rcu(void); @@ -25,7 +29,7 @@ Signed-off-by: Thomas Gleixner #else /* #ifdef CONFIG_PREEMPT_RCU */ -@@ -99,6 +104,8 @@ static inline int rcu_preempt_depth(void +@@ -99,6 +104,8 @@ static inline int rcu_preempt_depth(void) return 0; } @@ -34,6 +38,8 @@ Signed-off-by: Thomas Gleixner #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ /* Internal to kernel */ +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index a73497dfbd3f..158f182f6d73 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6050,7 +6050,7 @@ void __init sched_init(void) @@ -45,3 +51,6 @@ Signed-off-by: Thomas Gleixner return (nested == preempt_offset); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0220-cond-resched-softirq-rt.patch b/kernel/patches-4.14.x-rt/0220-0220-sched-Take-RT-softirq-semantics-into-account-in-cond.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0220-cond-resched-softirq-rt.patch rename to kernel/patches-4.14.x-rt/0220-0220-sched-Take-RT-softirq-semantics-into-account-in-cond.patch index e617510f3..25da38600 100644 --- a/kernel/patches-4.14.x-rt/0220-cond-resched-softirq-rt.patch +++ b/kernel/patches-4.14.x-rt/0220-0220-sched-Take-RT-softirq-semantics-into-account-in-cond.patch @@ -1,6 +1,8 @@ -Subject: sched: Take RT softirq semantics into account in cond_resched() +From 913d0d7a9163b3ce0d803f21dc51b0dd39ec796a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 14 Jul 2011 09:56:44 +0200 +Subject: [PATCH 220/414] sched: Take RT softirq semantics into account in + cond_resched() The softirq semantics work different on -RT. There is no SOFTIRQ_MASK in the preemption counter which leads to the BUG_ON() statement in @@ -9,13 +11,15 @@ schedule. Signed-off-by: Thomas Gleixner --- - include/linux/sched.h | 4 ++++ - kernel/sched/core.c | 2 ++ + include/linux/sched.h | 4 ++++ + kernel/sched/core.c | 2 ++ 2 files changed, 6 insertions(+) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 27f962abf4b3..d4c8b0e373e2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1610,12 +1610,16 @@ extern int __cond_resched_lock(spinlock_ +@@ -1610,12 +1610,16 @@ extern int __cond_resched_lock(spinlock_t *lock); __cond_resched_lock(lock); \ }) @@ -32,9 +36,11 @@ Signed-off-by: Thomas Gleixner static inline void cond_resched_rcu(void) { +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 158f182f6d73..26d66cceef6f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -4946,6 +4946,7 @@ int __cond_resched_lock(spinlock_t *lock +@@ -4946,6 +4946,7 @@ int __cond_resched_lock(spinlock_t *lock) } EXPORT_SYMBOL(__cond_resched_lock); @@ -50,3 +56,6 @@ Signed-off-by: Thomas Gleixner /** * yield - yield the current processor to other threads. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0221-cond-resched-lock-rt-tweak.patch b/kernel/patches-4.14.x-rt/0221-0221-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch similarity index 67% rename from kernel/patches-4.14.x-rt/0221-cond-resched-lock-rt-tweak.patch rename to kernel/patches-4.14.x-rt/0221-0221-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch index c3caef32f..f8cb317c4 100644 --- a/kernel/patches-4.14.x-rt/0221-cond-resched-lock-rt-tweak.patch +++ b/kernel/patches-4.14.x-rt/0221-0221-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch @@ -1,15 +1,18 @@ -Subject: sched: Use the proper LOCK_OFFSET for cond_resched() +From 63b1833f277eb87cce0eb151a90d407fafd30e13 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 22:51:33 +0200 +Subject: [PATCH 221/414] 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. Signed-off-by: Thomas Gleixner --- - include/linux/preempt.h | 4 ++++ + include/linux/preempt.h | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 8681df8e1632..2d5d002e06c2 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -118,7 +118,11 @@ @@ -24,3 +27,6 @@ Signed-off-by: Thomas Gleixner /* * The preempt_count offset needed for things like: +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0222-sched-disable-ttwu-queue.patch b/kernel/patches-4.14.x-rt/0222-0222-sched-Disable-TTWU_QUEUE-on-RT.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0222-sched-disable-ttwu-queue.patch rename to kernel/patches-4.14.x-rt/0222-0222-sched-Disable-TTWU_QUEUE-on-RT.patch index 95221e680..9b05ee58c 100644 --- a/kernel/patches-4.14.x-rt/0222-sched-disable-ttwu-queue.patch +++ b/kernel/patches-4.14.x-rt/0222-0222-sched-Disable-TTWU_QUEUE-on-RT.patch @@ -1,15 +1,18 @@ -Subject: sched: Disable TTWU_QUEUE on RT +From d2aae5ec378ecc6070ab0db04566a63ad031e1d0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 13 Sep 2011 16:42:35 +0200 +Subject: [PATCH 222/414] 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. Signed-off-by: Thomas Gleixner --- - kernel/sched/features.h | 5 +++++ + kernel/sched/features.h | 5 +++++ 1 file changed, 5 insertions(+) +diff --git a/kernel/sched/features.h b/kernel/sched/features.h +index 9552fd5854bf..c675ee1694f5 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -46,11 +46,16 @@ SCHED_FEAT(LB_BIAS, true) @@ -29,3 +32,6 @@ Signed-off-by: Thomas Gleixner /* * When doing wakeups, attempt to limit superfluous scans of the LLC domain. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0223-sched-disable-rt-group-sched-on-rt.patch b/kernel/patches-4.14.x-rt/0223-0223-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0223-sched-disable-rt-group-sched-on-rt.patch rename to kernel/patches-4.14.x-rt/0223-0223-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch index b99d7c6fb..516907d43 100644 --- a/kernel/patches-4.14.x-rt/0223-sched-disable-rt-group-sched-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0223-0223-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch @@ -1,6 +1,7 @@ -Subject: sched: Disable CONFIG_RT_GROUP_SCHED on RT +From 69ae9ab5b94c0a2181861962987a9a5a45efcfec Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:03:52 +0200 +Subject: [PATCH 223/414] sched: Disable CONFIG_RT_GROUP_SCHED on RT Carsten reported problems when running: @@ -13,9 +14,11 @@ shell. Disabling CONFIG_RT_GROUP_SCHED solves that as well. Signed-off-by: Thomas Gleixner --- - init/Kconfig | 1 + + init/Kconfig | 1 + 1 file changed, 1 insertion(+) +diff --git a/init/Kconfig b/init/Kconfig +index bec5b4b82585..a7aff2c1a203 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -744,6 +744,7 @@ config CFS_BANDWIDTH @@ -26,3 +29,6 @@ Signed-off-by: Thomas Gleixner default n help This feature lets you explicitly allocate real CPU bandwidth +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0224-sched-ttwu-ensure-success-return-is-correct.patch b/kernel/patches-4.14.x-rt/0224-0224-sched-ttwu-Return-success-when-only-changing-the-sav.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0224-sched-ttwu-ensure-success-return-is-correct.patch rename to kernel/patches-4.14.x-rt/0224-0224-sched-ttwu-Return-success-when-only-changing-the-sav.patch index eaf5e7294..3af7945cd 100644 --- a/kernel/patches-4.14.x-rt/0224-sched-ttwu-ensure-success-return-is-correct.patch +++ b/kernel/patches-4.14.x-rt/0224-0224-sched-ttwu-Return-success-when-only-changing-the-sav.patch @@ -1,6 +1,8 @@ -Subject: sched: ttwu: Return success when only changing the saved_state value +From 3ceba7043aeaa71e2f8da57bee327169e0be06b5 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 13 Dec 2011 21:42:19 +0100 +Subject: [PATCH 224/414] sched: ttwu: Return success when only changing the + saved_state value When a task blocks on a rt lock, it saves the current state in p->saved_state, so a lock related wake up will not destroy the @@ -13,14 +15,15 @@ code and the task remains in the waitqueue list. Return success in that case as well. Signed-off-by: Thomas Gleixner - --- - kernel/sched/core.c | 4 +++- + kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 26d66cceef6f..969449a43683 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2023,8 +2023,10 @@ try_to_wake_up(struct task_struct *p, un +@@ -2023,8 +2023,10 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) * if the wakeup condition is true. */ if (!(wake_flags & WF_LOCK_SLEEPER)) { @@ -32,3 +35,6 @@ Signed-off-by: Thomas Gleixner } goto out; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0225-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/kernel/patches-4.14.x-rt/0225-0225-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0225-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch rename to kernel/patches-4.14.x-rt/0225-0225-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch index fd96248b4..f4efce822 100644 --- a/kernel/patches-4.14.x-rt/0225-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +++ b/kernel/patches-4.14.x-rt/0225-0225-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch @@ -1,6 +1,8 @@ +From 5d82663728656b099762e6ffc371be81b4b7279c Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Mon, 18 Mar 2013 15:12:49 -0400 -Subject: sched/workqueue: Only wake up idle workers if not blocked on sleeping spin lock +Subject: [PATCH 225/414] 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 conversions is performed on the workqueue gcwq->lock. When the idle @@ -18,12 +20,14 @@ Check the saved_state too before waking up new workers. Signed-off-by: Steven Rostedt Signed-off-by: Sebastian Andrzej Siewior --- - kernel/sched/core.c | 4 +++- + kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 969449a43683..4d8a67a6d828 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3388,8 +3388,10 @@ static void __sched notrace __schedule(b +@@ -3388,8 +3388,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. @@ -35,3 +39,6 @@ Signed-off-by: Sebastian Andrzej Siewior struct task_struct *to_wakeup; to_wakeup = wq_worker_sleeping(prev); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0226-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/kernel/patches-4.14.x-rt/0226-0226-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch similarity index 93% rename from kernel/patches-4.14.x-rt/0226-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch rename to kernel/patches-4.14.x-rt/0226-0226-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index e5441486d..42e171620 100644 --- a/kernel/patches-4.14.x-rt/0226-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/kernel/patches-4.14.x-rt/0226-0226-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch @@ -1,6 +1,8 @@ +From 6bec424045f5ae9722908de06617a5e25758af66 Mon Sep 17 00:00:00 2001 From: Daniel Bristot de Oliveira Date: Mon, 26 Jun 2017 17:07:15 +0200 -Subject: rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration +Subject: [PATCH 226/414] rt: Increase/decrease the nr of migratory tasks when + enabling/disabling migration There is a problem in the migrate_disable()/enable() implementation regarding the number of migratory tasks in the rt/dl RQs. The problem @@ -75,9 +77,11 @@ Cc: LKML Cc: linux-rt-users Signed-off-by: Sebastian Andrzej Siewior --- - kernel/sched/core.c | 49 ++++++++++++++++++++++++++++++++++++++++++++----- + kernel/sched/core.c | 49 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 4d8a67a6d828..9841a7381457 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6851,6 +6851,47 @@ const u32 sched_prio_to_wmult[40] = { @@ -152,3 +156,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (p->migrate_disable_update) { struct rq *rq; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0227-stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch b/kernel/patches-4.14.x-rt/0227-0227-stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0227-stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch rename to kernel/patches-4.14.x-rt/0227-0227-stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch index 3f0172962..c071428e0 100644 --- a/kernel/patches-4.14.x-rt/0227-stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch +++ b/kernel/patches-4.14.x-rt/0227-0227-stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch @@ -1,6 +1,8 @@ +From e031de049951f540b2d6bed2f66a23cf5c77bfe2 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:27 -0500 -Subject: stop_machine: convert stop_machine_run() to PREEMPT_RT +Subject: [PATCH 227/414] stop_machine: convert stop_machine_run() to + PREEMPT_RT Instead of playing with non-preemption, introduce explicit startup serialization. This is more robust and cleaner as @@ -10,12 +12,14 @@ Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner [bigeasy: XXX: stopper_lock -> stop_cpus_lock] --- - kernel/stop_machine.c | 10 ++++++++++ + kernel/stop_machine.c | 10 ++++++++++ 1 file changed, 10 insertions(+) +diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c +index b7591261652d..b9f350bdf9a4 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c -@@ -475,6 +475,16 @@ static void cpu_stopper_thread(unsigned +@@ -475,6 +475,16 @@ static void cpu_stopper_thread(unsigned int cpu) struct cpu_stop_done *done = work->done; int ret; @@ -32,3 +36,6 @@ Signed-off-by: Thomas Gleixner /* cpu stop callbacks must not sleep, make in_atomic() == T */ preempt_count_inc(); ret = fn(arg); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0228-stop-machine-raw-lock.patch b/kernel/patches-4.14.x-rt/0228-0228-stop_machine-Use-raw-spinlocks.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0228-stop-machine-raw-lock.patch rename to kernel/patches-4.14.x-rt/0228-0228-stop_machine-Use-raw-spinlocks.patch index 412d5bc41..d7a05bf3f 100644 --- a/kernel/patches-4.14.x-rt/0228-stop-machine-raw-lock.patch +++ b/kernel/patches-4.14.x-rt/0228-0228-stop_machine-Use-raw-spinlocks.patch @@ -1,14 +1,17 @@ -Subject: stop_machine: Use raw spinlocks +From 2d07cf283b622ca6b92b71e756042399fbf0c52a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 11:01:51 +0200 +Subject: [PATCH 228/414] stop_machine: Use raw spinlocks Use raw-locks in stomp_machine() to allow locking in irq-off regions. Signed-off-by: Thomas Gleixner --- - kernel/stop_machine.c | 34 +++++++++++++--------------------- + kernel/stop_machine.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) +diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c +index b9f350bdf9a4..2aa4ce60811c 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -36,7 +36,7 @@ struct cpu_stop_done { @@ -20,7 +23,7 @@ Signed-off-by: Thomas Gleixner bool enabled; /* is this stopper enabled? */ struct list_head works; /* list of pending works */ -@@ -78,14 +78,14 @@ static bool cpu_stop_queue_work(unsigned +@@ -78,14 +78,14 @@ static bool cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work) unsigned long flags; bool enabled; @@ -37,7 +40,7 @@ Signed-off-by: Thomas Gleixner return enabled; } -@@ -231,8 +231,8 @@ static int cpu_stop_queue_two_works(int +@@ -231,8 +231,8 @@ static int cpu_stop_queue_two_works(int cpu1, struct cpu_stop_work *work1, struct cpu_stopper *stopper2 = per_cpu_ptr(&cpu_stopper, cpu2); int err; retry: @@ -48,7 +51,7 @@ Signed-off-by: Thomas Gleixner err = -ENOENT; if (!stopper1->enabled || !stopper2->enabled) -@@ -255,8 +255,8 @@ static int cpu_stop_queue_two_works(int +@@ -255,8 +255,8 @@ static int cpu_stop_queue_two_works(int cpu1, struct cpu_stop_work *work1, __cpu_stop_queue_work(stopper1, work1); __cpu_stop_queue_work(stopper2, work2); unlock: @@ -59,7 +62,7 @@ Signed-off-by: Thomas Gleixner if (unlikely(err == -EDEADLK)) { while (stop_cpus_in_progress) -@@ -448,9 +448,9 @@ static int cpu_stop_should_run(unsigned +@@ -448,9 +448,9 @@ static int cpu_stop_should_run(unsigned int cpu) unsigned long flags; int run; @@ -71,7 +74,7 @@ Signed-off-by: Thomas Gleixner return run; } -@@ -461,13 +461,13 @@ static void cpu_stopper_thread(unsigned +@@ -461,13 +461,13 @@ static void cpu_stopper_thread(unsigned int cpu) repeat: work = NULL; @@ -87,7 +90,7 @@ Signed-off-by: Thomas Gleixner if (work) { cpu_stop_fn_t fn = work->fn; -@@ -475,15 +475,7 @@ static void cpu_stopper_thread(unsigned +@@ -475,15 +475,7 @@ static void cpu_stopper_thread(unsigned int cpu) struct cpu_stop_done *done = work->done; int ret; @@ -113,3 +116,6 @@ Signed-off-by: Thomas Gleixner INIT_LIST_HEAD(&stopper->works); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0229-hotplug-light-get-online-cpus.patch b/kernel/patches-4.14.x-rt/0229-0229-hotplug-Lightweight-get-online-cpus.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0229-hotplug-light-get-online-cpus.patch rename to kernel/patches-4.14.x-rt/0229-0229-hotplug-Lightweight-get-online-cpus.patch index c41794c2a..64615cad3 100644 --- a/kernel/patches-4.14.x-rt/0229-hotplug-light-get-online-cpus.patch +++ b/kernel/patches-4.14.x-rt/0229-0229-hotplug-Lightweight-get-online-cpus.patch @@ -1,6 +1,7 @@ -Subject: hotplug: Lightweight get online cpus +From 40b285c9982d7bf568f0e41597de2826bcfa2d71 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 15 Jun 2011 12:36:06 +0200 +Subject: [PATCH 229/414] 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 @@ -12,11 +13,13 @@ tasks on the cpu which should be brought down. Signed-off-by: Thomas Gleixner --- - include/linux/cpu.h | 5 +++++ - kernel/cpu.c | 15 +++++++++++++++ - kernel/sched/core.c | 4 ++++ + include/linux/cpu.h | 5 +++++ + kernel/cpu.c | 15 +++++++++++++++ + kernel/sched/core.c | 4 ++++ 3 files changed, 24 insertions(+) +diff --git a/include/linux/cpu.h b/include/linux/cpu.h +index c816e6f2730c..b43db346dfe4 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -116,6 +116,8 @@ extern void cpu_hotplug_disable(void); @@ -28,7 +31,7 @@ Signed-off-by: Thomas Gleixner #else /* CONFIG_HOTPLUG_CPU */ -@@ -126,6 +128,9 @@ static inline void cpus_read_unlock(void +@@ -126,6 +128,9 @@ static inline void cpus_read_unlock(void) { } static inline void lockdep_assert_cpus_held(void) { } static inline void cpu_hotplug_disable(void) { } static inline void cpu_hotplug_enable(void) { } @@ -38,6 +41,8 @@ Signed-off-by: Thomas Gleixner #endif /* !CONFIG_HOTPLUG_CPU */ /* Wrappers which go away once all code is converted */ +diff --git a/kernel/cpu.c b/kernel/cpu.c +index f21bfa3172d8..aa9b1702e115 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -286,6 +286,21 @@ static int cpu_hotplug_disabled; @@ -62,6 +67,8 @@ Signed-off-by: Thomas Gleixner DEFINE_STATIC_PERCPU_RWSEM(cpu_hotplug_lock); void cpus_read_lock(void) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 9841a7381457..b07d65aca09e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6915,6 +6915,7 @@ void migrate_disable(void) @@ -88,3 +95,6 @@ Signed-off-by: Thomas Gleixner preempt_enable(); } EXPORT_SYMBOL(migrate_enable); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0230-ftrace-migrate-disable-tracing.patch b/kernel/patches-4.14.x-rt/0230-0230-trace-Add-migrate-disabled-counter-to-tracing-output.patch similarity index 65% rename from kernel/patches-4.14.x-rt/0230-ftrace-migrate-disable-tracing.patch rename to kernel/patches-4.14.x-rt/0230-0230-trace-Add-migrate-disabled-counter-to-tracing-output.patch index 28e98df2a..1facbfc32 100644 --- a/kernel/patches-4.14.x-rt/0230-ftrace-migrate-disable-tracing.patch +++ b/kernel/patches-4.14.x-rt/0230-0230-trace-Add-migrate-disabled-counter-to-tracing-output.patch @@ -1,15 +1,18 @@ +From 5d8962ddabfd1dc4f1df9651e9e8932d36b5f1ef Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:56:42 +0200 -Subject: trace: Add migrate-disabled counter to tracing output +Subject: [PATCH 230/414] trace: Add migrate-disabled counter to tracing output Signed-off-by: Thomas Gleixner --- - include/linux/trace_events.h | 2 ++ - kernel/trace/trace.c | 9 ++++++--- - kernel/trace/trace_events.c | 2 ++ - kernel/trace/trace_output.c | 5 +++++ + include/linux/trace_events.h | 2 ++ + kernel/trace/trace.c | 9 ++++++--- + kernel/trace/trace_events.c | 2 ++ + kernel/trace/trace_output.c | 5 +++++ 4 files changed, 15 insertions(+), 3 deletions(-) +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index aefc80f2909b..ffd595ab5008 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -62,6 +62,8 @@ struct trace_entry { @@ -21,9 +24,11 @@ Signed-off-by: Thomas Gleixner }; #define TRACE_EVENT_TYPE_MAX \ +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 7f779b99501b..5796c41319c8 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2141,6 +2141,8 @@ tracing_generic_entry_update(struct trac +@@ -2141,6 +2141,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, ((pc & SOFTIRQ_OFFSET) ? TRACE_FLAG_SOFTIRQ : 0) | (tif_need_resched() ? TRACE_FLAG_NEED_RESCHED : 0) | (test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0); @@ -32,7 +37,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL_GPL(tracing_generic_entry_update); -@@ -3344,9 +3346,10 @@ static void print_lat_help_header(struct +@@ -3344,9 +3346,10 @@ static void print_lat_help_header(struct seq_file *m) "# | / _----=> need-resched \n" "# || / _---=> hardirq/softirq \n" "# ||| / _--=> preempt-depth \n" @@ -46,9 +51,11 @@ Signed-off-by: Thomas Gleixner } 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 1b87157edbff..9ba230a4052f 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c -@@ -187,6 +187,8 @@ static int trace_define_common_fields(vo +@@ -187,6 +187,8 @@ static int trace_define_common_fields(void) __common_field(unsigned char, flags); __common_field(unsigned char, preempt_count); __common_field(int, pid); @@ -57,9 +64,11 @@ Signed-off-by: Thomas Gleixner return ret; } +diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c +index c738e764e2a5..2bccb364a483 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c -@@ -493,6 +493,11 @@ int trace_print_lat_fmt(struct trace_seq +@@ -493,6 +493,11 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) else trace_seq_putc(s, '.'); @@ -71,3 +80,6 @@ Signed-off-by: Thomas Gleixner return !trace_seq_has_overflowed(s); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0231-lockdep-no-softirq-accounting-on-rt.patch b/kernel/patches-4.14.x-rt/0231-0231-lockdep-Make-it-RT-aware.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0231-lockdep-no-softirq-accounting-on-rt.patch rename to kernel/patches-4.14.x-rt/0231-0231-lockdep-Make-it-RT-aware.patch index 092ea823a..7b3aaa7dc 100644 --- a/kernel/patches-4.14.x-rt/0231-lockdep-no-softirq-accounting-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0231-0231-lockdep-Make-it-RT-aware.patch @@ -1,15 +1,18 @@ -Subject: lockdep: Make it RT aware +From 833c294e7ae0392ab6c54a670ed0b167d8bfad35 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 18:51:23 +0200 +Subject: [PATCH 231/414] lockdep: Make it RT aware teach lockdep that we don't really do softirqs on -RT. Signed-off-by: Thomas Gleixner --- - include/linux/irqflags.h | 26 +++++++++++++++----------- - kernel/locking/lockdep.c | 2 ++ + include/linux/irqflags.h | 26 +++++++++++++++----------- + kernel/locking/lockdep.c | 2 ++ 2 files changed, 17 insertions(+), 11 deletions(-) +diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h +index 7834117a1ef5..2e023bfe45af 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h @@ -34,16 +34,6 @@ do { \ @@ -54,9 +57,11 @@ Signed-off-by: Thomas Gleixner #endif #if defined(CONFIG_IRQSOFF_TRACER) || \ +diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c +index 2f0f5720b123..aad05e4b228c 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c -@@ -3914,6 +3914,7 @@ static void check_flags(unsigned long fl +@@ -3914,6 +3914,7 @@ static void check_flags(unsigned long flags) } } @@ -64,7 +69,7 @@ Signed-off-by: Thomas Gleixner /* * We dont accurately track softirq state in e.g. * hardirq contexts (such as on 4KSTACKS), so only -@@ -3928,6 +3929,7 @@ static void check_flags(unsigned long fl +@@ -3928,6 +3929,7 @@ static void check_flags(unsigned long flags) DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled); } } @@ -72,3 +77,6 @@ Signed-off-by: Thomas Gleixner if (!debug_locks) print_irqtrace_events(current); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0232-lockdep-disable-self-test.patch b/kernel/patches-4.14.x-rt/0232-0232-lockdep-disable-self-test.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0232-lockdep-disable-self-test.patch rename to kernel/patches-4.14.x-rt/0232-0232-lockdep-disable-self-test.patch index 71b2e27ce..87e5a471f 100644 --- a/kernel/patches-4.14.x-rt/0232-lockdep-disable-self-test.patch +++ b/kernel/patches-4.14.x-rt/0232-0232-lockdep-disable-self-test.patch @@ -1,6 +1,7 @@ +From 16b14829c1c41fca4fb8cbc064b8f4642dbb4eb6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 17 Oct 2017 16:36:18 +0200 -Subject: [PATCH] lockdep: disable self-test +Subject: [PATCH 232/414] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -12,9 +13,11 @@ during boot and it needs to be investigated… Signed-off-by: Sebastian Andrzej Siewior --- - lib/Kconfig.debug | 2 +- + lib/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug +index 62d0e25c054c..401b7ed164b5 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1197,7 +1197,7 @@ config DEBUG_ATOMIC_SLEEP @@ -26,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior help 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.17.0 + diff --git a/kernel/patches-4.14.x-rt/0233-mutex-no-spin-on-rt.patch b/kernel/patches-4.14.x-rt/0233-0233-locking-Disable-spin-on-owner-for-RT.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0233-mutex-no-spin-on-rt.patch rename to kernel/patches-4.14.x-rt/0233-0233-locking-Disable-spin-on-owner-for-RT.patch index 6f7ca0e2e..c550c1f73 100644 --- a/kernel/patches-4.14.x-rt/0233-mutex-no-spin-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0233-0233-locking-Disable-spin-on-owner-for-RT.patch @@ -1,15 +1,21 @@ +From 090452d24009e941bd11c085654f61af6ac65ad7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:51:45 +0200 -Subject: locking: Disable spin on owner for RT +Subject: [PATCH 233/414] locking: Disable spin on owner for RT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Drop spin on owner for mutex / rwsem. We are most likely not using it but… Signed-off-by: Thomas Gleixner --- - kernel/Kconfig.locks | 4 ++-- + kernel/Kconfig.locks | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks +index 84d882f3e299..af27c4000812 100644 --- a/kernel/Kconfig.locks +++ b/kernel/Kconfig.locks @@ -225,11 +225,11 @@ config ARCH_SUPPORTS_ATOMIC_RMW @@ -26,3 +32,6 @@ Signed-off-by: Thomas Gleixner config LOCK_SPIN_ON_OWNER def_bool y +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0234-tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch b/kernel/patches-4.14.x-rt/0234-0234-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch similarity index 91% rename from kernel/patches-4.14.x-rt/0234-tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch rename to kernel/patches-4.14.x-rt/0234-0234-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch index 96297d22f..72052b3e9 100644 --- a/kernel/patches-4.14.x-rt/0234-tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch +++ b/kernel/patches-4.14.x-rt/0234-0234-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch @@ -1,6 +1,8 @@ -Subject: tasklet: Prevent tasklets from going into infinite spin in RT +From 03101c099d85bf5bbd1230163c6846169a42b341 Mon Sep 17 00:00:00 2001 From: Ingo Molnar -Date: Tue Nov 29 20:18:22 2011 -0500 +Date: Tue, 29 Nov 2011 20:18:22 -0500 +Subject: [PATCH 234/414] tasklet: Prevent tasklets from going into infinite + spin in RT When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with @@ -9,21 +11,21 @@ if a tasklets are disabled with tasklet_disable(), the tasklet count is increased. When a tasklet runs, it checks this counter and if it is set, it adds itself back on the softirq queue and returns. - + The problem arises in RT because ksoftirq will see that a softirq is ready to run (the tasklet softirq just re-armed itself), and will not sleep, but instead run the softirqs again. The tasklet softirq will still see that the count is non-zero and will not execute the tasklet and requeue itself on the softirq again, which will cause ksoftirqd to run it again and again and again. - + It gets worse because ksoftirqd runs as a real-time thread. If it preempted the task that disabled tasklets, and that task has migration disabled, or can't run for other reasons, the tasklet softirq will never run because the count will never be zero, and ksoftirqd will go into an infinite loop. As an RT task, it this becomes a big problem. - + This is a hack solution to have tasklet_disable stop tasklets, and when a tasklet runs, instead of requeueing the tasklet softirqd it delays it. When tasklet_enable() is called, and tasklets are @@ -31,19 +33,20 @@ waiting, then the tasklet_enable() will kick the tasklets to continue. This prevents the lock up from ksoftirq going into an infinite loop. [ rostedt@goodmis.org: ported to 3.0-rt ] - + Signed-off-by: Ingo Molnar Signed-off-by: Steven Rostedt Signed-off-by: Thomas Gleixner - --- - include/linux/interrupt.h | 33 ++++--- - kernel/softirq.c | 193 ++++++++++++++++++++++++++++++++-------------- + include/linux/interrupt.h | 33 ++++--- + kernel/softirq.c | 193 +++++++++++++++++++++++++++----------- 2 files changed, 157 insertions(+), 69 deletions(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 172376b9a049..e53ff6a143e0 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -537,8 +537,9 @@ static inline struct task_struct *this_c +@@ -537,8 +537,9 @@ static inline struct task_struct *this_cpu_ksoftirqd(void) to be executed on some cpu at least once after this. * If the tasklet is already scheduled, but its execution is still not started, it will be executed only once. @@ -55,7 +58,7 @@ Signed-off-by: Thomas Gleixner * Tasklet is strictly serialized wrt itself, but not wrt another tasklets. If client needs some intertask synchronization, he makes it with spinlocks. -@@ -563,27 +564,36 @@ struct tasklet_struct name = { NULL, 0, +@@ -563,27 +564,36 @@ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } enum { TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */ @@ -98,7 +101,7 @@ Signed-off-by: Thomas Gleixner #define tasklet_unlock_wait(t) do { } while (0) #define tasklet_unlock(t) do { } while (0) #endif -@@ -617,12 +627,7 @@ static inline void tasklet_disable(struc +@@ -617,12 +627,7 @@ static inline void tasklet_disable(struct tasklet_struct *t) smp_mb(); } @@ -112,6 +115,8 @@ Signed-off-by: Thomas Gleixner extern void tasklet_kill(struct tasklet_struct *t); extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); extern void tasklet_init(struct tasklet_struct *t, +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 0f84f2a8f564..6602a9ef492b 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -21,6 +21,7 @@ @@ -172,7 +177,7 @@ Signed-off-by: Thomas Gleixner local_irq_restore(flags); } EXPORT_SYMBOL(__tasklet_schedule); -@@ -484,50 +515,108 @@ void __tasklet_hi_schedule(struct taskle +@@ -484,50 +515,108 @@ void __tasklet_hi_schedule(struct tasklet_struct *t) unsigned long flags; local_irq_save(flags); @@ -307,7 +312,7 @@ Signed-off-by: Thomas Gleixner static __latent_entropy void tasklet_hi_action(struct softirq_action *a) { struct tasklet_struct *list; -@@ -538,30 +627,7 @@ static __latent_entropy void tasklet_hi_ +@@ -538,30 +627,7 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a) __this_cpu_write(tasklet_hi_vec.tail, this_cpu_ptr(&tasklet_hi_vec.head)); local_irq_enable(); @@ -339,7 +344,7 @@ Signed-off-by: Thomas Gleixner } void tasklet_init(struct tasklet_struct *t, -@@ -582,7 +648,7 @@ void tasklet_kill(struct tasklet_struct +@@ -582,7 +648,7 @@ void tasklet_kill(struct tasklet_struct *t) while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { do { @@ -372,3 +377,6 @@ Signed-off-by: Thomas Gleixner static int ksoftirqd_should_run(unsigned int cpu) { return local_softirq_pending(); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0235-softirq-preempt-fix-3-re.patch b/kernel/patches-4.14.x-rt/0235-0235-softirq-Check-preemption-after-reenabling-interrupts.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0235-softirq-preempt-fix-3-re.patch rename to kernel/patches-4.14.x-rt/0235-0235-softirq-Check-preemption-after-reenabling-interrupts.patch index 6eead96e1..bc8be234a 100644 --- a/kernel/patches-4.14.x-rt/0235-softirq-preempt-fix-3-re.patch +++ b/kernel/patches-4.14.x-rt/0235-0235-softirq-Check-preemption-after-reenabling-interrupts.patch @@ -1,6 +1,7 @@ -Subject: softirq: Check preemption after reenabling interrupts +From ec2a3f91df7f12d53bb5566935914f48df81eb39 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Sun, 13 Nov 2011 17:17:09 +0100 (CET) +Date: Sun, 13 Nov 2011 17:17:09 +0100 +Subject: [PATCH 235/414] 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, @@ -12,14 +13,15 @@ ones which show this behaviour. Reported-by: Carsten Emde Signed-off-by: Thomas Gleixner - --- - block/blk-softirq.c | 3 +++ - include/linux/preempt.h | 3 +++ - lib/irq_poll.c | 5 +++++ - net/core/dev.c | 7 +++++++ + block/blk-softirq.c | 3 +++ + include/linux/preempt.h | 3 +++ + lib/irq_poll.c | 5 +++++ + net/core/dev.c | 7 +++++++ 4 files changed, 18 insertions(+) +diff --git a/block/blk-softirq.c b/block/blk-softirq.c +index 01e2b353a2b9..e8c0d4945f5a 100644 --- a/block/blk-softirq.c +++ b/block/blk-softirq.c @@ -53,6 +53,7 @@ static void trigger_softirq(void *data) @@ -30,7 +32,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -91,6 +92,7 @@ static int blk_softirq_cpu_dead(unsigned +@@ -91,6 +92,7 @@ static int blk_softirq_cpu_dead(unsigned int cpu) this_cpu_ptr(&blk_cpu_done)); raise_softirq_irqoff(BLOCK_SOFTIRQ); local_irq_enable(); @@ -38,7 +40,7 @@ Signed-off-by: Thomas Gleixner return 0; } -@@ -143,6 +145,7 @@ void __blk_complete_request(struct reque +@@ -143,6 +145,7 @@ void __blk_complete_request(struct request *req) goto do_local; local_irq_restore(flags); @@ -46,6 +48,8 @@ Signed-off-by: Thomas Gleixner } /** +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 2d5d002e06c2..a3b19af35e3d 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -187,8 +187,10 @@ do { \ @@ -67,9 +71,11 @@ Signed-off-by: Thomas Gleixner #define preemptible() 0 #define migrate_disable() barrier() +diff --git a/lib/irq_poll.c b/lib/irq_poll.c +index 86a709954f5a..9c069ef83d6d 100644 --- a/lib/irq_poll.c +++ b/lib/irq_poll.c -@@ -37,6 +37,7 @@ void irq_poll_sched(struct irq_poll *iop +@@ -37,6 +37,7 @@ void irq_poll_sched(struct irq_poll *iop) list_add_tail(&iop->list, this_cpu_ptr(&blk_cpu_iopoll)); __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); local_irq_restore(flags); @@ -77,7 +83,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(irq_poll_sched); -@@ -72,6 +73,7 @@ void irq_poll_complete(struct irq_poll * +@@ -72,6 +73,7 @@ void irq_poll_complete(struct irq_poll *iop) local_irq_save(flags); __irq_poll_complete(iop); local_irq_restore(flags); @@ -85,7 +91,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(irq_poll_complete); -@@ -96,6 +98,7 @@ static void __latent_entropy irq_poll_so +@@ -96,6 +98,7 @@ static void __latent_entropy irq_poll_softirq(struct softirq_action *h) } local_irq_enable(); @@ -93,7 +99,7 @@ Signed-off-by: Thomas Gleixner /* Even though interrupts have been re-enabled, this * access is safe because interrupts can only add new -@@ -133,6 +136,7 @@ static void __latent_entropy irq_poll_so +@@ -133,6 +136,7 @@ static void __latent_entropy irq_poll_softirq(struct softirq_action *h) __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); local_irq_enable(); @@ -101,7 +107,7 @@ Signed-off-by: Thomas Gleixner } /** -@@ -196,6 +200,7 @@ static int irq_poll_cpu_dead(unsigned in +@@ -196,6 +200,7 @@ static int irq_poll_cpu_dead(unsigned int cpu) this_cpu_ptr(&blk_cpu_iopoll)); __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); local_irq_enable(); @@ -109,9 +115,11 @@ Signed-off-by: Thomas Gleixner return 0; } +diff --git a/net/core/dev.c b/net/core/dev.c +index e7d56c5adde6..e754b055b3c9 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2438,6 +2438,7 @@ static void __netif_reschedule(struct Qd +@@ -2438,6 +2438,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); @@ -119,7 +127,7 @@ Signed-off-by: Thomas Gleixner } void __netif_schedule(struct Qdisc *q) -@@ -2500,6 +2501,7 @@ void __dev_kfree_skb_irq(struct sk_buff +@@ -2500,6 +2501,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); @@ -127,7 +135,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__dev_kfree_skb_irq); -@@ -3882,6 +3884,7 @@ static int enqueue_to_backlog(struct sk_ +@@ -3882,6 +3884,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, rps_unlock(sd); local_irq_restore(flags); @@ -135,7 +143,7 @@ Signed-off-by: Thomas Gleixner atomic_long_inc(&skb->dev->rx_dropped); kfree_skb(skb); -@@ -5131,12 +5134,14 @@ static void net_rps_action_and_irq_enabl +@@ -5131,12 +5134,14 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd) sd->rps_ipi_list = NULL; local_irq_enable(); @@ -150,7 +158,7 @@ Signed-off-by: Thomas Gleixner } static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) -@@ -5214,6 +5219,7 @@ void __napi_schedule(struct napi_struct +@@ -5214,6 +5219,7 @@ void __napi_schedule(struct napi_struct *n) local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); @@ -158,7 +166,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__napi_schedule); -@@ -8418,6 +8424,7 @@ static int dev_cpu_dead(unsigned int old +@@ -8418,6 +8424,7 @@ static int dev_cpu_dead(unsigned int oldcpu) raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -166,3 +174,6 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_RPS remsd = oldsd->rps_ipi_list; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0236-softirq-disable-softirq-stacks-for-rt.patch b/kernel/patches-4.14.x-rt/0236-0236-softirq-Disable-softirq-stacks-for-RT.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0236-softirq-disable-softirq-stacks-for-rt.patch rename to kernel/patches-4.14.x-rt/0236-0236-softirq-Disable-softirq-stacks-for-RT.patch index d90b5f861..7124db833 100644 --- a/kernel/patches-4.14.x-rt/0236-softirq-disable-softirq-stacks-for-rt.patch +++ b/kernel/patches-4.14.x-rt/0236-0236-softirq-Disable-softirq-stacks-for-RT.patch @@ -1,22 +1,25 @@ -Subject: softirq: Disable softirq stacks for RT +From 94e6b2d0a8330955ac71355f7e0dd73824fb7f4f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 13:59:17 +0200 +Subject: [PATCH 236/414] 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. Signed-off-by: Thomas Gleixner --- - arch/powerpc/kernel/irq.c | 2 ++ - arch/powerpc/kernel/misc_32.S | 2 ++ - arch/powerpc/kernel/misc_64.S | 2 ++ - arch/sh/kernel/irq.c | 2 ++ - arch/sparc/kernel/irq_64.c | 2 ++ - arch/x86/entry/entry_64.S | 2 ++ - arch/x86/kernel/irq_32.c | 2 ++ - include/linux/interrupt.h | 2 +- + arch/powerpc/kernel/irq.c | 2 ++ + arch/powerpc/kernel/misc_32.S | 2 ++ + arch/powerpc/kernel/misc_64.S | 2 ++ + arch/sh/kernel/irq.c | 2 ++ + arch/sparc/kernel/irq_64.c | 2 ++ + arch/x86/entry/entry_64.S | 2 ++ + arch/x86/kernel/irq_32.c | 2 ++ + include/linux/interrupt.h | 2 +- 8 files changed, 15 insertions(+), 1 deletion(-) +diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c +index 0ce8b0e5d7ba..375adb3048fc 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -693,6 +693,7 @@ void irq_ctx_init(void) @@ -35,6 +38,8 @@ Signed-off-by: Thomas Gleixner irq_hw_number_t virq_to_hw(unsigned int virq) { +diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S +index 3f7a9a2d2435..1795359d27b6 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S @@ -41,6 +41,7 @@ @@ -45,7 +50,7 @@ Signed-off-by: Thomas Gleixner _GLOBAL(call_do_softirq) mflr r0 stw r0,4(r1) -@@ -57,6 +58,7 @@ +@@ -57,6 +58,7 @@ _GLOBAL(call_do_softirq) stw r10,THREAD+KSP_LIMIT(r2) mtlr r0 blr @@ -53,6 +58,8 @@ Signed-off-by: Thomas Gleixner /* * 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 3280953a82cf..dd2a80d190c4 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S @@ -31,6 +31,7 @@ @@ -63,7 +70,7 @@ Signed-off-by: Thomas Gleixner _GLOBAL(call_do_softirq) mflr r0 std r0,16(r1) -@@ -41,6 +42,7 @@ +@@ -41,6 +42,7 @@ _GLOBAL(call_do_softirq) ld r0,16(r1) mtlr r0 blr @@ -71,6 +78,8 @@ Signed-off-by: Thomas Gleixner _GLOBAL(call_do_irq) mflr r0 +diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c +index 245dbeb20afe..e298c82d2a69 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -148,6 +148,7 @@ void irq_ctx_exit(int cpu) @@ -89,9 +98,11 @@ Signed-off-by: Thomas Gleixner #else static inline void handle_one_irq(unsigned int irq) { +diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c +index d66dde833f5e..f87b3f8f4d43 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c -@@ -855,6 +855,7 @@ void __irq_entry handler_irq(int pil, st +@@ -855,6 +855,7 @@ void __irq_entry handler_irq(int pil, struct pt_regs *regs) set_irq_regs(old_regs); } @@ -107,9 +118,11 @@ Signed-off-by: Thomas Gleixner #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 f7bfa701219b..d1f3e2c8320b 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -988,6 +988,7 @@ EXPORT_SYMBOL(native_load_gs_index) +@@ -988,6 +988,7 @@ bad_gs: jmp 2b .previous @@ -125,6 +138,8 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_XEN idtentry hypervisor_callback xen_do_hypervisor_callback has_error_code=0 +diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c +index c1bdbd3d3232..e370e1b8b7ff 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -129,6 +129,7 @@ void irq_ctx_init(int cpu) @@ -143,6 +158,8 @@ Signed-off-by: Thomas Gleixner bool handle_irq(struct irq_desc *desc, struct pt_regs *regs) { +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index e53ff6a143e0..c77f7a9ba836 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -501,7 +501,7 @@ struct softirq_action @@ -154,3 +171,6 @@ Signed-off-by: Thomas Gleixner void do_softirq_own_stack(void); #else static inline void do_softirq_own_stack(void) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0237-softirq-split-locks.patch b/kernel/patches-4.14.x-rt/0237-0237-softirq-Split-softirq-locks.patch similarity index 90% rename from kernel/patches-4.14.x-rt/0237-softirq-split-locks.patch rename to kernel/patches-4.14.x-rt/0237-0237-softirq-Split-softirq-locks.patch index 594e34294..19ee47a23 100644 --- a/kernel/patches-4.14.x-rt/0237-softirq-split-locks.patch +++ b/kernel/patches-4.14.x-rt/0237-0237-softirq-Split-softirq-locks.patch @@ -1,6 +1,7 @@ +From 61ec464cb0c89b8b7fd37b287cc8defdd8c06bc1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Thu, 04 Oct 2012 14:20:47 +0100 -Subject: softirq: Split softirq locks +Date: Thu, 4 Oct 2012 14:20:47 +0100 +Subject: [PATCH 237/414] 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 @@ -24,16 +25,18 @@ threads. Signed-off-by: Thomas Gleixner --- - include/linux/bottom_half.h | 34 +++ - include/linux/interrupt.h | 15 + - include/linux/preempt.h | 15 + - include/linux/sched.h | 3 - init/main.c | 1 - kernel/softirq.c | 492 +++++++++++++++++++++++++++++++++++++------- - kernel/time/tick-sched.c | 9 - net/core/dev.c | 6 + include/linux/bottom_half.h | 34 +++ + include/linux/interrupt.h | 15 +- + include/linux/preempt.h | 15 +- + include/linux/sched.h | 3 + + init/main.c | 1 + + kernel/softirq.c | 492 ++++++++++++++++++++++++++++++------ + kernel/time/tick-sched.c | 9 +- + net/core/dev.c | 6 +- 8 files changed, 480 insertions(+), 95 deletions(-) +diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h +index a19519f4241d..40dd5ef9c154 100644 --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h @@ -4,6 +4,39 @@ @@ -83,6 +86,8 @@ Signed-off-by: Thomas Gleixner +#endif #endif /* _LINUX_BH_H */ +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index c77f7a9ba836..0003b88de96f 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -498,10 +498,11 @@ struct softirq_action @@ -99,7 +104,7 @@ Signed-off-by: Thomas Gleixner void do_softirq_own_stack(void); #else static inline void do_softirq_own_stack(void) -@@ -509,6 +510,9 @@ static inline void do_softirq_own_stack( +@@ -509,6 +510,9 @@ static inline void do_softirq_own_stack(void) __do_softirq(); } #endif @@ -109,7 +114,7 @@ Signed-off-by: Thomas Gleixner extern void open_softirq(int nr, void (*action)(struct softirq_action *)); extern void softirq_init(void); -@@ -516,6 +520,7 @@ extern void __raise_softirq_irqoff(unsig +@@ -516,6 +520,7 @@ extern void __raise_softirq_irqoff(unsigned int nr); extern void raise_softirq_irqoff(unsigned int nr); extern void raise_softirq(unsigned int nr); @@ -117,7 +122,7 @@ Signed-off-by: Thomas Gleixner DECLARE_PER_CPU(struct task_struct *, ksoftirqd); -@@ -633,6 +638,12 @@ extern void tasklet_kill_immediate(struc +@@ -633,6 +638,12 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); extern void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data); @@ -130,6 +135,8 @@ Signed-off-by: Thomas Gleixner /* * Autoprobing for irqs: * +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index a3b19af35e3d..2983043d2194 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -51,7 +51,11 @@ @@ -170,6 +177,8 @@ Signed-off-by: Thomas Gleixner #define in_nmi() (preempt_count() & NMI_MASK) #define in_task() (!(preempt_count() & \ (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET))) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index d4c8b0e373e2..2c14998b3aee 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1096,6 +1096,8 @@ struct task_struct { @@ -189,9 +198,11 @@ Signed-off-by: Thomas Gleixner #define PF_IDLE 0x00000002 /* I am an IDLE thread */ #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 2d355a61dfc5..2e39c7c35d32 100644 --- a/init/main.c +++ b/init/main.c -@@ -543,6 +543,7 @@ asmlinkage __visible void __init start_k +@@ -543,6 +543,7 @@ asmlinkage __visible void __init start_kernel(void) setup_command_line(command_line); setup_nr_cpu_ids(); setup_per_cpu_areas(); @@ -199,6 +210,8 @@ Signed-off-by: Thomas Gleixner boot_cpu_state_init(); smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 6602a9ef492b..c737ad6df54b 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -26,6 +26,7 @@ @@ -209,7 +222,7 @@ Signed-off-by: Thomas Gleixner #include #define CREATE_TRACE_POINTS -@@ -63,6 +64,98 @@ const char * const softirq_to_name[NR_SO +@@ -63,6 +64,98 @@ const char * const softirq_to_name[NR_SOFTIRQS] = { "TASKLET", "SCHED", "HRTIMER", "RCU" }; @@ -384,7 +397,7 @@ Signed-off-by: Thomas Gleixner /* * preempt_count and SOFTIRQ_OFFSET usage: * - preempt_count is changed by SOFTIRQ_OFFSET on entering or leaving -@@ -244,10 +399,8 @@ asmlinkage __visible void __softirq_entr +@@ -244,10 +399,8 @@ asmlinkage __visible void __softirq_entry __do_softirq(void) unsigned long end = jiffies + MAX_SOFTIRQ_TIME; unsigned long old_flags = current->flags; int max_restart = MAX_SOFTIRQ_RESTART; @@ -395,7 +408,7 @@ Signed-off-by: Thomas Gleixner /* * Mask out PF_MEMALLOC s current task context is borrowed for the -@@ -266,36 +419,7 @@ asmlinkage __visible void __softirq_entr +@@ -266,36 +419,7 @@ asmlinkage __visible void __softirq_entry __do_softirq(void) /* Reset the pending bitmask before enabling irqs */ set_softirq_pending(0); @@ -433,10 +446,11 @@ Signed-off-by: Thomas Gleixner pending = local_softirq_pending(); if (pending) { -@@ -332,6 +456,246 @@ asmlinkage __visible void do_softirq(voi +@@ -331,6 +455,246 @@ asmlinkage __visible void do_softirq(void) + local_irq_restore(flags); } - /* ++/* + * This function must run with irqs disabled! + */ +void raise_softirq_irqoff(unsigned int nr) @@ -676,10 +690,9 @@ Signed-off-by: Thomas Gleixner +} + +#endif /* PREEMPT_RT_FULL */ -+/* + /* * Enter an interrupt context. */ - void irq_enter(void) @@ -342,9 +706,9 @@ void irq_enter(void) * Prevent raise_softirq from needlessly waking up ksoftirqd * here, as softirq will be serviced on return from interrupt. @@ -787,7 +800,7 @@ Signed-off-by: Thomas Gleixner } #ifdef CONFIG_HOTPLUG_CPU -@@ -773,6 +1107,8 @@ static int takeover_tasklets(unsigned in +@@ -773,6 +1107,8 @@ static int takeover_tasklets(unsigned int cpu) static struct smp_hotplug_thread softirq_threads = { .store = &ksoftirqd, @@ -796,9 +809,11 @@ Signed-off-by: Thomas Gleixner .thread_should_run = ksoftirqd_should_run, .thread_fn = run_ksoftirqd, .thread_comm = "ksoftirqd/%u", +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index 145dc49881e6..0ba600553004 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -911,14 +911,7 @@ static bool can_stop_idle_tick(int cpu, +@@ -911,14 +911,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) return false; if (unlikely(local_softirq_pending() && cpu_online(cpu))) { @@ -814,6 +829,8 @@ Signed-off-by: Thomas Gleixner return false; } +diff --git a/net/core/dev.c b/net/core/dev.c +index e754b055b3c9..ab2b55dcd05f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4088,11 +4088,9 @@ int netif_rx_ni(struct sk_buff *skb) @@ -830,3 +847,6 @@ Signed-off-by: Thomas Gleixner return err; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0238-kernel-softirq-unlock-with-irqs-on.patch b/kernel/patches-4.14.x-rt/0238-0238-kernel-softirq-unlock-with-irqs-on.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0238-kernel-softirq-unlock-with-irqs-on.patch rename to kernel/patches-4.14.x-rt/0238-0238-kernel-softirq-unlock-with-irqs-on.patch index 8ad12c5a8..6d043cc14 100644 --- a/kernel/patches-4.14.x-rt/0238-kernel-softirq-unlock-with-irqs-on.patch +++ b/kernel/patches-4.14.x-rt/0238-0238-kernel-softirq-unlock-with-irqs-on.patch @@ -1,6 +1,7 @@ +From 9f5145c7113749cc467d45975ea5909c6fd00b07 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 9 Feb 2016 18:17:18 +0100 -Subject: kernel: softirq: unlock with irqs on +Subject: [PATCH 238/414] kernel: softirq: unlock with irqs on We unlock the lock while the interrupts are off. This isn't a problem now but will get because the migrate_disable() + enable are not @@ -8,9 +9,11 @@ symmetrical in regard to the status of interrupts. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/softirq.c | 4 +++- + kernel/softirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) +diff --git a/kernel/softirq.c b/kernel/softirq.c +index c737ad6df54b..bd4be3911b4a 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -560,8 +560,10 @@ static void do_current_softirqs(void) @@ -25,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0239-irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch b/kernel/patches-4.14.x-rt/0239-0239-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0239-irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch rename to kernel/patches-4.14.x-rt/0239-0239-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch index a20c8cb10..24368fa0e 100644 --- a/kernel/patches-4.14.x-rt/0239-irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch +++ b/kernel/patches-4.14.x-rt/0239-0239-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch @@ -1,6 +1,8 @@ -Subject: genirq: Allow disabling of softirq processing in irq thread context +From 0f151e9dfc43f5ef9f2e406b2505da0f447cfb08 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 31 Jan 2012 13:01:27 +0100 +Subject: [PATCH 239/414] genirq: Allow disabling of softirq processing in irq + thread context The processing of softirqs in irq thread context is a performance gain for the non-rt workloads of a system, but it's counterproductive for @@ -9,15 +11,16 @@ workload. Allow such interrupts to prevent softirq processing in their thread context. Signed-off-by: Thomas Gleixner - --- - include/linux/interrupt.h | 2 ++ - include/linux/irq.h | 4 +++- - kernel/irq/manage.c | 13 ++++++++++++- - kernel/irq/settings.h | 12 ++++++++++++ - kernel/softirq.c | 9 +++++++++ + include/linux/interrupt.h | 2 ++ + include/linux/irq.h | 4 +++- + kernel/irq/manage.c | 13 ++++++++++++- + kernel/irq/settings.h | 12 ++++++++++++ + kernel/softirq.c | 9 +++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 0003b88de96f..326af722c5ee 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -64,6 +64,7 @@ @@ -36,6 +39,8 @@ Signed-off-by: Thomas Gleixner #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) +diff --git a/include/linux/irq.h b/include/linux/irq.h +index 0d53626405bf..ddd23c6e2e55 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -74,6 +74,7 @@ enum irqchip_irq_state; @@ -62,9 +67,11 @@ Signed-off-by: Thomas Gleixner #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index 5007ea8ac740..d8fa6c86a8ca 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -922,7 +922,15 @@ irq_forced_thread_fn(struct irq_desc *de +@@ -922,7 +922,15 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) local_bh_disable(); ret = action->thread_fn(action->irq, action->dev_id); irq_finalize_oneshot(desc, action); @@ -81,7 +88,7 @@ Signed-off-by: Thomas Gleixner return ret; } -@@ -1410,6 +1418,9 @@ static int +@@ -1410,6 +1418,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) irqd_set(&desc->irq_data, IRQD_NO_BALANCING); } @@ -91,6 +98,8 @@ Signed-off-by: Thomas Gleixner if (irq_settings_can_autoenable(desc)) { irq_startup(desc, IRQ_RESEND, IRQ_START_COND); } else { +diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h +index e43795cd2ccf..47e2f9e23586 100644 --- a/kernel/irq/settings.h +++ b/kernel/irq/settings.h @@ -17,6 +17,7 @@ enum { @@ -109,7 +118,7 @@ Signed-off-by: Thomas Gleixner #undef IRQF_MODIFY_MASK #define IRQF_MODIFY_MASK GOT_YOU_MORON -@@ -41,6 +43,16 @@ irq_settings_clr_and_set(struct irq_desc +@@ -41,6 +43,16 @@ irq_settings_clr_and_set(struct irq_desc *desc, u32 clr, u32 set) desc->status_use_accessors |= (set & _IRQF_MODIFY_MASK); } @@ -126,6 +135,8 @@ Signed-off-by: Thomas Gleixner static inline bool irq_settings_is_per_cpu(struct irq_desc *desc) { return desc->status_use_accessors & _IRQ_PER_CPU; +diff --git a/kernel/softirq.c b/kernel/softirq.c +index bd4be3911b4a..5798ff8f6a40 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -589,6 +589,15 @@ void __local_bh_enable(void) @@ -144,3 +155,6 @@ Signed-off-by: Thomas Gleixner int in_serving_softirq(void) { return current->flags & PF_IN_SOFTIRQ; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0240-softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/kernel/patches-4.14.x-rt/0240-0240-softirq-split-timer-softirqs-out-of-ksoftirqd.patch similarity index 90% rename from kernel/patches-4.14.x-rt/0240-softirq-split-timer-softirqs-out-of-ksoftirqd.patch rename to kernel/patches-4.14.x-rt/0240-0240-softirq-split-timer-softirqs-out-of-ksoftirqd.patch index 13ccc857e..195eeb2e4 100644 --- a/kernel/patches-4.14.x-rt/0240-softirq-split-timer-softirqs-out-of-ksoftirqd.patch +++ b/kernel/patches-4.14.x-rt/0240-0240-softirq-split-timer-softirqs-out-of-ksoftirqd.patch @@ -1,6 +1,7 @@ +From d3c9f741dae979977c7baf9cd9048e401d9b814b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 16:34:17 +0100 -Subject: softirq: split timer softirqs out of ksoftirqd +Subject: [PATCH 240/414] 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 @@ -22,9 +23,11 @@ SCHED_OTHER priority and it won't defer RCU anymore. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - kernel/softirq.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++-------- + kernel/softirq.c | 85 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 12 deletions(-) +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 5798ff8f6a40..263d17b33f50 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -58,6 +58,10 @@ EXPORT_SYMBOL(irq_stat); @@ -56,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void handle_softirq(unsigned int vec_nr) { struct softirq_action *h = softirq_vec + vec_nr; -@@ -484,7 +499,6 @@ void __raise_softirq_irqoff(unsigned int +@@ -484,7 +499,6 @@ void __raise_softirq_irqoff(unsigned int nr) static inline void local_bh_disable_nort(void) { local_bh_disable(); } static inline void _local_bh_enable_nort(void) { _local_bh_enable(); } static void ksoftirqd_set_sched_params(unsigned int cpu) { } @@ -78,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * If we are not in a hard interrupt and inside a bh disabled -@@ -641,16 +659,29 @@ static void do_raise_softirq_irqoff(unsi +@@ -641,16 +659,29 @@ static void do_raise_softirq_irqoff(unsigned int nr) * delegate it to ksoftirqd. */ if (!in_irq() && current->softirq_nestcnt) @@ -112,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -676,7 +707,7 @@ void raise_softirq_irqoff(unsigned int n +@@ -676,7 +707,7 @@ void raise_softirq_irqoff(unsigned int nr) * raise a WARN() if the condition is met. */ if (!current->softirq_nestcnt) @@ -121,10 +124,11 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline int ksoftirqd_softirq_pending(void) -@@ -689,22 +720,37 @@ static inline void _local_bh_enable_nort +@@ -688,23 +719,38 @@ static inline void local_bh_disable_nort(void) { } + static inline void _local_bh_enable_nort(void) { } static inline void ksoftirqd_set_sched_params(unsigned int cpu) - { ++{ + /* Take over all but timer pending softirqs when starting */ + local_irq_disable(); + current->softirqs_raised = local_softirq_pending() & ~TIMER_SOFTIRQS; @@ -132,7 +136,7 @@ Signed-off-by: Sebastian Andrzej Siewior +} + +static inline void ktimer_softirqd_set_sched_params(unsigned int cpu) -+{ + { struct sched_param param = { .sched_priority = 1 }; sched_setscheduler(current, SCHED_FIFO, ¶m); @@ -172,7 +176,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_irq_restore(flags); #endif } -@@ -1119,18 +1168,30 @@ static int takeover_tasklets(unsigned in +@@ -1119,18 +1168,30 @@ static int takeover_tasklets(unsigned int cpu) static struct smp_hotplug_thread softirq_threads = { .store = &ksoftirqd, .setup = ksoftirqd_set_sched_params, @@ -205,3 +209,6 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } early_initcall(spawn_ksoftirqd); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0241-softirq-wake-the-timer-softirq-if-needed.patch b/kernel/patches-4.14.x-rt/0241-0241-softirq-wake-the-timer-softirq-if-needed.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0241-softirq-wake-the-timer-softirq-if-needed.patch rename to kernel/patches-4.14.x-rt/0241-0241-softirq-wake-the-timer-softirq-if-needed.patch index 0fefa35d9..11ba17ef3 100644 --- a/kernel/patches-4.14.x-rt/0241-softirq-wake-the-timer-softirq-if-needed.patch +++ b/kernel/patches-4.14.x-rt/0241-0241-softirq-wake-the-timer-softirq-if-needed.patch @@ -1,6 +1,7 @@ +From 0c3cd413c5efea18efbd4269700c4e2d68631844 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Fri, 20 Jan 2017 18:10:20 +0100 -Subject: [PATCH] softirq: wake the timer softirq if needed +Subject: [PATCH 241/414] softirq: wake the timer softirq if needed The irq-exit path only checks the "normal"-softirq thread if it is running and ignores the state of the "timer"-softirq thread. It is possible @@ -24,9 +25,11 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - kernel/softirq.c | 11 +++++------ + kernel/softirq.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 263d17b33f50..69a45729907a 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -28,6 +28,7 @@ @@ -37,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior #define CREATE_TRACE_POINTS #include -@@ -206,6 +207,7 @@ static void handle_softirq(unsigned int +@@ -206,6 +207,7 @@ static void handle_softirq(unsigned int vec_nr) } } @@ -77,3 +80,6 @@ Signed-off-by: Sebastian Andrzej Siewior local_irq_save(flags); if (__this_cpu_read(ksoftirqd) && +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0242-rtmutex-trylock-is-okay-on-RT.patch b/kernel/patches-4.14.x-rt/0242-0242-rtmutex-trylock-is-okay-on-RT.patch similarity index 61% rename from kernel/patches-4.14.x-rt/0242-rtmutex-trylock-is-okay-on-RT.patch rename to kernel/patches-4.14.x-rt/0242-0242-rtmutex-trylock-is-okay-on-RT.patch index 55da027d3..a57d90049 100644 --- a/kernel/patches-4.14.x-rt/0242-rtmutex-trylock-is-okay-on-RT.patch +++ b/kernel/patches-4.14.x-rt/0242-0242-rtmutex-trylock-is-okay-on-RT.patch @@ -1,6 +1,7 @@ +From c38533d2b8df1f4db5b2506da28472c4df83c5fd Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior -Date: Wed 02 Dec 2015 11:34:07 +0100 -Subject: rtmutex: trylock is okay on -RT +Date: Wed, 2 Dec 2015 11:34:07 +0100 +Subject: [PATCH 242/414] 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 @@ -8,12 +9,14 @@ not a issue here. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 4 ++++ + kernel/locking/rtmutex.c | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index fe7f97edc94e..6f3177a6b8e3 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1563,7 +1563,11 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1563,7 +1563,11 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) { int ret; @@ -25,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; ret = rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0243-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/kernel/patches-4.14.x-rt/0243-0243-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0243-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch rename to kernel/patches-4.14.x-rt/0243-0243-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index 28bc54ccc..6f186f30e 100644 --- a/kernel/patches-4.14.x-rt/0243-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/kernel/patches-4.14.x-rt/0243-0243-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,6 +1,7 @@ +From 53e59c1ee868cc6c235438f068d21b04322b90b0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 15 Sep 2016 10:51:27 +0200 -Subject: [PATCH] fs/nfs: turn rmdir_sem into a semaphore +Subject: [PATCH 243/414] 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 @@ -13,15 +14,17 @@ multiple readers anyway so that is not a loss. Signed-off-by: Sebastian Andrzej Siewior --- - fs/nfs/dir.c | 8 ++++++++ - fs/nfs/inode.c | 4 ++++ - fs/nfs/unlink.c | 31 +++++++++++++++++++++++++++---- - include/linux/nfs_fs.h | 4 ++++ + fs/nfs/dir.c | 8 ++++++++ + fs/nfs/inode.c | 4 ++++ + fs/nfs/unlink.c | 31 +++++++++++++++++++++++++++---- + include/linux/nfs_fs.h | 4 ++++ 4 files changed, 43 insertions(+), 4 deletions(-) +diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c +index bf2c43635062..1f3818580413 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c -@@ -1763,7 +1763,11 @@ int nfs_rmdir(struct inode *dir, struct +@@ -1763,7 +1763,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) trace_nfs_rmdir_enter(dir, dentry); if (d_really_is_positive(dentry)) { @@ -33,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); /* Ensure the VFS deletes this inode */ switch (error) { -@@ -1773,7 +1777,11 @@ int nfs_rmdir(struct inode *dir, struct +@@ -1773,7 +1777,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) case -ENOENT: nfs_dentry_handle_enoent(dentry); } @@ -45,6 +48,8 @@ Signed-off-by: Sebastian Andrzej Siewior } else 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 134d9f560240..ff64167f9811 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -2014,7 +2014,11 @@ static void init_once(void *foo) @@ -59,9 +64,11 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_init(&nfsi->commit_mutex); nfs4_init_once(nfsi); } +diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c +index 630b4a3c1a93..2e78bc25bcea 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c -@@ -52,6 +52,29 @@ static void nfs_async_unlink_done(struct +@@ -52,6 +52,29 @@ static void nfs_async_unlink_done(struct rpc_task *task, void *calldata) rpc_restart_call_prepare(task); } @@ -91,7 +98,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * nfs_async_unlink_release - Release the sillydelete data. * @task: rpc_task of the sillydelete -@@ -65,7 +88,7 @@ static void nfs_async_unlink_release(voi +@@ -65,7 +88,7 @@ static void nfs_async_unlink_release(void *calldata) struct dentry *dentry = data->dentry; struct super_block *sb = dentry->d_sb; @@ -100,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior d_lookup_done(dentry); nfs_free_unlinkdata(data); dput(dentry); -@@ -118,10 +141,10 @@ static int nfs_call_unlink(struct dentry +@@ -118,10 +141,10 @@ static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data) struct inode *dir = d_inode(dentry->d_parent); struct dentry *alias; @@ -113,7 +120,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } if (!d_in_lookup(alias)) { -@@ -143,7 +166,7 @@ static int nfs_call_unlink(struct dentry +@@ -143,7 +166,7 @@ static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data) ret = 0; spin_unlock(&alias->d_lock); dput(alias); @@ -122,6 +129,8 @@ Signed-off-by: Sebastian Andrzej Siewior /* * If we'd displaced old cached devname, free it. At that * point dentry is definitely not a root, so we won't need +diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h +index f0015f801a78..c38288622819 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -162,7 +162,11 @@ struct nfs_inode { @@ -136,3 +145,6 @@ Signed-off-by: Sebastian Andrzej Siewior struct mutex commit_mutex; #if IS_ENABLED(CONFIG_NFS_V4) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0244-rtmutex-futex-prepare-rt.patch b/kernel/patches-4.14.x-rt/0244-0244-rtmutex-Handle-the-various-new-futex-race-conditions.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0244-rtmutex-futex-prepare-rt.patch rename to kernel/patches-4.14.x-rt/0244-0244-rtmutex-Handle-the-various-new-futex-race-conditions.patch index 74c3c6ecf..1436643f5 100644 --- a/kernel/patches-4.14.x-rt/0244-rtmutex-futex-prepare-rt.patch +++ b/kernel/patches-4.14.x-rt/0244-0244-rtmutex-Handle-the-various-new-futex-race-conditions.patch @@ -1,6 +1,7 @@ -Subject: rtmutex: Handle the various new futex race conditions +From f98db64e451bcda06a0eaa62a19112af2cbf653c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 10 Jun 2011 11:04:15 +0200 +Subject: [PATCH 244/414] 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 @@ -8,14 +9,16 @@ therefor not disabling preemption. Signed-off-by: Thomas Gleixner --- - kernel/futex.c | 77 ++++++++++++++++++++++++++++++++-------- - kernel/locking/rtmutex.c | 36 +++++++++++++++--- - kernel/locking/rtmutex_common.h | 2 + + kernel/futex.c | 77 ++++++++++++++++++++++++++------- + kernel/locking/rtmutex.c | 36 ++++++++++++--- + kernel/locking/rtmutex_common.h | 2 + 3 files changed, 94 insertions(+), 21 deletions(-) +diff --git a/kernel/futex.c b/kernel/futex.c +index 1d87da84b2a2..207e10a1791a 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2104,6 +2104,16 @@ static int futex_requeue(u32 __user *uad +@@ -2104,6 +2104,16 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, requeue_pi_wake_futex(this, &key2, hb2); drop_count++; continue; @@ -32,7 +35,7 @@ Signed-off-by: Thomas Gleixner } else if (ret) { /* * rt_mutex_start_proxy_lock() detected a -@@ -3144,7 +3154,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3144,7 +3154,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; @@ -41,7 +44,7 @@ Signed-off-by: Thomas Gleixner union futex_key key2 = FUTEX_KEY_INIT; struct futex_q q = futex_q_init; int res, ret; -@@ -3202,20 +3212,55 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3202,20 +3212,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); @@ -108,7 +111,7 @@ Signed-off-by: Thomas Gleixner /* Check if the requeue code acquired the second futex for us. */ if (!q.rt_waiter) { -@@ -3224,7 +3269,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3224,7 +3269,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)) { @@ -118,7 +121,7 @@ Signed-off-by: Thomas Gleixner ret = fixup_pi_state_owner(uaddr2, &q, current); if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { pi_state = q.pi_state; -@@ -3235,7 +3281,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3235,7 +3281,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); @@ -127,7 +130,7 @@ Signed-off-by: Thomas Gleixner } } else { struct rt_mutex *pi_mutex; -@@ -3249,7 +3295,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3249,7 +3295,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); @@ -137,9 +140,11 @@ Signed-off-by: Thomas Gleixner if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) ret = 0; +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 6f3177a6b8e3..8d7ab272b109 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -135,6 +135,11 @@ static void fixup_rt_mutex_waiters(struc +@@ -135,6 +135,11 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) WRITE_ONCE(*p, owner & ~RT_MUTEX_HAS_WAITERS); } @@ -161,7 +166,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -515,7 +521,7 @@ static int rt_mutex_adjust_prio_chain(st +@@ -515,7 +521,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. */ @@ -170,7 +175,7 @@ Signed-off-by: Thomas Gleixner goto out_unlock_pi; /* -@@ -951,6 +957,22 @@ static int task_blocks_on_rt_mutex(struc +@@ -951,6 +957,22 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, return -EDEADLK; raw_spin_lock(&task->pi_lock); @@ -193,7 +198,7 @@ Signed-off-by: Thomas Gleixner waiter->task = task; waiter->lock = lock; waiter->prio = task->prio; -@@ -974,7 +996,7 @@ static int task_blocks_on_rt_mutex(struc +@@ -974,7 +996,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, rt_mutex_enqueue_pi(owner, waiter); rt_mutex_adjust_prio(owner); @@ -202,7 +207,7 @@ Signed-off-by: Thomas Gleixner chain_walk = 1; } else if (rt_mutex_cond_detect_deadlock(waiter, chwalk)) { chain_walk = 1; -@@ -1070,7 +1092,7 @@ static void remove_waiter(struct rt_mute +@@ -1070,7 +1092,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); @@ -211,7 +216,7 @@ Signed-off-by: Thomas Gleixner lockdep_assert_held(&lock->wait_lock); -@@ -1096,7 +1118,8 @@ static void remove_waiter(struct rt_mute +@@ -1096,7 +1118,8 @@ static void remove_waiter(struct rt_mutex *lock, rt_mutex_adjust_prio(owner); /* Store the lock on which owner is blocked or NULL */ @@ -221,7 +226,7 @@ Signed-off-by: Thomas Gleixner raw_spin_unlock(&owner->pi_lock); -@@ -1132,7 +1155,8 @@ void rt_mutex_adjust_pi(struct task_stru +@@ -1132,7 +1155,8 @@ void rt_mutex_adjust_pi(struct task_struct *task) raw_spin_lock_irqsave(&task->pi_lock, flags); waiter = task->pi_blocked_on; @@ -231,6 +236,8 @@ Signed-off-by: Thomas Gleixner raw_spin_unlock_irqrestore(&task->pi_lock, flags); return; } +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index 68686b3ec3c1..fa218cdff5eb 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h @@ -129,6 +129,8 @@ enum rtmutex_chainwalk { @@ -242,3 +249,6 @@ Signed-off-by: Thomas Gleixner 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.17.0 + diff --git a/kernel/patches-4.14.x-rt/0245-futex-requeue-pi-fix.patch b/kernel/patches-4.14.x-rt/0245-0245-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0245-futex-requeue-pi-fix.patch rename to kernel/patches-4.14.x-rt/0245-0245-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch index 824a04310..a8ffe675d 100644 --- a/kernel/patches-4.14.x-rt/0245-futex-requeue-pi-fix.patch +++ b/kernel/patches-4.14.x-rt/0245-0245-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch @@ -1,6 +1,7 @@ +From 0a5892ad82d686d7925c9f1b4d50df2727e7c45b Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: futex: Fix bug on when a requeued RT task times out +Subject: [PATCH 245/414] futex: Fix bug on when a requeued RT task times out Requeue with timeout causes a bug with PREEMPT_RT_FULL. @@ -16,7 +17,7 @@ The bug comes from a timed out condition. double_lock_hb(); raw_spin_lock(pi_lock); - if (current->pi_blocked_on) { + if (current->pi_blocked_on) { } else { current->pi_blocked_on = PI_WAKE_INPROGRESS; run_spin_unlock(pi_lock); @@ -49,13 +50,15 @@ appropriately. Signed-off-by: Steven Rostedt Signed-off-by: Thomas Gleixner --- - kernel/locking/rtmutex.c | 32 +++++++++++++++++++++++++++++++- - kernel/locking/rtmutex_common.h | 1 + + kernel/locking/rtmutex.c | 32 +++++++++++++++++++++++++++++++- + kernel/locking/rtmutex_common.h | 1 + 2 files changed, 32 insertions(+), 1 deletion(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 8d7ab272b109..ee867d9ebf72 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -137,7 +137,8 @@ static void fixup_rt_mutex_waiters(struc +@@ -137,7 +137,8 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) static int rt_mutex_real_waiter(struct rt_mutex_waiter *waiter) { @@ -65,7 +68,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1743,6 +1744,35 @@ int __rt_mutex_start_proxy_lock(struct r +@@ -1743,6 +1744,35 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, if (try_to_take_rt_mutex(lock, task, NULL)) return 1; @@ -101,6 +104,8 @@ Signed-off-by: Thomas Gleixner /* 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 fa218cdff5eb..509df18215f8 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h @@ -130,6 +130,7 @@ enum rtmutex_chainwalk { @@ -111,3 +116,6 @@ Signed-off-by: Thomas Gleixner extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0246-locking-rtmutex-don-t-drop-the-wait_lock-twice.patch b/kernel/patches-4.14.x-rt/0246-0246-locking-rtmutex-don-t-drop-the-wait_lock-twice.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0246-locking-rtmutex-don-t-drop-the-wait_lock-twice.patch rename to kernel/patches-4.14.x-rt/0246-0246-locking-rtmutex-don-t-drop-the-wait_lock-twice.patch index a149a5a80..93c36dfe7 100644 --- a/kernel/patches-4.14.x-rt/0246-locking-rtmutex-don-t-drop-the-wait_lock-twice.patch +++ b/kernel/patches-4.14.x-rt/0246-0246-locking-rtmutex-don-t-drop-the-wait_lock-twice.patch @@ -1,6 +1,7 @@ +From 180563060f645c409d22be68c60a4d68e7934e3b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 7 Sep 2017 12:38:47 +0200 -Subject: locking/rtmutex: don't drop the wait_lock twice +Subject: [PATCH 246/414] locking/rtmutex: don't drop the wait_lock twice Since the futex rework, __rt_mutex_start_proxy_lock() does no longer acquire the wait_lock so it must not drop it. Otherwise the lock is not @@ -14,12 +15,14 @@ Cc: stable-rt@vger.kernel.org #v4.9.18-rt14+ Reported-by: Gusenleitner Klaus Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 1 - + kernel/locking/rtmutex.c | 1 - 1 file changed, 1 deletion(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index ee867d9ebf72..bbb3508d267f 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1766,7 +1766,6 @@ int __rt_mutex_start_proxy_lock(struct r +@@ -1766,7 +1766,6 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, raw_spin_lock(&task->pi_lock); if (task->pi_blocked_on) { raw_spin_unlock(&task->pi_lock); @@ -27,3 +30,6 @@ Signed-off-by: Sebastian Andrzej Siewior return -EAGAIN; } task->pi_blocked_on = PI_REQUEUE_INPROGRESS; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0247-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/kernel/patches-4.14.x-rt/0247-0247-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0247-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch rename to kernel/patches-4.14.x-rt/0247-0247-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index 77da6fac4..adf059642 100644 --- a/kernel/patches-4.14.x-rt/0247-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/kernel/patches-4.14.x-rt/0247-0247-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch @@ -1,6 +1,8 @@ +From 2ef725837e40f9e133548ad515df592fde640f32 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 1 Mar 2013 11:17:42 +0100 -Subject: futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock +Subject: [PATCH 247/414] futex: Ensure lock/unlock symetry versus pi_lock and + hash bucket lock In exit_pi_state_list() we have the following locking construct: @@ -25,12 +27,14 @@ Reported-by: Yong Zhang Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/futex.c | 2 ++ + kernel/futex.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/kernel/futex.c b/kernel/futex.c +index 207e10a1791a..7540d5c425ac 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -936,7 +936,9 @@ void exit_pi_state_list(struct task_stru +@@ -936,7 +936,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); @@ -40,3 +44,6 @@ Signed-off-by: Sebastian Andrzej Siewior put_pi_state(pi_state); continue; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0248-pid.h-include-atomic.h.patch b/kernel/patches-4.14.x-rt/0248-0248-pid.h-include-atomic.h.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0248-pid.h-include-atomic.h.patch rename to kernel/patches-4.14.x-rt/0248-0248-pid.h-include-atomic.h.patch index 9510164b0..0a10bfd53 100644 --- a/kernel/patches-4.14.x-rt/0248-pid.h-include-atomic.h.patch +++ b/kernel/patches-4.14.x-rt/0248-0248-pid.h-include-atomic.h.patch @@ -1,6 +1,7 @@ +From 21ed5946a6efc1536fc1ec721334e0a37fb48240 Mon Sep 17 00:00:00 2001 From: Grygorii Strashko Date: Tue, 21 Jul 2015 19:43:56 +0300 -Subject: pid.h: include atomic.h +Subject: [PATCH 248/414] pid.h: include atomic.h This patch fixes build error: CC kernel/pid_namespace.o @@ -21,9 +22,11 @@ Vanilla gets this via spinlock.h. Signed-off-by: Grygorii Strashko Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/pid.h | 1 + + include/linux/pid.h | 1 + 1 file changed, 1 insertion(+) +diff --git a/include/linux/pid.h b/include/linux/pid.h +index dfd684ce0787..bc954a99aa70 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -3,6 +3,7 @@ @@ -34,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior enum pid_type { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0249-arm-include-definition-for-cpumask_t.patch b/kernel/patches-4.14.x-rt/0249-0249-arm-include-definition-for-cpumask_t.patch similarity index 67% rename from kernel/patches-4.14.x-rt/0249-arm-include-definition-for-cpumask_t.patch rename to kernel/patches-4.14.x-rt/0249-0249-arm-include-definition-for-cpumask_t.patch index 4bb2672be..d8b11c6a0 100644 --- a/kernel/patches-4.14.x-rt/0249-arm-include-definition-for-cpumask_t.patch +++ b/kernel/patches-4.14.x-rt/0249-0249-arm-include-definition-for-cpumask_t.patch @@ -1,6 +1,7 @@ +From 65883e07e5c4df5bf94f2dd3fc9cab2746f92382 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 22 Dec 2016 17:28:33 +0100 -Subject: [PATCH] arm: include definition for cpumask_t +Subject: [PATCH 249/414] 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. @@ -8,9 +9,11 @@ The split is done in ("rbtree: don't include the rcu header"). Signed-off-by: Sebastian Andrzej Siewior --- - arch/arm/include/asm/irq.h | 2 ++ + arch/arm/include/asm/irq.h | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h +index b6f319606e30..ad377ef73739 100644 --- a/arch/arm/include/asm/irq.h +++ b/arch/arm/include/asm/irq.h @@ -23,6 +23,8 @@ @@ -22,3 +25,6 @@ Signed-off-by: Sebastian Andrzej Siewior struct irqaction; struct pt_regs; extern void migrate_irqs(void); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0250-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/kernel/patches-4.14.x-rt/0250-0250-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0250-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch rename to kernel/patches-4.14.x-rt/0250-0250-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index f825a7f49..60a71b9bc 100644 --- a/kernel/patches-4.14.x-rt/0250-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/kernel/patches-4.14.x-rt/0250-0250-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch @@ -1,6 +1,8 @@ +From d11cd9ea277c0472256028afba34317c2fffa448 Mon Sep 17 00:00:00 2001 From: "Wolfgang M. Reimer" Date: Tue, 21 Jul 2015 16:20:07 +0200 -Subject: locking: locktorture: Do NOT include rwlock.h directly +Subject: [PATCH 250/414] locking: locktorture: Do NOT include rwlock.h + directly Including rwlock.h directly will cause kernel builds to fail if CONFIG_PREEMPT_RT_FULL is defined. The correct header file @@ -11,9 +13,11 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Wolfgang M. Reimer Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/locktorture.c | 1 - + kernel/locking/locktorture.c | 1 - 1 file changed, 1 deletion(-) +diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c +index 6dca260eeccf..5d01ac590d4c 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -26,7 +26,6 @@ @@ -24,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include #include +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0251-rtmutex-lock-killable.patch b/kernel/patches-4.14.x-rt/0251-0251-rtmutex-Add-rtmutex_lock_killable.patch similarity index 65% rename from kernel/patches-4.14.x-rt/0251-rtmutex-lock-killable.patch rename to kernel/patches-4.14.x-rt/0251-0251-rtmutex-Add-rtmutex_lock_killable.patch index dddfc8f28..d3f41e7bb 100644 --- a/kernel/patches-4.14.x-rt/0251-rtmutex-lock-killable.patch +++ b/kernel/patches-4.14.x-rt/0251-0251-rtmutex-Add-rtmutex_lock_killable.patch @@ -1,19 +1,22 @@ -Subject: rtmutex: Add rtmutex_lock_killable() +From bcb4b36573bd4e3dd6162891142dd117d2ceb039 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Thu, 09 Jun 2011 11:43:52 +0200 +Date: Thu, 9 Jun 2011 11:43:52 +0200 +Subject: [PATCH 251/414] 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. Signed-off-by: Thomas Gleixner --- - include/linux/rtmutex.h | 1 + - kernel/locking/rtmutex.c | 19 +++++++++++++++++++ + include/linux/rtmutex.h | 1 + + kernel/locking/rtmutex.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) +diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h +index 1b92a28dd672..66aa13520b68 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h -@@ -108,6 +108,7 @@ extern void rt_mutex_destroy(struct rt_m +@@ -108,6 +108,7 @@ extern void rt_mutex_destroy(struct rt_mutex *lock); extern void rt_mutex_lock(struct rt_mutex *lock); extern int rt_mutex_lock_interruptible(struct rt_mutex *lock); @@ -21,12 +24,15 @@ Signed-off-by: Thomas Gleixner extern int rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout); +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index bbb3508d267f..986620b78011 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1543,6 +1543,25 @@ int __sched __rt_mutex_futex_trylock(str +@@ -1542,6 +1542,25 @@ int __sched __rt_mutex_futex_trylock(struct rt_mutex *lock) + return __rt_mutex_slowtrylock(lock); } - /** ++/** + * rt_mutex_lock_killable - lock a rt_mutex killable + * + * @lock: the rt_mutex to be locked @@ -45,7 +51,9 @@ Signed-off-by: Thomas Gleixner +} +EXPORT_SYMBOL_GPL(rt_mutex_lock_killable); + -+/** + /** * rt_mutex_timed_lock - lock a rt_mutex interruptible * the timeout structure is provided - * by the caller +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0252-rtmutex-Make-lock_killable-work.patch b/kernel/patches-4.14.x-rt/0252-0252-rtmutex-Make-lock_killable-work.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0252-rtmutex-Make-lock_killable-work.patch rename to kernel/patches-4.14.x-rt/0252-0252-rtmutex-Make-lock_killable-work.patch index cc50d7ea5..cdd604215 100644 --- a/kernel/patches-4.14.x-rt/0252-rtmutex-Make-lock_killable-work.patch +++ b/kernel/patches-4.14.x-rt/0252-0252-rtmutex-Make-lock_killable-work.patch @@ -1,6 +1,7 @@ +From 2ea4ce949c86cb342aca03c2659fccccd011d06d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 1 Apr 2017 12:50:59 +0200 -Subject: [PATCH] rtmutex: Make lock_killable work +Subject: [PATCH 252/414] rtmutex: Make lock_killable work Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. @@ -11,12 +12,14 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 19 +++++++------------ + kernel/locking/rtmutex.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 986620b78011..0ba13b607757 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1201,18 +1201,13 @@ static int __sched +@@ -1201,18 +1201,13 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, if (try_to_take_rt_mutex(lock, current, waiter)) break; @@ -42,3 +45,6 @@ Signed-off-by: Sebastian Andrzej Siewior } raw_spin_unlock_irq(&lock->wait_lock); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0253-spinlock-types-separate-raw.patch b/kernel/patches-4.14.x-rt/0253-0253-spinlock-Split-the-lock-types-header.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0253-spinlock-types-separate-raw.patch rename to kernel/patches-4.14.x-rt/0253-0253-spinlock-Split-the-lock-types-header.patch index 08761b680..c6bdecb0a 100644 --- a/kernel/patches-4.14.x-rt/0253-spinlock-types-separate-raw.patch +++ b/kernel/patches-4.14.x-rt/0253-0253-spinlock-Split-the-lock-types-header.patch @@ -1,6 +1,7 @@ -Subject: spinlock: Split the lock types header +From 68e12bb9c78ec938afa51de6c2d182b7116685e9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 19:34:01 +0200 +Subject: [PATCH 253/414] 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 @@ -8,12 +9,16 @@ spinlocks. Signed-off-by: Thomas Gleixner --- - include/linux/rwlock_types.h | 4 + - include/linux/spinlock_types.h | 74 ------------------------------------ - include/linux/spinlock_types_nort.h | 33 ++++++++++++++++ - include/linux/spinlock_types_raw.h | 58 ++++++++++++++++++++++++++++ + include/linux/rwlock_types.h | 4 ++ + include/linux/spinlock_types.h | 74 +---------------------------- + include/linux/spinlock_types_nort.h | 33 +++++++++++++ + include/linux/spinlock_types_raw.h | 58 ++++++++++++++++++++++ 4 files changed, 97 insertions(+), 72 deletions(-) + create mode 100644 include/linux/spinlock_types_nort.h + create mode 100644 include/linux/spinlock_types_raw.h +diff --git a/include/linux/rwlock_types.h b/include/linux/rwlock_types.h +index cc0072e93e36..5317cd957292 100644 --- a/include/linux/rwlock_types.h +++ b/include/linux/rwlock_types.h @@ -1,6 +1,10 @@ @@ -27,6 +32,8 @@ Signed-off-by: Thomas Gleixner /* * include/linux/rwlock_types.h - generic rwlock type definitions * and initializers +diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h +index 73548eb13a5d..5c8664d57fb8 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h @@ -9,79 +9,9 @@ @@ -111,6 +118,9 @@ Signed-off-by: Thomas Gleixner #include +diff --git a/include/linux/spinlock_types_nort.h b/include/linux/spinlock_types_nort.h +new file mode 100644 +index 000000000000..f1dac1fb1d6a --- /dev/null +++ b/include/linux/spinlock_types_nort.h @@ -0,0 +1,33 @@ @@ -147,6 +157,9 @@ Signed-off-by: Thomas Gleixner +#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) + +#endif +diff --git a/include/linux/spinlock_types_raw.h b/include/linux/spinlock_types_raw.h +new file mode 100644 +index 000000000000..03235b475b77 --- /dev/null +++ b/include/linux/spinlock_types_raw.h @@ -0,0 +1,58 @@ @@ -208,3 +221,6 @@ Signed-off-by: Thomas Gleixner +#define DEFINE_RAW_SPINLOCK(x) raw_spinlock_t x = __RAW_SPIN_LOCK_UNLOCKED(x) + +#endif +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0254-rtmutex-avoid-include-hell.patch b/kernel/patches-4.14.x-rt/0254-0254-rtmutex-Avoid-include-hell.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0254-rtmutex-avoid-include-hell.patch rename to kernel/patches-4.14.x-rt/0254-0254-rtmutex-Avoid-include-hell.patch index a3b55f5b7..2c49ec40a 100644 --- a/kernel/patches-4.14.x-rt/0254-rtmutex-avoid-include-hell.patch +++ b/kernel/patches-4.14.x-rt/0254-0254-rtmutex-Avoid-include-hell.patch @@ -1,15 +1,18 @@ -Subject: rtmutex: Avoid include hell +From 5742deafd1a8a7ed456d624f7770ffb1997c2431 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 29 Jun 2011 20:06:39 +0200 +Subject: [PATCH 254/414] 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. Signed-off-by: Thomas Gleixner --- - include/linux/rtmutex.h | 2 +- + include/linux/rtmutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h +index 66aa13520b68..0331eb58f95d 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h @@ -15,7 +15,7 @@ @@ -21,3 +24,6 @@ Signed-off-by: Thomas Gleixner extern int max_lock_depth; /* for sysctl */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0255-rtmutex_dont_include_rcu.patch b/kernel/patches-4.14.x-rt/0255-0255-rbtree-don-t-include-the-rcu-header.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0255-rtmutex_dont_include_rcu.patch rename to kernel/patches-4.14.x-rt/0255-0255-rbtree-don-t-include-the-rcu-header.patch index d63e678a0..c45c1b4f2 100644 --- a/kernel/patches-4.14.x-rt/0255-rtmutex_dont_include_rcu.patch +++ b/kernel/patches-4.14.x-rt/0255-0255-rbtree-don-t-include-the-rcu-header.patch @@ -1,5 +1,10 @@ +From e312cb73ef5eb3bcf4ad566ea0fae589db735a51 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior -Subject: rbtree: don't include the rcu header +Date: Thu, 3 May 2018 17:46:31 +0200 +Subject: [PATCH 255/414] rbtree: don't include the rcu header +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit The RCU header pulls in spinlock.h and fails due not yet defined types: @@ -18,11 +23,14 @@ a new header file which can be included by both users. Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/rbtree.h | 2 - - include/linux/rcu_assign_pointer.h | 54 +++++++++++++++++++++++++++++++++++++ - include/linux/rcupdate.h | 49 --------------------------------- + include/linux/rbtree.h | 2 +- + include/linux/rcu_assign_pointer.h | 54 ++++++++++++++++++++++++++++++ + include/linux/rcupdate.h | 49 +-------------------------- 3 files changed, 56 insertions(+), 49 deletions(-) + create mode 100644 include/linux/rcu_assign_pointer.h +diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h +index d574361943ea..0a9f442409b9 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h @@ -31,7 +31,7 @@ @@ -34,6 +42,9 @@ Signed-off-by: Sebastian Andrzej Siewior struct rb_node { unsigned long __rb_parent_color; +diff --git a/include/linux/rcu_assign_pointer.h b/include/linux/rcu_assign_pointer.h +new file mode 100644 +index 000000000000..7066962a4379 --- /dev/null +++ b/include/linux/rcu_assign_pointer.h @@ -0,0 +1,54 @@ @@ -91,6 +102,8 @@ Signed-off-by: Sebastian Andrzej Siewior +}) + +#endif +diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h +index dbadbdbc8643..a2dc82b3118a 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -42,6 +42,7 @@ @@ -101,10 +114,11 @@ Signed-off-by: Sebastian Andrzej Siewior #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) -@@ -372,54 +373,6 @@ static inline void rcu_preempt_sleep_che +@@ -371,54 +372,6 @@ static inline void rcu_preempt_sleep_check(void) { } + ((typeof(*p) __force __kernel *)(________p1)); \ }) - /** +-/** - * RCU_INITIALIZER() - statically initialize an RCU-protected global variable - * @v: The value to statically initialize with. - */ @@ -152,7 +166,9 @@ Signed-off-by: Sebastian Andrzej Siewior - _r_a_p__v; \ -}) - --/** + /** * rcu_swap_protected() - swap an RCU and a regular pointer * @rcu_ptr: RCU pointer - * @ptr: regular pointer +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0256-rtmutex-Provide-rt_mutex_slowlock_locked.patch b/kernel/patches-4.14.x-rt/0256-0256-rtmutex-Provide-rt_mutex_slowlock_locked.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0256-rtmutex-Provide-rt_mutex_slowlock_locked.patch rename to kernel/patches-4.14.x-rt/0256-0256-rtmutex-Provide-rt_mutex_slowlock_locked.patch index c4aae473a..77f312c7e 100644 --- a/kernel/patches-4.14.x-rt/0256-rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/kernel/patches-4.14.x-rt/0256-0256-rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,19 +1,22 @@ +From 08620a678d3dad0c31f3282b40db7ee453baf8dc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:14:22 +0200 -Subject: rtmutex: Provide rt_mutex_slowlock_locked() +Subject: [PATCH 256/414] rtmutex: Provide rt_mutex_slowlock_locked() This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 70 ++++++++++++++++++++++------------------ - kernel/locking/rtmutex_common.h | 6 +++ + kernel/locking/rtmutex.c | 70 +++++++++++++++++++-------------- + kernel/locking/rtmutex_common.h | 6 +++ 2 files changed, 46 insertions(+), 30 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 0ba13b607757..922bf9c122b0 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1244,35 +1244,16 @@ static void rt_mutex_handle_deadlock(int +@@ -1244,35 +1244,16 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock, } } @@ -55,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior set_current_state(state); -@@ -1280,17 +1261,18 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1280,17 +1261,18 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, if (unlikely(timeout)) hrtimer_start_expires(&timeout->timer, HRTIMER_MODE_ABS); @@ -79,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -1298,6 +1280,34 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1298,6 +1280,34 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, * unconditionally. We might have to fix that up. */ fixup_rt_mutex_waiters(lock); @@ -114,9 +117,11 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&lock->wait_lock, flags); +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index 509df18215f8..3b10fde6fd1f 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h -@@ -158,6 +158,12 @@ extern bool __rt_mutex_futex_unlock(stru +@@ -158,6 +158,12 @@ extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, struct wake_q_head *wqh); extern void rt_mutex_postunlock(struct wake_q_head *wake_q); @@ -129,3 +134,6 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_DEBUG_RT_MUTEXES # include "rtmutex-debug.h" +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0257-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/kernel/patches-4.14.x-rt/0257-0257-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0257-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch rename to kernel/patches-4.14.x-rt/0257-0257-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index 2b5b99ae3..1c11a547e 100644 --- a/kernel/patches-4.14.x-rt/0257-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/kernel/patches-4.14.x-rt/0257-0257-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch @@ -1,20 +1,23 @@ +From af54ebbac5dbaa4d45210b2689daebb6c66f636a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:36:39 +0200 -Subject: rtmutex: export lockdep-less version of rt_mutex's lock, - trylock and unlock +Subject: [PATCH 257/414] rtmutex: export lockdep-less version of rt_mutex's + lock, trylock and unlock Required for lock implementation ontop of rtmutex. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 70 +++++++++++++++++++++++++--------------- - kernel/locking/rtmutex_common.h | 3 + + kernel/locking/rtmutex.c | 70 +++++++++++++++++++++------------ + kernel/locking/rtmutex_common.h | 3 ++ 2 files changed, 47 insertions(+), 26 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 922bf9c122b0..035bf01f3b73 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1496,6 +1496,29 @@ rt_mutex_fastunlock(struct rt_mutex *loc +@@ -1496,6 +1496,29 @@ rt_mutex_fastunlock(struct rt_mutex *lock, rt_mutex_postunlock(&wake_q); } @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * rt_mutex_lock - lock a rt_mutex * -@@ -1503,10 +1526,7 @@ rt_mutex_fastunlock(struct rt_mutex *loc +@@ -1503,10 +1526,7 @@ rt_mutex_fastunlock(struct rt_mutex *lock, */ void __sched rt_mutex_lock(struct rt_mutex *lock) { @@ -74,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(rt_mutex_lock_interruptible); -@@ -1556,13 +1567,10 @@ int __sched __rt_mutex_futex_trylock(str +@@ -1556,13 +1567,10 @@ int __sched __rt_mutex_futex_trylock(struct rt_mutex *lock) * Returns: * 0 on success * -EINTR when interrupted by a signal @@ -89,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(rt_mutex_lock_killable); -@@ -1597,6 +1605,18 @@ rt_mutex_timed_lock(struct rt_mutex *loc +@@ -1597,6 +1605,18 @@ rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout) } EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); @@ -108,7 +111,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * rt_mutex_trylock - try to lock a rt_mutex * -@@ -1612,14 +1632,7 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1612,14 +1632,7 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) { int ret; @@ -124,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (ret) mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); -@@ -1627,6 +1640,11 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1627,6 +1640,11 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) } EXPORT_SYMBOL_GPL(rt_mutex_trylock); @@ -136,9 +139,11 @@ Signed-off-by: Sebastian Andrzej Siewior /** * rt_mutex_unlock - unlock a rt_mutex * +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index 3b10fde6fd1f..ff17912f869c 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h -@@ -160,6 +160,9 @@ extern bool __rt_mutex_futex_unlock(stru +@@ -160,6 +160,9 @@ extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, extern void rt_mutex_postunlock(struct wake_q_head *wake_q); /* RW semaphore special interface */ @@ -148,3 +153,6 @@ Signed-off-by: Sebastian Andrzej Siewior int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0258-rtmutex-add-sleeping-lock-implementation.patch b/kernel/patches-4.14.x-rt/0258-0258-rtmutex-add-sleeping-lock-implementation.patch similarity index 88% rename from kernel/patches-4.14.x-rt/0258-rtmutex-add-sleeping-lock-implementation.patch rename to kernel/patches-4.14.x-rt/0258-0258-rtmutex-add-sleeping-lock-implementation.patch index d24489573..82028baa7 100644 --- a/kernel/patches-4.14.x-rt/0258-rtmutex-add-sleeping-lock-implementation.patch +++ b/kernel/patches-4.14.x-rt/0258-0258-rtmutex-add-sleeping-lock-implementation.patch @@ -1,25 +1,28 @@ +From 874edcc7de0f8ba63e1c51aed9fdb3638560adb2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:11:19 +0200 -Subject: rtmutex: add sleeping lock implementation +Subject: [PATCH 258/414] rtmutex: add sleeping lock implementation Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/kernel.h | 4 - include/linux/rtmutex.h | 21 + - include/linux/sched.h | 9 - include/linux/sched/wake_q.h | 27 ++ - include/linux/spinlock_rt.h | 159 +++++++++++++ - include/linux/spinlock_types_rt.h | 48 ++++ - kernel/fork.c | 1 - kernel/futex.c | 11 - kernel/locking/rtmutex.c | 449 ++++++++++++++++++++++++++++++++++---- - kernel/locking/rtmutex_common.h | 15 + - kernel/sched/core.c | 28 +- + include/linux/kernel.h | 4 + + include/linux/rtmutex.h | 21 +- + include/linux/sched.h | 9 + + include/linux/sched/wake_q.h | 27 +- + include/linux/spinlock_rt.h | 159 +++++++++++ + include/linux/spinlock_types_rt.h | 48 ++++ + kernel/fork.c | 1 + + kernel/futex.c | 11 +- + kernel/locking/rtmutex.c | 449 +++++++++++++++++++++++++++--- + kernel/locking/rtmutex_common.h | 15 +- + kernel/sched/core.c | 28 +- 11 files changed, 713 insertions(+), 59 deletions(-) create mode 100644 include/linux/spinlock_rt.h create mode 100644 include/linux/spinlock_types_rt.h +diff --git a/include/linux/kernel.h b/include/linux/kernel.h +index f696993c052c..74feebf9d82c 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -225,6 +225,9 @@ extern int _cond_resched(void); @@ -40,6 +43,8 @@ Signed-off-by: Sebastian Andrzej Siewior # define sched_annotate_sleep() do { } while (0) #endif +diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h +index 0331eb58f95d..82ac0e5db005 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h @@ -14,11 +14,15 @@ @@ -96,6 +101,8 @@ Signed-off-by: Sebastian Andrzej Siewior /** * 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 2c14998b3aee..af6f1bb58002 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -123,6 +123,11 @@ struct task_group; @@ -128,9 +135,11 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_RT_MUTEXES /* PI waiters blocked on a rt_mutex held by this task: */ +diff --git a/include/linux/sched/wake_q.h b/include/linux/sched/wake_q.h +index 10b19a192b2d..ce3ccff3d9d8 100644 --- a/include/linux/sched/wake_q.h +++ b/include/linux/sched/wake_q.h -@@ -47,8 +47,29 @@ static inline void wake_q_init(struct wa +@@ -47,8 +47,29 @@ static inline void wake_q_init(struct wake_q_head *head) head->lastp = &head->first; } @@ -163,6 +172,9 @@ Signed-off-by: Sebastian Andrzej Siewior +} #endif /* _LINUX_SCHED_WAKE_Q_H */ +diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h +new file mode 100644 +index 000000000000..c95e1f5145ac --- /dev/null +++ b/include/linux/spinlock_rt.h @@ -0,0 +1,159 @@ @@ -325,6 +337,9 @@ Signed-off-by: Sebastian Andrzej Siewior + atomic_dec_and_spin_lock(atomic, lock) + +#endif +diff --git a/include/linux/spinlock_types_rt.h b/include/linux/spinlock_types_rt.h +new file mode 100644 +index 000000000000..3e3d8c5f7a9a --- /dev/null +++ b/include/linux/spinlock_types_rt.h @@ -0,0 +1,48 @@ @@ -376,9 +391,11 @@ Signed-off-by: Sebastian Andrzej Siewior + spinlock_t name = __SPIN_LOCK_UNLOCKED(name) + +#endif +diff --git a/kernel/fork.c b/kernel/fork.c +index fe48256ed179..06ee8ea6daaf 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -600,6 +600,7 @@ static struct task_struct *dup_task_stru +@@ -600,6 +600,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; @@ -386,9 +403,11 @@ Signed-off-by: Sebastian Andrzej Siewior account_kernel_stack(tsk, 1); +diff --git a/kernel/futex.c b/kernel/futex.c +index 7540d5c425ac..2ba7fb04a107 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -1432,6 +1432,7 @@ static int wake_futex_pi(u32 __user *uad +@@ -1432,6 +1432,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); @@ -396,7 +415,7 @@ Signed-off-by: Sebastian Andrzej Siewior int ret = 0; new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); -@@ -1493,13 +1494,13 @@ static int wake_futex_pi(u32 __user *uad +@@ -1493,13 +1494,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); @@ -413,7 +432,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2811,7 +2812,7 @@ static int futex_lock_pi(u32 __user *uad +@@ -2811,7 +2812,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, goto no_block; } @@ -422,7 +441,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * On PREEMPT_RT_FULL, when hb->lock becomes an rt_mutex, we must not -@@ -3183,7 +3184,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3183,7 +3184,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. */ @@ -431,6 +450,8 @@ Signed-off-by: Sebastian Andrzej Siewior ret = get_futex_key(uaddr2, flags & FLAGS_SHARED, &key2, VERIFY_WRITE); if (unlikely(ret != 0)) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 035bf01f3b73..3d6374f5f776 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -7,6 +7,11 @@ @@ -445,7 +466,7 @@ Signed-off-by: Sebastian Andrzej Siewior * * See Documentation/locking/rt-mutex-design.txt for details. */ -@@ -234,7 +239,7 @@ static inline bool unlock_rt_mutex_safe( +@@ -234,7 +239,7 @@ static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, * Only use with rt_mutex_waiter_{less,equal}() */ #define task_to_waiter(p) \ @@ -454,7 +475,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline int rt_mutex_waiter_less(struct rt_mutex_waiter *left, -@@ -274,6 +279,27 @@ rt_mutex_waiter_equal(struct rt_mutex_wa +@@ -274,6 +279,27 @@ rt_mutex_waiter_equal(struct rt_mutex_waiter *left, return 1; } @@ -482,7 +503,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void rt_mutex_enqueue(struct rt_mutex *lock, struct rt_mutex_waiter *waiter) { -@@ -378,6 +404,14 @@ static bool rt_mutex_cond_detect_deadloc +@@ -378,6 +404,14 @@ static bool rt_mutex_cond_detect_deadlock(struct rt_mutex_waiter *waiter, return debug_rt_mutex_detect_deadlock(waiter, chwalk); } @@ -497,7 +518,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Max number of times we'll walk the boosting chain: */ -@@ -703,13 +737,16 @@ static int rt_mutex_adjust_prio_chain(st +@@ -703,13 +737,16 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, * follow here. This is the end of the chain we are walking. */ if (!rt_mutex_owner(lock)) { @@ -516,7 +537,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irq(&lock->wait_lock); return 0; } -@@ -811,9 +848,11 @@ static int rt_mutex_adjust_prio_chain(st +@@ -811,9 +848,11 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, * @task: The task which wants to acquire the lock * @waiter: The waiter that is queued to the lock's wait tree if the * callsite called task_blocked_on_lock(), otherwise NULL @@ -530,7 +551,7 @@ Signed-off-by: Sebastian Andrzej Siewior { lockdep_assert_held(&lock->wait_lock); -@@ -849,12 +888,11 @@ static int try_to_take_rt_mutex(struct r +@@ -849,12 +888,11 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, */ if (waiter) { /* @@ -546,7 +567,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * We can acquire the lock. Remove the waiter from the * lock waiters tree. -@@ -872,14 +910,12 @@ static int try_to_take_rt_mutex(struct r +@@ -872,14 +910,12 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, */ if (rt_mutex_has_waiters(lock)) { /* @@ -565,7 +586,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * The current top waiter stays enqueued. We * don't have to change anything in the lock -@@ -926,6 +962,309 @@ static int try_to_take_rt_mutex(struct r +@@ -926,6 +962,309 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, return 1; } @@ -875,7 +896,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Task blocks on lock. * -@@ -1039,6 +1378,7 @@ static int task_blocks_on_rt_mutex(struc +@@ -1039,6 +1378,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, * Called with lock->wait_lock held and interrupts disabled. */ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, @@ -883,7 +904,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct rt_mutex *lock) { struct rt_mutex_waiter *waiter; -@@ -1078,7 +1418,10 @@ static void mark_wakeup_next_waiter(stru +@@ -1078,7 +1418,10 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, * Pairs with preempt_enable() in rt_mutex_postunlock(); */ preempt_disable(); @@ -895,7 +916,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock(¤t->pi_lock); } -@@ -1162,21 +1505,22 @@ void rt_mutex_adjust_pi(struct task_stru +@@ -1162,21 +1505,22 @@ void rt_mutex_adjust_pi(struct task_struct *task) return; } next_lock = waiter->lock; @@ -920,7 +941,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /** -@@ -1295,7 +1639,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1295,7 +1639,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, unsigned long flags; int ret = 0; @@ -929,7 +950,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Technically we could use raw_spin_[un]lock_irq() here, but this can -@@ -1368,7 +1712,8 @@ static inline int rt_mutex_slowtrylock(s +@@ -1368,7 +1712,8 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) * Return whether the current task needs to call rt_mutex_postunlock(). */ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, @@ -939,7 +960,7 @@ Signed-off-by: Sebastian Andrzej Siewior { unsigned long flags; -@@ -1422,7 +1767,7 @@ static bool __sched rt_mutex_slowunlock( +@@ -1422,7 +1767,7 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, * * Queue the next waiter for wakeup once we release the wait_lock. */ @@ -948,7 +969,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&lock->wait_lock, flags); return true; /* call rt_mutex_postunlock() */ -@@ -1474,9 +1819,11 @@ rt_mutex_fasttrylock(struct rt_mutex *lo +@@ -1474,9 +1819,11 @@ rt_mutex_fasttrylock(struct rt_mutex *lock, /* * Performs the wakeup of the the top-waiter and re-enables preemption. */ @@ -961,7 +982,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Pairs with preempt_disable() in rt_mutex_slowunlock() */ preempt_enable(); -@@ -1485,15 +1832,17 @@ void rt_mutex_postunlock(struct wake_q_h +@@ -1485,15 +1832,17 @@ void rt_mutex_postunlock(struct wake_q_head *wake_q) static inline void rt_mutex_fastunlock(struct rt_mutex *lock, bool (*slowfn)(struct rt_mutex *lock, @@ -982,7 +1003,7 @@ Signed-off-by: Sebastian Andrzej Siewior } int __sched __rt_mutex_lock_state(struct rt_mutex *lock, int state) -@@ -1653,16 +2002,13 @@ void __sched __rt_mutex_unlock(struct rt +@@ -1653,16 +2002,13 @@ void __sched __rt_mutex_unlock(struct rt_mutex *lock) void __sched rt_mutex_unlock(struct rt_mutex *lock) { mutex_release(&lock->dep_map, 1, _RET_IP_); @@ -1003,7 +1024,7 @@ Signed-off-by: Sebastian Andrzej Siewior { lockdep_assert_held(&lock->wait_lock); -@@ -1679,23 +2025,35 @@ bool __sched __rt_mutex_futex_unlock(str +@@ -1679,23 +2025,35 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex *lock, * avoid inversion prior to the wakeup. preempt_disable() * therein pairs with rt_mutex_postunlock(). */ @@ -1042,7 +1063,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /** -@@ -1734,7 +2092,7 @@ void __rt_mutex_init(struct rt_mutex *lo +@@ -1734,7 +2092,7 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name, if (name && key) debug_rt_mutex_init(lock, name, key); } @@ -1051,7 +1072,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a -@@ -1903,6 +2261,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -1903,6 +2261,7 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, struct hrtimer_sleeper *to, struct rt_mutex_waiter *waiter) { @@ -1059,7 +1080,7 @@ Signed-off-by: Sebastian Andrzej Siewior int ret; raw_spin_lock_irq(&lock->wait_lock); -@@ -1914,6 +2273,24 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -1914,6 +2273,24 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, * have to fix that up. */ fixup_rt_mutex_waiters(lock); @@ -1084,6 +1105,8 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irq(&lock->wait_lock); return ret; +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index ff17912f869c..2d822a08c87d 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h @@ -15,6 +15,7 @@ @@ -1102,7 +1125,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_DEBUG_RT_MUTEXES unsigned long ip; struct pid *deadlock_task_pid; -@@ -137,7 +139,7 @@ extern void rt_mutex_init_proxy_locked(s +@@ -137,7 +139,7 @@ extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner); extern void rt_mutex_proxy_unlock(struct rt_mutex *lock, struct task_struct *proxy_owner); @@ -1111,7 +1134,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, struct task_struct *task); -@@ -155,9 +157,12 @@ extern int __rt_mutex_futex_trylock(stru +@@ -155,9 +157,12 @@ extern int __rt_mutex_futex_trylock(struct rt_mutex *l); extern void rt_mutex_futex_unlock(struct rt_mutex *lock); extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, @@ -1126,7 +1149,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* RW semaphore special interface */ extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); -@@ -167,6 +172,10 @@ int __sched rt_mutex_slowlock_locked(str +@@ -167,6 +172,10 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, struct rt_mutex_waiter *waiter); @@ -1137,9 +1160,11 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_DEBUG_RT_MUTEXES # include "rtmutex-debug.h" +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index b07d65aca09e..0c759bd68232 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -427,9 +427,15 @@ static bool set_nr_if_polling(struct tas +@@ -427,9 +427,15 @@ static bool set_nr_if_polling(struct task_struct *p) #endif #endif @@ -1157,7 +1182,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Atomically grab the task, if ->wake_q is !nil already it means -@@ -451,24 +457,32 @@ void wake_q_add(struct wake_q_head *head +@@ -451,24 +457,32 @@ void wake_q_add(struct wake_q_head *head, struct task_struct *task) head->lastp = &node->next; } @@ -1195,3 +1220,6 @@ Signed-off-by: Sebastian Andrzej Siewior put_task_struct(task); } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0259-rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/kernel/patches-4.14.x-rt/0259-0259-rtmutex-add-mutex-implementation-based-on-rtmutex.patch similarity index 95% rename from kernel/patches-4.14.x-rt/0259-rtmutex-add-mutex-implementation-based-on-rtmutex.patch rename to kernel/patches-4.14.x-rt/0259-0259-rtmutex-add-mutex-implementation-based-on-rtmutex.patch index 783831268..36162ab12 100644 --- a/kernel/patches-4.14.x-rt/0259-rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/kernel/patches-4.14.x-rt/0259-0259-rtmutex-add-mutex-implementation-based-on-rtmutex.patch @@ -1,16 +1,20 @@ +From 0f4b1cb696943b0a12dea9fa1a1b6fdc7b77c5f5 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:17:03 +0200 -Subject: rtmutex: add mutex implementation based on rtmutex +Subject: [PATCH 259/414] rtmutex: add mutex implementation based on rtmutex Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/mutex_rt.h | 130 ++++++++++++++++++++++++++ - kernel/locking/mutex-rt.c | 223 ++++++++++++++++++++++++++++++++++++++++++++++ + include/linux/mutex_rt.h | 130 ++++++++++++++++++++++ + kernel/locking/mutex-rt.c | 223 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 353 insertions(+) create mode 100644 include/linux/mutex_rt.h create mode 100644 kernel/locking/mutex-rt.c +diff --git a/include/linux/mutex_rt.h b/include/linux/mutex_rt.h +new file mode 100644 +index 000000000000..3fcb5edb1d2b --- /dev/null +++ b/include/linux/mutex_rt.h @@ -0,0 +1,130 @@ @@ -144,6 +148,9 @@ Signed-off-by: Sebastian Andrzej Siewior +extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); + +#endif +diff --git a/kernel/locking/mutex-rt.c b/kernel/locking/mutex-rt.c +new file mode 100644 +index 000000000000..4f81595c0f52 --- /dev/null +++ b/kernel/locking/mutex-rt.c @@ -0,0 +1,223 @@ @@ -370,3 +377,6 @@ Signed-off-by: Sebastian Andrzej Siewior + return 1; +} +EXPORT_SYMBOL(atomic_dec_and_mutex_lock); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0260-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/kernel/patches-4.14.x-rt/0260-0260-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch similarity index 95% rename from kernel/patches-4.14.x-rt/0260-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch rename to kernel/patches-4.14.x-rt/0260-0260-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index 39f2284f8..89cd5592f 100644 --- a/kernel/patches-4.14.x-rt/0260-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/kernel/patches-4.14.x-rt/0260-0260-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch @@ -1,6 +1,7 @@ +From 466f49e7b207aa071221ab566b05c9aab16824ec Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:28:34 +0200 -Subject: rtmutex: add rwsem implementation based on rtmutex +Subject: [PATCH 260/414] 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 @@ -41,12 +42,15 @@ the approach. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/rwsem_rt.h | 67 +++++++++++ - kernel/locking/rwsem-rt.c | 269 ++++++++++++++++++++++++++++++++++++++++++++++ + include/linux/rwsem_rt.h | 67 ++++++++++ + kernel/locking/rwsem-rt.c | 269 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 336 insertions(+) create mode 100644 include/linux/rwsem_rt.h create mode 100644 kernel/locking/rwsem-rt.c +diff --git a/include/linux/rwsem_rt.h b/include/linux/rwsem_rt.h +new file mode 100644 +index 000000000000..2ffbf093ae92 --- /dev/null +++ b/include/linux/rwsem_rt.h @@ -0,0 +1,67 @@ @@ -117,6 +121,9 @@ Signed-off-by: Sebastian Andrzej Siewior +extern void __downgrade_write(struct rw_semaphore *sem); + +#endif +diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c +new file mode 100644 +index 000000000000..a8f7ce5be989 --- /dev/null +++ b/kernel/locking/rwsem-rt.c @@ -0,0 +1,269 @@ @@ -389,3 +396,6 @@ Signed-off-by: Sebastian Andrzej Siewior + /* Release it and account current as reader */ + __up_write_unlock(sem, WRITER_BIAS - 1, flags); +} +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0261-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/kernel/patches-4.14.x-rt/0261-0261-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch similarity index 95% rename from kernel/patches-4.14.x-rt/0261-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch rename to kernel/patches-4.14.x-rt/0261-0261-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index 35ac0af12..9ec57d904 100644 --- a/kernel/patches-4.14.x-rt/0261-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/kernel/patches-4.14.x-rt/0261-0261-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch @@ -1,20 +1,24 @@ +From d40484f5f490dad4f424996ac035a7c0aabd1cce Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:18:06 +0200 -Subject: rtmutex: add rwlock implementation based on rtmutex +Subject: [PATCH 261/414] rtmutex: add rwlock implementation based on rtmutex The implementation is bias-based, similar to the rwsem implementation. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/rwlock_rt.h | 119 ++++++++++++ - include/linux/rwlock_types_rt.h | 55 +++++ - kernel/locking/rwlock-rt.c | 368 ++++++++++++++++++++++++++++++++++++++++ + include/linux/rwlock_rt.h | 119 +++++++++++ + include/linux/rwlock_types_rt.h | 55 +++++ + kernel/locking/rwlock-rt.c | 368 ++++++++++++++++++++++++++++++++ 3 files changed, 542 insertions(+) create mode 100644 include/linux/rwlock_rt.h create mode 100644 include/linux/rwlock_types_rt.h create mode 100644 kernel/locking/rwlock-rt.c +diff --git a/include/linux/rwlock_rt.h b/include/linux/rwlock_rt.h +new file mode 100644 +index 000000000000..a9c4c2ac4d1f --- /dev/null +++ b/include/linux/rwlock_rt.h @@ -0,0 +1,119 @@ @@ -137,6 +141,9 @@ Signed-off-by: Sebastian Andrzej Siewior +void __write_rt_unlock(struct rt_rw_lock *lock); + +#endif +diff --git a/include/linux/rwlock_types_rt.h b/include/linux/rwlock_types_rt.h +new file mode 100644 +index 000000000000..546a1f8f1274 --- /dev/null +++ b/include/linux/rwlock_types_rt.h @@ -0,0 +1,55 @@ @@ -195,6 +202,9 @@ Signed-off-by: Sebastian Andrzej Siewior + } while (0) + +#endif +diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c +new file mode 100644 +index 000000000000..aebb7ce25bc6 --- /dev/null +++ b/kernel/locking/rwlock-rt.c @@ -0,0 +1,368 @@ @@ -566,3 +576,6 @@ Signed-off-by: Sebastian Andrzej Siewior + do_rwlock_rt_init(rwlock, name, key); +} +EXPORT_SYMBOL(__rt_rwlock_init); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0262-rtmutex-wire-up-RT-s-locking.patch b/kernel/patches-4.14.x-rt/0262-0262-rtmutex-wire-up-RT-s-locking.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0262-rtmutex-wire-up-RT-s-locking.patch rename to kernel/patches-4.14.x-rt/0262-0262-rtmutex-wire-up-RT-s-locking.patch index bc1f7264d..589360f68 100644 --- a/kernel/patches-4.14.x-rt/0262-rtmutex-wire-up-RT-s-locking.patch +++ b/kernel/patches-4.14.x-rt/0262-0262-rtmutex-wire-up-RT-s-locking.patch @@ -1,20 +1,23 @@ +From 1decab5844b9e92e7a2cae9a5906d8b261f787c6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:31:14 +0200 -Subject: rtmutex: wire up RT's locking +Subject: [PATCH 262/414] rtmutex: wire up RT's locking Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/mutex.h | 20 +++++++++++++------- - include/linux/rwsem.h | 11 +++++++++++ - include/linux/spinlock.h | 12 +++++++++++- - include/linux/spinlock_api_smp.h | 4 +++- - include/linux/spinlock_types.h | 11 ++++++++--- - kernel/locking/Makefile | 9 ++++++++- - kernel/locking/spinlock.c | 7 +++++++ - kernel/locking/spinlock_debug.c | 5 +++++ + include/linux/mutex.h | 20 +++++++++++++------- + include/linux/rwsem.h | 11 +++++++++++ + include/linux/spinlock.h | 12 +++++++++++- + include/linux/spinlock_api_smp.h | 4 +++- + include/linux/spinlock_types.h | 11 ++++++++--- + kernel/locking/Makefile | 9 ++++++++- + kernel/locking/spinlock.c | 7 +++++++ + kernel/locking/spinlock_debug.c | 5 +++++ 8 files changed, 66 insertions(+), 13 deletions(-) +diff --git a/include/linux/mutex.h b/include/linux/mutex.h +index 153274f78402..dbb52857b25b 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -23,6 +23,17 @@ @@ -49,13 +52,15 @@ Signed-off-by: Sebastian Andrzej Siewior #define __MUTEX_INITIALIZER(lockname) \ { .owner = ATOMIC_LONG_INIT(0) \ , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \ -@@ -228,4 +232,6 @@ mutex_trylock_recursive(struct mutex *lo +@@ -228,4 +232,6 @@ mutex_trylock_recursive(struct mutex *lock) return mutex_trylock(lock); } +#endif /* !PREEMPT_RT_FULL */ + #endif /* __LINUX_MUTEX_H */ +diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h +index dfa34d803439..6671cff97fa5 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -20,6 +20,10 @@ @@ -69,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct rw_semaphore; #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK -@@ -108,6 +112,13 @@ static inline int rwsem_is_contended(str +@@ -108,6 +112,13 @@ static inline int rwsem_is_contended(struct rw_semaphore *sem) return !list_empty(&sem->wait_list); } @@ -83,9 +88,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * lock for reading */ +diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h +index 341e1a12bfc7..7c8f0a985b9e 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h -@@ -286,7 +286,11 @@ static inline void do_raw_spin_unlock(ra +@@ -286,7 +286,11 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) #define raw_spin_can_lock(lock) (!raw_spin_is_locked(lock)) /* Include rwlock functions */ @@ -98,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: -@@ -297,6 +301,10 @@ static inline void do_raw_spin_unlock(ra +@@ -297,6 +301,10 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) # include #endif @@ -109,16 +116,18 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Map the spin_lock functions to the raw variants for PREEMPT_RT=n */ -@@ -421,4 +429,6 @@ extern int _atomic_dec_and_lock(atomic_t +@@ -421,4 +429,6 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); #define atomic_dec_and_lock(atomic, lock) \ __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) +#endif /* !PREEMPT_RT_FULL */ + #endif /* __LINUX_SPINLOCK_H */ +diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h +index 42dfab89e740..29d99ae5a8ab 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h -@@ -187,6 +187,8 @@ static inline int __raw_spin_trylock_bh( +@@ -187,6 +187,8 @@ static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) return 0; } @@ -128,6 +137,8 @@ Signed-off-by: Sebastian Andrzej Siewior +#endif #endif /* __LINUX_SPINLOCK_API_SMP_H */ +diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h +index 5c8664d57fb8..10bac715ea96 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h @@ -11,8 +11,13 @@ @@ -147,6 +158,8 @@ Signed-off-by: Sebastian Andrzej Siewior +#endif #endif /* __LINUX_SPINLOCK_TYPES_H */ +diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile +index 392c7f23af76..c0bf04b6b965 100644 --- a/kernel/locking/Makefile +++ b/kernel/locking/Makefile @@ -3,7 +3,7 @@ @@ -158,7 +171,7 @@ Signed-off-by: Sebastian Andrzej Siewior ifdef CONFIG_FUNCTION_TRACER CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE) -@@ -12,7 +12,11 @@ CFLAGS_REMOVE_mutex-debug.o = $(CC_FLAGS +@@ -12,7 +12,11 @@ CFLAGS_REMOVE_mutex-debug.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_rtmutex-debug.o = $(CC_FLAGS_FTRACE) endif @@ -182,9 +195,11 @@ Signed-off-by: Sebastian Andrzej Siewior obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o obj-$(CONFIG_LOCK_TORTURE_TEST) += locktorture.o obj-$(CONFIG_WW_MUTEX_SELFTEST) += test-ww_mutex.o +diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c +index 6e40fdfba326..401bda23f786 100644 --- a/kernel/locking/spinlock.c +++ b/kernel/locking/spinlock.c -@@ -125,8 +125,11 @@ void __lockfunc __raw_##op##_lock_bh(loc +@@ -125,8 +125,11 @@ void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \ * __[spin|read|write]_lock_bh() */ BUILD_LOCK_OPS(spin, raw_spinlock); @@ -196,7 +211,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif -@@ -210,6 +213,8 @@ void __lockfunc _raw_spin_unlock_bh(raw_ +@@ -210,6 +213,8 @@ void __lockfunc _raw_spin_unlock_bh(raw_spinlock_t *lock) EXPORT_SYMBOL(_raw_spin_unlock_bh); #endif @@ -205,7 +220,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifndef CONFIG_INLINE_READ_TRYLOCK int __lockfunc _raw_read_trylock(rwlock_t *lock) { -@@ -354,6 +359,8 @@ void __lockfunc _raw_write_unlock_bh(rwl +@@ -354,6 +359,8 @@ void __lockfunc _raw_write_unlock_bh(rwlock_t *lock) EXPORT_SYMBOL(_raw_write_unlock_bh); #endif @@ -214,9 +229,11 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_DEBUG_LOCK_ALLOC 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 --- a/kernel/locking/spinlock_debug.c +++ b/kernel/locking/spinlock_debug.c -@@ -31,6 +31,7 @@ void __raw_spin_lock_init(raw_spinlock_t +@@ -31,6 +31,7 @@ void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, EXPORT_SYMBOL(__raw_spin_lock_init); @@ -224,7 +241,7 @@ Signed-off-by: Sebastian Andrzej Siewior void __rwlock_init(rwlock_t *lock, const char *name, struct lock_class_key *key) { -@@ -48,6 +49,7 @@ void __rwlock_init(rwlock_t *lock, const +@@ -48,6 +49,7 @@ void __rwlock_init(rwlock_t *lock, const char *name, } EXPORT_SYMBOL(__rwlock_init); @@ -232,7 +249,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void spin_dump(raw_spinlock_t *lock, const char *msg) { -@@ -135,6 +137,7 @@ void do_raw_spin_unlock(raw_spinlock_t * +@@ -135,6 +137,7 @@ void do_raw_spin_unlock(raw_spinlock_t *lock) arch_spin_unlock(&lock->raw_lock); } @@ -246,3 +263,6 @@ Signed-off-by: Sebastian Andrzej Siewior } + +#endif +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0263-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/kernel/patches-4.14.x-rt/0263-0263-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0263-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch rename to kernel/patches-4.14.x-rt/0263-0263-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index 612a8b8b1..87220a1ed 100644 --- a/kernel/patches-4.14.x-rt/0263-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/kernel/patches-4.14.x-rt/0263-0263-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,14 +1,17 @@ +From f30d023a97a6e21fef127a11a4d7de7223938b84 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 17:34:38 +0200 -Subject: rtmutex: add ww_mutex addon for mutex-rt +Subject: [PATCH 263/414] rtmutex: add ww_mutex addon for mutex-rt Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 264 ++++++++++++++++++++++++++++++++++++++-- - kernel/locking/rtmutex_common.h | 2 - kernel/locking/rwsem-rt.c | 2 + kernel/locking/rtmutex.c | 264 ++++++++++++++++++++++++++++++-- + kernel/locking/rtmutex_common.h | 2 + + kernel/locking/rwsem-rt.c | 2 +- 3 files changed, 257 insertions(+), 11 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 3d6374f5f776..3e130ea6f85c 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -23,6 +23,7 @@ @@ -60,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, struct rt_mutex_waiter *waiter) -@@ -1536,7 +1571,8 @@ void rt_mutex_init_waiter(struct rt_mute +@@ -1536,7 +1571,8 @@ void rt_mutex_init_waiter(struct rt_mutex_waiter *waiter, bool savestate) static int __sched __rt_mutex_slowlock(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, @@ -70,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior { int ret = 0; -@@ -1554,6 +1590,12 @@ static int __sched +@@ -1554,6 +1590,12 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, break; } @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irq(&lock->wait_lock); debug_rt_mutex_print_deadlock(waiter); -@@ -1588,16 +1630,106 @@ static void rt_mutex_handle_deadlock(int +@@ -1588,16 +1630,106 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock, } } @@ -191,7 +194,7 @@ Signed-off-by: Sebastian Andrzej Siewior set_current_state(state); -@@ -1609,7 +1741,12 @@ int __sched rt_mutex_slowlock_locked(str +@@ -1609,7 +1741,12 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, if (likely(!ret)) { /* sleep on the mutex */ @@ -205,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior } if (unlikely(ret)) { -@@ -1617,6 +1754,10 @@ int __sched rt_mutex_slowlock_locked(str +@@ -1617,6 +1754,10 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, if (rt_mutex_has_waiters(lock)) remove_waiter(lock, waiter); /* ww_mutex want to report EDEADLK/EALREADY, let them */ @@ -216,7 +219,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -1633,7 +1774,8 @@ int __sched rt_mutex_slowlock_locked(str +@@ -1633,7 +1774,8 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, static int __sched rt_mutex_slowlock(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, @@ -226,7 +229,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct rt_mutex_waiter waiter; unsigned long flags; -@@ -1651,7 +1793,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1651,7 +1793,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, */ raw_spin_lock_irqsave(&lock->wait_lock, flags); @@ -236,7 +239,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&lock->wait_lock, flags); -@@ -1781,29 +1924,33 @@ static bool __sched rt_mutex_slowunlock( +@@ -1781,29 +1924,33 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, */ static inline int rt_mutex_fastlock(struct rt_mutex *lock, int state, @@ -274,7 +277,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline int -@@ -1946,6 +2093,7 @@ rt_mutex_timed_lock(struct rt_mutex *loc +@@ -1946,6 +2093,7 @@ rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout) mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); ret = rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout, RT_MUTEX_MIN_CHAINWALK, @@ -282,7 +285,7 @@ Signed-off-by: Sebastian Andrzej Siewior rt_mutex_slowlock); if (ret) mutex_release(&lock->dep_map, 1, _RET_IP_); -@@ -2267,7 +2415,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -2267,7 +2415,7 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, raw_spin_lock_irq(&lock->wait_lock); /* sleep on the mutex */ set_current_state(TASK_INTERRUPTIBLE); @@ -291,7 +294,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * try_to_take_rt_mutex() sets the waiter bit unconditionally. We might * have to fix that up. -@@ -2351,3 +2499,99 @@ bool rt_mutex_cleanup_proxy_lock(struct +@@ -2351,3 +2499,99 @@ bool rt_mutex_cleanup_proxy_lock(struct rt_mutex *lock, return cleanup; } @@ -391,9 +394,11 @@ Signed-off-by: Sebastian Andrzej Siewior +} +EXPORT_SYMBOL(__rt_mutex_owner_current); +#endif +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index 2d822a08c87d..2a157c78e18c 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h -@@ -164,6 +164,7 @@ extern void rt_mutex_postunlock(struct w +@@ -164,6 +164,7 @@ extern void rt_mutex_postunlock(struct wake_q_head *wake_q, struct wake_q_head *wake_sleeper_q); /* RW semaphore special interface */ @@ -401,7 +406,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); extern int __rt_mutex_trylock(struct rt_mutex *lock); -@@ -171,6 +172,7 @@ extern void __rt_mutex_unlock(struct rt_ +@@ -171,6 +172,7 @@ extern void __rt_mutex_unlock(struct rt_mutex *lock); int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, @@ -409,9 +414,11 @@ Signed-off-by: Sebastian Andrzej Siewior struct rt_mutex_waiter *waiter); void __sched rt_spin_lock_slowlock_locked(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, +diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c +index a8f7ce5be989..26991ddb6c5a 100644 --- a/kernel/locking/rwsem-rt.c +++ b/kernel/locking/rwsem-rt.c -@@ -130,7 +130,7 @@ void __sched __down_read(struct rw_semap +@@ -130,7 +130,7 @@ void __sched __down_read(struct rw_semaphore *sem) */ rt_mutex_init_waiter(&waiter, false); rt_mutex_slowlock_locked(m, TASK_UNINTERRUPTIBLE, NULL, @@ -420,3 +427,6 @@ Signed-off-by: Sebastian Andrzej Siewior &waiter); /* * The slowlock() above is guaranteed to return with the rtmutex is +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0264-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/kernel/patches-4.14.x-rt/0264-0264-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0264-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch rename to kernel/patches-4.14.x-rt/0264-0264-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index 65c7a6099..4c99f6cb3 100644 --- a/kernel/patches-4.14.x-rt/0264-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/kernel/patches-4.14.x-rt/0264-0264-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch @@ -1,6 +1,8 @@ +From c33b49f83ccc428ca2f32bd95517733f45ad8b9a Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Mon, 13 Nov 2017 12:56:53 -0500 -Subject: [PATCH] locking/rt-mutex: fix deadlock in device mapper / block-IO +Subject: [PATCH 264/414] locking/rt-mutex: fix deadlock in device mapper / + block-IO When some block device driver creates a bio and submits it to another block device driver, the bio is added to current->bio_list (in order to @@ -32,9 +34,11 @@ CC: stable-rt@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 13 +++++++++++++ + kernel/locking/rtmutex.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 3e130ea6f85c..53f344caf5c8 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -24,6 +24,7 @@ @@ -45,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "rtmutex_common.h" -@@ -1933,6 +1934,15 @@ rt_mutex_fastlock(struct rt_mutex *lock, +@@ -1933,6 +1934,15 @@ rt_mutex_fastlock(struct rt_mutex *lock, int state, if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 0; @@ -61,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK, ww_ctx); } -@@ -1950,6 +1960,9 @@ rt_mutex_timed_fastlock(struct rt_mutex +@@ -1950,6 +1960,9 @@ rt_mutex_timed_fastlock(struct rt_mutex *lock, int state, likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 0; @@ -71,3 +75,6 @@ Signed-off-by: Sebastian Andrzej Siewior return slowfn(lock, state, timeout, chwalk, ww_ctx); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0265-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/kernel/patches-4.14.x-rt/0265-0265-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0265-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch rename to kernel/patches-4.14.x-rt/0265-0265-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index 810fe3837..5cc98d59a 100644 --- a/kernel/patches-4.14.x-rt/0265-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/kernel/patches-4.14.x-rt/0265-0265-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch @@ -1,6 +1,7 @@ +From de0000243b11540f11e2956d5a866486bf93d8ca Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 16 Nov 2017 16:48:48 +0100 -Subject: [PATCH] locking/rtmutex: re-init the wait_lock in +Subject: [PATCH 265/414] 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 @@ -10,12 +11,14 @@ seeing a double-lock of the wait_lock. Reported-by: Fernando Lopez-Lezcano Signed-off-by: Sebastian Andrzej Siewior --- - kernel/locking/rtmutex.c | 8 ++++++++ + kernel/locking/rtmutex.c | 8 ++++++++ 1 file changed, 8 insertions(+) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 53f344caf5c8..0cb716ba3be0 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -2273,6 +2273,14 @@ void rt_mutex_init_proxy_locked(struct r +@@ -2273,6 +2273,14 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner) { __rt_mutex_init(lock, NULL, NULL); @@ -30,3 +33,6 @@ Signed-off-by: Sebastian Andrzej Siewior debug_rt_mutex_proxy_lock(lock, proxy_owner); rt_mutex_set_owner(lock, proxy_owner); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0266-ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/kernel/patches-4.14.x-rt/0266-0266-ptrace-fix-ptrace-vs-tasklist_lock-race.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0266-ptrace-fix-ptrace-vs-tasklist_lock-race.patch rename to kernel/patches-4.14.x-rt/0266-0266-ptrace-fix-ptrace-vs-tasklist_lock-race.patch index 04f4b2dde..c2bbe03a7 100644 --- a/kernel/patches-4.14.x-rt/0266-ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/kernel/patches-4.14.x-rt/0266-0266-ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,6 +1,7 @@ +From e71270b6bdb4e57afbde8f4e881c8c957ae49edf Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 18:21:04 +0200 -Subject: ptrace: fix ptrace vs tasklist_lock race +Subject: [PATCH 266/414] ptrace: fix ptrace vs tasklist_lock race As explained by Alexander Fyodorov : @@ -23,11 +24,13 @@ taken in case the caller is interrupted between looking into ->state and Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/sched.h | 49 +++++++++++++++++++++++++++++++++++++++++++++---- - kernel/ptrace.c | 9 ++++++++- - kernel/sched/core.c | 17 +++++++++++++++-- + include/linux/sched.h | 49 +++++++++++++++++++++++++++++++++++++++---- + kernel/ptrace.c | 9 +++++++- + kernel/sched/core.c | 17 +++++++++++++-- 3 files changed, 68 insertions(+), 7 deletions(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index af6f1bb58002..89ea033c76d0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -100,12 +100,8 @@ struct task_group; @@ -43,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior #define task_contributes_to_load(task) ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ (task->flags & PF_FROZEN) == 0 && \ (task->state & TASK_NOLOAD) == 0) -@@ -1597,6 +1593,51 @@ static inline int test_tsk_need_resched( +@@ -1597,6 +1593,51 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } @@ -95,9 +98,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * 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 84b1367935e4..b32a86f63522 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c -@@ -175,7 +175,14 @@ static bool ptrace_freeze_traced(struct +@@ -175,7 +175,14 @@ static bool ptrace_freeze_traced(struct task_struct *task) spin_lock_irq(&task->sighand->siglock); if (task_is_traced(task) && !__fatal_signal_pending(task)) { @@ -113,9 +118,11 @@ Signed-off-by: Sebastian Andrzej Siewior ret = true; } spin_unlock_irq(&task->sighand->siglock); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 0c759bd68232..ce2e431e1b94 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1359,6 +1359,18 @@ int migrate_swap(struct task_struct *cur +@@ -1359,6 +1359,18 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p) return ret; } @@ -134,7 +141,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * wait_task_inactive - wait for a thread to unschedule. * -@@ -1403,7 +1415,7 @@ unsigned long wait_task_inactive(struct +@@ -1403,7 +1415,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state) * is actually now running somewhere else! */ while (task_running(rq, p)) { @@ -143,7 +150,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; cpu_relax(); } -@@ -1418,7 +1430,8 @@ unsigned long wait_task_inactive(struct +@@ -1418,7 +1430,8 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state) running = task_running(rq, p); queued = task_on_rq_queued(p); ncsw = 0; @@ -153,3 +160,6 @@ Signed-off-by: Sebastian Andrzej Siewior ncsw = p->nvcsw | LONG_MIN; /* sets MSB */ task_rq_unlock(rq, p, &rf); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0267-RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch b/kernel/patches-4.14.x-rt/0267-0267-RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0267-RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch rename to kernel/patches-4.14.x-rt/0267-0267-RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch index 28105f496..c4ae0e3d9 100644 --- a/kernel/patches-4.14.x-rt/0267-RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch +++ b/kernel/patches-4.14.x-rt/0267-0267-RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch @@ -1,7 +1,8 @@ +From 8055b8fd96f21c0bc990fcda87c29ac1d2ba4767 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:25:13 +0200 -Subject: [PATCH] RCU: we need to skip that warning but only on sleeping - locks +Subject: [PATCH 267/414] RCU: we need to skip that warning but only on + sleeping locks This check is okay for upstream. On RT we trigger this while blocking on sleeping lock. In this case, it is okay to schedule() within a RCU @@ -13,12 +14,14 @@ set on regular mutexes. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/tree_plugin.h | 6 +++++- + kernel/rcu/tree_plugin.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index 4428c8edb074..f7dee8352496 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h -@@ -323,9 +323,13 @@ static void rcu_preempt_note_context_swi +@@ -323,9 +323,13 @@ static void rcu_preempt_note_context_switch(bool preempt) struct task_struct *t = current; struct rcu_data *rdp; struct rcu_node *rnp; @@ -33,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (t->rcu_read_lock_nesting > 0 && !t->rcu_read_unlock_special.b.blocked) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0268-RCU-skip-the-schedule-in-RCU-section-warning-on-UP-t.patch b/kernel/patches-4.14.x-rt/0268-0268-RCU-skip-the-schedule-in-RCU-section-warning-on-UP-t.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0268-RCU-skip-the-schedule-in-RCU-section-warning-on-UP-t.patch rename to kernel/patches-4.14.x-rt/0268-0268-RCU-skip-the-schedule-in-RCU-section-warning-on-UP-t.patch index 126376ba2..e3005933e 100644 --- a/kernel/patches-4.14.x-rt/0268-RCU-skip-the-schedule-in-RCU-section-warning-on-UP-t.patch +++ b/kernel/patches-4.14.x-rt/0268-0268-RCU-skip-the-schedule-in-RCU-section-warning-on-UP-t.patch @@ -1,7 +1,8 @@ +From f45f65486122226766ccc613a5ed5d7488e13a13 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 16 Feb 2018 11:45:13 +0100 -Subject: [PATCH] RCU: skip the "schedule() in RCU section" warning on UP, - too +Subject: [PATCH 268/414] RCU: skip the "schedule() in RCU section" warning on + UP, too In "RCU: we need to skip that warning but only on sleeping locks" we skipped a warning on SMP systems in case we schedule out in a RCU @@ -16,12 +17,14 @@ Reported-by: Grygorii Strashko Tested-by: Grygorii Strashko Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/preempt.h | 9 +++++++++ - include/linux/sched.h | 6 ++++++ - kernel/rcu/tree_plugin.h | 2 +- - kernel/sched/core.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + include/linux/preempt.h | 9 ++++++++ + include/linux/sched.h | 6 ++++++ + kernel/rcu/tree_plugin.h | 2 +- + kernel/sched/core.c | 45 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 2983043d2194..fd2efc6ffc3f 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -211,6 +211,15 @@ extern void migrate_enable(void); @@ -40,6 +43,8 @@ Signed-off-by: Sebastian Andrzej Siewior #else #define migrate_disable() barrier() #define migrate_enable() barrier() +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 89ea033c76d0..c9941a5e93ae 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -591,6 +591,12 @@ struct task_struct { @@ -55,9 +60,11 @@ Signed-off-by: Sebastian Andrzej Siewior #endif #ifdef CONFIG_PREEMPT_RCU +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index f7dee8352496..cd4c89fcc33a 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h -@@ -326,7 +326,7 @@ static void rcu_preempt_note_context_swi +@@ -326,7 +326,7 @@ static void rcu_preempt_note_context_switch(bool preempt) int mg_counter = 0; RCU_LOCKDEP_WARN(!irqs_disabled(), "rcu_preempt_note_context_switch() invoked with interrupts enabled!!!\n"); @@ -66,6 +73,8 @@ Signed-off-by: Sebastian Andrzej Siewior mg_counter = t->migrate_disable; #endif WARN_ON_ONCE(!preempt && t->rcu_read_lock_nesting > 0 && !mg_counter); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index ce2e431e1b94..6ab163bbeaa0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7020,4 +7020,49 @@ void migrate_enable(void) @@ -118,3 +127,6 @@ Signed-off-by: Sebastian Andrzej Siewior +} +EXPORT_SYMBOL(migrate_enable); #endif +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0269-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/kernel/patches-4.14.x-rt/0269-0269-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch similarity index 65% rename from kernel/patches-4.14.x-rt/0269-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch rename to kernel/patches-4.14.x-rt/0269-0269-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index 336a73567..59ef0ed17 100644 --- a/kernel/patches-4.14.x-rt/0269-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/kernel/patches-4.14.x-rt/0269-0269-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -1,7 +1,8 @@ +From 2a95931c6cebd69e81f39ca8e4f0baeed593fd78 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 17:40:42 +0200 -Subject: [PATCH 1/2] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT - archs +Subject: [PATCH 269/414] locking: don't check for __LINUX_SPINLOCK_TYPES_H on + -RT archs Upstream uses arch_spinlock_t within spinlock_t and requests that spinlock_types.h header file is included first. @@ -13,23 +14,25 @@ Therefore I am dropping that check. Signed-off-by: Sebastian Andrzej Siewior --- - arch/alpha/include/asm/spinlock_types.h | 4 ---- - arch/arm/include/asm/spinlock_types.h | 4 ---- - arch/arm64/include/asm/spinlock_types.h | 4 ---- - arch/blackfin/include/asm/spinlock_types.h | 4 ---- - arch/hexagon/include/asm/spinlock_types.h | 4 ---- - arch/ia64/include/asm/spinlock_types.h | 4 ---- - arch/m32r/include/asm/spinlock_types.h | 4 ---- - arch/metag/include/asm/spinlock_types.h | 4 ---- - arch/mn10300/include/asm/spinlock_types.h | 4 ---- - arch/powerpc/include/asm/spinlock_types.h | 4 ---- - arch/s390/include/asm/spinlock_types.h | 4 ---- - arch/sh/include/asm/spinlock_types.h | 4 ---- - arch/tile/include/asm/spinlock_types.h | 4 ---- - arch/xtensa/include/asm/spinlock_types.h | 4 ---- - include/linux/spinlock_types_up.h | 4 ---- + arch/alpha/include/asm/spinlock_types.h | 4 ---- + arch/arm/include/asm/spinlock_types.h | 4 ---- + arch/arm64/include/asm/spinlock_types.h | 4 ---- + arch/blackfin/include/asm/spinlock_types.h | 4 ---- + arch/hexagon/include/asm/spinlock_types.h | 4 ---- + arch/ia64/include/asm/spinlock_types.h | 4 ---- + arch/m32r/include/asm/spinlock_types.h | 4 ---- + arch/metag/include/asm/spinlock_types.h | 4 ---- + arch/mn10300/include/asm/spinlock_types.h | 4 ---- + arch/powerpc/include/asm/spinlock_types.h | 4 ---- + arch/s390/include/asm/spinlock_types.h | 4 ---- + arch/sh/include/asm/spinlock_types.h | 4 ---- + arch/tile/include/asm/spinlock_types.h | 4 ---- + arch/xtensa/include/asm/spinlock_types.h | 4 ---- + include/linux/spinlock_types_up.h | 4 ---- 15 files changed, 60 deletions(-) +diff --git a/arch/alpha/include/asm/spinlock_types.h b/arch/alpha/include/asm/spinlock_types.h +index 1d5716bc060b..6883bc952d22 100644 --- a/arch/alpha/include/asm/spinlock_types.h +++ b/arch/alpha/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -43,6 +46,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/arm/include/asm/spinlock_types.h b/arch/arm/include/asm/spinlock_types.h +index 5976958647fe..a37c0803954b 100644 --- a/arch/arm/include/asm/spinlock_types.h +++ b/arch/arm/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -56,6 +61,8 @@ Signed-off-by: Sebastian Andrzej Siewior #define TICKET_SHIFT 16 typedef struct { +diff --git a/arch/arm64/include/asm/spinlock_types.h b/arch/arm64/include/asm/spinlock_types.h +index 55be59a35e3f..ba0cf1361f65 100644 --- a/arch/arm64/include/asm/spinlock_types.h +++ b/arch/arm64/include/asm/spinlock_types.h @@ -16,10 +16,6 @@ @@ -69,6 +76,8 @@ Signed-off-by: Sebastian Andrzej Siewior #include #define TICKET_SHIFT 16 +diff --git a/arch/blackfin/include/asm/spinlock_types.h b/arch/blackfin/include/asm/spinlock_types.h +index 1a33608c958b..103b34d3dcf6 100644 --- a/arch/blackfin/include/asm/spinlock_types.h +++ b/arch/blackfin/include/asm/spinlock_types.h @@ -7,10 +7,6 @@ @@ -82,6 +91,8 @@ Signed-off-by: Sebastian Andrzej Siewior #include typedef struct { +diff --git a/arch/hexagon/include/asm/spinlock_types.h b/arch/hexagon/include/asm/spinlock_types.h +index 7a906b5214a4..d8f596fec022 100644 --- a/arch/hexagon/include/asm/spinlock_types.h +++ b/arch/hexagon/include/asm/spinlock_types.h @@ -21,10 +21,6 @@ @@ -95,6 +106,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/ia64/include/asm/spinlock_types.h b/arch/ia64/include/asm/spinlock_types.h +index 6e345fefcdca..681408d6816f 100644 --- a/arch/ia64/include/asm/spinlock_types.h +++ b/arch/ia64/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -108,6 +121,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/m32r/include/asm/spinlock_types.h b/arch/m32r/include/asm/spinlock_types.h +index bb0d17b64198..fc6afa42fe11 100644 --- a/arch/m32r/include/asm/spinlock_types.h +++ b/arch/m32r/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -121,6 +136,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { volatile int slock; } arch_spinlock_t; +diff --git a/arch/metag/include/asm/spinlock_types.h b/arch/metag/include/asm/spinlock_types.h +index cd197f1bed59..adc26e9797c5 100644 --- a/arch/metag/include/asm/spinlock_types.h +++ b/arch/metag/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -134,6 +151,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/mn10300/include/asm/spinlock_types.h b/arch/mn10300/include/asm/spinlock_types.h +index 32abdc89bbc7..c45230a12d60 100644 --- a/arch/mn10300/include/asm/spinlock_types.h +++ b/arch/mn10300/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -147,6 +166,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct arch_spinlock { unsigned int slock; } arch_spinlock_t; +diff --git a/arch/powerpc/include/asm/spinlock_types.h b/arch/powerpc/include/asm/spinlock_types.h +index 87adaf13b7e8..7305cb6a53e4 100644 --- a/arch/powerpc/include/asm/spinlock_types.h +++ b/arch/powerpc/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -160,6 +181,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { volatile unsigned int slock; } arch_spinlock_t; +diff --git a/arch/s390/include/asm/spinlock_types.h b/arch/s390/include/asm/spinlock_types.h +index 1861a0c5dd47..74092ebaca3c 100644 --- a/arch/s390/include/asm/spinlock_types.h +++ b/arch/s390/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -173,6 +196,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { int lock; } __attribute__ ((aligned (4))) arch_spinlock_t; +diff --git a/arch/sh/include/asm/spinlock_types.h b/arch/sh/include/asm/spinlock_types.h +index e82369f286a2..22ca9a98bbb8 100644 --- a/arch/sh/include/asm/spinlock_types.h +++ b/arch/sh/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -186,6 +211,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/tile/include/asm/spinlock_types.h b/arch/tile/include/asm/spinlock_types.h +index a71f59b49c50..9311c6ff2abc 100644 --- a/arch/tile/include/asm/spinlock_types.h +++ b/arch/tile/include/asm/spinlock_types.h @@ -15,10 +15,6 @@ @@ -199,6 +226,8 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef __tilegx__ /* Low 15 bits are "next"; high 15 bits are "current". */ +diff --git a/arch/xtensa/include/asm/spinlock_types.h b/arch/xtensa/include/asm/spinlock_types.h +index bb1fe6c1816e..8a22f1e7b6c9 100644 --- a/arch/xtensa/include/asm/spinlock_types.h +++ b/arch/xtensa/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -212,6 +241,8 @@ Signed-off-by: Sebastian Andrzej Siewior typedef struct { volatile unsigned int slock; } arch_spinlock_t; +diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h +index c09b6407ae1b..b0243ba07fb7 100644 --- a/include/linux/spinlock_types_up.h +++ b/include/linux/spinlock_types_up.h @@ -1,10 +1,6 @@ @@ -225,3 +256,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * include/linux/spinlock_types_up.h - spinlock type definitions for UP * +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0270-peter_zijlstra-frob-rcu.patch b/kernel/patches-4.14.x-rt/0270-0270-rcu-Frob-softirq-test.patch similarity index 93% rename from kernel/patches-4.14.x-rt/0270-peter_zijlstra-frob-rcu.patch rename to kernel/patches-4.14.x-rt/0270-0270-rcu-Frob-softirq-test.patch index ff4fb670f..db7db87d8 100644 --- a/kernel/patches-4.14.x-rt/0270-peter_zijlstra-frob-rcu.patch +++ b/kernel/patches-4.14.x-rt/0270-0270-rcu-Frob-softirq-test.patch @@ -1,6 +1,7 @@ -Subject: rcu: Frob softirq test +From f4060948890d482ed47dc45775b2bc92f4f13ab6 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra -Date: Sat Aug 13 00:23:17 CEST 2011 +Date: Sat, 13 Aug 2011 00:23:17 +0200 +Subject: [PATCH 270/414] rcu: Frob softirq test With RT_FULL we get the below wreckage: @@ -10,15 +11,15 @@ With RT_FULL we get the below wreckage: [ 126.060490] ------------------------------------------------------- [ 126.060492] irq/24-eth0/1235 is trying to acquire lock: [ 126.060495] (&(lock)->wait_lock#2){+.+...}, at: [] rt_mutex_slowunlock+0x16/0x55 -[ 126.060503] +[ 126.060503] [ 126.060504] but task is already holding lock: [ 126.060506] (&p->pi_lock){-...-.}, at: [] try_to_wake_up+0x35/0x429 -[ 126.060511] +[ 126.060511] [ 126.060511] which lock already depends on the new lock. -[ 126.060513] -[ 126.060514] +[ 126.060513] +[ 126.060514] [ 126.060514] the existing dependency chain (in reverse order) is: -[ 126.060516] +[ 126.060516] [ 126.060516] -> #1 (&p->pi_lock){-...-.}: [ 126.060519] [] lock_acquire+0x145/0x18a [ 126.060524] [] _raw_spin_lock_irqsave+0x4b/0x85 @@ -29,7 +30,7 @@ With RT_FULL we get the below wreckage: [ 126.060541] [] rcu_boost_kthread+0x7d/0x9b [ 126.060544] [] kthread+0x99/0xa1 [ 126.060547] [] kernel_thread_helper+0x4/0x10 -[ 126.060551] +[ 126.060551] [ 126.060552] -> #0 (&(lock)->wait_lock#2){+.+...}: [ 126.060555] [] __lock_acquire+0x1157/0x1816 [ 126.060558] [] lock_acquire+0x145/0x18a @@ -49,23 +50,23 @@ With RT_FULL we get the below wreckage: [ 126.060603] [] irq_thread+0xde/0x1af [ 126.060606] [] kthread+0x99/0xa1 [ 126.060608] [] kernel_thread_helper+0x4/0x10 -[ 126.060611] +[ 126.060611] [ 126.060612] other info that might help us debug this: -[ 126.060614] +[ 126.060614] [ 126.060615] Possible unsafe locking scenario: -[ 126.060616] +[ 126.060616] [ 126.060617] CPU0 CPU1 [ 126.060619] ---- ---- [ 126.060620] lock(&p->pi_lock); [ 126.060623] lock(&(lock)->wait_lock); [ 126.060625] lock(&p->pi_lock); [ 126.060627] lock(&(lock)->wait_lock); -[ 126.060629] +[ 126.060629] [ 126.060629] *** DEADLOCK *** -[ 126.060630] +[ 126.060630] [ 126.060632] 1 lock held by irq/24-eth0/1235: [ 126.060633] #0: (&p->pi_lock){-...-.}, at: [] try_to_wake_up+0x35/0x429 -[ 126.060638] +[ 126.060638] [ 126.060638] stack backtrace: [ 126.060641] Pid: 1235, comm: irq/24-eth0 Not tainted 3.0.1-rt10+ #30 [ 126.060643] Call Trace: @@ -150,12 +151,14 @@ here... so this is very likely a bandaid and more thought is required. Cc: Paul E. McKenney Signed-off-by: Peter Zijlstra --- - kernel/rcu/tree_plugin.h | 2 +- + kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index cd4c89fcc33a..1789b7474b65 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h -@@ -466,7 +466,7 @@ void rcu_read_unlock_special(struct task +@@ -466,7 +466,7 @@ void rcu_read_unlock_special(struct task_struct *t) } /* Hardware IRQ handlers cannot block, complain if they get here. */ @@ -164,3 +167,6 @@ Signed-off-by: Peter Zijlstra lockdep_rcu_suspicious(__FILE__, __LINE__, "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.17.0 + diff --git a/kernel/patches-4.14.x-rt/0271-rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch b/kernel/patches-4.14.x-rt/0271-0271-rcu-Merge-RCU-bh-into-RCU-preempt.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0271-rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch rename to kernel/patches-4.14.x-rt/0271-0271-rcu-Merge-RCU-bh-into-RCU-preempt.patch index 839ec219e..dddcf269d 100644 --- a/kernel/patches-4.14.x-rt/0271-rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch +++ b/kernel/patches-4.14.x-rt/0271-0271-rcu-Merge-RCU-bh-into-RCU-preempt.patch @@ -1,6 +1,7 @@ -Subject: rcu: Merge RCU-bh into RCU-preempt -Date: Wed, 5 Oct 2011 11:59:38 -0700 +From d94c5d186590fe94eee1828d2ced173cb8442e85 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner +Date: Wed, 5 Oct 2011 11:59:38 -0700 +Subject: [PATCH 271/414] 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, @@ -22,20 +23,21 @@ Signed-off-by: Thomas Gleixner Signed-off-by: Paul E. McKenney Link: http://lkml.kernel.org/r/20111005185938.GA20403@linux.vnet.ibm.com Signed-off-by: Thomas Gleixner - --- - include/linux/rcupdate.h | 23 +++++++++++++++++++++++ - include/linux/rcutree.h | 8 ++++++++ - kernel/rcu/rcu.h | 14 +++++++++++--- - kernel/rcu/rcutorture.c | 7 +++++++ - kernel/rcu/tree.c | 24 ++++++++++++++++++++++++ - kernel/rcu/tree.h | 2 ++ - kernel/rcu/update.c | 2 ++ + include/linux/rcupdate.h | 23 +++++++++++++++++++++++ + include/linux/rcutree.h | 8 ++++++++ + kernel/rcu/rcu.h | 14 +++++++++++--- + kernel/rcu/rcutorture.c | 7 +++++++ + kernel/rcu/tree.c | 24 ++++++++++++++++++++++++ + kernel/rcu/tree.h | 2 ++ + kernel/rcu/update.c | 2 ++ 7 files changed, 77 insertions(+), 3 deletions(-) +diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h +index a2dc82b3118a..104fa2bdf127 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h -@@ -56,7 +56,11 @@ void call_rcu(struct rcu_head *head, rcu +@@ -56,7 +56,11 @@ void call_rcu(struct rcu_head *head, rcu_callback_t func); #define call_rcu call_rcu_sched #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ @@ -47,7 +49,7 @@ Signed-off-by: Thomas Gleixner void call_rcu_sched(struct rcu_head *head, rcu_callback_t func); void synchronize_sched(void); void rcu_barrier_tasks(void); -@@ -113,7 +117,11 @@ static inline int rcu_preempt_depth(void +@@ -113,7 +117,11 @@ static inline int rcu_preempt_depth(void) void rcu_init(void); extern int rcu_scheduler_active __read_mostly; void rcu_sched_qs(void); @@ -59,7 +61,7 @@ Signed-off-by: Thomas Gleixner void rcu_check_callbacks(int user); void rcu_report_dead(unsigned int cpu); void rcu_cpu_starting(unsigned int cpu); -@@ -263,7 +271,14 @@ extern struct lockdep_map rcu_sched_lock +@@ -263,7 +271,14 @@ extern struct lockdep_map rcu_sched_lock_map; extern struct lockdep_map rcu_callback_map; int debug_lockdep_rcu_enabled(void); int rcu_read_lock_held(void); @@ -89,7 +91,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -680,10 +699,14 @@ static inline void rcu_read_lock_bh(void +@@ -680,10 +699,14 @@ static inline void rcu_read_lock_bh(void) */ static inline void rcu_read_unlock_bh(void) { @@ -104,9 +106,11 @@ Signed-off-by: Thomas Gleixner local_bh_enable(); } +diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h +index 37d6fd3b7ff8..a082fde7d6bc 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h -@@ -44,7 +44,11 @@ static inline void rcu_virt_note_context +@@ -44,7 +44,11 @@ static inline void rcu_virt_note_context_switch(int cpu) rcu_note_context_switch(false); } @@ -118,7 +122,7 @@ Signed-off-by: Thomas Gleixner void synchronize_sched_expedited(void); void synchronize_rcu_expedited(void); -@@ -72,7 +76,11 @@ static inline void synchronize_rcu_bh_ex +@@ -72,7 +76,11 @@ static inline void synchronize_rcu_bh_expedited(void) } void rcu_barrier(void); @@ -130,9 +134,11 @@ Signed-off-by: Thomas Gleixner void rcu_barrier_sched(void); unsigned long get_state_synchronize_rcu(void); void cond_synchronize_rcu(unsigned long oldstate); +diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h +index e4b43fef89f5..0b056c30e9b1 100644 --- a/kernel/rcu/rcu.h +++ b/kernel/rcu/rcu.h -@@ -462,18 +462,26 @@ static inline void show_rcu_gp_kthreads( +@@ -462,18 +462,26 @@ static inline void show_rcu_gp_kthreads(void) { } extern unsigned long rcutorture_testseq; extern unsigned long rcutorture_vernum; unsigned long rcu_batches_started(void); @@ -162,9 +168,11 @@ Signed-off-by: Thomas Gleixner #endif /* #else #ifdef CONFIG_TINY_RCU */ #ifdef CONFIG_RCU_NOCB_CPU +diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c +index 45f2ffbc1e78..2e9dbb734d5a 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c -@@ -417,6 +417,7 @@ static struct rcu_torture_ops rcu_ops = +@@ -417,6 +417,7 @@ static struct rcu_torture_ops rcu_ops = { .name = "rcu" }; @@ -172,7 +180,7 @@ Signed-off-by: Thomas Gleixner /* * Definitions for rcu_bh torture testing. */ -@@ -456,6 +457,12 @@ static struct rcu_torture_ops rcu_bh_ops +@@ -456,6 +457,12 @@ static struct rcu_torture_ops rcu_bh_ops = { .name = "rcu_bh" }; @@ -185,6 +193,8 @@ Signed-off-by: Thomas Gleixner /* * Don't even think about trying any of these in real life!!! * The names includes "busted", and they really means it! +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index 3e3650e94ae6..b2367bc209cc 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -243,6 +243,7 @@ void rcu_sched_qs(void) @@ -203,7 +213,7 @@ Signed-off-by: Thomas Gleixner /* * Steal a bit from the bottom of ->dynticks for idle entry/exit -@@ -564,11 +566,13 @@ EXPORT_SYMBOL_GPL(rcu_batches_started_sc +@@ -564,11 +566,13 @@ EXPORT_SYMBOL_GPL(rcu_batches_started_sched); /* * Return the number of RCU BH batches started thus far for debug & stats. */ @@ -217,7 +227,7 @@ Signed-off-by: Thomas Gleixner /* * Return the number of RCU batches completed thus far for debug & stats. -@@ -588,6 +592,7 @@ unsigned long rcu_batches_completed_sche +@@ -588,6 +592,7 @@ unsigned long rcu_batches_completed_sched(void) } EXPORT_SYMBOL_GPL(rcu_batches_completed_sched); @@ -225,7 +235,7 @@ Signed-off-by: Thomas Gleixner /* * Return the number of RCU BH batches completed thus far for debug & stats. */ -@@ -596,6 +601,7 @@ unsigned long rcu_batches_completed_bh(v +@@ -596,6 +601,7 @@ unsigned long rcu_batches_completed_bh(void) return rcu_bh_state.completed; } EXPORT_SYMBOL_GPL(rcu_batches_completed_bh); @@ -233,7 +243,7 @@ Signed-off-by: Thomas Gleixner /* * Return the number of RCU expedited batches completed thus far for -@@ -619,6 +625,7 @@ unsigned long rcu_exp_batches_completed_ +@@ -619,6 +625,7 @@ unsigned long rcu_exp_batches_completed_sched(void) } EXPORT_SYMBOL_GPL(rcu_exp_batches_completed_sched); @@ -255,7 +265,7 @@ Signed-off-by: Thomas Gleixner /* * Force a quiescent state for RCU-sched. */ -@@ -687,9 +701,11 @@ void rcutorture_get_gp_data(enum rcutort +@@ -687,9 +701,11 @@ void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, case RCU_FLAVOR: rsp = rcu_state_p; break; @@ -267,7 +277,7 @@ Signed-off-by: Thomas Gleixner case RCU_SCHED_FLAVOR: rsp = &rcu_sched_state; break; -@@ -3113,6 +3129,7 @@ void call_rcu_sched(struct rcu_head *hea +@@ -3113,6 +3129,7 @@ void call_rcu_sched(struct rcu_head *head, rcu_callback_t func) } EXPORT_SYMBOL_GPL(call_rcu_sched); @@ -275,7 +285,7 @@ Signed-off-by: Thomas Gleixner /** * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period. * @head: structure to be used for queueing the RCU updates. -@@ -3140,6 +3157,7 @@ void call_rcu_bh(struct rcu_head *head, +@@ -3140,6 +3157,7 @@ void call_rcu_bh(struct rcu_head *head, rcu_callback_t func) __call_rcu(head, func, &rcu_bh_state, -1, 0); } EXPORT_SYMBOL_GPL(call_rcu_bh); @@ -299,7 +309,7 @@ Signed-off-by: Thomas Gleixner /** * get_state_synchronize_rcu - Snapshot current RCU state -@@ -3601,6 +3621,7 @@ static void _rcu_barrier(struct rcu_stat +@@ -3601,6 +3621,7 @@ static void _rcu_barrier(struct rcu_state *rsp) mutex_unlock(&rsp->barrier_mutex); } @@ -325,9 +335,11 @@ Signed-off-by: Thomas Gleixner rcu_init_one(&rcu_sched_state); if (dump_tree) rcu_dump_rcu_node_tree(&rcu_sched_state); +diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h +index 8e1f285f0a70..ac4296f85278 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h -@@ -427,7 +427,9 @@ extern struct list_head rcu_struct_flavo +@@ -427,7 +427,9 @@ extern struct list_head rcu_struct_flavors; */ extern struct rcu_state rcu_sched_state; @@ -337,6 +349,8 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_PREEMPT_RCU extern struct rcu_state rcu_preempt_state; +diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c +index 7a577bd989a4..c63c88a0de7e 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -333,6 +333,7 @@ int rcu_read_lock_held(void) @@ -355,3 +369,6 @@ Signed-off-by: Thomas Gleixner #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0272-patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch b/kernel/patches-4.14.x-rt/0272-0272-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0272-patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch rename to kernel/patches-4.14.x-rt/0272-0272-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch index f144e5c27..04d1f6739 100644 --- a/kernel/patches-4.14.x-rt/0272-patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch +++ b/kernel/patches-4.14.x-rt/0272-0272-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch @@ -1,6 +1,7 @@ -Subject: rcu: Make ksoftirqd do RCU quiescent states +From fc099edd130fe5260cdb0459c12d348eb38af28a Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Wed, 5 Oct 2011 11:45:18 -0700 +Subject: [PATCH 272/414] 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 @@ -21,16 +22,17 @@ in cases where __do_softirq() is invoked directly from ksoftirqd. Signed-off-by: Paul E. McKenney Link: http://lkml.kernel.org/r/20111005184518.GA21601@linux.vnet.ibm.com Signed-off-by: Thomas Gleixner - --- - include/linux/rcupdate.h | 4 ---- - kernel/rcu/tree.c | 9 ++++++++- - kernel/rcu/tree_plugin.h | 8 +++++++- + include/linux/rcupdate.h | 4 ---- + kernel/rcu/tree.c | 9 ++++++++- + kernel/rcu/tree_plugin.h | 8 +++++++- 3 files changed, 15 insertions(+), 6 deletions(-) +diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h +index 104fa2bdf127..70996e134818 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h -@@ -117,11 +117,7 @@ static inline int rcu_preempt_depth(void +@@ -117,11 +117,7 @@ static inline int rcu_preempt_depth(void) void rcu_init(void); extern int rcu_scheduler_active __read_mostly; void rcu_sched_qs(void); @@ -42,6 +44,8 @@ Signed-off-by: Thomas Gleixner void rcu_check_callbacks(int user); void rcu_report_dead(unsigned int cpu); void rcu_cpu_starting(unsigned int cpu); +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index b2367bc209cc..cc495f5273af 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -243,7 +243,14 @@ void rcu_sched_qs(void) @@ -60,6 +64,8 @@ Signed-off-by: Thomas Gleixner void rcu_bh_qs(void) { RCU_LOCKDEP_WARN(preemptible(), "rcu_bh_qs() invoked with preemption enabled!!!"); +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index 1789b7474b65..5d93d972d88e 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -29,6 +29,7 @@ @@ -70,7 +76,7 @@ Signed-off-by: Thomas Gleixner #include #include "../time/tick-internal.h" #include "../locking/rtmutex_common.h" -@@ -1299,7 +1300,7 @@ static void rcu_prepare_kthreads(int cpu +@@ -1299,7 +1300,7 @@ static void rcu_prepare_kthreads(int cpu) #endif /* #else #ifdef CONFIG_RCU_BOOST */ @@ -79,7 +85,7 @@ Signed-off-by: Thomas Gleixner /* * Check to see if any future RCU-related work will need to be done -@@ -1315,7 +1316,9 @@ int rcu_needs_cpu(u64 basemono, u64 *nex +@@ -1315,7 +1316,9 @@ int rcu_needs_cpu(u64 basemono, u64 *nextevt) *nextevt = KTIME_MAX; return rcu_cpu_has_callbacks(NULL); } @@ -89,7 +95,7 @@ Signed-off-by: Thomas Gleixner /* * Because we do not have RCU_FAST_NO_HZ, don't bother cleaning up * after it. -@@ -1411,6 +1414,8 @@ static bool __maybe_unused rcu_try_advan +@@ -1411,6 +1414,8 @@ static bool __maybe_unused rcu_try_advance_all_cbs(void) return cbs_ready; } @@ -98,7 +104,7 @@ Signed-off-by: Thomas Gleixner /* * 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 -@@ -1453,6 +1458,7 @@ int rcu_needs_cpu(u64 basemono, u64 *nex +@@ -1453,6 +1458,7 @@ int rcu_needs_cpu(u64 basemono, u64 *nextevt) *nextevt = basemono + dj * TICK_NSEC; return 0; } @@ -106,3 +112,6 @@ Signed-off-by: Thomas Gleixner /* * Prepare a CPU for idle from an RCU perspective. The first major task +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0273-rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch b/kernel/patches-4.14.x-rt/0273-0273-rcutree-rcu_bh_qs-Disable-irq-while-calling-rcu_pree.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0273-rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch rename to kernel/patches-4.14.x-rt/0273-0273-rcutree-rcu_bh_qs-Disable-irq-while-calling-rcu_pree.patch index a781890ab..5def722e4 100644 --- a/kernel/patches-4.14.x-rt/0273-rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch +++ b/kernel/patches-4.14.x-rt/0273-0273-rcutree-rcu_bh_qs-Disable-irq-while-calling-rcu_pree.patch @@ -1,6 +1,8 @@ +From 4ff7fc7a2f44365c7753570fe3b0b78f388c35e1 Mon Sep 17 00:00:00 2001 From: Tiejun Chen Date: Wed, 18 Dec 2013 17:51:49 +0800 -Subject: rcutree/rcu_bh_qs: Disable irq while calling rcu_preempt_qs() +Subject: [PATCH 273/414] rcutree/rcu_bh_qs: Disable irq while calling + rcu_preempt_qs() Any callers to the function rcu_preempt_qs() must disable irqs in order to protect the assignment to ->rcu_read_unlock_special. In @@ -28,9 +30,11 @@ Signed-off-by: Tiejun Chen Signed-off-by: Bin Jiang Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/tree.c | 5 +++++ + kernel/rcu/tree.c | 5 +++++ 1 file changed, 5 insertions(+) +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index cc495f5273af..55c56b1aece7 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -248,7 +248,12 @@ static void rcu_preempt_qs(void); @@ -46,3 +50,6 @@ Signed-off-by: Sebastian Andrzej Siewior } #else void rcu_bh_qs(void) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0274-drivers-tty-fix-omap-lock-crap.patch b/kernel/patches-4.14.x-rt/0274-0274-tty-serial-omap-Make-the-locking-RT-aware.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0274-drivers-tty-fix-omap-lock-crap.patch rename to kernel/patches-4.14.x-rt/0274-0274-tty-serial-omap-Make-the-locking-RT-aware.patch index e204ae10a..aa60a41bf 100644 --- a/kernel/patches-4.14.x-rt/0274-drivers-tty-fix-omap-lock-crap.patch +++ b/kernel/patches-4.14.x-rt/0274-0274-tty-serial-omap-Make-the-locking-RT-aware.patch @@ -1,6 +1,7 @@ -Subject: tty/serial/omap: Make the locking RT aware +From 943a26bad05db1c425c02de0fb0453bdac10f3ca Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 28 Jul 2011 13:32:57 +0200 +Subject: [PATCH 274/414] 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 @@ -8,12 +9,14 @@ non-RT. Signed-off-by: Thomas Gleixner --- - drivers/tty/serial/omap-serial.c | 12 ++++-------- + drivers/tty/serial/omap-serial.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) +diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c +index 26a22b100df1..69117e355bcd 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c -@@ -1311,13 +1311,10 @@ serial_omap_console_write(struct console +@@ -1311,13 +1311,10 @@ serial_omap_console_write(struct console *co, const char *s, pm_runtime_get_sync(up->dev); @@ -30,7 +33,7 @@ Signed-off-by: Thomas Gleixner /* * First save the IER then disable the interrupts -@@ -1346,8 +1343,7 @@ serial_omap_console_write(struct console +@@ -1346,8 +1343,7 @@ serial_omap_console_write(struct console *co, const char *s, pm_runtime_mark_last_busy(up->dev); pm_runtime_put_autosuspend(up->dev); if (locked) @@ -40,3 +43,6 @@ Signed-off-by: Thomas Gleixner } static int __init +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0275-drivers-tty-pl011-irq-disable-madness.patch b/kernel/patches-4.14.x-rt/0275-0275-tty-serial-pl011-Make-the-locking-work-on-RT.patch similarity index 67% rename from kernel/patches-4.14.x-rt/0275-drivers-tty-pl011-irq-disable-madness.patch rename to kernel/patches-4.14.x-rt/0275-0275-tty-serial-pl011-Make-the-locking-work-on-RT.patch index 7ee9fe704..6154308fc 100644 --- a/kernel/patches-4.14.x-rt/0275-drivers-tty-pl011-irq-disable-madness.patch +++ b/kernel/patches-4.14.x-rt/0275-0275-tty-serial-pl011-Make-the-locking-work-on-RT.patch @@ -1,18 +1,21 @@ -Subject: tty/serial/pl011: Make the locking work on RT +From 6dfaf3e1fd979b158e3e37dd835a3ebe0192077d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Tue, 08 Jan 2013 21:36:51 +0100 +Date: Tue, 8 Jan 2013 21:36:51 +0100 +Subject: [PATCH 275/414] 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. Signed-off-by: Thomas Gleixner --- - drivers/tty/serial/amba-pl011.c | 15 ++++++++++----- + drivers/tty/serial/amba-pl011.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) +diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c +index 111e6a950779..f5290e448783 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2220,13 +2220,19 @@ pl011_console_write(struct console *co, +@@ -2220,13 +2220,19 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) clk_enable(uap->clk); @@ -35,7 +38,7 @@ Signed-off-by: Thomas Gleixner /* * First save the CR then disable the interrupts -@@ -2252,8 +2258,7 @@ pl011_console_write(struct console *co, +@@ -2252,8 +2258,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) pl011_write(old_cr, uap, REG_CR); if (locked) @@ -45,3 +48,6 @@ Signed-off-by: Thomas Gleixner clk_disable(uap->clk); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0276-rt-serial-warn-fix.patch b/kernel/patches-4.14.x-rt/0276-0276-rt-Improve-the-serial-console-PASS_LIMIT.patch similarity index 63% rename from kernel/patches-4.14.x-rt/0276-rt-serial-warn-fix.patch rename to kernel/patches-4.14.x-rt/0276-0276-rt-Improve-the-serial-console-PASS_LIMIT.patch index da9b5306f..584fa92e9 100644 --- a/kernel/patches-4.14.x-rt/0276-rt-serial-warn-fix.patch +++ b/kernel/patches-4.14.x-rt/0276-0276-rt-Improve-the-serial-console-PASS_LIMIT.patch @@ -1,6 +1,10 @@ -Subject: rt: Improve the serial console PASS_LIMIT +From c28bb385bd040151b46b28e0beafef62dddcce9b Mon Sep 17 00:00:00 2001 From: Ingo Molnar -Date: Wed Dec 14 13:05:54 CET 2011 +Date: Wed, 14 Dec 2011 13:05:54 +0100 +Subject: [PATCH 276/414] rt: Improve the serial console PASS_LIMIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Beyond the warning: @@ -12,12 +16,14 @@ give it a chance to continue in some really ugly situation. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- - drivers/tty/serial/8250/8250_core.c | 11 ++++++++++- + drivers/tty/serial/8250/8250_core.c | 11 ++++++++++- 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 d29b512a7d9f..bc8cbb995b29 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c -@@ -58,7 +58,16 @@ static struct uart_driver serial8250_reg +@@ -58,7 +58,16 @@ static struct uart_driver serial8250_reg; static unsigned int skip_txen_test; /* force skip of txen test at init time */ @@ -35,3 +41,6 @@ Signed-off-by: Thomas Gleixner #include /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0277-tty-serial-8250-don-t-take-the-trylock-during-oops.patch b/kernel/patches-4.14.x-rt/0277-0277-tty-serial-8250-don-t-take-the-trylock-during-oops.patch similarity index 63% rename from kernel/patches-4.14.x-rt/0277-tty-serial-8250-don-t-take-the-trylock-during-oops.patch rename to kernel/patches-4.14.x-rt/0277-0277-tty-serial-8250-don-t-take-the-trylock-during-oops.patch index 4f3a2d283..fa54dd3f3 100644 --- a/kernel/patches-4.14.x-rt/0277-tty-serial-8250-don-t-take-the-trylock-during-oops.patch +++ b/kernel/patches-4.14.x-rt/0277-0277-tty-serial-8250-don-t-take-the-trylock-during-oops.patch @@ -1,6 +1,7 @@ +From 1009e99d6847e920efe02a042eeeaf7f949b976e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Apr 2016 16:55:02 +0200 -Subject: [PATCH] tty: serial: 8250: don't take the trylock during oops +Subject: [PATCH 277/414] 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 @@ -9,12 +10,14 @@ Therefore we skip the trylock in the oops case. Signed-off-by: Sebastian Andrzej Siewior --- - drivers/tty/serial/8250/8250_port.c | 4 +--- + drivers/tty/serial/8250/8250_port.c | 4 +--- 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 e32c51d549c3..5117bdf9b1ef 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -3224,10 +3224,8 @@ void serial8250_console_write(struct uar +@@ -3224,10 +3224,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, serial8250_rpm_get(up); @@ -26,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior else spin_lock_irqsave(&port->lock, flags); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0278-peterz-percpu-rwsem-rt.patch b/kernel/patches-4.14.x-rt/0278-0278-locking-percpu-rwsem-Remove-preempt_disable-variants.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0278-peterz-percpu-rwsem-rt.patch rename to kernel/patches-4.14.x-rt/0278-0278-locking-percpu-rwsem-Remove-preempt_disable-variants.patch index d01b42da6..1e32dc74f 100644 --- a/kernel/patches-4.14.x-rt/0278-peterz-percpu-rwsem-rt.patch +++ b/kernel/patches-4.14.x-rt/0278-0278-locking-percpu-rwsem-Remove-preempt_disable-variants.patch @@ -1,6 +1,7 @@ -Subject: locking/percpu-rwsem: Remove preempt_disable variants +From 426844bbaa0c1228f5bc4fd9bb1cfd435b50eca2 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra -Date: Wed Nov 23 16:29:32 CET 2016 +Date: Wed, 23 Nov 2016 16:29:32 +0100 +Subject: [PATCH 278/414] locking/percpu-rwsem: Remove preempt_disable variants Effective revert commit: @@ -11,14 +12,15 @@ performance issue for PREEMPT=y. Signed-off-by: Peter Zijlstra (Intel) --- ---- - fs/locks.c | 32 ++++++++++++++++---------------- - include/linux/percpu-rwsem.h | 24 ++++-------------------- + fs/locks.c | 32 ++++++++++++++++---------------- + include/linux/percpu-rwsem.h | 24 ++++-------------------- 2 files changed, 20 insertions(+), 36 deletions(-) +diff --git a/fs/locks.c b/fs/locks.c +index 1bd71c4d663a..fef5f1e29a4f 100644 --- a/fs/locks.c +++ b/fs/locks.c -@@ -945,7 +945,7 @@ static int flock_lock_inode(struct inode +@@ -945,7 +945,7 @@ static int flock_lock_inode(struct inode *inode, struct file_lock *request) return -ENOMEM; } @@ -27,7 +29,7 @@ Signed-off-by: Peter Zijlstra (Intel) spin_lock(&ctx->flc_lock); if (request->fl_flags & FL_ACCESS) goto find_conflict; -@@ -986,7 +986,7 @@ static int flock_lock_inode(struct inode +@@ -986,7 +986,7 @@ static int flock_lock_inode(struct inode *inode, struct file_lock *request) out: spin_unlock(&ctx->flc_lock); @@ -36,7 +38,7 @@ Signed-off-by: Peter Zijlstra (Intel) if (new_fl) locks_free_lock(new_fl); locks_dispose_list(&dispose); -@@ -1023,7 +1023,7 @@ static int posix_lock_inode(struct inode +@@ -1023,7 +1023,7 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request, new_fl2 = locks_alloc_lock(); } @@ -45,7 +47,7 @@ Signed-off-by: Peter Zijlstra (Intel) spin_lock(&ctx->flc_lock); /* * New lock request. Walk all POSIX locks and look for conflicts. If -@@ -1195,7 +1195,7 @@ static int posix_lock_inode(struct inode +@@ -1195,7 +1195,7 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request, } out: spin_unlock(&ctx->flc_lock); @@ -54,7 +56,7 @@ Signed-off-by: Peter Zijlstra (Intel) /* * Free any unused locks. */ -@@ -1470,7 +1470,7 @@ int __break_lease(struct inode *inode, u +@@ -1470,7 +1470,7 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) return error; } @@ -63,7 +65,7 @@ Signed-off-by: Peter Zijlstra (Intel) spin_lock(&ctx->flc_lock); time_out_leases(inode, &dispose); -@@ -1522,13 +1522,13 @@ int __break_lease(struct inode *inode, u +@@ -1522,13 +1522,13 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) locks_insert_block(fl, new_fl); trace_break_lease_block(inode, new_fl); spin_unlock(&ctx->flc_lock); @@ -79,7 +81,7 @@ Signed-off-by: Peter Zijlstra (Intel) spin_lock(&ctx->flc_lock); trace_break_lease_unblock(inode, new_fl); locks_delete_block(new_fl); -@@ -1545,7 +1545,7 @@ int __break_lease(struct inode *inode, u +@@ -1545,7 +1545,7 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) } out: spin_unlock(&ctx->flc_lock); @@ -106,7 +108,7 @@ Signed-off-by: Peter Zijlstra (Intel) locks_dispose_list(&dispose); } -@@ -1704,7 +1704,7 @@ generic_add_lease(struct file *filp, lon +@@ -1704,7 +1704,7 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr return -EINVAL; } @@ -115,7 +117,7 @@ Signed-off-by: Peter Zijlstra (Intel) spin_lock(&ctx->flc_lock); time_out_leases(inode, &dispose); error = check_conflicting_open(dentry, arg, lease->fl_flags); -@@ -1775,7 +1775,7 @@ generic_add_lease(struct file *filp, lon +@@ -1775,7 +1775,7 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr lease->fl_lmops->lm_setup(lease, priv); out: spin_unlock(&ctx->flc_lock); @@ -124,7 +126,7 @@ Signed-off-by: Peter Zijlstra (Intel) locks_dispose_list(&dispose); if (is_deleg) inode_unlock(inode); -@@ -1798,7 +1798,7 @@ static int generic_delete_lease(struct f +@@ -1798,7 +1798,7 @@ static int generic_delete_lease(struct file *filp, void *owner) return error; } @@ -133,7 +135,7 @@ Signed-off-by: Peter Zijlstra (Intel) spin_lock(&ctx->flc_lock); list_for_each_entry(fl, &ctx->flc_lease, fl_list) { if (fl->fl_file == filp && -@@ -1811,7 +1811,7 @@ static int generic_delete_lease(struct f +@@ -1811,7 +1811,7 @@ static int generic_delete_lease(struct file *filp, void *owner) if (victim) error = fl->fl_lmops->lm_change(victim, F_UNLCK, &dispose); spin_unlock(&ctx->flc_lock); @@ -142,7 +144,7 @@ Signed-off-by: Peter Zijlstra (Intel) locks_dispose_list(&dispose); return error; } -@@ -2535,13 +2535,13 @@ locks_remove_lease(struct file *filp, st +@@ -2535,13 +2535,13 @@ locks_remove_lease(struct file *filp, struct file_lock_context *ctx) if (list_empty(&ctx->flc_lease)) return; @@ -158,9 +160,11 @@ Signed-off-by: Peter Zijlstra (Intel) locks_dispose_list(&dispose); } +diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h +index b1f37a89e368..cd61863d2cb9 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h -@@ -29,7 +29,7 @@ static struct percpu_rw_semaphore name = +@@ -29,7 +29,7 @@ static struct percpu_rw_semaphore name = { \ extern int __percpu_down_read(struct percpu_rw_semaphore *, int); extern void __percpu_up_read(struct percpu_rw_semaphore *); @@ -169,7 +173,7 @@ Signed-off-by: Peter Zijlstra (Intel) { might_sleep(); -@@ -47,16 +47,10 @@ static inline void percpu_down_read_pree +@@ -47,16 +47,10 @@ static inline void percpu_down_read_preempt_disable(struct percpu_rw_semaphore * __this_cpu_inc(*sem->read_count); if (unlikely(!rcu_sync_is_idle(&sem->rss))) __percpu_down_read(sem, false); /* Unconditional memory barrier */ @@ -187,7 +191,7 @@ Signed-off-by: Peter Zijlstra (Intel) preempt_enable(); } -@@ -83,13 +77,9 @@ static inline int percpu_down_read_trylo +@@ -83,13 +77,9 @@ static inline int percpu_down_read_trylock(struct percpu_rw_semaphore *sem) return ret; } @@ -203,7 +207,7 @@ Signed-off-by: Peter Zijlstra (Intel) /* * Same as in percpu_down_read(). */ -@@ -102,12 +92,6 @@ static inline void percpu_up_read_preemp +@@ -102,12 +92,6 @@ static inline void percpu_up_read_preempt_enable(struct percpu_rw_semaphore *sem rwsem_release(&sem->rw_sem.dep_map, 1, _RET_IP_); } @@ -216,3 +220,6 @@ Signed-off-by: Peter Zijlstra (Intel) extern void percpu_down_write(struct percpu_rw_semaphore *); extern void percpu_up_write(struct percpu_rw_semaphore *); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0279-fs-namespace-preemption-fix.patch b/kernel/patches-4.14.x-rt/0279-0279-fs-namespace-preemption-fix.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0279-fs-namespace-preemption-fix.patch rename to kernel/patches-4.14.x-rt/0279-0279-fs-namespace-preemption-fix.patch index 405111933..c13380f5e 100644 --- a/kernel/patches-4.14.x-rt/0279-fs-namespace-preemption-fix.patch +++ b/kernel/patches-4.14.x-rt/0279-0279-fs-namespace-preemption-fix.patch @@ -1,6 +1,7 @@ +From 5d20c7dd73c9d5dbba939708df619b139fe55f7f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 19 Jul 2009 08:44:27 -0500 -Subject: fs: namespace preemption fix +Subject: [PATCH 279/414] fs: namespace preemption fix On RT we cannot loop with preemption disabled here as mnt_make_readonly() might have been preempted. We can safely enable @@ -8,11 +9,12 @@ preemption while waiting for MNT_WRITE_HOLD to be cleared. Safe on !RT as well. Signed-off-by: Thomas Gleixner - --- - fs/namespace.c | 5 ++++- + fs/namespace.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/fs/namespace.c b/fs/namespace.c +index 62b17aff1908..b9cd42b9b2c9 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -353,8 +353,11 @@ int __mnt_want_write(struct vfsmount *m) @@ -28,3 +30,6 @@ Signed-off-by: Thomas Gleixner /* * 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.17.0 + diff --git a/kernel/patches-4.14.x-rt/0280-mm-protect-activate-switch-mm.patch b/kernel/patches-4.14.x-rt/0280-0280-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0280-mm-protect-activate-switch-mm.patch rename to kernel/patches-4.14.x-rt/0280-0280-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch index 16cc40ca0..2dc4cbbd3 100644 --- a/kernel/patches-4.14.x-rt/0280-mm-protect-activate-switch-mm.patch +++ b/kernel/patches-4.14.x-rt/0280-0280-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch @@ -1,6 +1,8 @@ +From 31408e871a9cab07d1e9f792fd9fa4f721e538ab Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Tue, 15 May 2012 13:53:56 +0800 -Subject: mm: Protect activate_mm() by preempt_[disable&enable]_rt() +Subject: [PATCH 280/414] mm: Protect activate_mm() by + preempt_[disable&enable]_rt() User preempt_*_rt instead of local_irq_*_rt or otherwise there will be warning on ARM like below: @@ -30,13 +32,15 @@ Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1337061236-1766-1-git-send-email-yong.zhang0@gmail.com Signed-off-by: Thomas Gleixner --- - fs/exec.c | 2 ++ - mm/mmu_context.c | 2 ++ + fs/exec.c | 2 ++ + mm/mmu_context.c | 2 ++ 2 files changed, 4 insertions(+) +diff --git a/fs/exec.c b/fs/exec.c +index 0da4d748b4e6..609aee4dbfa9 100644 --- a/fs/exec.c +++ b/fs/exec.c -@@ -1024,12 +1024,14 @@ static int exec_mmap(struct mm_struct *m +@@ -1024,12 +1024,14 @@ static int exec_mmap(struct mm_struct *mm) } } task_lock(tsk); @@ -51,6 +55,8 @@ Signed-off-by: Thomas Gleixner task_unlock(tsk); if (old_mm) { up_read(&old_mm->mmap_sem); +diff --git a/mm/mmu_context.c b/mm/mmu_context.c +index 3e612ae748e9..d0ccc070979f 100644 --- a/mm/mmu_context.c +++ b/mm/mmu_context.c @@ -25,6 +25,7 @@ void use_mm(struct mm_struct *mm) @@ -69,3 +75,6 @@ Signed-off-by: Thomas Gleixner task_unlock(tsk); #ifdef finish_arch_post_lock_switch finish_arch_post_lock_switch(); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0281-fs-block-rt-support.patch b/kernel/patches-4.14.x-rt/0281-0281-block-Turn-off-warning-which-is-bogus-on-RT.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0281-fs-block-rt-support.patch rename to kernel/patches-4.14.x-rt/0281-0281-block-Turn-off-warning-which-is-bogus-on-RT.patch index 78f9980d4..5a9aa4012 100644 --- a/kernel/patches-4.14.x-rt/0281-fs-block-rt-support.patch +++ b/kernel/patches-4.14.x-rt/0281-0281-block-Turn-off-warning-which-is-bogus-on-RT.patch @@ -1,14 +1,17 @@ -Subject: block: Turn off warning which is bogus on RT +From b77c6d43af8b9bb970fa1182c92aa1bc5d547841 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 14 Jun 2011 17:05:09 +0200 +Subject: [PATCH 281/414] block: Turn off warning which is bogus on RT On -RT the context is always with IRQs enabled. Ignore this warning on -RT. Signed-off-by: Thomas Gleixner --- - block/blk-core.c | 2 +- + block/blk-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/block/blk-core.c b/block/blk-core.c +index b4dd598666b9..0b7308bce7e7 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -280,7 +280,7 @@ EXPORT_SYMBOL(blk_start_queue_async); @@ -20,3 +23,6 @@ Signed-off-by: Thomas Gleixner WARN_ON_ONCE(q->mq_ops); queue_flag_clear(QUEUE_FLAG_STOPPED, q); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0282-fs-ntfs-disable-interrupt-non-rt.patch b/kernel/patches-4.14.x-rt/0282-0282-fs-ntfs-disable-interrupt-only-on-RT.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0282-fs-ntfs-disable-interrupt-non-rt.patch rename to kernel/patches-4.14.x-rt/0282-0282-fs-ntfs-disable-interrupt-only-on-RT.patch index 0363487b0..115f8a280 100644 --- a/kernel/patches-4.14.x-rt/0282-fs-ntfs-disable-interrupt-non-rt.patch +++ b/kernel/patches-4.14.x-rt/0282-0282-fs-ntfs-disable-interrupt-only-on-RT.patch @@ -1,6 +1,7 @@ +From 653bc43dc4c68e0c57dd6f8304f33c466f080836 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Fri, 3 Jul 2009 08:44:12 -0500 -Subject: fs: ntfs: disable interrupt only on !RT +Subject: [PATCH 282/414] fs: ntfs: disable interrupt only on !RT On Sat, 2007-10-27 at 11:44 +0200, Ingo Molnar wrote: > * Nick Piggin wrote: @@ -34,14 +35,15 @@ instead? Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner - --- - fs/ntfs/aops.c | 8 ++++---- + fs/ntfs/aops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c +index e11411997769..a982d7c3ad91 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c -@@ -93,13 +93,13 @@ static void ntfs_end_buffer_async_read(s +@@ -93,13 +93,13 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) ofs = 0; if (file_ofs < init_size) ofs = init_size - file_ofs; @@ -57,7 +59,7 @@ Signed-off-by: Thomas Gleixner } } else { clear_buffer_uptodate(bh); -@@ -144,13 +144,13 @@ static void ntfs_end_buffer_async_read(s +@@ -144,13 +144,13 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) recs = PAGE_SIZE / rec_size; /* Should have been verified before we got here... */ BUG_ON(!recs); @@ -73,3 +75,6 @@ Signed-off-by: Thomas Gleixner flush_dcache_page(page); if (likely(page_uptodate && !PageError(page))) SetPageUptodate(page); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0283-fs-jbd2-pull-your-plug-when-waiting-for-space.patch b/kernel/patches-4.14.x-rt/0283-0283-fs-jbd2-pull-your-plug-when-waiting-for-space.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0283-fs-jbd2-pull-your-plug-when-waiting-for-space.patch rename to kernel/patches-4.14.x-rt/0283-0283-fs-jbd2-pull-your-plug-when-waiting-for-space.patch index 600ade5dd..d8a0620fc 100644 --- a/kernel/patches-4.14.x-rt/0283-fs-jbd2-pull-your-plug-when-waiting-for-space.patch +++ b/kernel/patches-4.14.x-rt/0283-0283-fs-jbd2-pull-your-plug-when-waiting-for-space.patch @@ -1,6 +1,7 @@ +From b0c90c02e2089bae0efd84f73e91a77974d03eff Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 17 Feb 2014 17:30:03 +0100 -Subject: fs: jbd2: pull your plug when waiting for space +Subject: [PATCH 283/414] fs: jbd2: pull your plug when waiting for space Two cps in parallel managed to stall the the ext4 fs. It seems that journal code is either waiting for locks or sleeping waiting for @@ -15,12 +16,14 @@ here is his description: Signed-off-by: Sebastian Andrzej Siewior --- - fs/jbd2/checkpoint.c | 2 ++ + fs/jbd2/checkpoint.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c +index 4055f51617ef..bba2e5e6e917 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c -@@ -116,6 +116,8 @@ void __jbd2_log_wait_for_space(journal_t +@@ -116,6 +116,8 @@ void __jbd2_log_wait_for_space(journal_t *journal) nblocks = jbd2_space_needed(journal); while (jbd2_log_space_left(journal) < nblocks) { write_unlock(&journal->j_state_lock); @@ -29,3 +32,6 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_lock(&journal->j_checkpoint_mutex); /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0284-Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch b/kernel/patches-4.14.x-rt/0284-0284-Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0284-Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch rename to kernel/patches-4.14.x-rt/0284-0284-Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch index 967c9fcb5..1efbf7d1f 100644 --- a/kernel/patches-4.14.x-rt/0284-Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch +++ b/kernel/patches-4.14.x-rt/0284-0284-Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch @@ -1,6 +1,8 @@ +From 9aa6e7941c453162c95598c898bdb50029e5d613 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 23 Nov 2017 17:51:51 +0100 -Subject: [PATCH] Revert "fs: jbd2: pull your plug when waiting for space" +Subject: [PATCH 284/414] Revert "fs: jbd2: pull your plug when waiting for + space" This reverts commit "fs: jbd2: pull your plug when waiting for space". This was a duct-tape fix which shouldn't be needed since commit @@ -9,12 +11,14 @@ This was a duct-tape fix which shouldn't be needed since commit Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - fs/jbd2/checkpoint.c | 2 -- + fs/jbd2/checkpoint.c | 2 -- 1 file changed, 2 deletions(-) +diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c +index bba2e5e6e917..4055f51617ef 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c -@@ -116,8 +116,6 @@ void __jbd2_log_wait_for_space(journal_t +@@ -116,8 +116,6 @@ void __jbd2_log_wait_for_space(journal_t *journal) nblocks = jbd2_space_needed(journal); while (jbd2_log_space_left(journal) < nblocks) { write_unlock(&journal->j_state_lock); @@ -23,3 +27,6 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_lock(&journal->j_checkpoint_mutex); /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0285-fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch b/kernel/patches-4.14.x-rt/0285-0285-fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0285-fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch rename to kernel/patches-4.14.x-rt/0285-0285-fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch index 7b7374050..369664304 100644 --- a/kernel/patches-4.14.x-rt/0285-fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch +++ b/kernel/patches-4.14.x-rt/0285-0285-fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch @@ -1,6 +1,8 @@ +From 1081cdfbed7a465e58fab659fbff84d15c2d1cbd Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 12:32:34 +0200 -Subject: [PATCH] fs/dcache: bringt back explicit INIT_HLIST_BL_HEAD init +Subject: [PATCH 285/414] fs/dcache: bringt back explicit INIT_HLIST_BL_HEAD + init Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed INIT_HLIST_BL_HEAD and uses the ZERO flag instead for the init. However @@ -9,12 +11,14 @@ that. Signed-off-by: Sebastian Andrzej Siewior --- - fs/dcache.c | 10 ++++++++++ + fs/dcache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) +diff --git a/fs/dcache.c b/fs/dcache.c +index c28b9c91b5cb..fa65b2a6776a 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -3590,6 +3590,8 @@ static int __init set_dhash_entries(char +@@ -3590,6 +3590,8 @@ __setup("dhash_entries=", set_dhash_entries); static void __init dcache_init_early(void) { @@ -23,7 +27,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* If hashes are distributed across NUMA nodes, defer * hash allocation until vmalloc space is available. */ -@@ -3606,10 +3608,14 @@ static void __init dcache_init_early(voi +@@ -3606,10 +3608,14 @@ static void __init dcache_init_early(void) &d_hash_mask, 0, 0); @@ -49,3 +53,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /* SLAB cache for __getname() consumers */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0286-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/kernel/patches-4.14.x-rt/0286-0286-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0286-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch rename to kernel/patches-4.14.x-rt/0286-0286-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index a8cd1f6f0..162110de7 100644 --- a/kernel/patches-4.14.x-rt/0286-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/kernel/patches-4.14.x-rt/0286-0286-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,6 +1,8 @@ +From 3325a8b430181d98e1f38702d5dfaf3c4a04a609 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 20 Oct 2017 11:29:53 +0200 -Subject: [PATCH] fs/dcache: disable preemption on i_dir_seq's write side +Subject: [PATCH 286/414] 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 could have two writers in parallel despite the fact that the d_lock is @@ -15,12 +17,14 @@ Cc: stable-rt@vger.kernel.org Reported-by: Oleg.Karfich@wago.com Signed-off-by: Sebastian Andrzej Siewior --- - fs/dcache.c | 12 +++++++----- - fs/inode.c | 2 +- - fs/libfs.c | 6 ++++-- - include/linux/fs.h | 2 +- + fs/dcache.c | 12 +++++++----- + fs/inode.c | 2 +- + fs/libfs.c | 6 ++++-- + include/linux/fs.h | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) +diff --git a/fs/dcache.c b/fs/dcache.c +index fa65b2a6776a..39ba05ff22aa 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2417,9 +2417,10 @@ EXPORT_SYMBOL(d_rehash); @@ -36,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior return n; cpu_relax(); } -@@ -2427,7 +2428,8 @@ static inline unsigned start_dir_add(str +@@ -2427,7 +2428,8 @@ static inline unsigned start_dir_add(struct inode *dir) static inline void end_dir_add(struct inode *dir, unsigned n) { @@ -46,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void d_wait_lookup(struct dentry *dentry) -@@ -2460,7 +2462,7 @@ struct dentry *d_alloc_parallel(struct d +@@ -2460,7 +2462,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, retry: rcu_read_lock(); @@ -55,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior r_seq = read_seqbegin(&rename_lock); dentry = __d_lookup_rcu(parent, name, &d_seq); if (unlikely(dentry)) { -@@ -2482,7 +2484,7 @@ struct dentry *d_alloc_parallel(struct d +@@ -2482,7 +2484,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, goto retry; } hlist_bl_lock(b); @@ -64,9 +68,11 @@ Signed-off-by: Sebastian Andrzej Siewior hlist_bl_unlock(b); rcu_read_unlock(); goto retry; +diff --git a/fs/inode.c b/fs/inode.c +index d1e35b53bb23..f3cb2638e258 100644 --- a/fs/inode.c +++ b/fs/inode.c -@@ -154,7 +154,7 @@ int inode_init_always(struct super_block +@@ -154,7 +154,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_bdev = NULL; inode->i_cdev = NULL; inode->i_link = NULL; @@ -75,9 +81,11 @@ Signed-off-by: Sebastian Andrzej Siewior inode->i_rdev = 0; inode->dirtied_when = 0; +diff --git a/fs/libfs.c b/fs/libfs.c +index 3aabe553fc45..b5d63bf1ad8e 100644 --- a/fs/libfs.c +++ b/fs/libfs.c -@@ -90,7 +90,7 @@ static struct dentry *next_positive(stru +@@ -90,7 +90,7 @@ static struct dentry *next_positive(struct dentry *parent, struct list_head *from, int count) { @@ -86,7 +94,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct dentry *res; struct list_head *p; bool skipped; -@@ -123,8 +123,9 @@ static struct dentry *next_positive(stru +@@ -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; @@ -97,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior for (;;) { n = *seq; if (!(n & 1) && cmpxchg(seq, n, n + 1) == n) -@@ -137,6 +138,7 @@ static void move_cursor(struct dentry *c +@@ -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); @@ -105,6 +113,8 @@ Signed-off-by: Sebastian Andrzej Siewior spin_unlock(&parent->d_lock); } +diff --git a/include/linux/fs.h b/include/linux/fs.h +index cc613f20e5a6..b806e2116f5c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -655,7 +655,7 @@ struct inode { @@ -116,3 +126,6 @@ Signed-off-by: Sebastian Andrzej Siewior }; __u32 i_generation; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0287-x86-mce-timer-hrtimer.patch b/kernel/patches-4.14.x-rt/0287-0287-x86-Convert-mce-timer-to-hrtimer.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0287-x86-mce-timer-hrtimer.patch rename to kernel/patches-4.14.x-rt/0287-0287-x86-Convert-mce-timer-to-hrtimer.patch index 5332d9c92..25f827a05 100644 --- a/kernel/patches-4.14.x-rt/0287-x86-mce-timer-hrtimer.patch +++ b/kernel/patches-4.14.x-rt/0287-0287-x86-Convert-mce-timer-to-hrtimer.patch @@ -1,6 +1,7 @@ +From 179ba6984f5c701eab592a6c832d687fe17da639 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 13 Dec 2010 16:33:39 +0100 -Subject: x86: Convert mce timer to hrtimer +Subject: [PATCH 287/414] x86: Convert mce timer to hrtimer mce_timer is started in atomic contexts of cpu bringup. This results in might_sleep() warnings on RT. Convert mce_timer to a hrtimer to @@ -21,9 +22,11 @@ fold in: |[bigeasy: use ULL instead of u64 cast] |Signed-off-by: Sebastian Andrzej Siewior --- - arch/x86/kernel/cpu/mcheck/mce.c | 54 ++++++++++++++++++--------------------- + arch/x86/kernel/cpu/mcheck/mce.c | 54 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 28 deletions(-) +diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c +index 28d27de08545..85ceb6a035b4 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -42,6 +42,7 @@ @@ -34,7 +37,7 @@ fold in: #include #include -@@ -1353,7 +1354,7 @@ int memory_failure(unsigned long pfn, in +@@ -1353,7 +1354,7 @@ int memory_failure(unsigned long pfn, int vector, int flags) static unsigned long check_interval = INITIAL_CHECK_INTERVAL; static DEFINE_PER_CPU(unsigned long, mce_next_interval); /* in jiffies */ @@ -43,7 +46,7 @@ fold in: static unsigned long mce_adjust_timer_default(unsigned long interval) { -@@ -1362,27 +1363,19 @@ static unsigned long mce_adjust_timer_de +@@ -1362,27 +1363,19 @@ static unsigned long mce_adjust_timer_default(unsigned long interval) static unsigned long (*mce_adjust_timer)(unsigned long interval) = mce_adjust_timer_default; @@ -77,7 +80,7 @@ fold in: iv = __this_cpu_read(mce_next_interval); if (mce_available(this_cpu_ptr(&cpu_info))) { -@@ -1405,7 +1398,11 @@ static void mce_timer_fn(unsigned long d +@@ -1405,7 +1398,11 @@ static void mce_timer_fn(unsigned long data) done: __this_cpu_write(mce_next_interval, iv); @@ -90,7 +93,7 @@ fold in: } /* -@@ -1413,7 +1410,7 @@ static void mce_timer_fn(unsigned long d +@@ -1413,7 +1410,7 @@ static void mce_timer_fn(unsigned long data) */ void mce_timer_kick(unsigned long interval) { @@ -108,7 +111,7 @@ fold in: } /* -@@ -1757,7 +1754,7 @@ static void __mcheck_cpu_clear_vendor(st +@@ -1757,7 +1754,7 @@ static void __mcheck_cpu_clear_vendor(struct cpuinfo_x86 *c) } } @@ -117,7 +120,7 @@ fold in: { unsigned long iv = check_interval * HZ; -@@ -1770,18 +1767,19 @@ static void mce_start_timer(struct timer +@@ -1770,18 +1767,19 @@ static void mce_start_timer(struct timer_list *t) static void __mcheck_cpu_setup_timer(void) { @@ -143,7 +146,7 @@ fold in: mce_start_timer(t); } -@@ -2300,7 +2298,7 @@ static int mce_cpu_dead(unsigned int cpu +@@ -2300,7 +2298,7 @@ static int mce_cpu_dead(unsigned int cpu) static int mce_cpu_online(unsigned int cpu) { @@ -152,7 +155,7 @@ fold in: int ret; mce_device_create(cpu); -@@ -2317,10 +2315,10 @@ static int mce_cpu_online(unsigned int c +@@ -2317,10 +2315,10 @@ static int mce_cpu_online(unsigned int cpu) static int mce_cpu_pre_down(unsigned int cpu) { @@ -165,3 +168,6 @@ fold in: mce_threshold_remove_device(cpu); mce_device_remove(cpu); return 0; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0288-x86-mce-use-swait-queue-for-mce-wakeups.patch b/kernel/patches-4.14.x-rt/0288-0288-x86-mce-use-swait-queue-for-mce-wakeups.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0288-x86-mce-use-swait-queue-for-mce-wakeups.patch rename to kernel/patches-4.14.x-rt/0288-0288-x86-mce-use-swait-queue-for-mce-wakeups.patch index 14962b438..a92fa3a58 100644 --- a/kernel/patches-4.14.x-rt/0288-x86-mce-use-swait-queue-for-mce-wakeups.patch +++ b/kernel/patches-4.14.x-rt/0288-0288-x86-mce-use-swait-queue-for-mce-wakeups.patch @@ -1,6 +1,7 @@ -Subject: x86/mce: use swait queue for mce wakeups +From 84fabe5dfcb6c7578692c91fda2d1765f53e168d Mon Sep 17 00:00:00 2001 From: Steven Rostedt -Date: Fri, 27 Feb 2015 15:20:37 +0100 +Date: Fri, 27 Feb 2015 15:20:37 +0100 +Subject: [PATCH 288/414] x86/mce: use swait queue for mce wakeups We had a customer report a lockup on a 3.0-rt kernel that had the following backtrace: @@ -55,9 +56,11 @@ Signed-off-by: Sebastian Andrzej Siewior [wagi: use work-simple framework to defer work to a kthread] Signed-off-by: Daniel Wagner --- - arch/x86/kernel/cpu/mcheck/dev-mcelog.c | 37 +++++++++++++++++++++++++++++--- + arch/x86/kernel/cpu/mcheck/dev-mcelog.c | 37 +++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) +diff --git a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c +index 7f85b76f43bc..9e74b805070f 100644 --- a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c +++ b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c @@ -14,6 +14,7 @@ @@ -68,7 +71,7 @@ Signed-off-by: Daniel Wagner #include "mce-internal.h" -@@ -86,13 +87,43 @@ static void mce_do_trigger(struct work_s +@@ -86,13 +87,43 @@ static void mce_do_trigger(struct work_struct *work) static DECLARE_WORK(mce_trigger_work, mce_do_trigger); @@ -114,7 +117,7 @@ Signed-off-by: Daniel Wagner static ssize_t show_trigger(struct device *s, struct device_attribute *attr, char *buf) { -@@ -356,7 +387,7 @@ static __init int dev_mcelog_init_device +@@ -356,7 +387,7 @@ static __init int dev_mcelog_init_device(void) return err; } @@ -123,3 +126,6 @@ Signed-off-by: Daniel Wagner mce_register_decode_chain(&dev_mcelog_nb); return 0; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0289-x86-stackprot-no-random-on-rt.patch b/kernel/patches-4.14.x-rt/0289-0289-x86-stackprotector-Avoid-random-pool-on-rt.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0289-x86-stackprot-no-random-on-rt.patch rename to kernel/patches-4.14.x-rt/0289-0289-x86-stackprotector-Avoid-random-pool-on-rt.patch index 66c2ecf59..dbebfb779 100644 --- a/kernel/patches-4.14.x-rt/0289-x86-stackprot-no-random-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0289-0289-x86-stackprotector-Avoid-random-pool-on-rt.patch @@ -1,6 +1,7 @@ +From deaba519af851c42da129408a78aac9269aecf99 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 16 Dec 2010 14:25:18 +0100 -Subject: x86: stackprotector: Avoid random pool on rt +Subject: [PATCH 289/414] 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 @@ -12,11 +13,12 @@ entropy and we rely on the TSC randomnness. Reported-by: Carsten Emde Signed-off-by: Thomas Gleixner - --- - arch/x86/include/asm/stackprotector.h | 8 +++++++- + arch/x86/include/asm/stackprotector.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) +diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h +index 371b3a4af000..06613a805b25 100644 --- a/arch/x86/include/asm/stackprotector.h +++ b/arch/x86/include/asm/stackprotector.h @@ -60,7 +60,7 @@ @@ -28,7 +30,7 @@ Signed-off-by: Thomas Gleixner u64 tsc; #ifdef CONFIG_X86_64 -@@ -71,8 +71,14 @@ static __always_inline void boot_init_st +@@ -71,8 +71,14 @@ static __always_inline void boot_init_stack_canary(void) * of randomness. The TSC only matters for very early init, * there it already has some randomness on most systems. Later * on during the bootup the random pool has true entropy too. @@ -43,3 +45,6 @@ Signed-off-by: Thomas Gleixner tsc = rdtsc(); canary += tsc + (tsc << 32UL); canary &= CANARY_MASK; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0290-x86-use-gen-rwsem-spinlocks-rt.patch b/kernel/patches-4.14.x-rt/0290-0290-x86-Use-generic-rwsem_spinlocks-on-rt.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0290-x86-use-gen-rwsem-spinlocks-rt.patch rename to kernel/patches-4.14.x-rt/0290-0290-x86-Use-generic-rwsem_spinlocks-on-rt.patch index 06a17285b..5e49b2e49 100644 --- a/kernel/patches-4.14.x-rt/0290-x86-use-gen-rwsem-spinlocks-rt.patch +++ b/kernel/patches-4.14.x-rt/0290-0290-x86-Use-generic-rwsem_spinlocks-on-rt.patch @@ -1,16 +1,18 @@ +From ad90d00bff6b11c605d489d652337cf0ca166007 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 26 Jul 2009 02:21:32 +0200 -Subject: x86: Use generic rwsem_spinlocks on -rt +Subject: [PATCH 290/414] x86: Use generic rwsem_spinlocks on -rt Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt. Signed-off-by: Thomas Gleixner - --- - arch/x86/Kconfig | 5 ++++- + arch/x86/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index 7483cd514c32..310df1ea0d68 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -255,8 +255,11 @@ config ARCH_MAY_HAVE_PC_FDC @@ -26,3 +28,6 @@ Signed-off-by: Thomas Gleixner config GENERIC_CALIBRATE_DELAY def_bool y +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0291-x86-UV-raw_spinlock-conversion.patch b/kernel/patches-4.14.x-rt/0291-0291-x86-UV-raw_spinlock-conversion.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0291-x86-UV-raw_spinlock-conversion.patch rename to kernel/patches-4.14.x-rt/0291-0291-x86-UV-raw_spinlock-conversion.patch index 33a21cb8f..8ca80c6a2 100644 --- a/kernel/patches-4.14.x-rt/0291-x86-UV-raw_spinlock-conversion.patch +++ b/kernel/patches-4.14.x-rt/0291-0291-x86-UV-raw_spinlock-conversion.patch @@ -1,6 +1,7 @@ +From 643de3b90808014aebd9911fac5d78802e6e5070 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 2 Nov 2014 08:31:37 +0100 -Subject: x86: UV: raw_spinlock conversion +Subject: [PATCH 291/414] x86: UV: raw_spinlock conversion Shrug. Lots of hobbyists have a beast in their basement, right? @@ -8,11 +9,13 @@ Shrug. Lots of hobbyists have a beast in their basement, right? Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - arch/x86/include/asm/uv/uv_bau.h | 14 +++++++------- - arch/x86/platform/uv/tlb_uv.c | 26 +++++++++++++------------- - arch/x86/platform/uv/uv_time.c | 20 ++++++++++++-------- + arch/x86/include/asm/uv/uv_bau.h | 14 +++++++------- + arch/x86/platform/uv/tlb_uv.c | 26 +++++++++++++------------- + arch/x86/platform/uv/uv_time.c | 20 ++++++++++++-------- 3 files changed, 32 insertions(+), 28 deletions(-) +diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h +index 7cac79802ad2..2ac6e347bdc5 100644 --- a/arch/x86/include/asm/uv/uv_bau.h +++ b/arch/x86/include/asm/uv/uv_bau.h @@ -643,9 +643,9 @@ struct bau_control { @@ -28,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* tunables */ int max_concurr; int max_concurr_const; -@@ -847,15 +847,15 @@ static inline int atom_asr(short i, stru +@@ -847,15 +847,15 @@ static inline int atom_asr(short i, struct atomic_short *v) * to be lowered below the current 'v'. atomic_add_unless can only stop * on equal. */ @@ -48,9 +51,11 @@ Signed-off-by: Sebastian Andrzej Siewior return 1; } +diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c +index 0b530c53de1f..2df1ee9a55f2 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c -@@ -740,9 +740,9 @@ static void destination_plugged(struct b +@@ -740,9 +740,9 @@ static void destination_plugged(struct bau_desc *bau_desc, quiesce_local_uvhub(hmaster); @@ -62,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior end_uvhub_quiesce(hmaster); -@@ -762,9 +762,9 @@ static void destination_timeout(struct b +@@ -762,9 +762,9 @@ static void destination_timeout(struct bau_desc *bau_desc, quiesce_local_uvhub(hmaster); @@ -74,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior end_uvhub_quiesce(hmaster); -@@ -785,7 +785,7 @@ static void disable_for_period(struct ba +@@ -785,7 +785,7 @@ static void disable_for_period(struct bau_control *bcp, struct ptc_stats *stat) cycles_t tm1; hmaster = bcp->uvhub_master; @@ -83,7 +88,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!bcp->baudisabled) { stat->s_bau_disabled++; tm1 = get_cycles(); -@@ -798,7 +798,7 @@ static void disable_for_period(struct ba +@@ -798,7 +798,7 @@ static void disable_for_period(struct bau_control *bcp, struct ptc_stats *stat) } } } @@ -92,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void count_max_concurr(int stat, struct bau_control *bcp, -@@ -861,7 +861,7 @@ static void record_send_stats(cycles_t t +@@ -861,7 +861,7 @@ static void record_send_stats(cycles_t time1, cycles_t time2, */ static void uv1_throttle(struct bau_control *hmaster, struct ptc_stats *stat) { @@ -101,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior atomic_t *v; v = &hmaster->active_descriptor_count; -@@ -995,7 +995,7 @@ static int check_enable(struct bau_contr +@@ -995,7 +995,7 @@ static int check_enable(struct bau_control *bcp, struct ptc_stats *stat) struct bau_control *hmaster; hmaster = bcp->uvhub_master; @@ -110,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (bcp->baudisabled && (get_cycles() >= bcp->set_bau_on_time)) { stat->s_bau_reenabled++; for_each_present_cpu(tcpu) { -@@ -1007,10 +1007,10 @@ static int check_enable(struct bau_contr +@@ -1007,10 +1007,10 @@ static int check_enable(struct bau_control *bcp, struct ptc_stats *stat) tbcp->period_giveups = 0; } } @@ -123,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -1; } -@@ -1941,9 +1941,9 @@ static void __init init_per_cpu_tunables +@@ -1941,9 +1941,9 @@ static void __init init_per_cpu_tunables(void) bcp->cong_reps = congested_reps; bcp->disabled_period = sec_2_cycles(disabled_period); bcp->giveup_limit = giveup_limit; @@ -136,9 +141,11 @@ Signed-off-by: Sebastian Andrzej Siewior } } +diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c +index b082d71b08ee..badf377efc21 100644 --- a/arch/x86/platform/uv/uv_time.c +++ b/arch/x86/platform/uv/uv_time.c -@@ -57,7 +57,7 @@ static DEFINE_PER_CPU(struct clock_event +@@ -57,7 +57,7 @@ static DEFINE_PER_CPU(struct clock_event_device, cpu_ced); /* There is one of these allocated per node */ struct uv_rtc_timer_head { @@ -147,7 +154,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* next cpu waiting for timer, local node relative: */ int next_cpu; /* number of cpus on this node: */ -@@ -177,7 +177,7 @@ static __init int uv_rtc_allocate_timers +@@ -177,7 +177,7 @@ static __init int uv_rtc_allocate_timers(void) uv_rtc_deallocate_timers(); return -ENOMEM; } @@ -156,7 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior head->ncpus = uv_blade_nr_possible_cpus(bid); head->next_cpu = -1; blade_info[bid] = head; -@@ -231,7 +231,7 @@ static int uv_rtc_set_timer(int cpu, u64 +@@ -231,7 +231,7 @@ static int uv_rtc_set_timer(int cpu, u64 expires) unsigned long flags; int next_cpu; @@ -165,7 +172,7 @@ Signed-off-by: Sebastian Andrzej Siewior next_cpu = head->next_cpu; *t = expires; -@@ -243,12 +243,12 @@ static int uv_rtc_set_timer(int cpu, u64 +@@ -243,12 +243,12 @@ static int uv_rtc_set_timer(int cpu, u64 expires) if (uv_setup_intr(cpu, expires)) { *t = ULLONG_MAX; uv_rtc_find_next_timer(head, pnode); @@ -180,7 +187,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -267,7 +267,7 @@ static int uv_rtc_unset_timer(int cpu, i +@@ -267,7 +267,7 @@ static int uv_rtc_unset_timer(int cpu, int force) unsigned long flags; int rc = 0; @@ -189,7 +196,7 @@ Signed-off-by: Sebastian Andrzej Siewior if ((head->next_cpu == bcpu && uv_read_rtc(NULL) >= *t) || force) rc = 1; -@@ -279,7 +279,7 @@ static int uv_rtc_unset_timer(int cpu, i +@@ -279,7 +279,7 @@ static int uv_rtc_unset_timer(int cpu, int force) uv_rtc_find_next_timer(head, pnode); } @@ -198,7 +205,7 @@ Signed-off-by: Sebastian Andrzej Siewior return rc; } -@@ -299,13 +299,17 @@ static int uv_rtc_unset_timer(int cpu, i +@@ -299,13 +299,17 @@ static int uv_rtc_unset_timer(int cpu, int force) static u64 uv_read_rtc(struct clocksource *cs) { unsigned long offset; @@ -217,3 +224,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0292-thermal-Defer-thermal-wakups-to-threads.patch b/kernel/patches-4.14.x-rt/0292-0292-thermal-Defer-thermal-wakups-to-threads.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0292-thermal-Defer-thermal-wakups-to-threads.patch rename to kernel/patches-4.14.x-rt/0292-0292-thermal-Defer-thermal-wakups-to-threads.patch index 72faa3db2..b0e67787c 100644 --- a/kernel/patches-4.14.x-rt/0292-thermal-Defer-thermal-wakups-to-threads.patch +++ b/kernel/patches-4.14.x-rt/0292-0292-thermal-Defer-thermal-wakups-to-threads.patch @@ -1,6 +1,7 @@ +From ec61d6f3d4ceea71a05cace70bbb619cf0cfdc2a Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 17 Feb 2015 09:37:44 +0100 -Subject: thermal: Defer thermal wakups to threads +Subject: [PATCH 292/414] 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. @@ -23,9 +24,11 @@ Signed-off-by: Daniel Wagner [bigeasy: reoder init/denit position. TODO: flush swork on exit] Signed-off-by: Sebastian Andrzej Siewior --- - drivers/thermal/x86_pkg_temp_thermal.c | 52 +++++++++++++++++++++++++++++++-- + drivers/thermal/x86_pkg_temp_thermal.c | 52 ++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) +diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c +index d93eee2f101b..0287333b1f3c 100644 --- a/drivers/thermal/x86_pkg_temp_thermal.c +++ b/drivers/thermal/x86_pkg_temp_thermal.c @@ -29,6 +29,7 @@ @@ -36,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include -@@ -329,7 +330,7 @@ static void pkg_thermal_schedule_work(in +@@ -329,7 +330,7 @@ static void pkg_thermal_schedule_work(int cpu, struct delayed_work *work) schedule_delayed_work_on(cpu, work, ms); } @@ -45,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior { int cpu = smp_processor_id(); struct pkg_device *pkgdev; -@@ -348,9 +349,47 @@ static int pkg_thermal_notify(u64 msr_va +@@ -348,9 +349,47 @@ static int pkg_thermal_notify(u64 msr_val) } spin_unlock_irqrestore(&pkg_temp_lock, flags); @@ -93,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int pkg_temp_thermal_device_add(unsigned int cpu) { int pkgid = topology_logical_package_id(cpu); -@@ -515,10 +554,15 @@ static int __init pkg_temp_thermal_init( +@@ -515,10 +554,15 @@ static int __init pkg_temp_thermal_init(void) if (!x86_match_cpu(pkg_temp_thermal_ids)) return -ENODEV; @@ -111,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "thermal/x86_pkg:online", pkg_thermal_cpu_online, pkg_thermal_cpu_offline); -@@ -536,6 +580,7 @@ static int __init pkg_temp_thermal_init( +@@ -536,6 +580,7 @@ static int __init pkg_temp_thermal_init(void) return 0; err: @@ -119,7 +122,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(packages); return ret; } -@@ -549,6 +594,7 @@ static void __exit pkg_temp_thermal_exit +@@ -549,6 +594,7 @@ static void __exit pkg_temp_thermal_exit(void) cpuhp_remove_state(pkg_thermal_hp_state); debugfs_remove_recursive(debugfs); kfree(packages); @@ -127,3 +130,6 @@ Signed-off-by: Sebastian Andrzej Siewior } module_exit(pkg_temp_thermal_exit) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0293-epoll-use-get-cpu-light.patch b/kernel/patches-4.14.x-rt/0293-0293-fs-epoll-Do-not-disable-preemption-on-RT.patch similarity index 64% rename from kernel/patches-4.14.x-rt/0293-epoll-use-get-cpu-light.patch rename to kernel/patches-4.14.x-rt/0293-0293-fs-epoll-Do-not-disable-preemption-on-RT.patch index 7dfa6c5b3..39b1d4946 100644 --- a/kernel/patches-4.14.x-rt/0293-epoll-use-get-cpu-light.patch +++ b/kernel/patches-4.14.x-rt/0293-0293-fs-epoll-Do-not-disable-preemption-on-RT.patch @@ -1,6 +1,7 @@ -Subject: fs/epoll: Do not disable preemption on RT +From e7587d1f9fcf179d430a7d4140d711a28b6008b6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Fri, 08 Jul 2011 16:35:35 +0200 +Date: Fri, 8 Jul 2011 16:35:35 +0200 +Subject: [PATCH 293/414] 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 @@ -8,12 +9,14 @@ invoked twice on the same CPU. Signed-off-by: Thomas Gleixner --- - fs/eventpoll.c | 4 ++-- + fs/eventpoll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/fs/eventpoll.c b/fs/eventpoll.c +index 2fabd19cdeea..b768c32631eb 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c -@@ -587,12 +587,12 @@ static int ep_poll_wakeup_proc(void *pri +@@ -587,12 +587,12 @@ static int ep_poll_wakeup_proc(void *priv, void *cookie, int call_nests) */ static void ep_poll_safewake(wait_queue_head_t *wq) { @@ -28,3 +31,6 @@ Signed-off-by: Thomas Gleixner } static void ep_remove_wait_queue(struct eppoll_entry *pwq) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0294-mm-vmalloc-use-get-cpu-light.patch b/kernel/patches-4.14.x-rt/0294-0294-mm-vmalloc-Another-preempt-disable-region-which-suck.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0294-mm-vmalloc-use-get-cpu-light.patch rename to kernel/patches-4.14.x-rt/0294-0294-mm-vmalloc-Another-preempt-disable-region-which-suck.patch index 0690a5e46..1f590de69 100644 --- a/kernel/patches-4.14.x-rt/0294-mm-vmalloc-use-get-cpu-light.patch +++ b/kernel/patches-4.14.x-rt/0294-0294-mm-vmalloc-Another-preempt-disable-region-which-suck.patch @@ -1,18 +1,22 @@ -Subject: mm/vmalloc: Another preempt disable region which sucks +From 878da860dcbc9369fede0aabb04640de942db843 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 12 Jul 2011 11:39:36 +0200 +Subject: [PATCH 294/414] mm/vmalloc: Another preempt disable region which + sucks Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. Signed-off-by: Thomas Gleixner --- - mm/vmalloc.c | 13 ++++++++----- + mm/vmalloc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) +diff --git a/mm/vmalloc.c b/mm/vmalloc.c +index ebff729cc956..5e3c3b21fe9e 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -865,7 +865,7 @@ static void *new_vmap_block(unsigned int +@@ -865,7 +865,7 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask) struct vmap_block *vb; struct vmap_area *va; unsigned long vb_idx; @@ -21,7 +25,7 @@ Signed-off-by: Thomas Gleixner void *vaddr; node = numa_node_id(); -@@ -908,11 +908,12 @@ static void *new_vmap_block(unsigned int +@@ -908,11 +908,12 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask) BUG_ON(err); radix_tree_preload_end(); @@ -36,7 +40,7 @@ Signed-off-by: Thomas Gleixner return vaddr; } -@@ -981,6 +982,7 @@ static void *vb_alloc(unsigned long size +@@ -981,6 +982,7 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) struct vmap_block *vb; void *vaddr = NULL; unsigned int order; @@ -44,7 +48,7 @@ Signed-off-by: Thomas Gleixner BUG_ON(offset_in_page(size)); BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); -@@ -995,7 +997,8 @@ static void *vb_alloc(unsigned long size +@@ -995,7 +997,8 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) order = get_order(size); rcu_read_lock(); @@ -54,7 +58,7 @@ Signed-off-by: Thomas Gleixner list_for_each_entry_rcu(vb, &vbq->free, free_list) { unsigned long pages_off; -@@ -1018,7 +1021,7 @@ static void *vb_alloc(unsigned long size +@@ -1018,7 +1021,7 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) break; } @@ -63,3 +67,6 @@ Signed-off-by: Thomas Gleixner rcu_read_unlock(); /* Allocate new block if nothing was found */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0295-block-mq-use-cpu_light.patch b/kernel/patches-4.14.x-rt/0295-0295-block-mq-use-cpu_light.patch similarity index 67% rename from kernel/patches-4.14.x-rt/0295-block-mq-use-cpu_light.patch rename to kernel/patches-4.14.x-rt/0295-0295-block-mq-use-cpu_light.patch index 6c14c233f..db2918846 100644 --- a/kernel/patches-4.14.x-rt/0295-block-mq-use-cpu_light.patch +++ b/kernel/patches-4.14.x-rt/0295-0295-block-mq-use-cpu_light.patch @@ -1,18 +1,21 @@ +From d65c8aef1cd4f6f700ac747978b54987bbd22505 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 10:37:23 +0200 -Subject: block: mq: use cpu_light() +Subject: [PATCH 295/414] 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(). Signed-off-by: Sebastian Andrzej Siewior --- - block/blk-mq.h | 4 ++-- + block/blk-mq.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/block/blk-mq.h b/block/blk-mq.h +index 4933af9d61f7..d0d9f9862d5f 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h -@@ -98,12 +98,12 @@ static inline struct blk_mq_ctx *__blk_m +@@ -98,12 +98,12 @@ static inline struct blk_mq_ctx *__blk_mq_get_ctx(struct request_queue *q, */ static inline struct blk_mq_ctx *blk_mq_get_ctx(struct request_queue *q) { @@ -27,3 +30,6 @@ Signed-off-by: Sebastian Andrzej Siewior } struct blk_mq_alloc_data { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0296-block-mq-drop-preempt-disable.patch b/kernel/patches-4.14.x-rt/0296-0296-block-mq-do-not-invoke-preempt_disable.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0296-block-mq-drop-preempt-disable.patch rename to kernel/patches-4.14.x-rt/0296-0296-block-mq-do-not-invoke-preempt_disable.patch index 66ca47768..e29fcd63a 100644 --- a/kernel/patches-4.14.x-rt/0296-block-mq-drop-preempt-disable.patch +++ b/kernel/patches-4.14.x-rt/0296-0296-block-mq-do-not-invoke-preempt_disable.patch @@ -1,6 +1,7 @@ +From 4936051fe8ae71d33035a472873206dad8aff190 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: block/mq: do not invoke preempt_disable() +Subject: [PATCH 296/414] 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. @@ -8,12 +9,14 @@ It seems to be enough to replace it with get_cpu_light() and migrate_disable(). Signed-off-by: Sebastian Andrzej Siewior --- - block/blk-mq.c | 10 +++++----- + block/blk-mq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) +diff --git a/block/blk-mq.c b/block/blk-mq.c +index de6cbc13a0d9..608ec6407dc5 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -539,7 +539,7 @@ static void __blk_mq_complete_request(st +@@ -539,7 +539,7 @@ static void __blk_mq_complete_request(struct request *rq) return; } @@ -22,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!test_bit(QUEUE_FLAG_SAME_FORCE, &rq->q->queue_flags)) shared = cpus_share_cache(cpu, ctx->cpu); -@@ -551,7 +551,7 @@ static void __blk_mq_complete_request(st +@@ -551,7 +551,7 @@ static void __blk_mq_complete_request(struct request *rq) } else { rq->q->softirq_done_fn(rq); } @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /** -@@ -1219,14 +1219,14 @@ static void __blk_mq_delay_run_hw_queue( +@@ -1219,14 +1219,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)) { @@ -49,3 +52,6 @@ Signed-off-by: Sebastian Andrzej Siewior } kblockd_schedule_delayed_work_on(blk_mq_hctx_next_cpu(hctx), +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0297-block-mq-don-t-complete-requests-via-IPI.patch b/kernel/patches-4.14.x-rt/0297-0297-block-mq-don-t-complete-requests-via-IPI.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0297-block-mq-don-t-complete-requests-via-IPI.patch rename to kernel/patches-4.14.x-rt/0297-0297-block-mq-don-t-complete-requests-via-IPI.patch index 9c7c0e350..543abd5b4 100644 --- a/kernel/patches-4.14.x-rt/0297-block-mq-don-t-complete-requests-via-IPI.patch +++ b/kernel/patches-4.14.x-rt/0297-0297-block-mq-don-t-complete-requests-via-IPI.patch @@ -1,21 +1,24 @@ +From 937f94a8e3102871e0f904173d78213c8b34ee6d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 15:10:08 +0100 -Subject: block/mq: don't complete requests via IPI +Subject: [PATCH 297/414] 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. Signed-off-by: Sebastian Andrzej Siewior --- - block/blk-core.c | 3 +++ - block/blk-mq.c | 23 +++++++++++++++++++++++ - include/linux/blk-mq.h | 2 +- - include/linux/blkdev.h | 3 +++ + block/blk-core.c | 3 +++ + block/blk-mq.c | 23 +++++++++++++++++++++++ + include/linux/blk-mq.h | 2 +- + include/linux/blkdev.h | 3 +++ 4 files changed, 30 insertions(+), 1 deletion(-) +diff --git a/block/blk-core.c b/block/blk-core.c +index 0b7308bce7e7..4ea09f0974d6 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -116,6 +116,9 @@ void blk_rq_init(struct request_queue *q +@@ -116,6 +116,9 @@ void blk_rq_init(struct request_queue *q, struct request *rq) INIT_LIST_HEAD(&rq->queuelist); INIT_LIST_HEAD(&rq->timeout_list); @@ -25,9 +28,11 @@ Signed-off-by: Sebastian Andrzej Siewior rq->cpu = -1; rq->q = q; rq->__sector = (sector_t) -1; +diff --git a/block/blk-mq.c b/block/blk-mq.c +index 608ec6407dc5..f321d46fcec2 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -320,6 +320,9 @@ static struct request *blk_mq_rq_ctx_ini +@@ -320,6 +320,9 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, /* tag was already set */ rq->extra_len = 0; @@ -37,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior INIT_LIST_HEAD(&rq->timeout_list); rq->timeout = 0; -@@ -514,12 +517,24 @@ void blk_mq_end_request(struct request * +@@ -514,12 +517,24 @@ void blk_mq_end_request(struct request *rq, blk_status_t error) } EXPORT_SYMBOL(blk_mq_end_request); @@ -62,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void __blk_mq_complete_request(struct request *rq) { -@@ -544,10 +559,18 @@ static void __blk_mq_complete_request(st +@@ -544,10 +559,18 @@ static void __blk_mq_complete_request(struct request *rq) shared = cpus_share_cache(cpu, ctx->cpu); if (cpu != ctx->cpu && !shared && cpu_online(ctx->cpu)) { @@ -81,9 +86,11 @@ Signed-off-by: Sebastian Andrzej Siewior } else { rq->q->softirq_done_fn(rq); } +diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h +index 994cbb0f7ffc..0d4b7e3489a9 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h -@@ -226,7 +226,7 @@ static inline u16 blk_mq_unique_tag_to_t +@@ -226,7 +226,7 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) return unique_tag & BLK_MQ_UNIQUE_TAG_MASK; } @@ -92,6 +99,8 @@ Signed-off-by: Sebastian Andrzej Siewior int blk_mq_request_started(struct request *rq); 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 6362e3606aa5..b68752bfb645 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -134,6 +134,9 @@ typedef __u32 __bitwise req_flags_t; @@ -104,3 +113,6 @@ Signed-off-by: Sebastian Andrzej Siewior union { struct __call_single_data csd; u64 fifo_time; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0298-md-raid5-percpu-handling-rt-aware.patch b/kernel/patches-4.14.x-rt/0298-0298-md-raid5-Make-raid5_percpu-handling-RT-aware.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0298-md-raid5-percpu-handling-rt-aware.patch rename to kernel/patches-4.14.x-rt/0298-0298-md-raid5-Make-raid5_percpu-handling-RT-aware.patch index c6b65b27a..2691fd223 100644 --- a/kernel/patches-4.14.x-rt/0298-md-raid5-percpu-handling-rt-aware.patch +++ b/kernel/patches-4.14.x-rt/0298-0298-md-raid5-Make-raid5_percpu-handling-RT-aware.patch @@ -1,6 +1,7 @@ +From b3da713afb931a7ca38ebbbad75d872457db2f45 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 6 Apr 2010 16:51:31 +0200 -Subject: md: raid5: Make raid5_percpu handling RT aware +Subject: [PATCH 298/414] 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 @@ -12,15 +13,16 @@ preemptible. Reported-by: Udo van den Heuvel Signed-off-by: Thomas Gleixner Tested-by: Udo van den Heuvel - --- - drivers/md/raid5.c | 8 +++++--- - drivers/md/raid5.h | 1 + + drivers/md/raid5.c | 8 +++++--- + drivers/md/raid5.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index 7ec822ced80b..871f1d2e9cc4 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c -@@ -2067,8 +2067,9 @@ static void raid_run_ops(struct stripe_h +@@ -2067,8 +2067,9 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) struct raid5_percpu *percpu; unsigned long cpu; @@ -31,7 +33,7 @@ Tested-by: Udo van den Heuvel if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) { ops_run_biofill(sh); overlap_clear++; -@@ -2127,7 +2128,8 @@ static void raid_run_ops(struct stripe_h +@@ -2127,7 +2128,8 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) if (test_and_clear_bit(R5_Overlap, &dev->flags)) wake_up(&sh->raid_conf->wait_for_overlap); } @@ -41,7 +43,7 @@ Tested-by: Udo van den Heuvel } static void free_stripe(struct kmem_cache *sc, struct stripe_head *sh) -@@ -6796,6 +6798,7 @@ static int raid456_cpu_up_prepare(unsign +@@ -6796,6 +6798,7 @@ static int raid456_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) __func__, cpu); return -ENOMEM; } @@ -49,7 +51,7 @@ Tested-by: Udo van den Heuvel return 0; } -@@ -6806,7 +6809,6 @@ static int raid5_alloc_percpu(struct r5c +@@ -6806,7 +6809,6 @@ static int raid5_alloc_percpu(struct r5conf *conf) conf->percpu = alloc_percpu(struct raid5_percpu); if (!conf->percpu) return -ENOMEM; @@ -57,6 +59,8 @@ Tested-by: Udo van den Heuvel err = cpuhp_state_add_instance(CPUHP_MD_RAID5_PREPARE, &conf->node); if (!err) { conf->scribble_disks = max(conf->raid_disks, +diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h +index 2e6123825095..37a6021418a2 100644 --- a/drivers/md/raid5.h +++ b/drivers/md/raid5.h @@ -624,6 +624,7 @@ struct r5conf { @@ -67,3 +71,6 @@ Tested-by: Udo van den Heuvel struct page *spare_page; /* Used when checking P/Q in raid6 */ struct flex_array *scribble; /* space for constructing buffer * lists and performing address +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0299-md-raid5-do-not-disable-interrupts.patch b/kernel/patches-4.14.x-rt/0299-0299-md-raid5-do-not-disable-interrupts.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0299-md-raid5-do-not-disable-interrupts.patch rename to kernel/patches-4.14.x-rt/0299-0299-md-raid5-do-not-disable-interrupts.patch index 79464e43c..feba85f4a 100644 --- a/kernel/patches-4.14.x-rt/0299-md-raid5-do-not-disable-interrupts.patch +++ b/kernel/patches-4.14.x-rt/0299-0299-md-raid5-do-not-disable-interrupts.patch @@ -1,6 +1,7 @@ +From 97b8569fdcde9e2323505a8f4a20730c7f2a2dc8 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 17 Nov 2017 16:21:00 +0100 -Subject: [PATCH] md/raid5: do not disable interrupts +Subject: [PATCH 299/414] md/raid5: do not disable interrupts |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974 |in_atomic(): 0, irqs_disabled(): 1, pid: 2992, name: lvm @@ -29,12 +30,14 @@ interrupts disabled. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - drivers/md/raid5.c | 4 ++-- + drivers/md/raid5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index 871f1d2e9cc4..79ba70bc1f89 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c -@@ -410,7 +410,7 @@ void raid5_release_stripe(struct stripe_ +@@ -410,7 +410,7 @@ void raid5_release_stripe(struct stripe_head *sh) md_wakeup_thread(conf->mddev->thread); return; slow_path: @@ -43,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* we are ok here if STRIPE_ON_RELEASE_LIST is set or not */ if (atomic_dec_and_lock(&sh->count, &conf->device_lock)) { INIT_LIST_HEAD(&list); -@@ -419,7 +419,7 @@ void raid5_release_stripe(struct stripe_ +@@ -419,7 +419,7 @@ void raid5_release_stripe(struct stripe_head *sh) spin_unlock(&conf->device_lock); release_inactive_stripe_list(conf, &list, hash); } @@ -52,3 +55,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline void remove_hash(struct stripe_head *sh) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0300-rt-introduce-cpu-chill.patch b/kernel/patches-4.14.x-rt/0300-0300-rt-Introduce-cpu_chill.patch similarity index 89% rename from kernel/patches-4.14.x-rt/0300-rt-introduce-cpu-chill.patch rename to kernel/patches-4.14.x-rt/0300-0300-rt-Introduce-cpu_chill.patch index 078f933f6..96c438aab 100644 --- a/kernel/patches-4.14.x-rt/0300-rt-introduce-cpu-chill.patch +++ b/kernel/patches-4.14.x-rt/0300-0300-rt-Introduce-cpu_chill.patch @@ -1,6 +1,7 @@ -Subject: rt: Introduce cpu_chill() +From 611df5906d053af47be15a4080fccf2d08291722 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Wed, 07 Mar 2012 20:51:03 +0100 +Date: Wed, 7 Mar 2012 20:51:03 +0100 +Subject: [PATCH 300/414] 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() @@ -81,13 +82,15 @@ Signed-off-by: Thomas Gleixner Signed-off-by: Steven Rostedt Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/delay.h | 6 ++++++ - kernel/time/hrtimer.c | 19 +++++++++++++++++++ + include/linux/delay.h | 6 ++++++ + kernel/time/hrtimer.c | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) +diff --git a/include/linux/delay.h b/include/linux/delay.h +index b78bab4395d8..7c4bc414a504 100644 --- a/include/linux/delay.h +++ b/include/linux/delay.h -@@ -64,4 +64,10 @@ static inline void ssleep(unsigned int s +@@ -64,4 +64,10 @@ static inline void ssleep(unsigned int seconds) msleep(seconds * 1000); } @@ -98,9 +101,11 @@ Signed-off-by: Sebastian Andrzej Siewior +#endif + #endif /* defined(_LINUX_DELAY_H) */ +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index f824b9721ce7..ad67ac12d6b6 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1858,6 +1858,25 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct +@@ -1858,6 +1858,25 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, } #endif @@ -126,3 +131,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Functions related to boot-time initialization: */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0301-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch b/kernel/patches-4.14.x-rt/0301-0301-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0301-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch rename to kernel/patches-4.14.x-rt/0301-0301-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch index bd71d8051..e2cd07ea1 100644 --- a/kernel/patches-4.14.x-rt/0301-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch +++ b/kernel/patches-4.14.x-rt/0301-0301-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch @@ -1,6 +1,7 @@ +From 5ce0ac406fcb466d4a16c428c2aa241e32380d58 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Tue, 4 Mar 2014 12:28:32 -0500 -Subject: cpu_chill: Add a UNINTERRUPTIBLE hrtimer_nanosleep +Subject: [PATCH 301/414] cpu_chill: Add a UNINTERRUPTIBLE hrtimer_nanosleep We hit another bug that was caused by switching cpu_chill() from msleep() to hrtimer_nanosleep(). @@ -28,12 +29,14 @@ Reported-by: Ulrich Obergfell Signed-off-by: Steven Rostedt Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 24 +++++++++++++++++------- + kernel/time/hrtimer.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index ad67ac12d6b6..6c77643eaf02 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1742,12 +1742,13 @@ int nanosleep_copyout(struct restart_blo +@@ -1742,12 +1742,13 @@ int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) return -ERESTART_RESTARTBLOCK; } @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_start_expires(&t->timer, mode); if (likely(t->task)) -@@ -1785,13 +1786,15 @@ static long __sched hrtimer_nanosleep_re +@@ -1785,13 +1786,15 @@ static long __sched hrtimer_nanosleep_restart(struct restart_block *restart) hrtimer_init_sleeper_on_stack(&t, restart->nanosleep.clockid, HRTIMER_MODE_ABS, current); hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires); @@ -68,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct restart_block *restart; struct hrtimer_sleeper t; -@@ -1804,7 +1807,7 @@ long hrtimer_nanosleep(const struct time +@@ -1804,7 +1807,7 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp, hrtimer_init_sleeper_on_stack(&t, clockid, mode, current); hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); @@ -77,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (ret != -ERESTART_RESTARTBLOCK) goto out; -@@ -1823,6 +1826,12 @@ long hrtimer_nanosleep(const struct time +@@ -1823,6 +1826,12 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp, return ret; } @@ -100,3 +103,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (!freeze_flag) current->flags &= ~PF_NOFREEZE; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0302-kernel-cpu_chill-use-schedule_hrtimeout.patch b/kernel/patches-4.14.x-rt/0302-0302-kernel-cpu_chill-use-schedule_hrtimeout.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0302-kernel-cpu_chill-use-schedule_hrtimeout.patch rename to kernel/patches-4.14.x-rt/0302-0302-kernel-cpu_chill-use-schedule_hrtimeout.patch index 893f97972..a5ca9ce78 100644 --- a/kernel/patches-4.14.x-rt/0302-kernel-cpu_chill-use-schedule_hrtimeout.patch +++ b/kernel/patches-4.14.x-rt/0302-0302-kernel-cpu_chill-use-schedule_hrtimeout.patch @@ -1,6 +1,7 @@ +From 3b22e437d3251c80d0724ab8ac6314443a3d2334 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 16 Mar 2018 13:07:59 +0100 -Subject: [PATCH] kernel/cpu_chill: use schedule_hrtimeout() +Subject: [PATCH 302/414] kernel/cpu_chill: use schedule_hrtimeout() If a task calls cpu_chill() and gets woken up by a regular or spurious wakeup and has a signal pending, then it exits the sleep loop in @@ -14,12 +15,14 @@ Instead all this trouble, use schedule_hrtimeout(). Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 9 ++++----- + kernel/time/hrtimer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 6c77643eaf02..c0efc22ba635 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1873,14 +1873,13 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct +@@ -1873,14 +1873,13 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, */ void cpu_chill(void) { @@ -38,3 +41,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (!freeze_flag) current->flags &= ~PF_NOFREEZE; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0303-Revert-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanos.patch b/kernel/patches-4.14.x-rt/0303-0303-Revert-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanos.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0303-Revert-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanos.patch rename to kernel/patches-4.14.x-rt/0303-0303-Revert-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanos.patch index f8c0432bd..d85d95700 100644 --- a/kernel/patches-4.14.x-rt/0303-Revert-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanos.patch +++ b/kernel/patches-4.14.x-rt/0303-0303-Revert-cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanos.patch @@ -1,6 +1,7 @@ +From 17dc278d62433ceb76fbe2ceaedd64a2b210a84a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 16 Mar 2018 15:04:49 +0100 -Subject: [PATCH] Revert "cpu_chill: Add a UNINTERRUPTIBLE +Subject: [PATCH 303/414] Revert "cpu_chill: Add a UNINTERRUPTIBLE hrtimer_nanosleep" This reverts commit "cpu_chill: Add a UNINTERRUPTIBLE @@ -10,12 +11,14 @@ we can remove that change since we have no users for it. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/hrtimer.c | 21 ++++++--------------- + kernel/time/hrtimer.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index c0efc22ba635..ce2c2d04cbaa 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1742,13 +1742,12 @@ int nanosleep_copyout(struct restart_blo +@@ -1742,13 +1742,12 @@ int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) return -ERESTART_RESTARTBLOCK; } @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_start_expires(&t->timer, mode); if (likely(t->task)) -@@ -1786,15 +1785,13 @@ static long __sched hrtimer_nanosleep_re +@@ -1786,15 +1785,13 @@ static long __sched hrtimer_nanosleep_restart(struct restart_block *restart) hrtimer_init_sleeper_on_stack(&t, restart->nanosleep.clockid, HRTIMER_MODE_ABS, current); hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires); @@ -50,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct restart_block *restart; struct hrtimer_sleeper t; -@@ -1807,7 +1804,7 @@ static long __hrtimer_nanosleep(const st +@@ -1807,7 +1804,7 @@ static long __hrtimer_nanosleep(const struct timespec64 *rqtp, hrtimer_init_sleeper_on_stack(&t, clockid, mode, current); hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (ret != -ERESTART_RESTARTBLOCK) goto out; -@@ -1826,12 +1823,6 @@ static long __hrtimer_nanosleep(const st +@@ -1826,12 +1823,6 @@ static long __hrtimer_nanosleep(const struct timespec64 *rqtp, return ret; } @@ -72,3 +75,6 @@ Signed-off-by: Sebastian Andrzej Siewior SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, struct timespec __user *, rmtp) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0304-rtmutex-annotate-sleeping-lock-context.patch b/kernel/patches-4.14.x-rt/0304-0304-rtmutex-annotate-sleeping-lock-context.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0304-rtmutex-annotate-sleeping-lock-context.patch rename to kernel/patches-4.14.x-rt/0304-0304-rtmutex-annotate-sleeping-lock-context.patch index 8250c5ead..9e3f477b6 100644 --- a/kernel/patches-4.14.x-rt/0304-rtmutex-annotate-sleeping-lock-context.patch +++ b/kernel/patches-4.14.x-rt/0304-0304-rtmutex-annotate-sleeping-lock-context.patch @@ -1,6 +1,7 @@ +From 413200f00f89f4f99291278d14468d5abb8f2828 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 3 May 2018 17:16:26 +0200 -Subject: [PATCH] rtmutex: annotate sleeping lock context +Subject: [PATCH 304/414] 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 @@ -23,13 +24,15 @@ cpu_chill() to avoid the RCU warning from there. Reported-by: Grygorii Strashko Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/sched.h | 20 ++++++++++++++++++++ - kernel/locking/rtmutex.c | 12 ++++++++++-- - kernel/locking/rwlock-rt.c | 18 ++++++++++++++---- - kernel/rcu/tree_plugin.h | 8 ++++---- - kernel/time/hrtimer.c | 2 ++ + include/linux/sched.h | 20 ++++++++++++++++++++ + kernel/locking/rtmutex.c | 12 ++++++++++-- + kernel/locking/rwlock-rt.c | 18 ++++++++++++++---- + kernel/rcu/tree_plugin.h | 8 ++++---- + kernel/time/hrtimer.c | 2 ++ 5 files changed, 50 insertions(+), 10 deletions(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index c9941a5e93ae..358748c77304 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -598,6 +598,9 @@ struct task_struct { @@ -42,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_PREEMPT_RCU int rcu_read_lock_nesting; -@@ -1708,6 +1711,23 @@ static __always_inline bool need_resched +@@ -1708,6 +1711,23 @@ static __always_inline bool need_resched(void) return unlikely(tif_need_resched()); } @@ -66,9 +69,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Wrappers for p->thread_info->cpu access. No-op on UP. */ +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 0cb716ba3be0..bac3fb580af6 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1141,6 +1141,7 @@ void __sched rt_spin_lock_slowunlock(str +@@ -1141,6 +1141,7 @@ void __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) void __lockfunc rt_spin_lock(spinlock_t *lock) { @@ -76,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior migrate_disable(); spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -@@ -1155,6 +1156,7 @@ void __lockfunc __rt_spin_lock(struct rt +@@ -1155,6 +1156,7 @@ void __lockfunc __rt_spin_lock(struct rt_mutex *lock) #ifdef CONFIG_DEBUG_LOCK_ALLOC void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) { @@ -84,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior migrate_disable(); spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -@@ -1168,6 +1170,7 @@ void __lockfunc rt_spin_unlock(spinlock_ +@@ -1168,6 +1170,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(); @@ -92,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL(rt_spin_unlock); -@@ -1193,12 +1196,15 @@ int __lockfunc rt_spin_trylock(spinlock_ +@@ -1193,12 +1196,15 @@ int __lockfunc rt_spin_trylock(spinlock_t *lock) { int ret; @@ -110,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } EXPORT_SYMBOL(rt_spin_trylock); -@@ -1210,6 +1216,7 @@ int __lockfunc rt_spin_trylock_bh(spinlo +@@ -1210,6 +1216,7 @@ int __lockfunc rt_spin_trylock_bh(spinlock_t *lock) local_bh_disable(); ret = __rt_mutex_trylock(&lock->lock); if (ret) { @@ -118,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior migrate_disable(); spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); } else -@@ -1225,6 +1232,7 @@ int __lockfunc rt_spin_trylock_irqsave(s +@@ -1225,6 +1232,7 @@ int __lockfunc rt_spin_trylock_irqsave(spinlock_t *lock, unsigned long *flags) *flags = 0; ret = __rt_mutex_trylock(&lock->lock); if (ret) { @@ -126,9 +131,11 @@ Signed-off-by: Sebastian Andrzej Siewior 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 aebb7ce25bc6..f2e155b2c4a8 100644 --- a/kernel/locking/rwlock-rt.c +++ b/kernel/locking/rwlock-rt.c -@@ -305,12 +305,15 @@ int __lockfunc rt_read_trylock(rwlock_t +@@ -305,12 +305,15 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock) { int ret; @@ -146,7 +153,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } EXPORT_SYMBOL(rt_read_trylock); -@@ -319,18 +322,22 @@ int __lockfunc rt_write_trylock(rwlock_t +@@ -319,18 +322,22 @@ int __lockfunc rt_write_trylock(rwlock_t *rwlock) { int ret; @@ -179,7 +186,7 @@ Signed-off-by: Sebastian Andrzej Siewior migrate_disable(); rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); do_write_rt_lock(rwlock); -@@ -350,6 +358,7 @@ void __lockfunc rt_read_unlock(rwlock_t +@@ -350,6 +358,7 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock) rwlock_release(&rwlock->dep_map, 1, _RET_IP_); do_read_rt_unlock(rwlock); migrate_enable(); @@ -187,7 +194,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL(rt_read_unlock); -@@ -358,6 +367,7 @@ void __lockfunc rt_write_unlock(rwlock_t +@@ -358,6 +367,7 @@ void __lockfunc rt_write_unlock(rwlock_t *rwlock) rwlock_release(&rwlock->dep_map, 1, _RET_IP_); do_write_rt_unlock(rwlock); migrate_enable(); @@ -195,9 +202,11 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL(rt_write_unlock); +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index 5d93d972d88e..5426b8733293 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h -@@ -324,13 +324,13 @@ static void rcu_preempt_note_context_swi +@@ -324,13 +324,13 @@ static void rcu_preempt_note_context_switch(bool preempt) struct task_struct *t = current; struct rcu_data *rdp; struct rcu_node *rnp; @@ -215,6 +224,8 @@ Signed-off-by: Sebastian Andrzej Siewior if (t->rcu_read_lock_nesting > 0 && !t->rcu_read_unlock_special.b.blocked) { +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index ce2c2d04cbaa..b59e009087a9 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1870,7 +1870,9 @@ void cpu_chill(void) @@ -227,3 +238,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (!freeze_flag) current->flags &= ~PF_NOFREEZE; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0305-block-blk-mq-use-swait.patch b/kernel/patches-4.14.x-rt/0305-0305-block-blk-mq-Use-swait.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0305-block-blk-mq-use-swait.patch rename to kernel/patches-4.14.x-rt/0305-0305-block-blk-mq-Use-swait.patch index 82d25ff49..215553e91 100644 --- a/kernel/patches-4.14.x-rt/0305-block-blk-mq-use-swait.patch +++ b/kernel/patches-4.14.x-rt/0305-0305-block-blk-mq-Use-swait.patch @@ -1,6 +1,7 @@ +From 0614daa5f982ae058cf0984949a896dba68db3b8 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 11:01:26 +0100 -Subject: block: blk-mq: Use swait +Subject: [PATCH 305/414] block: blk-mq: Use swait | 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 @@ -38,14 +39,16 @@ Subject: block: blk-mq: Use swait Signed-off-by: Sebastian Andrzej Siewior --- - block/blk-core.c | 6 +++--- - block/blk-mq.c | 8 ++++---- - include/linux/blkdev.h | 2 +- + block/blk-core.c | 6 +++--- + block/blk-mq.c | 8 ++++---- + include/linux/blkdev.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) +diff --git a/block/blk-core.c b/block/blk-core.c +index 4ea09f0974d6..8b04cde33602 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -799,7 +799,7 @@ int blk_queue_enter(struct request_queue +@@ -799,7 +799,7 @@ int blk_queue_enter(struct request_queue *q, bool nowait) */ smp_rmb(); @@ -54,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior !atomic_read(&q->mq_freeze_depth) || blk_queue_dying(q)); if (blk_queue_dying(q)) -@@ -819,7 +819,7 @@ static void blk_queue_usage_counter_rele +@@ -819,7 +819,7 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref) struct request_queue *q = container_of(ref, struct request_queue, q_usage_counter); @@ -63,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void blk_rq_timed_out_timer(unsigned long data) -@@ -895,7 +895,7 @@ struct request_queue *blk_alloc_queue_no +@@ -895,7 +895,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) q->bypass_depth = 1; __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); @@ -72,9 +75,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Init percpu_ref in atomic mode so that it's faster to shutdown. +diff --git a/block/blk-mq.c b/block/blk-mq.c +index f321d46fcec2..1da05b172dc4 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -132,14 +132,14 @@ EXPORT_SYMBOL_GPL(blk_freeze_queue_start +@@ -132,14 +132,14 @@ EXPORT_SYMBOL_GPL(blk_freeze_queue_start); void blk_mq_freeze_queue_wait(struct request_queue *q) { @@ -91,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior percpu_ref_is_zero(&q->q_usage_counter), timeout); } -@@ -182,7 +182,7 @@ void blk_mq_unfreeze_queue(struct reques +@@ -182,7 +182,7 @@ void blk_mq_unfreeze_queue(struct request_queue *q) WARN_ON_ONCE(freeze_depth < 0); if (!freeze_depth) { percpu_ref_reinit(&q->q_usage_counter); @@ -100,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); -@@ -263,7 +263,7 @@ void blk_mq_wake_waiters(struct request_ +@@ -263,7 +263,7 @@ void blk_mq_wake_waiters(struct request_queue *q) * dying, we need to ensure that processes currently waiting on * the queue are notified as well. */ @@ -109,6 +114,8 @@ Signed-off-by: Sebastian Andrzej Siewior } bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx) +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index b68752bfb645..6f278f1fd634 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -598,7 +598,7 @@ struct request_queue { @@ -120,3 +127,6 @@ Signed-off-by: Sebastian Andrzej Siewior struct percpu_ref q_usage_counter; struct list_head all_q_node; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0306-Revert-block-blk-mq-Use-swait.patch b/kernel/patches-4.14.x-rt/0306-0306-Revert-block-blk-mq-Use-swait.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0306-Revert-block-blk-mq-Use-swait.patch rename to kernel/patches-4.14.x-rt/0306-0306-Revert-block-blk-mq-Use-swait.patch index ff2c2481f..165536c6f 100644 --- a/kernel/patches-4.14.x-rt/0306-Revert-block-blk-mq-Use-swait.patch +++ b/kernel/patches-4.14.x-rt/0306-0306-Revert-block-blk-mq-Use-swait.patch @@ -1,6 +1,7 @@ +From 60400047cfb26f6617c03f1cd648444739529f2d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 13 Mar 2018 11:31:09 +0100 -Subject: [PATCH] Revert "block: blk-mq: Use swait" +Subject: [PATCH 306/414] Revert "block: blk-mq: Use swait" This reverts commit "block: blk-mq: Use swait". The issue remains but will be fixed differently. @@ -8,14 +9,16 @@ will be fixed differently. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - block/blk-core.c | 6 +++--- - block/blk-mq.c | 8 ++++---- - include/linux/blkdev.h | 2 +- + block/blk-core.c | 6 +++--- + block/blk-mq.c | 8 ++++---- + include/linux/blkdev.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) +diff --git a/block/blk-core.c b/block/blk-core.c +index 8b04cde33602..4ea09f0974d6 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -799,7 +799,7 @@ int blk_queue_enter(struct request_queue +@@ -799,7 +799,7 @@ int blk_queue_enter(struct request_queue *q, bool nowait) */ smp_rmb(); @@ -24,7 +27,7 @@ Signed-off-by: Sebastian Andrzej Siewior !atomic_read(&q->mq_freeze_depth) || blk_queue_dying(q)); if (blk_queue_dying(q)) -@@ -819,7 +819,7 @@ static void blk_queue_usage_counter_rele +@@ -819,7 +819,7 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref) struct request_queue *q = container_of(ref, struct request_queue, q_usage_counter); @@ -33,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void blk_rq_timed_out_timer(unsigned long data) -@@ -895,7 +895,7 @@ struct request_queue *blk_alloc_queue_no +@@ -895,7 +895,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) q->bypass_depth = 1; __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); @@ -42,9 +45,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Init percpu_ref in atomic mode so that it's faster to shutdown. +diff --git a/block/blk-mq.c b/block/blk-mq.c +index 1da05b172dc4..f321d46fcec2 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -132,14 +132,14 @@ EXPORT_SYMBOL_GPL(blk_freeze_queue_start +@@ -132,14 +132,14 @@ EXPORT_SYMBOL_GPL(blk_freeze_queue_start); void blk_mq_freeze_queue_wait(struct request_queue *q) { @@ -61,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior percpu_ref_is_zero(&q->q_usage_counter), timeout); } -@@ -182,7 +182,7 @@ void blk_mq_unfreeze_queue(struct reques +@@ -182,7 +182,7 @@ void blk_mq_unfreeze_queue(struct request_queue *q) WARN_ON_ONCE(freeze_depth < 0); if (!freeze_depth) { percpu_ref_reinit(&q->q_usage_counter); @@ -70,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); -@@ -263,7 +263,7 @@ void blk_mq_wake_waiters(struct request_ +@@ -263,7 +263,7 @@ void blk_mq_wake_waiters(struct request_queue *q) * dying, we need to ensure that processes currently waiting on * the queue are notified as well. */ @@ -79,6 +84,8 @@ Signed-off-by: Sebastian Andrzej Siewior } bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx) +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index 6f278f1fd634..b68752bfb645 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -598,7 +598,7 @@ struct request_queue { @@ -90,3 +97,6 @@ Signed-off-by: Sebastian Andrzej Siewior struct percpu_ref q_usage_counter; struct list_head all_q_node; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0307-block-blk-mq-move-blk_queue_usage_counter_release-in.patch b/kernel/patches-4.14.x-rt/0307-0307-block-blk-mq-move-blk_queue_usage_counter_release-in.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0307-block-blk-mq-move-blk_queue_usage_counter_release-in.patch rename to kernel/patches-4.14.x-rt/0307-0307-block-blk-mq-move-blk_queue_usage_counter_release-in.patch index 946aad6d0..2b8014985 100644 --- a/kernel/patches-4.14.x-rt/0307-block-blk-mq-move-blk_queue_usage_counter_release-in.patch +++ b/kernel/patches-4.14.x-rt/0307-0307-block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -1,6 +1,7 @@ +From 3b72a7410a5417936cb0c7fd6c988c20a836cdc9 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 13 Mar 2018 13:49:16 +0100 -Subject: [PATCH] block: blk-mq: move blk_queue_usage_counter_release() +Subject: [PATCH 307/414] 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 @@ -46,13 +47,15 @@ The wq_has_sleeper() check has been suggested by Peter Zijlstra. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - block/blk-core.c | 14 +++++++++++++- - include/linux/blkdev.h | 2 ++ + block/blk-core.c | 14 +++++++++++++- + include/linux/blkdev.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) +diff --git a/block/blk-core.c b/block/blk-core.c +index 4ea09f0974d6..a51c18d57a0d 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -814,12 +814,21 @@ void blk_queue_exit(struct request_queue +@@ -814,12 +814,21 @@ void blk_queue_exit(struct request_queue *q) percpu_ref_put(&q->q_usage_counter); } @@ -75,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void blk_rq_timed_out_timer(unsigned long data) -@@ -896,6 +905,7 @@ struct request_queue *blk_alloc_queue_no +@@ -896,6 +905,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); init_waitqueue_head(&q->mq_freeze_wq); @@ -92,6 +95,8 @@ Signed-off-by: Sebastian Andrzej Siewior 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 b68752bfb645..49b53ad6d2d6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -27,6 +27,7 @@ @@ -110,3 +115,6 @@ Signed-off-by: Sebastian Andrzej Siewior struct percpu_ref q_usage_counter; struct list_head all_q_node; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0308-block-use-cpu-chill.patch b/kernel/patches-4.14.x-rt/0308-0308-block-Use-cpu_chill-for-retry-loops.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0308-block-use-cpu-chill.patch rename to kernel/patches-4.14.x-rt/0308-0308-block-Use-cpu_chill-for-retry-loops.patch index 83b2351bd..946413d2e 100644 --- a/kernel/patches-4.14.x-rt/0308-block-use-cpu-chill.patch +++ b/kernel/patches-4.14.x-rt/0308-0308-block-Use-cpu_chill-for-retry-loops.patch @@ -1,6 +1,7 @@ -Subject: block: Use cpu_chill() for retry loops +From ec5cb0791cfa622ba7be0207c4fc375dcc392bcd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 20 Dec 2012 18:28:26 +0100 +Subject: [PATCH 308/414] 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 @@ -10,11 +11,12 @@ Use cpu_chill() instead of cpu_relax() to let the system make progress. Signed-off-by: Thomas Gleixner - --- - block/blk-ioc.c | 5 +++-- + block/blk-ioc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) +diff --git a/block/blk-ioc.c b/block/blk-ioc.c +index f23311e4b201..ca9ea624f159 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -9,6 +9,7 @@ @@ -25,7 +27,7 @@ Signed-off-by: Thomas Gleixner #include "blk.h" -@@ -118,7 +119,7 @@ static void ioc_release_fn(struct work_s +@@ -118,7 +119,7 @@ static void ioc_release_fn(struct work_struct *work) spin_unlock(q->queue_lock); } else { spin_unlock_irqrestore(&ioc->lock, flags); @@ -34,7 +36,7 @@ Signed-off-by: Thomas Gleixner spin_lock_irqsave_nested(&ioc->lock, flags, 1); } } -@@ -202,7 +203,7 @@ void put_io_context_active(struct io_con +@@ -202,7 +203,7 @@ void put_io_context_active(struct io_context *ioc) spin_unlock(icq->q->queue_lock); } else { spin_unlock_irqrestore(&ioc->lock, flags); @@ -43,3 +45,6 @@ Signed-off-by: Thomas Gleixner goto retry; } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0309-fs-dcache-use-cpu-chill-in-trylock-loops.patch b/kernel/patches-4.14.x-rt/0309-0309-fs-dcache-Use-cpu_chill-in-trylock-loops.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0309-fs-dcache-use-cpu-chill-in-trylock-loops.patch rename to kernel/patches-4.14.x-rt/0309-0309-fs-dcache-Use-cpu_chill-in-trylock-loops.patch index bb4ae8508..7f827c9cd 100644 --- a/kernel/patches-4.14.x-rt/0309-fs-dcache-use-cpu-chill-in-trylock-loops.patch +++ b/kernel/patches-4.14.x-rt/0309-0309-fs-dcache-Use-cpu_chill-in-trylock-loops.patch @@ -1,20 +1,22 @@ -Subject: fs: dcache: Use cpu_chill() in trylock loops +From 7c153c19a4f32b9ef2a4b31116b994e8e31eb233 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Wed, 07 Mar 2012 21:00:34 +0100 +Date: Wed, 7 Mar 2012 21:00:34 +0100 +Subject: [PATCH 309/414] 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 make progress. Signed-off-by: Thomas Gleixner - --- - fs/autofs4/autofs_i.h | 1 + - fs/autofs4/expire.c | 2 +- - fs/dcache.c | 20 ++++++++++++++++---- - fs/namespace.c | 3 ++- + fs/autofs4/autofs_i.h | 1 + + fs/autofs4/expire.c | 2 +- + fs/dcache.c | 20 ++++++++++++++++---- + fs/namespace.c | 3 ++- 4 files changed, 20 insertions(+), 6 deletions(-) +diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h +index 4737615f0eaa..bf71f1aaecbe 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h @@ -20,6 +20,7 @@ @@ -25,9 +27,11 @@ Signed-off-by: Thomas Gleixner #include #include #include +diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c +index 57725d4a8c59..62220508bace 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c -@@ -148,7 +148,7 @@ static struct dentry *get_next_positive_ +@@ -148,7 +148,7 @@ static struct dentry *get_next_positive_dentry(struct dentry *prev, parent = p->d_parent; if (!spin_trylock(&parent->d_lock)) { spin_unlock(&p->d_lock); @@ -36,6 +40,8 @@ Signed-off-by: Thomas Gleixner goto relock; } spin_unlock(&p->d_lock); +diff --git a/fs/dcache.c b/fs/dcache.c +index 39ba05ff22aa..1f20fdce4730 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -19,6 +19,7 @@ @@ -46,7 +52,7 @@ Signed-off-by: Thomas Gleixner #include #include #include -@@ -796,6 +797,8 @@ static inline bool fast_dput(struct dent +@@ -796,6 +797,8 @@ static inline bool fast_dput(struct dentry *dentry) */ void dput(struct dentry *dentry) { @@ -86,6 +92,8 @@ Signed-off-by: Thomas Gleixner goto again; } dentry->d_flags &= ~DCACHE_CANT_MOUNT; +diff --git a/fs/namespace.c b/fs/namespace.c +index b9cd42b9b2c9..e6360689fab3 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -14,6 +14,7 @@ @@ -105,3 +113,6 @@ Signed-off-by: Thomas Gleixner preempt_disable(); } /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0310-net-use-cpu-chill.patch b/kernel/patches-4.14.x-rt/0310-0310-net-Use-cpu_chill-instead-of-cpu_relax.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0310-net-use-cpu-chill.patch rename to kernel/patches-4.14.x-rt/0310-0310-net-Use-cpu_chill-instead-of-cpu_relax.patch index a51a4b369..52fa2d1f9 100644 --- a/kernel/patches-4.14.x-rt/0310-net-use-cpu-chill.patch +++ b/kernel/patches-4.14.x-rt/0310-0310-net-Use-cpu_chill-instead-of-cpu_relax.patch @@ -1,18 +1,20 @@ -Subject: net: Use cpu_chill() instead of cpu_relax() +From c2959cdf29207c99481ce01e75d3154ea1624cb6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Wed, 07 Mar 2012 21:10:04 +0100 +Date: Wed, 7 Mar 2012 21:10:04 +0100 +Subject: [PATCH 310/414] 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 make progress. Signed-off-by: Thomas Gleixner - --- - net/packet/af_packet.c | 5 +++-- - net/rds/ib_rdma.c | 3 ++- + net/packet/af_packet.c | 5 +++-- + net/rds/ib_rdma.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c +index 3994b71f8197..5022140aff40 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -63,6 +63,7 @@ @@ -23,7 +25,7 @@ Signed-off-by: Thomas Gleixner #include #include #include -@@ -707,7 +708,7 @@ static void prb_retire_rx_blk_timer_expi +@@ -707,7 +708,7 @@ static void prb_retire_rx_blk_timer_expired(unsigned long data) if (BLOCK_NUM_PKTS(pbd)) { while (atomic_read(&pkc->blk_fill_in_prog)) { /* Waiting for skb_copy_bits to finish... */ @@ -32,7 +34,7 @@ Signed-off-by: Thomas Gleixner } } -@@ -969,7 +970,7 @@ static void prb_retire_current_block(str +@@ -969,7 +970,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... */ @@ -41,6 +43,8 @@ Signed-off-by: Thomas Gleixner } } prb_close_block(pkc, pbd, po, status); +diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c +index 9a3c54e659e9..2a95f1d587ac 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -34,6 +34,7 @@ @@ -51,7 +55,7 @@ Signed-off-by: Thomas Gleixner #include "rds_single_path.h" #include "ib_mr.h" -@@ -210,7 +211,7 @@ static inline void wait_clean_list_grace +@@ -210,7 +211,7 @@ static inline void wait_clean_list_grace(void) for_each_online_cpu(cpu) { flag = &per_cpu(clean_list_grace, cpu); while (test_bit(CLEAN_LIST_BUSY_BIT, flag)) @@ -60,3 +64,6 @@ Signed-off-by: Thomas Gleixner } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0311-fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/kernel/patches-4.14.x-rt/0311-0311-fs-dcache-use-swait_queue-instead-of-waitqueue.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0311-fs-dcache-use-swait_queue-instead-of-waitqueue.patch rename to kernel/patches-4.14.x-rt/0311-0311-fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 2b36c1d1f..eda40f194 100644 --- a/kernel/patches-4.14.x-rt/0311-fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/kernel/patches-4.14.x-rt/0311-0311-fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,28 +1,31 @@ +From b4baebe842bbdd23f5ec667a77354420ba63ed4a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 14:35:49 +0200 -Subject: [PATCH] fs/dcache: use swait_queue instead of waitqueue +Subject: [PATCH 311/414] 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. Signed-off-by: Sebastian Andrzej Siewior --- - fs/cifs/readdir.c | 2 +- - fs/dcache.c | 27 +++++++++++++++------------ - fs/fuse/dir.c | 2 +- - fs/namei.c | 4 ++-- - fs/nfs/dir.c | 4 ++-- - fs/nfs/unlink.c | 4 ++-- - fs/proc/base.c | 2 +- - fs/proc/proc_sysctl.c | 2 +- - include/linux/dcache.h | 4 ++-- - include/linux/nfs_xdr.h | 2 +- - kernel/sched/swait.c | 1 + + fs/cifs/readdir.c | 2 +- + fs/dcache.c | 27 +++++++++++++++------------ + fs/fuse/dir.c | 2 +- + fs/namei.c | 4 ++-- + fs/nfs/dir.c | 4 ++-- + fs/nfs/unlink.c | 4 ++-- + fs/proc/base.c | 2 +- + fs/proc/proc_sysctl.c | 2 +- + include/linux/dcache.h | 4 ++-- + include/linux/nfs_xdr.h | 2 +- + kernel/sched/swait.c | 1 + 11 files changed, 29 insertions(+), 25 deletions(-) +diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c +index a27fc8791551..791aecb7c1ac 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c -@@ -80,7 +80,7 @@ cifs_prime_dcache(struct dentry *parent, +@@ -80,7 +80,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name, struct inode *inode; struct super_block *sb = parent->d_sb; struct cifs_sb_info *cifs_sb = CIFS_SB(sb); @@ -31,9 +34,11 @@ Signed-off-by: Sebastian Andrzej Siewior cifs_dbg(FYI, "%s: for %s\n", __func__, name->name); +diff --git a/fs/dcache.c b/fs/dcache.c +index 1f20fdce4730..b5a8d9d26740 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -2446,21 +2446,24 @@ static inline void end_dir_add(struct in +@@ -2446,21 +2446,24 @@ static inline void end_dir_add(struct inode *dir, unsigned n) static void d_wait_lookup(struct dentry *dentry) { @@ -69,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior { unsigned int hash = name->hash; struct hlist_bl_head *b = in_lookup_hash(parent, hash); -@@ -2569,7 +2572,7 @@ void __d_lookup_done(struct dentry *dent +@@ -2569,7 +2572,7 @@ void __d_lookup_done(struct dentry *dentry) hlist_bl_lock(b); dentry->d_flags &= ~DCACHE_PAR_LOOKUP; __hlist_bl_del(&dentry->d_u.d_in_lookup_hash); @@ -78,9 +83,11 @@ Signed-off-by: Sebastian Andrzej Siewior dentry->d_wait = NULL; 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 24967382a7b1..031d85ec822c 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c -@@ -1187,7 +1187,7 @@ static int fuse_direntplus_link(struct f +@@ -1187,7 +1187,7 @@ static int fuse_direntplus_link(struct file *file, struct inode *dir = d_inode(parent); struct fuse_conn *fc; struct inode *inode; @@ -89,9 +96,11 @@ Signed-off-by: Sebastian Andrzej Siewior if (!o->nodeid) { /* +diff --git a/fs/namei.c b/fs/namei.c +index 0b46b858cd42..f5c6c2ec44ce 100644 --- a/fs/namei.c +++ b/fs/namei.c -@@ -1627,7 +1627,7 @@ static struct dentry *lookup_slow(const +@@ -1627,7 +1627,7 @@ static struct dentry *lookup_slow(const struct qstr *name, { struct dentry *dentry = ERR_PTR(-ENOENT), *old; struct inode *inode = dir->d_inode; @@ -100,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior inode_lock_shared(inode); /* Don't go there if it's already dead */ -@@ -3100,7 +3100,7 @@ static int lookup_open(struct nameidata +@@ -3100,7 +3100,7 @@ static int lookup_open(struct nameidata *nd, struct path *path, struct dentry *dentry; int error, create_error = 0; umode_t mode = op->mode; @@ -109,6 +118,8 @@ Signed-off-by: Sebastian Andrzej Siewior if (unlikely(IS_DEADDIR(dir_inode))) return -ENOENT; +diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c +index 1f3818580413..f43f5da4a8c3 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -452,7 +452,7 @@ static @@ -120,7 +131,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct dentry *dentry; struct dentry *alias; struct inode *dir = d_inode(parent); -@@ -1443,7 +1443,7 @@ int nfs_atomic_open(struct inode *dir, s +@@ -1443,7 +1443,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode, int *opened) { @@ -129,6 +140,8 @@ Signed-off-by: Sebastian Andrzej Siewior struct nfs_open_context *ctx; struct dentry *res; struct iattr attr = { .ia_valid = ATTR_OPEN }; +diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c +index 2e78bc25bcea..0dc1d3e6a62f 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c @@ -13,7 +13,7 @@ @@ -140,7 +153,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include -@@ -206,7 +206,7 @@ nfs_async_unlink(struct dentry *dentry, +@@ -206,7 +206,7 @@ nfs_async_unlink(struct dentry *dentry, const struct qstr *name) goto out_free_name; } data->res.dir_attr = &data->dir_attr; @@ -149,9 +162,11 @@ Signed-off-by: Sebastian Andrzej Siewior status = -EBUSY; spin_lock(&dentry->d_lock); +diff --git a/fs/proc/base.c b/fs/proc/base.c +index 2ff11a693360..53ed8f8ca752 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c -@@ -1880,7 +1880,7 @@ bool proc_fill_cache(struct file *file, +@@ -1880,7 +1880,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, child = d_hash_and_lookup(dir, &qname); if (!child) { @@ -160,9 +175,11 @@ Signed-off-by: Sebastian Andrzej Siewior child = d_alloc_parallel(dir, &qname, &wq); if (IS_ERR(child)) goto end_instantiate; +diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c +index c5cbbdff3c3d..3b742e3b4dbc 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c -@@ -679,7 +679,7 @@ static bool proc_sys_fill_cache(struct f +@@ -679,7 +679,7 @@ static bool proc_sys_fill_cache(struct file *file, child = d_lookup(dir, &qname); if (!child) { @@ -171,6 +188,8 @@ Signed-off-by: Sebastian Andrzej Siewior child = d_alloc_parallel(dir, &qname, &wq); if (IS_ERR(child)) return false; +diff --git a/include/linux/dcache.h b/include/linux/dcache.h +index f05a659cdf34..33c6591e59c1 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -107,7 +107,7 @@ struct dentry { @@ -182,7 +201,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct list_head d_child; /* child of parent list */ struct list_head d_subdirs; /* our children */ -@@ -237,7 +237,7 @@ extern void d_set_d_op(struct dentry *de +@@ -237,7 +237,7 @@ extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op extern struct dentry * d_alloc(struct dentry *, const struct qstr *); extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *); extern struct dentry * d_alloc_parallel(struct dentry *, const struct qstr *, @@ -191,6 +210,8 @@ Signed-off-by: Sebastian Andrzej Siewior extern struct dentry * d_splice_alias(struct inode *, struct dentry *); 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 6959968dc36a..802e849b57ac 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -1530,7 +1530,7 @@ struct nfs_unlinkdata { @@ -202,9 +223,11 @@ Signed-off-by: Sebastian Andrzej Siewior struct rpc_cred *cred; struct nfs_fattr dir_attr; long timeout; +diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c +index 7006375949c2..b14638a05ec9 100644 --- a/kernel/sched/swait.c +++ b/kernel/sched/swait.c -@@ -69,6 +69,7 @@ void swake_up_all(struct swait_queue_hea +@@ -69,6 +69,7 @@ void swake_up_all(struct swait_queue_head *q) struct swait_queue *curr; LIST_HEAD(tmp); @@ -212,3 +235,6 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_lock_irq(&q->lock); list_splice_init(&q->task_list, &tmp); while (!list_empty(&tmp)) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0312-workqueue-use-rcu.patch b/kernel/patches-4.14.x-rt/0312-0312-workqueue-Use-normal-rcu.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0312-workqueue-use-rcu.patch rename to kernel/patches-4.14.x-rt/0312-0312-workqueue-Use-normal-rcu.patch index 4615074f5..4b92d4cce 100644 --- a/kernel/patches-4.14.x-rt/0312-workqueue-use-rcu.patch +++ b/kernel/patches-4.14.x-rt/0312-0312-workqueue-Use-normal-rcu.patch @@ -1,6 +1,7 @@ -Subject: workqueue: Use normal rcu +From bc530122ea666661632fd063c6bfdf151abd34a8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 24 Jul 2013 15:26:54 +0200 +Subject: [PATCH 312/414] 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 @@ -9,9 +10,11 @@ protected by preempt or irq disabled regions. Signed-off-by: Thomas Gleixner --- - kernel/workqueue.c | 95 +++++++++++++++++++++++++++++------------------------ + kernel/workqueue.c | 95 +++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 43 deletions(-) +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index d0c6b50792c8..8237f1af3bc3 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -127,7 +127,7 @@ enum { @@ -50,7 +53,7 @@ Signed-off-by: Thomas Gleixner * determined without grabbing wq->mutex. */ struct work_struct unbound_release_work; -@@ -359,20 +359,20 @@ static void workqueue_sysfs_unregister(s +@@ -359,20 +359,20 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); #include #define assert_rcu_or_pool_mutex() \ @@ -77,7 +80,7 @@ Signed-off-by: Thomas Gleixner #define for_each_cpu_worker_pool(pool, cpu) \ for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \ -@@ -384,7 +384,7 @@ static void workqueue_sysfs_unregister(s +@@ -384,7 +384,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); * @pool: iteration cursor * @pi: integer used for iteration * @@ -86,7 +89,7 @@ Signed-off-by: Thomas Gleixner * locked. If the pool needs to be used beyond the locking in effect, the * caller is responsible for guaranteeing that the pool stays online. * -@@ -416,7 +416,7 @@ static void workqueue_sysfs_unregister(s +@@ -416,7 +416,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); * @pwq: iteration cursor * @wq: the target workqueue * @@ -95,7 +98,7 @@ Signed-off-by: Thomas Gleixner * If the pwq needs to be used beyond the locking in effect, the caller is * responsible for guaranteeing that the pwq stays online. * -@@ -552,7 +552,7 @@ static int worker_pool_assign_id(struct +@@ -552,7 +552,7 @@ static int worker_pool_assign_id(struct worker_pool *pool) * @wq: the target workqueue * @node: the node ID * @@ -104,7 +107,7 @@ Signed-off-by: Thomas Gleixner * read locked. * If the pwq needs to be used beyond the locking in effect, the caller is * responsible for guaranteeing that the pwq stays online. -@@ -696,8 +696,8 @@ static struct pool_workqueue *get_work_p +@@ -696,8 +696,8 @@ static struct pool_workqueue *get_work_pwq(struct work_struct *work) * @work: the work item of interest * * Pools are created and destroyed under wq_pool_mutex, and allows read @@ -115,7 +118,7 @@ Signed-off-by: Thomas Gleixner * * All fields of the returned pool are accessible as long as the above * mentioned locking is in effect. If the returned pool needs to be used -@@ -1102,7 +1102,7 @@ static void put_pwq_unlocked(struct pool +@@ -1102,7 +1102,7 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq) { if (pwq) { /* @@ -124,7 +127,7 @@ Signed-off-by: Thomas Gleixner * following lock operations are safe. */ spin_lock_irq(&pwq->pool->lock); -@@ -1230,6 +1230,7 @@ static int try_to_grab_pending(struct wo +@@ -1230,6 +1230,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))) return 0; @@ -132,7 +135,7 @@ Signed-off-by: Thomas Gleixner /* * The queueing is in progress, or it is already queued. Try to * steal it from ->worklist without clearing WORK_STRUCT_PENDING. -@@ -1268,10 +1269,12 @@ static int try_to_grab_pending(struct wo +@@ -1268,10 +1269,12 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, set_work_pool_and_keep_pending(work, pool->id); spin_unlock(&pool->lock); @@ -145,7 +148,7 @@ Signed-off-by: Thomas Gleixner local_irq_restore(*flags); if (work_is_canceling(work)) return -ENOENT; -@@ -1385,6 +1388,7 @@ static void __queue_work(int cpu, struct +@@ -1385,6 +1388,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, if (unlikely(wq->flags & __WQ_DRAINING) && WARN_ON_ONCE(!is_chained_work(wq))) return; @@ -153,7 +156,7 @@ Signed-off-by: Thomas Gleixner retry: if (req_cpu == WORK_CPU_UNBOUND) cpu = wq_select_unbound_cpu(raw_smp_processor_id()); -@@ -1441,10 +1445,8 @@ static void __queue_work(int cpu, struct +@@ -1441,10 +1445,8 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, /* pwq determined, queue */ trace_workqueue_queue_work(req_cpu, pwq, work); @@ -166,7 +169,7 @@ Signed-off-by: Thomas Gleixner pwq->nr_in_flight[pwq->work_color]++; work_flags = work_color_to_flags(pwq->work_color); -@@ -1462,7 +1464,9 @@ static void __queue_work(int cpu, struct +@@ -1462,7 +1464,9 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, insert_work(pwq, work, worklist, work_flags); @@ -176,7 +179,7 @@ Signed-off-by: Thomas Gleixner } /** -@@ -2815,14 +2819,14 @@ static bool start_flush_work(struct work +@@ -2815,14 +2819,14 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr) might_sleep(); @@ -194,7 +197,7 @@ Signed-off-by: Thomas Gleixner /* see the comment in try_to_grab_pending() with the same code */ pwq = get_work_pwq(work); if (pwq) { -@@ -2853,10 +2857,11 @@ static bool start_flush_work(struct work +@@ -2853,10 +2857,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); } @@ -207,7 +210,7 @@ Signed-off-by: Thomas Gleixner return false; } -@@ -3284,7 +3289,7 @@ static void rcu_free_pool(struct rcu_hea +@@ -3284,7 +3289,7 @@ static void rcu_free_pool(struct rcu_head *rcu) * put_unbound_pool - put a worker_pool * @pool: worker_pool to put * @@ -216,7 +219,7 @@ Signed-off-by: Thomas Gleixner * 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(). -@@ -3338,8 +3343,8 @@ static void put_unbound_pool(struct work +@@ -3338,8 +3343,8 @@ static void put_unbound_pool(struct worker_pool *pool) del_timer_sync(&pool->idle_timer); del_timer_sync(&pool->mayday_timer); @@ -227,7 +230,7 @@ Signed-off-by: Thomas Gleixner } /** -@@ -3446,14 +3451,14 @@ static void pwq_unbound_release_workfn(s +@@ -3446,14 +3451,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work) put_unbound_pool(pool); mutex_unlock(&wq_pool_mutex); @@ -244,7 +247,7 @@ Signed-off-by: Thomas Gleixner } /** -@@ -4128,7 +4133,7 @@ void destroy_workqueue(struct workqueue_ +@@ -4128,7 +4133,7 @@ void destroy_workqueue(struct workqueue_struct *wq) * The base ref is never dropped on per-cpu pwqs. Directly * schedule RCU free. */ @@ -253,7 +256,7 @@ Signed-off-by: Thomas Gleixner } else { /* * We're the sole accessor of @wq at this point. Directly -@@ -4238,7 +4243,8 @@ bool workqueue_congested(int cpu, struct +@@ -4238,7 +4243,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) struct pool_workqueue *pwq; bool ret; @@ -263,7 +266,7 @@ Signed-off-by: Thomas Gleixner if (cpu == WORK_CPU_UNBOUND) cpu = smp_processor_id(); -@@ -4249,7 +4255,8 @@ bool workqueue_congested(int cpu, struct +@@ -4249,7 +4255,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); @@ -273,7 +276,7 @@ Signed-off-by: Thomas Gleixner return ret; } -@@ -4275,15 +4282,15 @@ unsigned int work_busy(struct work_struc +@@ -4275,15 +4282,15 @@ unsigned int work_busy(struct work_struct *work) if (work_pending(work)) ret |= WORK_BUSY_PENDING; @@ -331,7 +334,7 @@ Signed-off-by: Thomas Gleixner } out_unlock: mutex_unlock(&wq_pool_mutex); -@@ -5097,7 +5104,8 @@ static ssize_t wq_pool_ids_show(struct d +@@ -5097,7 +5104,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, const char *delim = ""; int node, written = 0; @@ -341,7 +344,7 @@ Signed-off-by: Thomas Gleixner for_each_node(node) { written += scnprintf(buf + written, PAGE_SIZE - written, "%s%d:%d", delim, node, -@@ -5105,7 +5113,8 @@ static ssize_t wq_pool_ids_show(struct d +@@ -5105,7 +5113,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, delim = " "; } written += scnprintf(buf + written, PAGE_SIZE - written, "\n"); @@ -351,3 +354,6 @@ Signed-off-by: Thomas Gleixner return written; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0313-workqueue-use-locallock.patch b/kernel/patches-4.14.x-rt/0313-0313-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0313-workqueue-use-locallock.patch rename to kernel/patches-4.14.x-rt/0313-0313-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch index 70b26e001..51f7dc4d4 100644 --- a/kernel/patches-4.14.x-rt/0313-workqueue-use-locallock.patch +++ b/kernel/patches-4.14.x-rt/0313-0313-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch @@ -1,15 +1,19 @@ -Subject: workqueue: Use local irq lock instead of irq disable regions +From f56c9372b3af4a683575374a9f0becd1d4887901 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:42:26 +0200 +Subject: [PATCH 313/414] 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 semantic of irq-off in regard to the pool->lock and remain preemptible. Signed-off-by: Thomas Gleixner --- - kernel/workqueue.c | 36 ++++++++++++++++++++++-------------- + kernel/workqueue.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index 8237f1af3bc3..a54388c98ad6 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -49,6 +49,7 @@ @@ -20,7 +24,7 @@ Signed-off-by: Thomas Gleixner #include "workqueue_internal.h" -@@ -352,6 +353,8 @@ EXPORT_SYMBOL_GPL(system_power_efficient +@@ -352,6 +353,8 @@ 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); @@ -29,7 +33,7 @@ Signed-off-by: Thomas Gleixner static int worker_thread(void *__worker); static void workqueue_sysfs_unregister(struct workqueue_struct *wq); -@@ -1105,9 +1108,11 @@ static void put_pwq_unlocked(struct pool +@@ -1105,9 +1108,11 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq) * As both pwqs and pools are RCU protected, the * following lock operations are safe. */ @@ -43,7 +47,7 @@ Signed-off-by: Thomas Gleixner } } -@@ -1211,7 +1216,7 @@ static int try_to_grab_pending(struct wo +@@ -1211,7 +1216,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, struct worker_pool *pool; struct pool_workqueue *pwq; @@ -52,7 +56,7 @@ Signed-off-by: Thomas Gleixner /* try to steal the timer if it exists */ if (is_dwork) { -@@ -1275,7 +1280,7 @@ static int try_to_grab_pending(struct wo +@@ -1275,7 +1280,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, spin_unlock(&pool->lock); fail: rcu_read_unlock(); @@ -61,7 +65,7 @@ Signed-off-by: Thomas Gleixner if (work_is_canceling(work)) return -ENOENT; cpu_relax(); -@@ -1380,7 +1385,7 @@ static void __queue_work(int cpu, struct +@@ -1380,7 +1385,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, * queued or lose PENDING. Grabbing PENDING and queueing should * happen with IRQ disabled. */ @@ -70,7 +74,7 @@ Signed-off-by: Thomas Gleixner debug_work_activate(work); -@@ -1486,14 +1491,14 @@ bool queue_work_on(int cpu, struct workq +@@ -1486,14 +1491,14 @@ bool queue_work_on(int cpu, struct workqueue_struct *wq, bool ret = false; unsigned long flags; @@ -87,7 +91,7 @@ Signed-off-by: Thomas Gleixner return ret; } EXPORT_SYMBOL(queue_work_on); -@@ -1502,8 +1507,11 @@ void delayed_work_timer_fn(unsigned long +@@ -1502,8 +1507,11 @@ void delayed_work_timer_fn(unsigned long __data) { struct delayed_work *dwork = (struct delayed_work *)__data; @@ -99,7 +103,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(delayed_work_timer_fn); -@@ -1559,14 +1567,14 @@ bool queue_delayed_work_on(int cpu, stru +@@ -1559,14 +1567,14 @@ bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq, unsigned long flags; /* read the comment in __queue_work() */ @@ -116,7 +120,7 @@ Signed-off-by: Thomas Gleixner return ret; } EXPORT_SYMBOL(queue_delayed_work_on); -@@ -1601,7 +1609,7 @@ bool mod_delayed_work_on(int cpu, struct +@@ -1601,7 +1609,7 @@ bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq, if (likely(ret >= 0)) { __queue_delayed_work(cpu, wq, dwork, delay); @@ -125,7 +129,7 @@ Signed-off-by: Thomas Gleixner } /* -ENOENT from try_to_grab_pending() becomes %true */ -@@ -2951,7 +2959,7 @@ static bool __cancel_work_timer(struct w +@@ -2951,7 +2959,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); @@ -147,7 +151,7 @@ Signed-off-by: Thomas Gleixner return flush_work(&dwork->work); } EXPORT_SYMBOL(flush_delayed_work); -@@ -3033,7 +3041,7 @@ static bool __cancel_work(struct work_st +@@ -3033,7 +3041,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)); @@ -156,3 +160,6 @@ Signed-off-by: Thomas Gleixner return ret; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0314-work-queue-work-around-irqsafe-timer-optimization.patch b/kernel/patches-4.14.x-rt/0314-0314-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch similarity index 93% rename from kernel/patches-4.14.x-rt/0314-work-queue-work-around-irqsafe-timer-optimization.patch rename to kernel/patches-4.14.x-rt/0314-0314-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch index 8687fb723..1229ed33b 100644 --- a/kernel/patches-4.14.x-rt/0314-work-queue-work-around-irqsafe-timer-optimization.patch +++ b/kernel/patches-4.14.x-rt/0314-0314-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch @@ -1,6 +1,7 @@ +From 874e82674e471c7f9f4f0d60c819e8d32dabb17c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Mon, 01 Jul 2013 11:02:42 +0200 -Subject: workqueue: Prevent workqueue versus ata-piix livelock +Date: Mon, 1 Jul 2013 11:02:42 +0200 +Subject: [PATCH 314/414] 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 @@ -108,9 +109,11 @@ Signed-off-by: Carsten Emde Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - kernel/workqueue.c | 3 ++- + kernel/workqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index a54388c98ad6..f56f234b1209 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -50,6 +50,7 @@ @@ -121,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "workqueue_internal.h" -@@ -1283,7 +1284,7 @@ static int try_to_grab_pending(struct wo +@@ -1283,7 +1284,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, local_unlock_irqrestore(pendingb_lock, *flags); if (work_is_canceling(work)) return -ENOENT; @@ -130,3 +133,6 @@ Signed-off-by: Sebastian Andrzej Siewior return -EAGAIN; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0315-workqueue-distangle-from-rq-lock.patch b/kernel/patches-4.14.x-rt/0315-0315-sched-Distangle-worker-accounting-from-rqlock.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0315-workqueue-distangle-from-rq-lock.patch rename to kernel/patches-4.14.x-rt/0315-0315-sched-Distangle-worker-accounting-from-rqlock.patch index f9790ce06..ad7b66c3c 100644 --- a/kernel/patches-4.14.x-rt/0315-workqueue-distangle-from-rq-lock.patch +++ b/kernel/patches-4.14.x-rt/0315-0315-sched-Distangle-worker-accounting-from-rqlock.patch @@ -1,12 +1,13 @@ +From fb434ada4e710cc858d341947ee069174665f653 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Wed Jun 22 19:47:03 2011 +0200 -Subject: sched: Distangle worker accounting from rqlock - +Date: Wed, 22 Jun 2011 19:47:03 +0200 +Subject: [PATCH 315/414] 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 can be avoided by keeping track of the state in the workqueue code itself. - + Keep track of the sleeping state in the worker itself and call the notifier before entering the core scheduler. There might be false positives when the task is woken between that call and actually @@ -14,7 +15,7 @@ scheduling, but that's not really different from scheduling and being woken immediately after switching away. There is also no harm from updating nr_running when the task returns from scheduling instead of accounting it in the wakeup code. - + Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Tejun Heo @@ -22,16 +23,17 @@ Cc: Jens Axboe Cc: Linus Torvalds Link: http://lkml.kernel.org/r/20110622174919.135236139@linutronix.de Signed-off-by: Thomas Gleixner - --- - kernel/sched/core.c | 84 +++++++------------------------------------- - kernel/workqueue.c | 52 ++++++++++++--------------- - kernel/workqueue_internal.h | 5 +- + kernel/sched/core.c | 84 +++++++------------------------------ + kernel/workqueue.c | 52 ++++++++++------------- + kernel/workqueue_internal.h | 5 ++- 3 files changed, 41 insertions(+), 100 deletions(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 6ab163bbeaa0..44a529ca00e0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1716,10 +1716,6 @@ static inline void ttwu_activate(struct +@@ -1716,10 +1716,6 @@ static inline void ttwu_activate(struct rq *rq, struct task_struct *p, int en_fl { activate_task(rq, p, en_flags); p->on_rq = TASK_ON_RQ_QUEUED; @@ -42,10 +44,11 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2160,56 +2156,6 @@ try_to_wake_up(struct task_struct *p, un +@@ -2159,56 +2155,6 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) + return success; } - /** +-/** - * try_to_wake_up_local - try to wake up a local task with rq lock held - * @p: the thread to be awakened - * @rf: request-queue flags for pinning @@ -95,11 +98,10 @@ Signed-off-by: Thomas Gleixner - raw_spin_unlock(&p->pi_lock); -} - --/** + /** * wake_up_process - Wake up a specific process * @p: The process to be woken up. - * -@@ -3410,21 +3356,6 @@ static void __sched notrace __schedule(b +@@ -3410,21 +3356,6 @@ static void __sched notrace __schedule(bool preempt) atomic_inc(&rq->nr_iowait); delayacct_blkio_start(); } @@ -121,7 +123,7 @@ Signed-off-by: Thomas Gleixner } switch_count = &prev->nvcsw; } -@@ -3500,6 +3431,14 @@ static inline void sched_submit_work(str +@@ -3500,6 +3431,14 @@ static inline void sched_submit_work(struct task_struct *tsk) { if (!tsk->state || tsk_is_pi_blocked(tsk)) return; @@ -136,7 +138,7 @@ Signed-off-by: Thomas Gleixner /* * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. -@@ -3508,6 +3447,12 @@ static inline void sched_submit_work(str +@@ -3508,6 +3447,12 @@ static inline void sched_submit_work(struct task_struct *tsk) blk_schedule_flush_plug(tsk); } @@ -149,7 +151,7 @@ Signed-off-by: Thomas Gleixner asmlinkage __visible void __sched schedule(void) { struct task_struct *tsk = current; -@@ -3518,6 +3463,7 @@ asmlinkage __visible void __sched schedu +@@ -3518,6 +3463,7 @@ asmlinkage __visible void __sched schedule(void) __schedule(false); sched_preempt_enable_no_resched(); } while (need_resched()); @@ -157,9 +159,11 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(schedule); +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index f56f234b1209..a02ce94e5871 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c -@@ -845,43 +845,32 @@ static void wake_up_worker(struct worker +@@ -845,43 +845,32 @@ static void wake_up_worker(struct worker_pool *pool) } /** @@ -214,7 +218,7 @@ Signed-off-by: Thomas Gleixner struct worker_pool *pool; /* -@@ -890,13 +879,15 @@ struct task_struct *wq_worker_sleeping(s +@@ -890,13 +879,15 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task) * checking NOT_RUNNING. */ if (worker->flags & WORKER_NOT_RUNNING) @@ -234,7 +238,7 @@ Signed-off-by: Thomas Gleixner /* * The counterpart of the following dec_and_test, implied mb, -@@ -910,9 +901,12 @@ struct task_struct *wq_worker_sleeping(s +@@ -910,9 +901,12 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task) * lock is safe. */ if (atomic_dec_and_test(&pool->nr_running) && @@ -250,6 +254,8 @@ Signed-off-by: Thomas Gleixner } /** +diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h +index d390d1be3748..2dbcfe9bc364 100644 --- a/kernel/workqueue_internal.h +++ b/kernel/workqueue_internal.h @@ -45,6 +45,7 @@ struct worker { @@ -260,7 +266,7 @@ Signed-off-by: Thomas Gleixner /* * Opaque string set with work_set_desc(). Printed out with task -@@ -70,7 +71,7 @@ static inline struct worker *current_wq_ +@@ -70,7 +71,7 @@ static inline struct worker *current_wq_worker(void) * Scheduler hooks for concurrency managed workqueue. Only to be used from * sched/core.c and workqueue.c. */ @@ -270,3 +276,6 @@ Signed-off-by: Thomas Gleixner +void wq_worker_sleeping(struct task_struct *task); #endif /* _KERNEL_WORKQUEUE_INTERNAL_H */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0316-percpu_ida-use-locklocks.patch b/kernel/patches-4.14.x-rt/0316-0316-percpu_ida-Use-local-locks.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0316-percpu_ida-use-locklocks.patch rename to kernel/patches-4.14.x-rt/0316-0316-percpu_ida-Use-local-locks.patch index 9e4a3c38c..2abbb14ed 100644 --- a/kernel/patches-4.14.x-rt/0316-percpu_ida-use-locklocks.patch +++ b/kernel/patches-4.14.x-rt/0316-0316-percpu_ida-Use-local-locks.patch @@ -1,14 +1,17 @@ +From ef8eeac6d1c88e1d159af3107cdb0928ed6cbef7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 11:58:17 +0200 -Subject: percpu_ida: Use local locks +Subject: [PATCH 316/414] percpu_ida: Use local locks the local_irq_save() + spin_lock() does not work that well on -RT Signed-off-by: Sebastian Andrzej Siewior --- - lib/percpu_ida.c | 20 ++++++++++++-------- + lib/percpu_ida.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) +diff --git a/lib/percpu_ida.c b/lib/percpu_ida.c +index 6016f1deb1f5..cdd43086b55b 100644 --- a/lib/percpu_ida.c +++ b/lib/percpu_ida.c @@ -27,6 +27,9 @@ @@ -21,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct percpu_ida_cpu { /* -@@ -149,13 +152,13 @@ int percpu_ida_alloc(struct percpu_ida * +@@ -149,13 +152,13 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) unsigned long flags; int tag; @@ -37,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior return tag; } -@@ -174,6 +177,7 @@ int percpu_ida_alloc(struct percpu_ida * +@@ -174,6 +177,7 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) if (!tags->nr_free) alloc_global_tags(pool, tags); @@ -45,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!tags->nr_free) steal_tags(pool, tags); -@@ -185,7 +189,7 @@ int percpu_ida_alloc(struct percpu_ida * +@@ -185,7 +189,7 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) } spin_unlock(&pool->lock); @@ -54,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (tag >= 0 || state == TASK_RUNNING) break; -@@ -197,7 +201,7 @@ int percpu_ida_alloc(struct percpu_ida * +@@ -197,7 +201,7 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) schedule(); @@ -63,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior tags = this_cpu_ptr(pool->tag_cpu); } if (state != TASK_RUNNING) -@@ -222,7 +226,7 @@ void percpu_ida_free(struct percpu_ida * +@@ -222,7 +226,7 @@ void percpu_ida_free(struct percpu_ida *pool, unsigned tag) BUG_ON(tag >= pool->nr_tags); @@ -72,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior tags = this_cpu_ptr(pool->tag_cpu); spin_lock(&tags->lock); -@@ -254,7 +258,7 @@ void percpu_ida_free(struct percpu_ida * +@@ -254,7 +258,7 @@ void percpu_ida_free(struct percpu_ida *pool, unsigned tag) spin_unlock(&pool->lock); } @@ -81,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(percpu_ida_free); -@@ -346,7 +350,7 @@ int percpu_ida_for_each_free(struct perc +@@ -346,7 +350,7 @@ int percpu_ida_for_each_free(struct percpu_ida *pool, percpu_ida_cb fn, struct percpu_ida_cpu *remote; unsigned cpu, i, err = 0; @@ -90,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_possible_cpu(cpu) { remote = per_cpu_ptr(pool->tag_cpu, cpu); spin_lock(&remote->lock); -@@ -368,7 +372,7 @@ int percpu_ida_for_each_free(struct perc +@@ -368,7 +372,7 @@ int percpu_ida_for_each_free(struct percpu_ida *pool, percpu_ida_cb fn, } spin_unlock(&pool->lock); out: @@ -99,3 +102,6 @@ Signed-off-by: Sebastian Andrzej Siewior return err; } EXPORT_SYMBOL_GPL(percpu_ida_for_each_free); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0317-debugobjects-rt.patch b/kernel/patches-4.14.x-rt/0317-0317-debugobjects-Make-RT-aware.patch similarity index 58% rename from kernel/patches-4.14.x-rt/0317-debugobjects-rt.patch rename to kernel/patches-4.14.x-rt/0317-0317-debugobjects-Make-RT-aware.patch index dd32133de..376381970 100644 --- a/kernel/patches-4.14.x-rt/0317-debugobjects-rt.patch +++ b/kernel/patches-4.14.x-rt/0317-0317-debugobjects-Make-RT-aware.patch @@ -1,17 +1,20 @@ -Subject: debugobjects: Make RT aware +From 486c11672e2b42023b9b966fd4a7f289237ff668 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:41:35 +0200 +Subject: [PATCH 317/414] debugobjects: Make RT aware Avoid filling the pool / allocating memory with irqs off(). Signed-off-by: Thomas Gleixner --- - lib/debugobjects.c | 5 ++++- + lib/debugobjects.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/lib/debugobjects.c b/lib/debugobjects.c +index 2f5349c6e81a..d789930edcc2 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c -@@ -336,7 +336,10 @@ static void +@@ -336,7 +336,10 @@ __debug_object_init(void *addr, struct debug_obj_descr *descr, int onstack) struct debug_obj *obj; unsigned long flags; @@ -23,3 +26,6 @@ Signed-off-by: Thomas Gleixner db = get_bucket((unsigned long) addr); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0318-jump-label-rt.patch b/kernel/patches-4.14.x-rt/0318-0318-jump-label-disable-if-stop_machine-is-used.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0318-jump-label-rt.patch rename to kernel/patches-4.14.x-rt/0318-0318-jump-label-disable-if-stop_machine-is-used.patch index 782de0c79..df753984b 100644 --- a/kernel/patches-4.14.x-rt/0318-jump-label-rt.patch +++ b/kernel/patches-4.14.x-rt/0318-0318-jump-label-disable-if-stop_machine-is-used.patch @@ -1,6 +1,7 @@ -Subject: jump-label: disable if stop_machine() is used +From f7f75473dbcc1a9f37c6db6c9dd3ec2f6849c2bf Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Wed, 08 Jul 2015 17:14:48 +0200 +Date: Wed, 8 Jul 2015 17:14:48 +0200 +Subject: [PATCH 318/414] jump-label: disable if stop_machine() is used Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. @@ -19,9 +20,11 @@ Signed-off-by: Thomas Gleixner [bigeasy: only ARM for now] Signed-off-by: Sebastian Andrzej Siewior --- - arch/arm/Kconfig | 2 +- + arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index d1346a160760..e57221694d28 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -45,7 +45,7 @@ config ARM @@ -33,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU select HAVE_ARCH_MMAP_RND_BITS if MMU select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0319-seqlock-prevent-rt-starvation.patch b/kernel/patches-4.14.x-rt/0319-0319-seqlock-Prevent-rt-starvation.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0319-seqlock-prevent-rt-starvation.patch rename to kernel/patches-4.14.x-rt/0319-0319-seqlock-Prevent-rt-starvation.patch index 3fd3d955e..044fe6a1a 100644 --- a/kernel/patches-4.14.x-rt/0319-seqlock-prevent-rt-starvation.patch +++ b/kernel/patches-4.14.x-rt/0319-0319-seqlock-Prevent-rt-starvation.patch @@ -1,6 +1,7 @@ -Subject: seqlock: Prevent rt starvation +From d02ab7e10b1e9f2ef97676c0510da95fceeb967b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 22 Feb 2012 12:03:30 +0100 +Subject: [PATCH 319/414] 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. @@ -18,16 +19,16 @@ Nicholas Mc Guire: - __write_seqcount_begin => __raw_write_seqcount_begin Signed-off-by: Thomas Gleixner - - --- - include/linux/seqlock.h | 56 +++++++++++++++++++++++++++++++++++++----------- - include/net/neighbour.h | 6 ++--- + include/linux/seqlock.h | 56 ++++++++++++++++++++++++++++++++--------- + include/net/neighbour.h | 6 ++--- 2 files changed, 47 insertions(+), 15 deletions(-) +diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h +index f189a8a3bbb8..e99de03f09ef 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h -@@ -221,20 +221,30 @@ static inline int read_seqcount_retry(co +@@ -221,20 +221,30 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) return __read_seqcount_retry(s, start); } @@ -95,7 +96,7 @@ Signed-off-by: Thomas Gleixner static inline unsigned read_seqretry(const seqlock_t *sl, unsigned start) { -@@ -447,36 +479,36 @@ static inline unsigned read_seqretry(con +@@ -447,36 +479,36 @@ static inline unsigned read_seqretry(const seqlock_t *sl, unsigned start) static inline void write_seqlock(seqlock_t *sl) { spin_lock(&sl->lock); @@ -138,7 +139,7 @@ Signed-off-by: Thomas Gleixner spin_unlock_irq(&sl->lock); } -@@ -485,7 +517,7 @@ static inline unsigned long __write_seql +@@ -485,7 +517,7 @@ static inline unsigned long __write_seqlock_irqsave(seqlock_t *sl) unsigned long flags; spin_lock_irqsave(&sl->lock, flags); @@ -147,7 +148,7 @@ Signed-off-by: Thomas Gleixner return flags; } -@@ -495,7 +527,7 @@ static inline unsigned long __write_seql +@@ -495,7 +527,7 @@ static inline unsigned long __write_seqlock_irqsave(seqlock_t *sl) static inline void write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags) { @@ -156,9 +157,11 @@ Signed-off-by: Thomas Gleixner spin_unlock_irqrestore(&sl->lock, flags); } +diff --git a/include/net/neighbour.h b/include/net/neighbour.h +index a964366a7ef5..51c854583987 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h -@@ -450,7 +450,7 @@ static inline int neigh_hh_bridge(struct +@@ -450,7 +450,7 @@ static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) } #endif @@ -167,7 +170,7 @@ Signed-off-by: Thomas Gleixner { unsigned int seq; unsigned int hh_len; -@@ -474,7 +474,7 @@ static inline int neigh_hh_output(const +@@ -474,7 +474,7 @@ static inline int neigh_hh_output(const struct hh_cache *hh, struct sk_buff *skb static inline int neigh_output(struct neighbour *n, struct sk_buff *skb) { @@ -185,3 +188,6 @@ Signed-off-by: Thomas Gleixner const struct net_device *dev) { unsigned int seq; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0320-sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/kernel/patches-4.14.x-rt/0320-0320-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0320-sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch rename to kernel/patches-4.14.x-rt/0320-0320-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch index c248ca0aa..8eb292f99 100644 --- a/kernel/patches-4.14.x-rt/0320-sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/kernel/patches-4.14.x-rt/0320-0320-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,6 +1,8 @@ +From 9be48a5300df1f103eae12aaa574ce898f167829 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 18 Feb 2015 16:05:28 +0100 -Subject: sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() +Subject: [PATCH 320/414] sunrpc: Make svc_xprt_do_enqueue() use + get_cpu_light() |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd @@ -28,12 +30,14 @@ Subject: sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - net/sunrpc/svc_xprt.c | 6 +++--- + net/sunrpc/svc_xprt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c +index d16a8b423c20..cedaf909eb97 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c -@@ -396,7 +396,7 @@ void svc_xprt_do_enqueue(struct svc_xprt +@@ -396,7 +396,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt) goto out; } @@ -42,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior pool = svc_pool_for_cpu(xprt->xpt_server, cpu); atomic_long_inc(&pool->sp_stats.packets); -@@ -432,7 +432,7 @@ void svc_xprt_do_enqueue(struct svc_xprt +@@ -432,7 +432,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt) atomic_long_inc(&pool->sp_stats.threads_woken); wake_up_process(rqstp->rq_task); @@ -51,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; } rcu_read_unlock(); -@@ -453,7 +453,7 @@ void svc_xprt_do_enqueue(struct svc_xprt +@@ -453,7 +453,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt) goto redo_search; } rqstp = NULL; @@ -60,3 +64,6 @@ Signed-off-by: Sebastian Andrzej Siewior out: trace_svc_xprt_do_enqueue(xprt, rqstp); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0321-skbufhead-raw-lock.patch b/kernel/patches-4.14.x-rt/0321-0321-net-Use-skbufhead-with-raw-lock.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0321-skbufhead-raw-lock.patch rename to kernel/patches-4.14.x-rt/0321-0321-net-Use-skbufhead-with-raw-lock.patch index 865ea6c72..34cfeab96 100644 --- a/kernel/patches-4.14.x-rt/0321-skbufhead-raw-lock.patch +++ b/kernel/patches-4.14.x-rt/0321-0321-net-Use-skbufhead-with-raw-lock.patch @@ -1,6 +1,7 @@ +From aa8c557bc62b92234f5ed1609124b13f4be8957f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 12 Jul 2011 15:38:34 +0200 -Subject: net: Use skbufhead with raw lock +Subject: [PATCH 321/414] 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 @@ -8,11 +9,13 @@ to the softirq and use the tofree_queue list for it (similar to process_queue). Signed-off-by: Thomas Gleixner --- - include/linux/netdevice.h | 1 + - include/linux/skbuff.h | 7 +++++++ - net/core/dev.c | 31 ++++++++++++++++++++++++------- + include/linux/netdevice.h | 1 + + include/linux/skbuff.h | 7 +++++++ + net/core/dev.c | 31 ++++++++++++++++++++++++------- 3 files changed, 32 insertions(+), 7 deletions(-) +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index 46bf7cc7d5d5..a5e88b07a471 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2772,6 +2772,7 @@ struct softnet_data { @@ -23,6 +26,8 @@ Signed-off-by: Thomas Gleixner }; +diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h +index be45224b01d7..675e45323f17 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -287,6 +287,7 @@ struct sk_buff_head { @@ -33,7 +38,7 @@ Signed-off-by: Thomas Gleixner }; struct sk_buff; -@@ -1667,6 +1668,12 @@ static inline void skb_queue_head_init(s +@@ -1667,6 +1668,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) __skb_queue_head_init(list); } @@ -46,9 +51,11 @@ Signed-off-by: Thomas Gleixner static inline void skb_queue_head_init_class(struct sk_buff_head *list, struct lock_class_key *class) { +diff --git a/net/core/dev.c b/net/core/dev.c +index ab2b55dcd05f..536508ef7d5e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -217,14 +217,14 @@ static inline struct hlist_head *dev_ind +@@ -217,14 +217,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 @@ -65,7 +72,7 @@ Signed-off-by: Thomas Gleixner #endif } -@@ -4608,7 +4608,7 @@ static void flush_backlog(struct work_st +@@ -4608,7 +4608,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); @@ -74,7 +81,7 @@ Signed-off-by: Thomas Gleixner input_queue_head_incr(sd); } } -@@ -4618,11 +4618,14 @@ static void flush_backlog(struct work_st +@@ -4618,11 +4618,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); @@ -90,7 +97,7 @@ Signed-off-by: Thomas Gleixner } static void flush_all_backlogs(void) -@@ -5169,7 +5172,9 @@ static int process_backlog(struct napi_s +@@ -5169,7 +5172,9 @@ static int process_backlog(struct napi_struct *napi, int quota) while (again) { struct sk_buff *skb; @@ -100,7 +107,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); __netif_receive_skb(skb); rcu_read_unlock(); -@@ -5177,9 +5182,9 @@ static int process_backlog(struct napi_s +@@ -5177,9 +5182,9 @@ static int process_backlog(struct napi_struct *napi, int quota) if (++work >= quota) return work; @@ -111,7 +118,7 @@ Signed-off-by: Thomas Gleixner rps_lock(sd); if (skb_queue_empty(&sd->input_pkt_queue)) { /* -@@ -5619,13 +5624,21 @@ static __latent_entropy void net_rx_acti +@@ -5619,13 +5624,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; @@ -133,7 +140,7 @@ Signed-off-by: Thomas Gleixner for (;;) { struct napi_struct *n; -@@ -8440,6 +8453,9 @@ static int dev_cpu_dead(unsigned int old +@@ -8440,6 +8453,9 @@ static int dev_cpu_dead(unsigned int oldcpu) netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -155,3 +162,6 @@ Signed-off-by: Thomas Gleixner INIT_LIST_HEAD(&sd->poll_list); sd->output_queue_tailp = &sd->output_queue; #ifdef CONFIG_RPS +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0322-net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch b/kernel/patches-4.14.x-rt/0322-0322-net-core-cpuhotplug-Drain-input_pkt_queue-lockless.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0322-net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch rename to kernel/patches-4.14.x-rt/0322-0322-net-core-cpuhotplug-Drain-input_pkt_queue-lockless.patch index 45b7402e6..7a2d1d95c 100644 --- a/kernel/patches-4.14.x-rt/0322-net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch +++ b/kernel/patches-4.14.x-rt/0322-0322-net-core-cpuhotplug-Drain-input_pkt_queue-lockless.patch @@ -1,8 +1,9 @@ -Subject: net/core/cpuhotplug: Drain input_pkt_queue lockless +From 9c45aca7ebb5f1876046c17476a0147cc6b945ae Mon Sep 17 00:00:00 2001 From: Grygorii Strashko Date: Fri, 9 Oct 2015 09:25:49 -0500 +Subject: [PATCH 322/414] net/core/cpuhotplug: Drain input_pkt_queue lockless -I can constantly see below error report with 4.1 RT-kernel on TI ARM dra7-evm +I can constantly see below error report with 4.1 RT-kernel on TI ARM dra7-evm if I'm trying to unplug cpu1: [ 57.737589] CPU1: shutdown @@ -30,12 +31,14 @@ Fixes: 91df05da13a6 'net: Use skbufhead with raw lock' Signed-off-by: Thomas Gleixner Cc: stable-rt@vger.kernel.org --- - net/core/dev.c | 2 +- + net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/net/core/dev.c b/net/core/dev.c +index 536508ef7d5e..bcbc5b2b2d3f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -8449,7 +8449,7 @@ static int dev_cpu_dead(unsigned int old +@@ -8449,7 +8449,7 @@ static int dev_cpu_dead(unsigned int oldcpu) netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -44,3 +47,6 @@ Cc: stable-rt@vger.kernel.org netif_rx_ni(skb); input_queue_head_incr(oldsd); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0323-net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/kernel/patches-4.14.x-rt/0323-0323-net-move-xmit_recursion-to-per-task-variable-on-RT.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0323-net-move-xmit_recursion-to-per-task-variable-on-RT.patch rename to kernel/patches-4.14.x-rt/0323-0323-net-move-xmit_recursion-to-per-task-variable-on-RT.patch index ccd23a288..f3614aafc 100644 --- a/kernel/patches-4.14.x-rt/0323-net-move-xmit_recursion-to-per-task-variable-on-RT.patch +++ b/kernel/patches-4.14.x-rt/0323-0323-net-move-xmit_recursion-to-per-task-variable-on-RT.patch @@ -1,6 +1,7 @@ +From 5fb53f2940525ef6ad39acc8f612e657bd7cbea7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Jan 2016 15:55:02 +0100 -Subject: net: move xmit_recursion to per-task variable on -RT +Subject: [PATCH 323/414] 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 @@ -15,15 +16,17 @@ the recursion properly on -RT. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/netdevice.h | 41 ++++++++++++++++++++++++++++++++++++++++- - include/linux/sched.h | 3 +++ - net/core/dev.c | 9 +++++---- - net/core/filter.c | 6 +++--- + include/linux/netdevice.h | 41 ++++++++++++++++++++++++++++++++++++++- + include/linux/sched.h | 3 +++ + net/core/dev.c | 9 +++++---- + net/core/filter.c | 6 +++--- 4 files changed, 51 insertions(+), 8 deletions(-) +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index a5e88b07a471..03d01f91df83 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2433,14 +2433,53 @@ void netdev_freemem(struct net_device *d +@@ -2433,14 +2433,53 @@ void netdev_freemem(struct net_device *dev); void synchronize_net(void); int init_dummy_netdev(struct net_device *dev); @@ -78,21 +81,25 @@ Signed-off-by: Sebastian Andrzej Siewior 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); +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 358748c77304..f6ea03d86966 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1116,6 +1116,9 @@ struct task_struct { +@@ -1115,6 +1115,9 @@ struct task_struct { + #endif #ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change; - #endif ++#endif +#ifdef CONFIG_PREEMPT_RT_FULL + int xmit_recursion; -+#endif + #endif int pagefault_disabled; #ifdef CONFIG_MMU - struct task_struct *oom_reaper_list; +diff --git a/net/core/dev.c b/net/core/dev.c +index bcbc5b2b2d3f..b39e7672062a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3248,8 +3248,10 @@ static void skb_update_prio(struct sk_bu +@@ -3248,8 +3248,10 @@ static void skb_update_prio(struct sk_buff *skb) #define skb_update_prio(skb) #endif @@ -103,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * dev_loopback_xmit - loop back @skb -@@ -3490,8 +3492,7 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3490,8 +3492,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv) int cpu = smp_processor_id(); /* ok because BHs are off */ if (txq->xmit_lock_owner != cpu) { @@ -113,7 +120,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto recursion_alert; skb = validate_xmit_skb(skb, dev); -@@ -3501,9 +3502,9 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3501,9 +3502,9 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv) HARD_TX_LOCK(dev, txq, cpu); if (!netif_xmit_stopped(txq)) { @@ -125,9 +132,11 @@ Signed-off-by: Sebastian Andrzej Siewior if (dev_xmit_complete(rc)) { HARD_TX_UNLOCK(dev, txq); goto out; +diff --git a/net/core/filter.c b/net/core/filter.c +index d5158a10ac8f..ad96ec78f7b8 100644 --- a/net/core/filter.c +++ b/net/core/filter.c -@@ -1696,7 +1696,7 @@ static inline int __bpf_tx_skb(struct ne +@@ -1696,7 +1696,7 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) { int ret; @@ -136,7 +145,7 @@ Signed-off-by: Sebastian Andrzej Siewior net_crit_ratelimited("bpf: recursion limit reached on datapath, buggy bpf program?\n"); kfree_skb(skb); return -ENETDOWN; -@@ -1704,9 +1704,9 @@ static inline int __bpf_tx_skb(struct ne +@@ -1704,9 +1704,9 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) skb->dev = dev; @@ -148,3 +157,6 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0324-net-use-task_struct-instead-of-CPU-number-as-the-que.patch b/kernel/patches-4.14.x-rt/0324-0324-net-use-task_struct-instead-of-CPU-number-as-the-que.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0324-net-use-task_struct-instead-of-CPU-number-as-the-que.patch rename to kernel/patches-4.14.x-rt/0324-0324-net-use-task_struct-instead-of-CPU-number-as-the-que.patch index 2d7ca26bc..9b7c0ca1a 100644 --- a/kernel/patches-4.14.x-rt/0324-net-use-task_struct-instead-of-CPU-number-as-the-que.patch +++ b/kernel/patches-4.14.x-rt/0324-0324-net-use-task_struct-instead-of-CPU-number-as-the-que.patch @@ -1,7 +1,8 @@ +From 12adfa82bdfa758daeeac0a221f6c51b393c513c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 21 Feb 2018 10:39:54 +0100 -Subject: [PATCH] net: use task_struct instead of CPU number as the queue - owner on -RT +Subject: [PATCH 324/414] net: use task_struct instead of CPU number as the + queue owner on -RT In commit ("net: move xmit_recursion to per-task variable on -RT") the recursion level was changed to be per-task since we can get preempted in @@ -14,10 +15,12 @@ Reported-by: Kurt Kanzenbach Tested-by: Kurt Kanzenbach Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/netdevice.h | 54 ++++++++++++++++++++++++++++++++++++++++------ - net/core/dev.c | 6 ++++- + include/linux/netdevice.h | 54 ++++++++++++++++++++++++++++++++++----- + net/core/dev.c | 6 ++++- 2 files changed, 53 insertions(+), 7 deletions(-) +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index 03d01f91df83..2b0110cc0e13 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -571,7 +571,11 @@ struct netdev_queue { @@ -32,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Time (in jiffies) of last Tx */ -@@ -3535,10 +3539,48 @@ static inline u32 netif_msg_init(int deb +@@ -3535,10 +3539,48 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) return (1 << debug_value) - 1; } @@ -82,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline bool __netif_tx_acquire(struct netdev_queue *txq) -@@ -3555,32 +3597,32 @@ static inline void __netif_tx_release(st +@@ -3555,32 +3597,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); @@ -120,9 +123,11 @@ Signed-off-by: Sebastian Andrzej Siewior txq->trans_start = jiffies; } +diff --git a/net/core/dev.c b/net/core/dev.c +index b39e7672062a..2077c851f3b4 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3491,7 +3491,11 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3491,7 +3491,11 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv) if (dev->flags & IFF_UP) { int cpu = smp_processor_id(); /* ok because BHs are off */ @@ -134,7 +139,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (unlikely(xmit_rec_read() > XMIT_RECURSION_LIMIT)) goto recursion_alert; -@@ -7496,7 +7500,7 @@ static void netdev_init_one_queue(struct +@@ -7496,7 +7500,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); @@ -143,3 +148,6 @@ Signed-off-by: Sebastian Andrzej Siewior netdev_queue_numa_node_write(queue, NUMA_NO_NODE); queue->dev = dev; #ifdef CONFIG_BQL +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0325-net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/kernel/patches-4.14.x-rt/0325-0325-net-provide-a-way-to-delegate-processing-a-softirq-t.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0325-net-provide-a-way-to-delegate-processing-a-softirq-t.patch rename to kernel/patches-4.14.x-rt/0325-0325-net-provide-a-way-to-delegate-processing-a-softirq-t.patch index af2e8f34f..d7f8a0cc3 100644 --- a/kernel/patches-4.14.x-rt/0325-net-provide-a-way-to-delegate-processing-a-softirq-t.patch +++ b/kernel/patches-4.14.x-rt/0325-0325-net-provide-a-way-to-delegate-processing-a-softirq-t.patch @@ -1,7 +1,8 @@ +From 0d46d626c7a61114e0949aa9538ac72de117a05c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 15:39:05 +0100 -Subject: net: provide a way to delegate processing a softirq to - ksoftirqd +Subject: [PATCH 325/414] 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 invocations into the `ksoftirqd`. On -RT it does not do so. Instead it @@ -13,11 +14,13 @@ __raise_softirq_irqoff_ksoft() which raises the softirq in the ksoftird. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/interrupt.h | 8 ++++++++ - kernel/softirq.c | 21 +++++++++++++++++++++ - net/core/dev.c | 2 +- + include/linux/interrupt.h | 8 ++++++++ + kernel/softirq.c | 21 +++++++++++++++++++++ + net/core/dev.c | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 326af722c5ee..0f25fa19b2d8 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -519,6 +519,14 @@ extern void thread_do_softirq(void); @@ -35,12 +38,15 @@ Signed-off-by: Sebastian Andrzej Siewior extern void raise_softirq_irqoff(unsigned int nr); extern void raise_softirq(unsigned int nr); +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 69a45729907a..28bd8394caa3 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -686,6 +686,27 @@ void __raise_softirq_irqoff(unsigned int +@@ -685,6 +685,27 @@ void __raise_softirq_irqoff(unsigned int nr) + wakeup_proper_softirq(nr); } - /* ++/* + * Same as __raise_softirq_irqoff() but will process them in ksoftirqd + */ +void __raise_softirq_irqoff_ksoft(unsigned int nr) @@ -61,13 +67,14 @@ Signed-off-by: Sebastian Andrzej Siewior + wakeup_proper_softirq(nr); +} + -+/* + /* * This function must run with irqs disabled! */ - void raise_softirq_irqoff(unsigned int nr) +diff --git a/net/core/dev.c b/net/core/dev.c +index 2077c851f3b4..626d7cc80b7a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5673,7 +5673,7 @@ static __latent_entropy void net_rx_acti +@@ -5673,7 +5673,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)) @@ -76,3 +83,6 @@ Signed-off-by: Sebastian Andrzej Siewior net_rps_action_and_irq_enable(sd); out: +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0326-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/kernel/patches-4.14.x-rt/0326-0326-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0326-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch rename to kernel/patches-4.14.x-rt/0326-0326-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index 09a006075..014672b06 100644 --- a/kernel/patches-4.14.x-rt/0326-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/kernel/patches-4.14.x-rt/0326-0326-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,6 +1,8 @@ +From 9c18aecf96f5310afecaab00a6dbf74615cc9602 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 30 Mar 2016 13:36:29 +0200 -Subject: [PATCH] net: dev: always take qdisc's busylock in __dev_xmit_skb() +Subject: [PATCH 326/414] 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 setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away @@ -15,12 +17,14 @@ low-prio task and submit the packet. Signed-off-by: Sebastian Andrzej Siewior --- - net/core/dev.c | 4 ++++ + net/core/dev.c | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/net/core/dev.c b/net/core/dev.c +index 626d7cc80b7a..8a9590c0d6af 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3177,7 +3177,11 @@ static inline int __dev_xmit_skb(struct +@@ -3177,7 +3177,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. */ @@ -32,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (unlikely(contended)) spin_lock(&q->busylock); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0327-net-Qdisc-use-a-seqlock-instead-seqcount.patch b/kernel/patches-4.14.x-rt/0327-0327-net-Qdisc-use-a-seqlock-instead-seqcount.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0327-net-Qdisc-use-a-seqlock-instead-seqcount.patch rename to kernel/patches-4.14.x-rt/0327-0327-net-Qdisc-use-a-seqlock-instead-seqcount.patch index b16348cc7..c357d2042 100644 --- a/kernel/patches-4.14.x-rt/0327-net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/kernel/patches-4.14.x-rt/0327-0327-net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,6 +1,7 @@ +From 7aab44d2f015ac27ee797f0916375aa9581d640e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 17:36:35 +0200 -Subject: [PATCH] net/Qdisc: use a seqlock instead seqcount +Subject: [PATCH 327/414] 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 @@ -9,20 +10,22 @@ the lock while writer is active. Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/seqlock.h | 9 +++++++++ - include/net/gen_stats.h | 9 +++++---- - include/net/net_seq_lock.h | 15 +++++++++++++++ - include/net/sch_generic.h | 21 ++++++++++++++++++--- - net/core/gen_estimator.c | 6 +++--- - net/core/gen_stats.c | 8 ++++---- - net/sched/sch_api.c | 2 +- - net/sched/sch_generic.c | 12 ++++++++++++ + include/linux/seqlock.h | 9 +++++++++ + include/net/gen_stats.h | 9 +++++---- + include/net/net_seq_lock.h | 15 +++++++++++++++ + include/net/sch_generic.h | 21 ++++++++++++++++++--- + net/core/gen_estimator.c | 6 +++--- + net/core/gen_stats.c | 8 ++++---- + net/sched/sch_api.c | 2 +- + net/sched/sch_generic.c | 12 ++++++++++++ 8 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 include/net/net_seq_lock.h +diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h +index e99de03f09ef..a59751276b94 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h -@@ -482,6 +482,15 @@ static inline void write_seqlock(seqlock +@@ -482,6 +482,15 @@ static inline void write_seqlock(seqlock_t *sl) __raw_write_seqcount_begin(&sl->seqcount); } @@ -38,6 +41,8 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void write_sequnlock(seqlock_t *sl) { __raw_write_seqcount_end(&sl->seqcount); +diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h +index 304f7aa9cc01..00d3813cef26 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h @@ -6,6 +6,7 @@ @@ -48,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct gnet_stats_basic_cpu { struct gnet_stats_basic_packed bstats; -@@ -36,11 +37,11 @@ int gnet_stats_start_copy_compat(struct +@@ -36,11 +37,11 @@ int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, spinlock_t *lock, struct gnet_dump *d, int padattr); @@ -62,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu, struct gnet_stats_basic_packed *b); -@@ -57,13 +58,13 @@ int gen_new_estimator(struct gnet_stats_ +@@ -57,13 +58,13 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu_bstats, struct net_rate_estimator __rcu **rate_est, spinlock_t *stats_lock, @@ -78,6 +83,9 @@ Signed-off-by: Sebastian Andrzej Siewior bool gen_estimator_active(struct net_rate_estimator __rcu **ptr); bool gen_estimator_read(struct net_rate_estimator __rcu **ptr, struct gnet_stats_rate_est64 *sample); +diff --git a/include/net/net_seq_lock.h b/include/net/net_seq_lock.h +new file mode 100644 +index 000000000000..a7034298a82a --- /dev/null +++ b/include/net/net_seq_lock.h @@ -0,0 +1,15 @@ @@ -96,6 +104,8 @@ Signed-off-by: Sebastian Andrzej Siewior +#endif + +#endif +diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h +index f59acacaa265..6ac7c3659973 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -10,6 +10,7 @@ @@ -115,7 +125,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct gnet_stats_queue qstats; unsigned long state; struct Qdisc *next_sched; -@@ -109,13 +110,22 @@ static inline void qdisc_refcount_inc(st +@@ -109,13 +110,22 @@ static inline void qdisc_refcount_inc(struct Qdisc *qdisc) refcount_inc(&qdisc->refcnt); } @@ -139,7 +149,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (qdisc_is_running(qdisc)) return false; /* Variant of write_seqcount_begin() telling lockdep a trylock -@@ -124,11 +134,16 @@ static inline bool qdisc_run_begin(struc +@@ -124,11 +134,16 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc) raw_write_seqcount_begin(&qdisc->running); seqcount_acquire(&qdisc->running.dep_map, 0, 1, _RET_IP_); return true; @@ -156,7 +166,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline bool qdisc_may_bulk(const struct Qdisc *qdisc) -@@ -337,7 +352,7 @@ static inline spinlock_t *qdisc_root_sle +@@ -337,7 +352,7 @@ static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc) return qdisc_lock(root); } @@ -165,6 +175,8 @@ Signed-off-by: Sebastian Andrzej Siewior { struct Qdisc *root = qdisc_root_sleeping(qdisc); +diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c +index 7f980bd7426e..7250106015ef 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -46,7 +46,7 @@ @@ -176,7 +188,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct gnet_stats_basic_cpu __percpu *cpu_bstats; u8 ewma_log; u8 intvl_log; /* period : (250ms << intvl_log) */ -@@ -129,7 +129,7 @@ int gen_new_estimator(struct gnet_stats_ +@@ -129,7 +129,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu_bstats, struct net_rate_estimator __rcu **rate_est, spinlock_t *stats_lock, @@ -185,7 +197,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct nlattr *opt) { struct gnet_estimator *parm = nla_data(opt); -@@ -222,7 +222,7 @@ int gen_replace_estimator(struct gnet_st +@@ -222,7 +222,7 @@ int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu_bstats, struct net_rate_estimator __rcu **rate_est, spinlock_t *stats_lock, @@ -194,9 +206,11 @@ Signed-off-by: Sebastian Andrzej Siewior { return gen_new_estimator(bstats, cpu_bstats, rate_est, stats_lock, running, opt); +diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c +index 87f28557b329..18e6c2a9f465 100644 --- a/net/core/gen_stats.c +++ b/net/core/gen_stats.c -@@ -130,7 +130,7 @@ static void +@@ -130,7 +130,7 @@ __gnet_stats_copy_basic_cpu(struct gnet_stats_basic_packed *bstats, } void @@ -205,7 +219,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu, struct gnet_stats_basic_packed *b) -@@ -143,10 +143,10 @@ void +@@ -143,10 +143,10 @@ __gnet_stats_copy_basic(const seqcount_t *running, } do { if (running) @@ -227,9 +241,11 @@ Signed-off-by: Sebastian Andrzej Siewior struct gnet_dump *d, 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 22bc6fc48311..131aac4cf2e0 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -1081,7 +1081,7 @@ static struct Qdisc *qdisc_create(struct +@@ -1081,7 +1081,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev, rcu_assign_pointer(sch->stab, stab); } if (tca[TCA_RATE]) { @@ -238,6 +254,8 @@ Signed-off-by: Sebastian Andrzej Siewior err = -EOPNOTSUPP; if (sch->flags & TCQ_F_MQROOT) +diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c +index de0839491dd8..341f7895659c 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -429,7 +429,11 @@ struct Qdisc noop_qdisc = { @@ -252,7 +270,7 @@ Signed-off-by: Sebastian Andrzej Siewior .busylock = __SPIN_LOCK_UNLOCKED(noop_qdisc.busylock), }; EXPORT_SYMBOL(noop_qdisc); -@@ -628,9 +632,17 @@ struct Qdisc *qdisc_alloc(struct netdev_ +@@ -628,9 +632,17 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, lockdep_set_class(&sch->busylock, dev->qdisc_tx_busylock ?: &qdisc_tx_busylock); @@ -270,3 +288,6 @@ Signed-off-by: Sebastian Andrzej Siewior sch->ops = ops; sch->enqueue = ops->enqueue; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0328-net-add-back-the-missing-serialization-in-ip_send_un.patch b/kernel/patches-4.14.x-rt/0328-0328-net-add-back-the-missing-serialization-in-ip_send_un.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0328-net-add-back-the-missing-serialization-in-ip_send_un.patch rename to kernel/patches-4.14.x-rt/0328-0328-net-add-back-the-missing-serialization-in-ip_send_un.patch index 0dc9f7f2f..046418c39 100644 --- a/kernel/patches-4.14.x-rt/0328-net-add-back-the-missing-serialization-in-ip_send_un.patch +++ b/kernel/patches-4.14.x-rt/0328-0328-net-add-back-the-missing-serialization-in-ip_send_un.patch @@ -1,6 +1,7 @@ +From 82fdf9494a68f087723e08a533fa550fc72fe970 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:21:56 +0200 -Subject: [PATCH] net: add back the missing serialization in +Subject: [PATCH 328/414] net: add back the missing serialization in ip_send_unicast_reply() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -37,9 +38,11 @@ This is brings back the old locks. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - net/ipv4/tcp_ipv4.c | 6 ++++++ + net/ipv4/tcp_ipv4.c | 6 ++++++ 1 file changed, 6 insertions(+) +diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c +index cab4b935e474..43ca00e05177 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -62,6 +62,7 @@ @@ -50,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include -@@ -580,6 +581,7 @@ void tcp_v4_send_check(struct sock *sk, +@@ -580,6 +581,7 @@ void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb) } EXPORT_SYMBOL(tcp_v4_send_check); @@ -58,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * This routine will send an RST to the other tcp. * -@@ -709,6 +711,7 @@ static void tcp_v4_send_reset(const stru +@@ -709,6 +711,7 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) arg.tos = ip_hdr(skb)->tos; arg.uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL); @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_bh_disable(); ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk), skb, &TCP_SKB_CB(skb)->header.h4.opt, -@@ -718,6 +721,7 @@ static void tcp_v4_send_reset(const stru +@@ -718,6 +721,7 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) __TCP_INC_STATS(net, TCP_MIB_OUTSEGS); __TCP_INC_STATS(net, TCP_MIB_OUTRSTS); local_bh_enable(); @@ -74,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_TCP_MD5SIG out: -@@ -795,6 +799,7 @@ static void tcp_v4_send_ack(const struct +@@ -795,6 +799,7 @@ static void tcp_v4_send_ack(const struct sock *sk, arg.bound_dev_if = oif; arg.tos = tos; arg.uid = sock_net_uid(net, sk_fullsock(sk) ? sk : NULL); @@ -82,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_bh_disable(); ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk), skb, &TCP_SKB_CB(skb)->header.h4.opt, -@@ -803,6 +808,7 @@ static void tcp_v4_send_ack(const struct +@@ -803,6 +808,7 @@ static void tcp_v4_send_ack(const struct sock *sk, __TCP_INC_STATS(net, TCP_MIB_OUTSEGS); local_bh_enable(); @@ -90,3 +93,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0329-net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch b/kernel/patches-4.14.x-rt/0329-0329-net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0329-net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch rename to kernel/patches-4.14.x-rt/0329-0329-net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch index 47e284763..13fc0f54a 100644 --- a/kernel/patches-4.14.x-rt/0329-net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch +++ b/kernel/patches-4.14.x-rt/0329-0329-net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch @@ -1,6 +1,7 @@ +From f2951c60354c34a4a7c145737b8d7e2b4e65c145 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 21 Aug 2017 15:09:13 +0200 -Subject: [PATCH] net: take the tcp_sk_lock lock with BH disabled +Subject: [PATCH 329/414] net: take the tcp_sk_lock lock with BH disabled Lockdep may complain about an unsafe locking scenario: | CPU0 CPU1 @@ -21,12 +22,14 @@ the order makes lockdep happy. Reported-by: Jacek Konieczny Signed-off-by: Sebastian Andrzej Siewior --- - net/ipv4/tcp_ipv4.c | 8 ++++---- + net/ipv4/tcp_ipv4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c +index 43ca00e05177..734dac099371 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c -@@ -711,8 +711,8 @@ static void tcp_v4_send_reset(const stru +@@ -711,8 +711,8 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) arg.tos = ip_hdr(skb)->tos; arg.uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL); @@ -36,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk), skb, &TCP_SKB_CB(skb)->header.h4.opt, ip_hdr(skb)->saddr, ip_hdr(skb)->daddr, -@@ -720,8 +720,8 @@ static void tcp_v4_send_reset(const stru +@@ -720,8 +720,8 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) __TCP_INC_STATS(net, TCP_MIB_OUTSEGS); __TCP_INC_STATS(net, TCP_MIB_OUTRSTS); @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_TCP_MD5SIG out: -@@ -799,16 +799,16 @@ static void tcp_v4_send_ack(const struct +@@ -799,16 +799,16 @@ static void tcp_v4_send_ack(const struct sock *sk, arg.bound_dev_if = oif; arg.tos = tos; arg.uid = sock_net_uid(net, sk_fullsock(sk) ? sk : NULL); @@ -65,3 +68,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0330-net-add-a-lock-around-icmp_sk.patch b/kernel/patches-4.14.x-rt/0330-0330-net-add-a-lock-around-icmp_sk.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0330-net-add-a-lock-around-icmp_sk.patch rename to kernel/patches-4.14.x-rt/0330-0330-net-add-a-lock-around-icmp_sk.patch index 4d552af76..8d3a11226 100644 --- a/kernel/patches-4.14.x-rt/0330-net-add-a-lock-around-icmp_sk.patch +++ b/kernel/patches-4.14.x-rt/0330-0330-net-add-a-lock-around-icmp_sk.patch @@ -1,6 +1,7 @@ +From e5787932c4705893bc2b76d96325b25aedabfa1a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:54:09 +0200 -Subject: [PATCH] net: add a lock around icmp_sk() +Subject: [PATCH 330/414] 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 @@ -9,9 +10,11 @@ here a local lock. No crash has been observed, this is just precaution. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - net/ipv4/icmp.c | 7 +++++++ + net/ipv4/icmp.c | 7 +++++++ 1 file changed, 7 insertions(+) +diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c +index 3c1570d3e22f..6e1ae84d662c 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -77,6 +77,7 @@ @@ -22,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include #include -@@ -204,6 +205,8 @@ static const struct icmp_control icmp_po +@@ -204,6 +205,8 @@ static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1]; * * On SMP we have one ICMP socket per-cpu. */ @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct sock *icmp_sk(struct net *net) { return *this_cpu_ptr(net->ipv4.icmp_sk); -@@ -417,6 +420,7 @@ static void icmp_reply(struct icmp_bxm * +@@ -417,6 +420,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) /* Needed by both icmp_global_allow and icmp_xmit_lock */ local_bh_disable(); @@ -39,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* global icmp_msgs_per_sec */ if (!icmpv4_global_allow(net, type, code)) -@@ -461,6 +465,7 @@ static void icmp_reply(struct icmp_bxm * +@@ -461,6 +465,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) out_unlock: icmp_xmit_unlock(sk); out_bh_enable: @@ -47,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_bh_enable(); } -@@ -656,6 +661,7 @@ void icmp_send(struct sk_buff *skb_in, i +@@ -656,6 +661,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) /* Needed by both icmp_global_allow and icmp_xmit_lock */ local_bh_disable(); @@ -55,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Check global sysctl_icmp_msgs_per_sec ratelimit, unless * incoming dev is loopback. If outgoing dev change to not be -@@ -744,6 +750,7 @@ void icmp_send(struct sk_buff *skb_in, i +@@ -744,6 +750,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) out_unlock: icmp_xmit_unlock(sk); out_bh_enable: @@ -63,3 +66,6 @@ Signed-off-by: Sebastian Andrzej Siewior local_bh_enable(); out:; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0331-net-use-trylock-in-icmp_sk.patch b/kernel/patches-4.14.x-rt/0331-0331-net-use-trylock-in-icmp_sk.patch similarity index 67% rename from kernel/patches-4.14.x-rt/0331-net-use-trylock-in-icmp_sk.patch rename to kernel/patches-4.14.x-rt/0331-0331-net-use-trylock-in-icmp_sk.patch index 509c71aa8..f6bfea42e 100644 --- a/kernel/patches-4.14.x-rt/0331-net-use-trylock-in-icmp_sk.patch +++ b/kernel/patches-4.14.x-rt/0331-0331-net-use-trylock-in-icmp_sk.patch @@ -1,6 +1,7 @@ +From 0257fa00cf1c964c5ee9286e5b3d24c5a76d9a50 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:42:04 +0200 -Subject: net: use trylock in icmp_sk +Subject: [PATCH 331/414] net: use trylock in icmp_sk The locking path can be recursive (same as for sk->sk_lock.slock) and therefore we need a trylock version for the locallock, too. @@ -9,12 +10,14 @@ Cc: stable-rt@vger.kernel.org Reported-by: Jacek Konieczny Signed-off-by: Sebastian Andrzej Siewior --- - net/ipv4/icmp.c | 9 +++++---- + net/ipv4/icmp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) +diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c +index 6e1ae84d662c..0310ea93f877 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c -@@ -217,12 +217,16 @@ static inline struct sock *icmp_xmit_loc +@@ -217,12 +217,16 @@ static inline struct sock *icmp_xmit_lock(struct net *net) { struct sock *sk; @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior return NULL; } return sk; -@@ -231,6 +235,7 @@ static inline struct sock *icmp_xmit_loc +@@ -231,6 +235,7 @@ static inline struct sock *icmp_xmit_lock(struct net *net) static inline void icmp_xmit_unlock(struct sock *sk) { spin_unlock(&sk->sk_lock.slock); @@ -39,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior } int sysctl_icmp_msgs_per_sec __read_mostly = 1000; -@@ -420,7 +425,6 @@ static void icmp_reply(struct icmp_bxm * +@@ -420,7 +425,6 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) /* Needed by both icmp_global_allow and icmp_xmit_lock */ local_bh_disable(); @@ -47,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* global icmp_msgs_per_sec */ if (!icmpv4_global_allow(net, type, code)) -@@ -465,7 +469,6 @@ static void icmp_reply(struct icmp_bxm * +@@ -465,7 +469,6 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) out_unlock: icmp_xmit_unlock(sk); out_bh_enable: @@ -55,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_bh_enable(); } -@@ -661,7 +664,6 @@ void icmp_send(struct sk_buff *skb_in, i +@@ -661,7 +664,6 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) /* Needed by both icmp_global_allow and icmp_xmit_lock */ local_bh_disable(); @@ -63,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Check global sysctl_icmp_msgs_per_sec ratelimit, unless * incoming dev is loopback. If outgoing dev change to not be -@@ -750,7 +752,6 @@ void icmp_send(struct sk_buff *skb_in, i +@@ -750,7 +752,6 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) out_unlock: icmp_xmit_unlock(sk); out_bh_enable: @@ -71,3 +74,6 @@ Signed-off-by: Sebastian Andrzej Siewior local_bh_enable(); out:; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0332-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/kernel/patches-4.14.x-rt/0332-0332-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0332-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch rename to kernel/patches-4.14.x-rt/0332-0332-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index 064e6cb5d..bb69938c9 100644 --- a/kernel/patches-4.14.x-rt/0332-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/kernel/patches-4.14.x-rt/0332-0332-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -1,7 +1,8 @@ +From 70149de53319af9940161038e0cbae8afb8a1a62 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Tue, 6 Dec 2016 17:50:30 -0500 -Subject: [PATCH] net: Have __napi_schedule_irqoff() disable interrupts on - RT +Subject: [PATCH 332/414] net: Have __napi_schedule_irqoff() disable interrupts + on RT A customer hit a crash where the napi sd->poll_list became corrupted. The customer had the bnx2x driver, which does a @@ -22,13 +23,15 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Steven Rostedt (Red Hat) Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/netdevice.h | 12 ++++++++++++ - net/core/dev.c | 2 ++ + include/linux/netdevice.h | 12 ++++++++++++ + net/core/dev.c | 2 ++ 2 files changed, 14 insertions(+) +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index 2b0110cc0e13..cd0f34dfc5f4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -409,7 +409,19 @@ typedef enum rx_handler_result rx_handle +@@ -409,7 +409,19 @@ typedef enum rx_handler_result rx_handler_result_t; typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb); void __napi_schedule(struct napi_struct *n); @@ -48,9 +51,11 @@ Signed-off-by: Sebastian Andrzej Siewior static inline bool napi_disable_pending(struct napi_struct *n) { +diff --git a/net/core/dev.c b/net/core/dev.c +index 8a9590c0d6af..9285dd9f69de 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5268,6 +5268,7 @@ bool napi_schedule_prep(struct napi_stru +@@ -5268,6 +5268,7 @@ bool napi_schedule_prep(struct napi_struct *n) } EXPORT_SYMBOL(napi_schedule_prep); @@ -58,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * __napi_schedule_irqoff - schedule for receive * @n: entry to schedule -@@ -5279,6 +5280,7 @@ void __napi_schedule_irqoff(struct napi_ +@@ -5279,6 +5280,7 @@ void __napi_schedule_irqoff(struct napi_struct *n) ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); @@ -66,3 +71,6 @@ Signed-off-by: Sebastian Andrzej Siewior bool napi_complete_done(struct napi_struct *n, int work_done) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0333-irqwork-push_most_work_into_softirq_context.patch b/kernel/patches-4.14.x-rt/0333-0333-irqwork-push-most-work-into-softirq-context.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0333-irqwork-push_most_work_into_softirq_context.patch rename to kernel/patches-4.14.x-rt/0333-0333-irqwork-push-most-work-into-softirq-context.patch index 1bbc38795..655c4118d 100644 --- a/kernel/patches-4.14.x-rt/0333-irqwork-push_most_work_into_softirq_context.patch +++ b/kernel/patches-4.14.x-rt/0333-0333-irqwork-push-most-work-into-softirq-context.patch @@ -1,6 +1,7 @@ -Subject: irqwork: push most work into softirq context +From c79323cff02a034a861d6e52a5254a880251e50e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 23 Jun 2015 15:32:51 +0200 +Subject: [PATCH 333/414] 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. @@ -19,13 +20,15 @@ Mike Galbraith, Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/irq_work.h | 1 + - kernel/irq_work.c | 47 ++++++++++++++++++++++++++++++++++------------- - kernel/sched/topology.c | 1 + - kernel/time/tick-sched.c | 1 + - kernel/time/timer.c | 5 ++++- + include/linux/irq_work.h | 1 + + kernel/irq_work.c | 47 +++++++++++++++++++++++++++++----------- + kernel/sched/topology.c | 1 + + kernel/time/tick-sched.c | 1 + + kernel/time/timer.c | 5 ++++- 5 files changed, 41 insertions(+), 14 deletions(-) +diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h +index 9270d73ea682..929fb9091d16 100644 --- a/include/linux/irq_work.h +++ b/include/linux/irq_work.h @@ -17,6 +17,7 @@ @@ -36,6 +39,8 @@ Signed-off-by: Sebastian Andrzej Siewior struct irq_work { unsigned long flags; +diff --git a/kernel/irq_work.c b/kernel/irq_work.c +index bcf107ce0854..0ddaf1e66d8c 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -17,6 +17,7 @@ @@ -55,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* All work should have been flushed before going offline */ WARN_ON_ONCE(cpu_is_offline(cpu)); -@@ -75,7 +78,12 @@ bool irq_work_queue_on(struct irq_work * +@@ -75,7 +78,12 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) if (!irq_work_claim(work)) return false; @@ -79,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Only queue if not already pending */ if (!irq_work_claim(work)) return false; -@@ -93,13 +104,15 @@ bool irq_work_queue(struct irq_work *wor +@@ -93,13 +104,15 @@ bool irq_work_queue(struct irq_work *work) /* Queue the entry and raise the IPI if needed. */ preempt_disable(); @@ -114,7 +119,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* All work should have been flushed before going offline */ WARN_ON_ONCE(cpu_is_offline(smp_processor_id())); -@@ -132,7 +144,7 @@ static void irq_work_run_list(struct lli +@@ -132,7 +144,7 @@ static void irq_work_run_list(struct llist_head *list) struct irq_work *work; struct llist_node *llnode; @@ -123,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (llist_empty(list)) return; -@@ -169,7 +181,16 @@ static void irq_work_run_list(struct lli +@@ -169,7 +181,16 @@ static void irq_work_run_list(struct llist_head *list) void irq_work_run(void) { irq_work_run_list(this_cpu_ptr(&raised_list)); @@ -141,9 +146,11 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(irq_work_run); +diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c +index 659e075ef70b..bb22e3620a90 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c -@@ -286,6 +286,7 @@ static int init_rootdomain(struct root_d +@@ -286,6 +286,7 @@ static int init_rootdomain(struct root_domain *rd) rd->rto_cpu = -1; raw_spin_lock_init(&rd->rto_lock); init_irq_work(&rd->rto_push_work, rto_push_irq_work_func); @@ -151,9 +158,11 @@ Signed-off-by: Sebastian Andrzej Siewior #endif init_dl_bw(&rd->dl_bw); +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index 0ba600553004..c4efbd993380 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -230,6 +230,7 @@ static void nohz_full_kick_func(struct i +@@ -230,6 +230,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, @@ -161,6 +170,8 @@ Signed-off-by: Sebastian Andrzej Siewior }; /* +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index ced791c0b47b..feab4b90d896 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1638,7 +1638,7 @@ void update_process_times(int user_tick) @@ -172,7 +183,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (in_irq()) irq_work_tick(); #endif -@@ -1679,6 +1679,9 @@ static __latent_entropy void run_timer_s +@@ -1679,6 +1679,9 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h) { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); @@ -182,3 +193,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * must_forward_clk must be cleared before running timers so that any * timer functions that call mod_timer will not try to forward the +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0334-irqwork-Move-irq-safe-work-to-irq-context.patch b/kernel/patches-4.14.x-rt/0334-0334-irqwork-Move-irq-safe-work-to-irq-context.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0334-irqwork-Move-irq-safe-work-to-irq-context.patch rename to kernel/patches-4.14.x-rt/0334-0334-irqwork-Move-irq-safe-work-to-irq-context.patch index f97b004fb..e0bcd8e06 100644 --- a/kernel/patches-4.14.x-rt/0334-irqwork-Move-irq-safe-work-to-irq-context.patch +++ b/kernel/patches-4.14.x-rt/0334-0334-irqwork-Move-irq-safe-work-to-irq-context.patch @@ -1,6 +1,7 @@ -Subject: irqwork: Move irq safe work to irq context +From a9a73df81d9a906141d9dce9cd6e8548ba047ee3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 15 Nov 2015 18:40:17 +0100 +Subject: [PATCH 334/414] irqwork: Move irq safe work to irq context On architectures where arch_irq_work_has_interrupt() returns false, we end up running the irq safe work from the softirq context. That @@ -15,14 +16,16 @@ Reported-and-tested-by: Yanjiang Jin Signed-off-by: Thomas Gleixner Cc: stable-rt@vger.kernel.org --- - include/linux/irq_work.h | 6 ++++++ - kernel/irq_work.c | 9 +++++++++ - kernel/time/timer.c | 6 ++---- + include/linux/irq_work.h | 6 ++++++ + kernel/irq_work.c | 9 +++++++++ + kernel/time/timer.c | 6 ++---- 3 files changed, 17 insertions(+), 4 deletions(-) +diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h +index 929fb9091d16..1e66fac6f1d2 100644 --- a/include/linux/irq_work.h +++ b/include/linux/irq_work.h -@@ -53,4 +53,10 @@ static inline bool irq_work_needs_cpu(vo +@@ -53,4 +53,10 @@ static inline bool irq_work_needs_cpu(void) { return false; } static inline void irq_work_run(void) { } #endif @@ -33,6 +36,8 @@ Cc: stable-rt@vger.kernel.org +#endif + #endif /* _LINUX_IRQ_WORK_H */ +diff --git a/kernel/irq_work.c b/kernel/irq_work.c +index 0ddaf1e66d8c..2899ba0d23d1 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -200,8 +200,17 @@ void irq_work_tick(void) @@ -53,6 +58,8 @@ Cc: stable-rt@vger.kernel.org /* * Synchronize against the irq_work @entry, ensures the entry is not +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index feab4b90d896..ff1d60d4c0cc 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1638,7 +1638,7 @@ void update_process_times(int user_tick) @@ -64,7 +71,7 @@ Cc: stable-rt@vger.kernel.org if (in_irq()) irq_work_tick(); #endif -@@ -1679,9 +1679,7 @@ static __latent_entropy void run_timer_s +@@ -1679,9 +1679,7 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h) { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); @@ -75,3 +82,6 @@ Cc: stable-rt@vger.kernel.org /* * must_forward_clk must be cleared before running timers so that any * timer functions that call mod_timer will not try to forward the +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0335-snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch b/kernel/patches-4.14.x-rt/0335-0335-snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0335-snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch rename to kernel/patches-4.14.x-rt/0335-0335-snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch index b8329c157..771c33df2 100644 --- a/kernel/patches-4.14.x-rt/0335-snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch +++ b/kernel/patches-4.14.x-rt/0335-0335-snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch @@ -1,6 +1,8 @@ +From 2fffd07035f47b41fc7c4b3c4af5a89300610414 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 18 Feb 2015 15:09:23 +0100 -Subject: snd/pcm: fix snd_pcm_stream_lock*() irqs_disabled() splats +Subject: [PATCH 335/414] snd/pcm: fix snd_pcm_stream_lock*() irqs_disabled() + splats Locking functions previously using read_lock_irq()/read_lock_irqsave() were changed to local_irq_disable/save(), leading to gripes. Use nort variants. @@ -26,12 +28,14 @@ changed to local_irq_disable/save(), leading to gripes. Use nort variants. Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - sound/core/pcm_native.c | 8 ++++---- + sound/core/pcm_native.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c +index ab3bf36786b6..f0bb7c9aa4be 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c -@@ -148,7 +148,7 @@ EXPORT_SYMBOL_GPL(snd_pcm_stream_unlock) +@@ -148,7 +148,7 @@ EXPORT_SYMBOL_GPL(snd_pcm_stream_unlock); void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream) { if (!substream->pcm->nonatomic) @@ -40,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior snd_pcm_stream_lock(substream); } EXPORT_SYMBOL_GPL(snd_pcm_stream_lock_irq); -@@ -163,7 +163,7 @@ void snd_pcm_stream_unlock_irq(struct sn +@@ -163,7 +163,7 @@ void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream) { snd_pcm_stream_unlock(substream); if (!substream->pcm->nonatomic) @@ -49,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(snd_pcm_stream_unlock_irq); -@@ -171,7 +171,7 @@ unsigned long _snd_pcm_stream_lock_irqsa +@@ -171,7 +171,7 @@ unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream) { unsigned long flags = 0; if (!substream->pcm->nonatomic) @@ -58,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior snd_pcm_stream_lock(substream); return flags; } -@@ -189,7 +189,7 @@ void snd_pcm_stream_unlock_irqrestore(st +@@ -189,7 +189,7 @@ void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream, { snd_pcm_stream_unlock(substream); if (!substream->pcm->nonatomic) @@ -67,3 +71,6 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(snd_pcm_stream_unlock_irqrestore); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0336-printk-rt-aware.patch b/kernel/patches-4.14.x-rt/0336-0336-printk-Make-rt-aware.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0336-printk-rt-aware.patch rename to kernel/patches-4.14.x-rt/0336-0336-printk-Make-rt-aware.patch index fab124dd2..757e11aeb 100644 --- a/kernel/patches-4.14.x-rt/0336-printk-rt-aware.patch +++ b/kernel/patches-4.14.x-rt/0336-0336-printk-Make-rt-aware.patch @@ -1,18 +1,21 @@ -Subject: printk: Make rt aware +From 28161c1d6514b28df731b8b4f9f181903a22ece9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 19 Sep 2012 14:50:37 +0200 +Subject: [PATCH 336/414] printk: Make rt aware Drop the lock before calling the console driver and do not disable interrupts while printing to a serial console. Signed-off-by: Thomas Gleixner --- - kernel/printk/printk.c | 19 ++++++++++++++++++- + kernel/printk/printk.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 1da739f39a3d..bce72853f9a2 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1617,6 +1617,7 @@ static void call_console_drivers(const c +@@ -1617,6 +1617,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, if (!console_drivers) return; @@ -20,7 +23,7 @@ Signed-off-by: Thomas Gleixner for_each_console(con) { if (exclusive_console && con != exclusive_console) continue; -@@ -1632,6 +1633,7 @@ static void call_console_drivers(const c +@@ -1632,6 +1633,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, else con->write(con, text, len); } @@ -28,7 +31,7 @@ Signed-off-by: Thomas Gleixner } int printk_delay_msec __read_mostly; -@@ -1814,12 +1816,22 @@ asmlinkage int vprintk_emit(int facility +@@ -1814,12 +1816,22 @@ asmlinkage int vprintk_emit(int facility, int level, /* If called from the scheduler, we can not call up(). */ if (!in_sched) { @@ -68,3 +71,6 @@ Signed-off-by: Thomas Gleixner if (do_cond_resched) cond_resched(); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0337-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch b/kernel/patches-4.14.x-rt/0337-0337-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0337-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch rename to kernel/patches-4.14.x-rt/0337-0337-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch index 139b70086..8989e443d 100644 --- a/kernel/patches-4.14.x-rt/0337-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch +++ b/kernel/patches-4.14.x-rt/0337-0337-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch @@ -1,6 +1,7 @@ +From 89c50e0769a2eb7abc81f652699c94011dc59c19 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 19 May 2016 17:45:27 +0200 -Subject: [PATCH] kernel/printk: Don't try to print from IRQ/NMI region +Subject: [PATCH 337/414] 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 @@ -10,12 +11,14 @@ this via console_unblank() / bust_spinlocks() as well. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/printk/printk.c | 10 ++++++++++ + kernel/printk/printk.c | 10 ++++++++++ 1 file changed, 10 insertions(+) +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index bce72853f9a2..304abddbab01 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1617,6 +1617,11 @@ static void call_console_drivers(const c +@@ -1617,6 +1617,11 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, if (!console_drivers) return; @@ -39,3 +42,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * console_unblank can no longer be called in interrupt context unless * oops_in_progress is set to 1.. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0338-HACK-printk-drop-the-logbuf_lock-more-often.patch b/kernel/patches-4.14.x-rt/0338-0338-printk-Drop-the-logbuf_lock-more-often.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0338-HACK-printk-drop-the-logbuf_lock-more-often.patch rename to kernel/patches-4.14.x-rt/0338-0338-printk-Drop-the-logbuf_lock-more-often.patch index 578878355..ca8a0c497 100644 --- a/kernel/patches-4.14.x-rt/0338-HACK-printk-drop-the-logbuf_lock-more-often.patch +++ b/kernel/patches-4.14.x-rt/0338-0338-printk-Drop-the-logbuf_lock-more-often.patch @@ -1,18 +1,21 @@ +From 2e8d3aef326ac42e9eacfac8c753f990efead8e2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 21 Mar 2013 19:01:05 +0100 -Subject: printk: Drop the logbuf_lock more often +Subject: [PATCH 338/414] 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. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/printk/printk.c | 27 +++++++++++++++++++++++++++ + kernel/printk/printk.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 304abddbab01..7393fcb271fb 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1407,6 +1407,8 @@ static int syslog_print_all(char __user +@@ -1407,6 +1407,8 @@ static int syslog_print_all(char __user *buf, int size, bool clear) { char *text; int len = 0; @@ -21,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL); if (!text) -@@ -1418,6 +1420,14 @@ static int syslog_print_all(char __user +@@ -1418,6 +1420,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) u64 seq; u32 idx; @@ -36,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Find first record that fits, including all following records, * into the user-provided buffer for this dump. -@@ -1430,6 +1440,14 @@ static int syslog_print_all(char __user +@@ -1430,6 +1440,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++; @@ -51,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* move first record forward until length fits into the buffer */ -@@ -1441,6 +1459,14 @@ static int syslog_print_all(char __user +@@ -1441,6 +1459,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++; @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* last message fitting into this dump */ -@@ -1479,6 +1505,7 @@ static int syslog_print_all(char __user +@@ -1479,6 +1505,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) clear_seq = log_next_seq; clear_idx = log_next_idx; } @@ -74,3 +77,6 @@ Signed-off-by: Sebastian Andrzej Siewior logbuf_unlock_irq(); kfree(text); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0339-power-use-generic-rwsem-on-rt.patch b/kernel/patches-4.14.x-rt/0339-0339-powerpc-Use-generic-rwsem-on-RT.patch similarity index 65% rename from kernel/patches-4.14.x-rt/0339-power-use-generic-rwsem-on-rt.patch rename to kernel/patches-4.14.x-rt/0339-0339-powerpc-Use-generic-rwsem-on-RT.patch index d1d414f54..b73e18b63 100644 --- a/kernel/patches-4.14.x-rt/0339-power-use-generic-rwsem-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0339-0339-powerpc-Use-generic-rwsem-on-RT.patch @@ -1,14 +1,17 @@ +From aaa43fcfe6fa7505ce319098d20800af97950545 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: powerpc: Use generic rwsem on RT +Subject: [PATCH 339/414] powerpc: Use generic rwsem on RT Use generic code which uses rtmutex Signed-off-by: Thomas Gleixner --- - arch/powerpc/Kconfig | 3 ++- + arch/powerpc/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig +index fe418226df7f..b8525ddc4b3b 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -111,10 +111,11 @@ config LOCKDEP_SUPPORT @@ -24,3 +27,6 @@ Signed-off-by: Thomas Gleixner config GENERIC_LOCKBREAK bool +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0340-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/kernel/patches-4.14.x-rt/0340-0340-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0340-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch rename to kernel/patches-4.14.x-rt/0340-0340-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index 913bb4bcc..2a2d5bd10 100644 --- a/kernel/patches-4.14.x-rt/0340-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/kernel/patches-4.14.x-rt/0340-0340-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,6 +1,8 @@ +From 746383160c2087d0bc7578ca74577ca352ccb84d Mon Sep 17 00:00:00 2001 From: Bogdan Purcareata Date: Fri, 24 Apr 2015 15:53:13 +0000 -Subject: powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT_FULL +Subject: [PATCH 340/414] powerpc/kvm: Disable in-kernel MPIC emulation for + PREEMPT_RT_FULL While converting the openpic emulation code to use a raw_spinlock_t enables guests to run on RT, there's still a performance issue. For interrupts sent in @@ -22,9 +24,11 @@ Acked-by: Scott Wood Signed-off-by: Bogdan Purcareata Signed-off-by: Sebastian Andrzej Siewior --- - arch/powerpc/kvm/Kconfig | 1 + + arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) +diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig +index 648160334abf..9d24331fc9b4 100644 --- a/arch/powerpc/kvm/Kconfig +++ b/arch/powerpc/kvm/Kconfig @@ -177,6 +177,7 @@ config KVM_E500MC @@ -35,3 +39,6 @@ Signed-off-by: Sebastian Andrzej Siewior select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQFD select HAVE_KVM_IRQ_ROUTING +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0341-powerpc-ps3-device-init.c-adapt-to-completions-using.patch b/kernel/patches-4.14.x-rt/0341-0341-powerpc-ps3-device-init.c-adapt-to-completions-using.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0341-powerpc-ps3-device-init.c-adapt-to-completions-using.patch rename to kernel/patches-4.14.x-rt/0341-0341-powerpc-ps3-device-init.c-adapt-to-completions-using.patch index a153e1cf0..7588a7f6f 100644 --- a/kernel/patches-4.14.x-rt/0341-powerpc-ps3-device-init.c-adapt-to-completions-using.patch +++ b/kernel/patches-4.14.x-rt/0341-0341-powerpc-ps3-device-init.c-adapt-to-completions-using.patch @@ -1,6 +1,8 @@ +From f1176d41575ab74c24f3541cda6f2fb725c16efe Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sun, 31 May 2015 14:44:42 -0400 -Subject: powerpc: ps3/device-init.c - adapt to completions using swait vs wait +Subject: [PATCH 341/414] powerpc: ps3/device-init.c - adapt to completions + using swait vs wait To fix: @@ -15,12 +17,14 @@ To fix: Signed-off-by: Paul Gortmaker Signed-off-by: Sebastian Andrzej Siewior --- - arch/powerpc/platforms/ps3/device-init.c | 2 +- + arch/powerpc/platforms/ps3/device-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c +index e48462447ff0..2670cee66064 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c -@@ -752,7 +752,7 @@ static int ps3_notification_read_write(s +@@ -752,7 +752,7 @@ static int ps3_notification_read_write(struct ps3_notification_device *dev, } pr_debug("%s:%u: notification %s issued\n", __func__, __LINE__, op); @@ -29,3 +33,6 @@ Signed-off-by: Sebastian Andrzej Siewior dev->done.done || kthread_should_stop()); if (kthread_should_stop()) res = -EINTR; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0342-arm-at91-tclib-default-to-tclib-timer-for-rt.patch b/kernel/patches-4.14.x-rt/0342-0342-ARM-at91-tclib-Default-to-tclib-timer-for-RT.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0342-arm-at91-tclib-default-to-tclib-timer-for-rt.patch rename to kernel/patches-4.14.x-rt/0342-0342-ARM-at91-tclib-Default-to-tclib-timer-for-RT.patch index f81c2037b..b6f17e92d 100644 --- a/kernel/patches-4.14.x-rt/0342-arm-at91-tclib-default-to-tclib-timer-for-rt.patch +++ b/kernel/patches-4.14.x-rt/0342-0342-ARM-at91-tclib-Default-to-tclib-timer-for-RT.patch @@ -1,16 +1,18 @@ +From fc767fa862ee5982cd088c4e8c67ba666f8ea0f6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 1 May 2010 18:29:35 +0200 -Subject: ARM: at91: tclib: Default to tclib timer for RT +Subject: [PATCH 342/414] ARM: at91: tclib: Default to tclib timer for RT RT is not too happy about the shared timer interrupt in AT91 devices. Default to tclib timer for RT. Signed-off-by: Thomas Gleixner - --- - drivers/misc/Kconfig | 3 ++- + drivers/misc/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig +index d2feb491e689..86e83b9629d7 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -54,6 +54,7 @@ config AD525X_DPOT_SPI @@ -30,3 +32,6 @@ Signed-off-by: Thomas Gleixner help Select this to use 32 KiHz base clock rate as TC block clock source for clock events. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0343-arm-unwind-use_raw_lock.patch b/kernel/patches-4.14.x-rt/0343-0343-arm-unwind-use-a-raw_spin_lock.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0343-arm-unwind-use_raw_lock.patch rename to kernel/patches-4.14.x-rt/0343-0343-arm-unwind-use-a-raw_spin_lock.patch index 9c10dd91c..fce3c8e10 100644 --- a/kernel/patches-4.14.x-rt/0343-arm-unwind-use_raw_lock.patch +++ b/kernel/patches-4.14.x-rt/0343-0343-arm-unwind-use-a-raw_spin_lock.patch @@ -1,6 +1,7 @@ +From 5be2f7c4e90a5ddccbc1eb9ad61f0eb6f73e55cb Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 20 Sep 2013 14:31:54 +0200 -Subject: arm/unwind: use a raw_spin_lock +Subject: [PATCH 343/414] arm/unwind: use a raw_spin_lock Mostly unwind is done with irqs enabled however SLUB may call it with irqs disabled while creating a new SLUB cache. @@ -25,12 +26,14 @@ interrupts and then Signed-off-by: Sebastian Andrzej Siewior --- - arch/arm/kernel/unwind.c | 14 +++++++------- + arch/arm/kernel/unwind.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) +diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c +index 0bee233fef9a..314cfb232a63 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c -@@ -93,7 +93,7 @@ extern const struct unwind_idx __start_u +@@ -93,7 +93,7 @@ extern const struct unwind_idx __start_unwind_idx[]; static const struct unwind_idx *__origin_unwind_idx; extern const struct unwind_idx __stop_unwind_idx[]; @@ -39,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior static LIST_HEAD(unwind_tables); /* Convert a prel31 symbol to an absolute address */ -@@ -201,7 +201,7 @@ static const struct unwind_idx *unwind_f +@@ -201,7 +201,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr) /* module unwind tables */ struct unwind_table *table; @@ -48,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior list_for_each_entry(table, &unwind_tables, list) { if (addr >= table->begin_addr && addr < table->end_addr) { -@@ -213,7 +213,7 @@ static const struct unwind_idx *unwind_f +@@ -213,7 +213,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr) break; } } @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior } pr_debug("%s: idx = %p\n", __func__, idx); -@@ -529,9 +529,9 @@ struct unwind_table *unwind_table_add(un +@@ -529,9 +529,9 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size, tab->begin_addr = text_addr; tab->end_addr = text_addr + text_size; @@ -69,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior return tab; } -@@ -543,9 +543,9 @@ void unwind_table_del(struct unwind_tabl +@@ -543,9 +543,9 @@ void unwind_table_del(struct unwind_table *tab) if (!tab) return; @@ -81,3 +84,6 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(tab); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0344-ARM-enable-irq-in-translation-section-permission-fau.patch b/kernel/patches-4.14.x-rt/0344-0344-ARM-enable-irq-in-translation-section-permission-fau.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0344-ARM-enable-irq-in-translation-section-permission-fau.patch rename to kernel/patches-4.14.x-rt/0344-0344-ARM-enable-irq-in-translation-section-permission-fau.patch index d90d23403..acaad703c 100644 --- a/kernel/patches-4.14.x-rt/0344-ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/kernel/patches-4.14.x-rt/0344-0344-ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,6 +1,11 @@ +From da3ed3f476407de24913a137363d9cf308a5d8ea Mon Sep 17 00:00:00 2001 From: "Yadi.hu" Date: Wed, 10 Dec 2014 10:32:09 +0800 -Subject: ARM: enable irq in translation/section permission fault handlers +Subject: [PATCH 344/414] ARM: enable irq in translation/section permission + fault handlers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL @@ -58,12 +63,14 @@ permission exception. Signed-off-by: Yadi.hu Signed-off-by: Sebastian Andrzej Siewior --- - arch/arm/mm/fault.c | 6 ++++++ + arch/arm/mm/fault.c | 6 ++++++ 1 file changed, 6 insertions(+) +diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c +index 42f585379e19..93d2eccc8b60 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c -@@ -434,6 +434,9 @@ do_translation_fault(unsigned long addr, +@@ -434,6 +434,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, if (addr < TASK_SIZE) return do_page_fault(addr, fsr, regs); @@ -73,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (user_mode(regs)) goto bad_area; -@@ -501,6 +504,9 @@ do_translation_fault(unsigned long addr, +@@ -501,6 +504,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, static int do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) { @@ -83,3 +90,6 @@ Signed-off-by: Sebastian Andrzej Siewior do_bad_area(addr, fsr, regs); return 0; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0345-genirq-update-irq_set_irqchip_state-documentation.patch b/kernel/patches-4.14.x-rt/0345-0345-genirq-update-irq_set_irqchip_state-documentation.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0345-genirq-update-irq_set_irqchip_state-documentation.patch rename to kernel/patches-4.14.x-rt/0345-0345-genirq-update-irq_set_irqchip_state-documentation.patch index f997f28f3..315fa8d54 100644 --- a/kernel/patches-4.14.x-rt/0345-genirq-update-irq_set_irqchip_state-documentation.patch +++ b/kernel/patches-4.14.x-rt/0345-0345-genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,6 +1,7 @@ +From 775f24452fe994f0cff5189a860f020611642a1c Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:00 -0600 -Subject: genirq: update irq_set_irqchip_state documentation +Subject: [PATCH 345/414] 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 @@ -9,12 +10,14 @@ irq_set_irqchip_state() documentation to reflect this. Signed-off-by: Josh Cartwright Signed-off-by: Sebastian Andrzej Siewior --- - kernel/irq/manage.c | 2 +- + kernel/irq/manage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index d8fa6c86a8ca..000c519a35cd 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -2202,7 +2202,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state) +@@ -2202,7 +2202,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); * This call sets the internal irqchip state of an interrupt, * depending on the value of @which. * @@ -23,3 +26,6 @@ Signed-off-by: Sebastian Andrzej Siewior * interrupt controller has per-cpu registers. */ int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0346-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/kernel/patches-4.14.x-rt/0346-0346-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0346-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch rename to kernel/patches-4.14.x-rt/0346-0346-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index e7dff17b0..aa7bc40cf 100644 --- a/kernel/patches-4.14.x-rt/0346-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/kernel/patches-4.14.x-rt/0346-0346-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,6 +1,8 @@ +From eb332dff86d3e136ca90df99478c697c1ad5bd51 Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:01 -0600 -Subject: KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() +Subject: [PATCH 346/414] KVM: arm/arm64: downgrade preempt_disable()d region + to migrate_disable() kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating the vgic and timer states to prevent the calling task from migrating to @@ -17,12 +19,14 @@ Reported-by: Manish Jaggi Signed-off-by: Josh Cartwright Signed-off-by: Sebastian Andrzej Siewior --- - virt/kvm/arm/arm.c | 6 +++--- + virt/kvm/arm/arm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c +index 0c5d846ba809..9c25fd3d9708 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c -@@ -651,7 +651,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -651,7 +651,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. */ @@ -31,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior kvm_pmu_flush_hwstate(vcpu); -@@ -688,7 +688,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -688,7 +688,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) kvm_pmu_sync_hwstate(vcpu); kvm_timer_sync_hwstate(vcpu); kvm_vgic_sync_hwstate(vcpu); @@ -40,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; } -@@ -743,7 +743,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -743,7 +743,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) kvm_vgic_sync_hwstate(vcpu); @@ -49,3 +53,6 @@ Signed-off-by: Sebastian Andrzej Siewior ret = handle_exit(vcpu, run, ret); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0347-arm64-xen--Make-XEN-depend-on-non-rt.patch b/kernel/patches-4.14.x-rt/0347-0347-arm64-xen-Make-XEN-depend-on-RT.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0347-arm64-xen--Make-XEN-depend-on-non-rt.patch rename to kernel/patches-4.14.x-rt/0347-0347-arm64-xen-Make-XEN-depend-on-RT.patch index 9e292b7de..cee453c3d 100644 --- a/kernel/patches-4.14.x-rt/0347-arm64-xen--Make-XEN-depend-on-non-rt.patch +++ b/kernel/patches-4.14.x-rt/0347-0347-arm64-xen-Make-XEN-depend-on-RT.patch @@ -1,15 +1,18 @@ -Subject: arm64/xen: Make XEN depend on !RT +From d74cda3c6ed4ad6ac0595c5ebde25ae9360677dc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 12 Oct 2015 11:18:40 +0200 +Subject: [PATCH 347/414] arm64/xen: Make XEN depend on !RT It's not ready and probably never will be, unless xen folks have a look at it. Signed-off-by: Thomas Gleixner --- - arch/arm64/Kconfig | 2 +- + arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig +index c2abb4e88ff2..c8bcd6e41192 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -777,7 +777,7 @@ config XEN_DOM0 @@ -21,3 +24,6 @@ Signed-off-by: Thomas Gleixner select SWIOTLB_XEN select PARAVIRT help +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0348-kgb-serial-hackaround.patch b/kernel/patches-4.14.x-rt/0348-0348-kgdb-serial-Short-term-workaround.patch similarity index 70% rename from kernel/patches-4.14.x-rt/0348-kgb-serial-hackaround.patch rename to kernel/patches-4.14.x-rt/0348-0348-kgdb-serial-Short-term-workaround.patch index e700ffe15..2615911ed 100644 --- a/kernel/patches-4.14.x-rt/0348-kgb-serial-hackaround.patch +++ b/kernel/patches-4.14.x-rt/0348-0348-kgdb-serial-Short-term-workaround.patch @@ -1,6 +1,7 @@ +From 59651504fc65850831f802e0374082fce770307f Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Thu, 28 Jul 2011 12:42:23 -0500 -Subject: kgdb/serial: Short term workaround +Subject: [PATCH 348/414] 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 @@ -16,13 +17,14 @@ change separation between the console and the HW to have a polled mode Thanks, Jason. - --- - drivers/tty/serial/8250/8250_port.c | 3 +++ - include/linux/kdb.h | 2 ++ - kernel/debug/kdb/kdb_io.c | 2 ++ + drivers/tty/serial/8250/8250_port.c | 3 +++ + include/linux/kdb.h | 2 ++ + kernel/debug/kdb/kdb_io.c | 2 ++ 3 files changed, 7 insertions(+) +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index 5117bdf9b1ef..59c1c0944ebc 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -35,6 +35,7 @@ @@ -33,7 +35,7 @@ Jason. #include #include #include -@@ -3226,6 +3227,8 @@ void serial8250_console_write(struct uar +@@ -3226,6 +3227,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, if (port->sysrq || oops_in_progress) locked = 0; @@ -42,9 +44,11 @@ Jason. else spin_lock_irqsave(&port->lock, flags); +diff --git a/include/linux/kdb.h b/include/linux/kdb.h +index 68bd88223417..e033b25b0b72 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h -@@ -167,6 +167,7 @@ extern __printf(2, 0) int vkdb_printf(en +@@ -167,6 +167,7 @@ extern __printf(2, 0) int vkdb_printf(enum kdb_msgsrc src, const char *fmt, extern __printf(1, 2) int kdb_printf(const char *, ...); typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...); @@ -52,7 +56,7 @@ Jason. extern void kdb_init(int level); /* Access to kdb specific polling devices */ -@@ -201,6 +202,7 @@ extern int kdb_register_flags(char *, kd +@@ -201,6 +202,7 @@ extern int kdb_register_flags(char *, kdb_func_t, char *, char *, extern int kdb_unregister(char *); #else /* ! CONFIG_KGDB_KDB */ static inline __printf(1, 2) int kdb_printf(const char *fmt, ...) { return 0; } @@ -60,6 +64,8 @@ Jason. static inline void kdb_init(int level) {} static inline int kdb_register(char *cmd, kdb_func_t func, char *usage, char *help, short minlen) { return 0; } +diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c +index ed5d34925ad0..c0d4c24fc241 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -854,9 +854,11 @@ int kdb_printf(const char *fmt, ...) @@ -74,3 +80,6 @@ Jason. return r; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0349-sysfs-realtime-entry.patch b/kernel/patches-4.14.x-rt/0349-0349-sysfs-Add-sys-kernel-realtime-entry.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0349-sysfs-realtime-entry.patch rename to kernel/patches-4.14.x-rt/0349-0349-sysfs-Add-sys-kernel-realtime-entry.patch index 85c90149d..7e46540a0 100644 --- a/kernel/patches-4.14.x-rt/0349-sysfs-realtime-entry.patch +++ b/kernel/patches-4.14.x-rt/0349-0349-sysfs-Add-sys-kernel-realtime-entry.patch @@ -1,6 +1,7 @@ -Subject: sysfs: Add /sys/kernel/realtime entry +From dbf2260f8d92cb24c34bdd8081bf4966bf657aad Mon Sep 17 00:00:00 2001 From: Clark Williams -Date: Sat Jul 30 21:55:53 2011 -0500 +Date: Sat, 30 Jul 2011 21:55:53 -0500 +Subject: [PATCH 349/414] sysfs: Add /sys/kernel/realtime entry Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. @@ -14,9 +15,11 @@ Are there better solutions? Should it exist and return 0 on !-rt? Signed-off-by: Clark Williams Signed-off-by: Peter Zijlstra --- - kernel/ksysfs.c | 12 ++++++++++++ + kernel/ksysfs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) +diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c +index 46ba853656f6..9a23632b6294 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -140,6 +140,15 @@ KERNEL_ATTR_RO(vmcoreinfo); @@ -35,13 +38,16 @@ Signed-off-by: Peter Zijlstra /* whether file capabilities are enabled */ static ssize_t fscaps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) -@@ -231,6 +240,9 @@ static struct attribute * kernel_attrs[] +@@ -230,6 +239,9 @@ static struct attribute * kernel_attrs[] = { + #ifndef CONFIG_TINY_RCU &rcu_expedited_attr.attr, &rcu_normal_attr.attr, - #endif ++#endif +#ifdef CONFIG_PREEMPT_RT_FULL + &realtime_attr.attr, -+#endif + #endif NULL }; - +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0350-power-disable-highmem-on-rt.patch b/kernel/patches-4.14.x-rt/0350-0350-powerpc-Disable-highmem-on-RT.patch similarity index 66% rename from kernel/patches-4.14.x-rt/0350-power-disable-highmem-on-rt.patch rename to kernel/patches-4.14.x-rt/0350-0350-powerpc-Disable-highmem-on-RT.patch index db3c1ee9d..7a63b41ff 100644 --- a/kernel/patches-4.14.x-rt/0350-power-disable-highmem-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0350-0350-powerpc-Disable-highmem-on-RT.patch @@ -1,14 +1,17 @@ -Subject: powerpc: Disable highmem on RT +From b175d82ce10a88627f94383da00a03f5f9fa0ded Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:08:34 +0200 +Subject: [PATCH 350/414] powerpc: Disable highmem on RT The current highmem handling on -RT is not compatible and needs fixups. Signed-off-by: Thomas Gleixner --- - arch/powerpc/Kconfig | 2 +- + arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig +index b8525ddc4b3b..f3201bf888ad 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -391,7 +391,7 @@ menu "Kernel options" @@ -20,3 +23,6 @@ Signed-off-by: Thomas Gleixner source kernel/Kconfig.hz source kernel/Kconfig.preempt +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0351-mips-disable-highmem-on-rt.patch b/kernel/patches-4.14.x-rt/0351-0351-mips-Disable-highmem-on-RT.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0351-mips-disable-highmem-on-rt.patch rename to kernel/patches-4.14.x-rt/0351-0351-mips-Disable-highmem-on-RT.patch index 503ff8c2b..1a486363d 100644 --- a/kernel/patches-4.14.x-rt/0351-mips-disable-highmem-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0351-0351-mips-Disable-highmem-on-RT.patch @@ -1,14 +1,17 @@ -Subject: mips: Disable highmem on RT +From 3bd7b49f5ddb5faade45667000d49fd182acc4a5 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:10:12 +0200 +Subject: [PATCH 351/414] mips: Disable highmem on RT The current highmem handling on -RT is not compatible and needs fixups. Signed-off-by: Thomas Gleixner --- - arch/mips/Kconfig | 2 +- + arch/mips/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig +index c82457b0e733..7bb1838508de 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2519,7 +2519,7 @@ config MIPS_ASID_BITS_VARIABLE @@ -20,3 +23,6 @@ Signed-off-by: Thomas Gleixner config CPU_SUPPORTS_HIGHMEM bool +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0352-mm-rt-kmap-atomic-scheduling.patch b/kernel/patches-4.14.x-rt/0352-0352-mm-rt-kmap_atomic-scheduling.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0352-mm-rt-kmap-atomic-scheduling.patch rename to kernel/patches-4.14.x-rt/0352-0352-mm-rt-kmap_atomic-scheduling.patch index 5e40984ec..583992bdf 100644 --- a/kernel/patches-4.14.x-rt/0352-mm-rt-kmap-atomic-scheduling.patch +++ b/kernel/patches-4.14.x-rt/0352-0352-mm-rt-kmap_atomic-scheduling.patch @@ -1,6 +1,7 @@ -Subject: mm, rt: kmap_atomic scheduling +From 9039bc9b5255a113e59443fa2b063dccac0405b6 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 28 Jul 2011 10:43:51 +0200 +Subject: [PATCH 352/414] 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 @@ -19,15 +20,17 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins and the pte content right away in the task struct. Shortens the context switch code. ] --- - arch/x86/kernel/process_32.c | 32 ++++++++++++++++++++++++++++++++ - arch/x86/mm/highmem_32.c | 13 ++++++++++--- - arch/x86/mm/iomap_32.c | 9 ++++++++- - include/linux/highmem.h | 27 +++++++++++++++++++++++---- - include/linux/sched.h | 7 +++++++ - include/linux/uaccess.h | 2 ++ - mm/highmem.c | 6 ++++-- + arch/x86/kernel/process_32.c | 32 ++++++++++++++++++++++++++++++++ + arch/x86/mm/highmem_32.c | 13 ++++++++++--- + arch/x86/mm/iomap_32.c | 9 ++++++++- + include/linux/highmem.h | 27 +++++++++++++++++++++++---- + include/linux/sched.h | 7 +++++++ + include/linux/uaccess.h | 2 ++ + mm/highmem.c | 6 ++++-- 7 files changed, 86 insertions(+), 10 deletions(-) +diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c +index 5224c6099184..9b2b1f0409c5 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -38,6 +38,7 @@ @@ -38,7 +41,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins #include #include -@@ -198,6 +199,35 @@ start_thread(struct pt_regs *regs, unsig +@@ -198,6 +199,35 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) } EXPORT_SYMBOL_GPL(start_thread); @@ -74,7 +77,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins /* * switch_to(x,y) should switch tasks from x to y. -@@ -273,6 +303,8 @@ EXPORT_SYMBOL_GPL(start_thread); +@@ -273,6 +303,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT)) __switch_to_xtra(prev_p, next_p, tss); @@ -83,6 +86,8 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins /* * Leave lazy mode, flushing any hypercalls made here. * This must be done before restoring TLS segments so +diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c +index 6d18b70ed5a9..f752724c22e8 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c @@ -32,10 +32,11 @@ EXPORT_SYMBOL(kunmap); @@ -98,7 +103,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins pagefault_disable(); if (!PageHighMem(page)) -@@ -45,7 +46,10 @@ void *kmap_atomic_prot(struct page *page +@@ -45,7 +46,10 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot) idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); BUG_ON(!pte_none(*(kmap_pte-idx))); @@ -129,6 +134,8 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins } EXPORT_SYMBOL(__kunmap_atomic); +diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c +index ada98b39b8ad..2620fb55ece1 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c @@ -56,6 +56,7 @@ EXPORT_SYMBOL_GPL(iomap_free); @@ -139,7 +146,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins unsigned long vaddr; int idx, type; -@@ -65,7 +66,10 @@ void *kmap_atomic_prot_pfn(unsigned long +@@ -65,7 +66,10 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot) type = kmap_atomic_idx_push(); idx = type + KM_TYPE_NR * smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); @@ -161,9 +168,11 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins kpte_clear_flush(kmap_pte-idx, vaddr); kmap_atomic_idx_pop(); } +diff --git a/include/linux/highmem.h b/include/linux/highmem.h +index 776f90f3a1cd..cfcd7b7ab205 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h -@@ -87,32 +87,51 @@ static inline void __kunmap_atomic(void +@@ -87,32 +87,51 @@ static inline void __kunmap_atomic(void *addr) #if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32) @@ -219,6 +228,8 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins #endif } +diff --git a/include/linux/sched.h b/include/linux/sched.h +index f6ea03d86966..35f7a037fe1a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -27,6 +27,7 @@ @@ -242,9 +253,11 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins #ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change; #endif +diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h +index 251e655d407f..57e8e32ef2b0 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h -@@ -185,6 +185,7 @@ static __always_inline void pagefault_di +@@ -185,6 +185,7 @@ static __always_inline void pagefault_disabled_dec(void) */ static inline void pagefault_disable(void) { @@ -252,7 +265,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins pagefault_disabled_inc(); /* * make sure to have issued the store before a pagefault -@@ -201,6 +202,7 @@ static inline void pagefault_enable(void +@@ -201,6 +202,7 @@ static inline void pagefault_enable(void) */ barrier(); pagefault_disabled_dec(); @@ -260,6 +273,8 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins } /* +diff --git a/mm/highmem.c b/mm/highmem.c +index 59db3223a5d6..22aa3ddbd87b 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -30,10 +30,11 @@ @@ -275,7 +290,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins /* * Virtual_count is not a pure "count". -@@ -108,8 +109,9 @@ static inline wait_queue_head_t *get_pkm +@@ -108,8 +109,9 @@ static inline wait_queue_head_t *get_pkmap_wait_queue_head(unsigned int color) unsigned long totalhigh_pages __read_mostly; EXPORT_SYMBOL(totalhigh_pages); @@ -286,3 +301,6 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins unsigned int nr_free_highpages (void) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0353-mm--rt--Fix-generic-kmap_atomic-for-RT.patch b/kernel/patches-4.14.x-rt/0353-0353-mm-rt-Fix-generic-kmap_atomic-for-RT.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0353-mm--rt--Fix-generic-kmap_atomic-for-RT.patch rename to kernel/patches-4.14.x-rt/0353-0353-mm-rt-Fix-generic-kmap_atomic-for-RT.patch index 3549e58fd..f7b5f0a0b 100644 --- a/kernel/patches-4.14.x-rt/0353-mm--rt--Fix-generic-kmap_atomic-for-RT.patch +++ b/kernel/patches-4.14.x-rt/0353-0353-mm-rt-Fix-generic-kmap_atomic-for-RT.patch @@ -1,6 +1,7 @@ -Subject: mm: rt: Fix generic kmap_atomic for RT +From 3b0334349225ed443a5111ef3edd3fa5cb3ec670 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 19 Sep 2015 10:15:00 +0200 +Subject: [PATCH 353/414] mm: rt: Fix generic kmap_atomic for RT The update to 4.1 brought in the mainline variant of the pagefault disable distangling from preempt count. That introduced a @@ -15,12 +16,14 @@ Fix that up. Reported-and-tested-by: Juergen Borleis Signed-off-by: Thomas Gleixner --- - include/linux/highmem.h | 4 ++-- + include/linux/highmem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/include/linux/highmem.h b/include/linux/highmem.h +index cfcd7b7ab205..8f248e2137eb 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h -@@ -66,7 +66,7 @@ static inline void kunmap(struct page *p +@@ -66,7 +66,7 @@ static inline void kunmap(struct page *page) static inline void *kmap_atomic(struct page *page) { @@ -29,7 +32,7 @@ Signed-off-by: Thomas Gleixner pagefault_disable(); return page_address(page); } -@@ -75,7 +75,7 @@ static inline void *kmap_atomic(struct p +@@ -75,7 +75,7 @@ static inline void *kmap_atomic(struct page *page) static inline void __kunmap_atomic(void *addr) { pagefault_enable(); @@ -38,3 +41,6 @@ Signed-off-by: Thomas Gleixner } #define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0354-x86-highmem-add-a-already-used-pte-check.patch b/kernel/patches-4.14.x-rt/0354-0354-x86-highmem-Add-a-already-used-pte-check.patch similarity index 59% rename from kernel/patches-4.14.x-rt/0354-x86-highmem-add-a-already-used-pte-check.patch rename to kernel/patches-4.14.x-rt/0354-0354-x86-highmem-Add-a-already-used-pte-check.patch index a3493efae..1965134bc 100644 --- a/kernel/patches-4.14.x-rt/0354-x86-highmem-add-a-already-used-pte-check.patch +++ b/kernel/patches-4.14.x-rt/0354-0354-x86-highmem-Add-a-already-used-pte-check.patch @@ -1,17 +1,20 @@ +From 6c60c6993f036d39e8d733b751879d805416fe10 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 17:09:55 +0100 -Subject: x86/highmem: Add a "already used pte" check +Subject: [PATCH 354/414] x86/highmem: Add a "already used pte" check This is a copy from kmap_atomic_prot(). Signed-off-by: Sebastian Andrzej Siewior --- - arch/x86/mm/iomap_32.c | 2 ++ + arch/x86/mm/iomap_32.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c +index 2620fb55ece1..585f6829653b 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c -@@ -66,6 +66,8 @@ void *kmap_atomic_prot_pfn(unsigned long +@@ -66,6 +66,8 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot) type = kmap_atomic_idx_push(); idx = type + KM_TYPE_NR * smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); @@ -20,3 +23,6 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_PREEMPT_RT_FULL current->kmap_pte[type] = pte; #endif +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0355-arm-highmem-flush-tlb-on-unmap.patch b/kernel/patches-4.14.x-rt/0355-0355-arm-highmem-Flush-tlb-on-unmap.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0355-arm-highmem-flush-tlb-on-unmap.patch rename to kernel/patches-4.14.x-rt/0355-0355-arm-highmem-Flush-tlb-on-unmap.patch index 08e17cab7..fee30feff 100644 --- a/kernel/patches-4.14.x-rt/0355-arm-highmem-flush-tlb-on-unmap.patch +++ b/kernel/patches-4.14.x-rt/0355-0355-arm-highmem-Flush-tlb-on-unmap.patch @@ -1,6 +1,7 @@ +From 099d3ec8f53955ac473b850e61deca85a00b31ea Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 21:37:27 +0100 -Subject: arm/highmem: Flush tlb on unmap +Subject: [PATCH 355/414] 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 @@ -8,9 +9,11 @@ right. Signed-off-by: Sebastian Andrzej Siewior --- - arch/arm/mm/highmem.c | 2 +- + arch/arm/mm/highmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c +index d02f8187b1cc..eb4b225d28c9 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c @@ -112,10 +112,10 @@ void __kunmap_atomic(void *kvaddr) @@ -25,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior kmap_atomic_idx_pop(); } else if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) { /* this address was obtained through kmap_high_get() */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0356-arm-enable-highmem-for-rt.patch b/kernel/patches-4.14.x-rt/0356-0356-arm-Enable-highmem-for-rt.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0356-arm-enable-highmem-for-rt.patch rename to kernel/patches-4.14.x-rt/0356-0356-arm-Enable-highmem-for-rt.patch index 3891177cb..9865a390f 100644 --- a/kernel/patches-4.14.x-rt/0356-arm-enable-highmem-for-rt.patch +++ b/kernel/patches-4.14.x-rt/0356-0356-arm-Enable-highmem-for-rt.patch @@ -1,16 +1,19 @@ -Subject: arm: Enable highmem for rt +From e8d822eba7301a92b762de86156dbb861df39b4f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 13 Feb 2013 11:03:11 +0100 +Subject: [PATCH 356/414] arm: Enable highmem for rt fixup highmem for ARM. Signed-off-by: Thomas Gleixner --- - arch/arm/include/asm/switch_to.h | 8 +++++ - arch/arm/mm/highmem.c | 56 +++++++++++++++++++++++++++++++++------ - include/linux/highmem.h | 1 + arch/arm/include/asm/switch_to.h | 8 +++++ + arch/arm/mm/highmem.c | 56 +++++++++++++++++++++++++++----- + include/linux/highmem.h | 1 + 3 files changed, 57 insertions(+), 8 deletions(-) +diff --git a/arch/arm/include/asm/switch_to.h b/arch/arm/include/asm/switch_to.h +index d3e937dcee4d..6ab96a2ce1f8 100644 --- a/arch/arm/include/asm/switch_to.h +++ b/arch/arm/include/asm/switch_to.h @@ -4,6 +4,13 @@ @@ -27,7 +30,7 @@ Signed-off-by: Thomas Gleixner /* * For v7 SMP cores running a preemptible kernel we may be pre-empted * during a TLB maintenance operation, so execute an inner-shareable dsb -@@ -26,6 +33,7 @@ extern struct task_struct *__switch_to(s +@@ -26,6 +33,7 @@ extern struct task_struct *__switch_to(struct task_struct *, struct thread_info #define switch_to(prev,next,last) \ do { \ __complete_pending_tlbi(); \ @@ -35,9 +38,11 @@ Signed-off-by: Thomas Gleixner last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \ } while (0) +diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c +index eb4b225d28c9..542692dbd40a 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c -@@ -34,6 +34,11 @@ static inline pte_t get_fixmap_pte(unsig +@@ -34,6 +34,11 @@ static inline pte_t get_fixmap_pte(unsigned long vaddr) return *ptep; } @@ -161,6 +166,8 @@ Signed-off-by: Thomas Gleixner + } +} +#endif +diff --git a/include/linux/highmem.h b/include/linux/highmem.h +index 8f248e2137eb..5f0bd7a3e6a7 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -8,6 +8,7 @@ @@ -171,3 +178,6 @@ Signed-off-by: Thomas Gleixner #include +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0357-scsi-fcoe-rt-aware.patch b/kernel/patches-4.14.x-rt/0357-0357-scsi-fcoe-Make-RT-aware.patch similarity index 71% rename from kernel/patches-4.14.x-rt/0357-scsi-fcoe-rt-aware.patch rename to kernel/patches-4.14.x-rt/0357-0357-scsi-fcoe-Make-RT-aware.patch index f5f4bd62d..13f92a11d 100644 --- a/kernel/patches-4.14.x-rt/0357-scsi-fcoe-rt-aware.patch +++ b/kernel/patches-4.14.x-rt/0357-0357-scsi-fcoe-Make-RT-aware.patch @@ -1,20 +1,23 @@ -Subject: scsi/fcoe: Make RT aware. +From 64c81d9042394979f29faba76ae6af9637780e78 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 12 Nov 2011 14:00:48 +0100 +Subject: [PATCH 357/414] scsi/fcoe: Make RT aware. Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. Signed-off-by: Thomas Gleixner --- - drivers/scsi/fcoe/fcoe.c | 16 ++++++++-------- - drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++-- - drivers/scsi/libfc/fc_exch.c | 4 ++-- + drivers/scsi/fcoe/fcoe.c | 16 ++++++++-------- + drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++-- + drivers/scsi/libfc/fc_exch.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) +diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c +index 85f9a3eba387..08ea05ddcd82 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c -@@ -1464,11 +1464,11 @@ static int fcoe_rcv(struct sk_buff *skb, +@@ -1464,11 +1464,11 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev, static int fcoe_alloc_paged_crc_eof(struct sk_buff *skb, int tlen) { struct fcoe_percpu_s *fps; @@ -29,7 +32,7 @@ Signed-off-by: Thomas Gleixner return rc; } -@@ -1655,11 +1655,11 @@ static inline int fcoe_filter_frames(str +@@ -1655,11 +1655,11 @@ static inline int fcoe_filter_frames(struct fc_lport *lport, return 0; } @@ -43,7 +46,7 @@ Signed-off-by: Thomas Gleixner return -EINVAL; } -@@ -1702,7 +1702,7 @@ static void fcoe_recv_frame(struct sk_bu +@@ -1702,7 +1702,7 @@ static void fcoe_recv_frame(struct sk_buff *skb) */ hp = (struct fcoe_hdr *) skb_network_header(skb); @@ -52,7 +55,7 @@ Signed-off-by: Thomas Gleixner if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) { if (stats->ErrorFrames < 5) printk(KERN_WARNING "fcoe: FCoE version " -@@ -1734,13 +1734,13 @@ static void fcoe_recv_frame(struct sk_bu +@@ -1734,13 +1734,13 @@ static void fcoe_recv_frame(struct sk_buff *skb) goto drop; if (!fcoe_filter_frames(lport, fp)) { @@ -68,9 +71,11 @@ Signed-off-by: Thomas Gleixner kfree_skb(skb); } +diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c +index fff6f1851dc1..0ac24fd699a1 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c -@@ -835,7 +835,7 @@ static unsigned long fcoe_ctlr_age_fcfs( +@@ -835,7 +835,7 @@ static unsigned long fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip) INIT_LIST_HEAD(&del_list); @@ -79,7 +84,7 @@ Signed-off-by: Thomas Gleixner list_for_each_entry_safe(fcf, next, &fip->fcfs, list) { deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2; -@@ -871,7 +871,7 @@ static unsigned long fcoe_ctlr_age_fcfs( +@@ -871,7 +871,7 @@ static unsigned long fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip) sel_time = fcf->time; } } @@ -88,9 +93,11 @@ Signed-off-by: Thomas Gleixner 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 --- 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( +@@ -833,10 +833,10 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, } memset(ep, 0, sizeof(*ep)); @@ -103,3 +110,6 @@ Signed-off-by: Thomas Gleixner /* peek cache of free slot */ if (pool->left != FC_XID_UNKNOWN) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0358-sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch b/kernel/patches-4.14.x-rt/0358-0358-sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0358-sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch rename to kernel/patches-4.14.x-rt/0358-0358-sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch index 1774c4cef..9e64001e6 100644 --- a/kernel/patches-4.14.x-rt/0358-sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch +++ b/kernel/patches-4.14.x-rt/0358-0358-sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch @@ -1,6 +1,8 @@ +From 805724cc332ec3f4ae61da37f79cada0ca97fee0 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sat, 14 Feb 2015 11:01:16 -0500 -Subject: sas-ata/isci: dont't disable interrupts in qc_issue handler +Subject: [PATCH 358/414] sas-ata/isci: dont't disable interrupts in qc_issue + handler On 3.14-rt we see the following trace on Canoe Pass for SCSI_ISCI "Intel(R) C600 Series Chipset SAS Controller" @@ -53,12 +55,14 @@ be running the qc_issue code with interrupts enabled anyway. Signed-off-by: Paul Gortmaker Signed-off-by: Sebastian Andrzej Siewior --- - drivers/scsi/libsas/sas_ata.c | 4 ++-- + drivers/scsi/libsas/sas_ata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c +index 70be4425ae0b..a23ef685deac 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c -@@ -190,7 +190,7 @@ static unsigned int sas_ata_qc_issue(str +@@ -190,7 +190,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) /* TODO: audit callers to ensure they are ready for qc_issue to * unconditionally re-enable interrupts */ @@ -67,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior spin_unlock(ap->lock); /* If the device fell off, no sense in issuing commands */ -@@ -252,7 +252,7 @@ static unsigned int sas_ata_qc_issue(str +@@ -252,7 +252,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) out: spin_lock(ap->lock); @@ -76,3 +80,6 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0359-x86-crypto-reduce-preempt-disabled-regions.patch b/kernel/patches-4.14.x-rt/0359-0359-x86-crypto-Reduce-preempt-disabled-regions.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0359-x86-crypto-reduce-preempt-disabled-regions.patch rename to kernel/patches-4.14.x-rt/0359-0359-x86-crypto-Reduce-preempt-disabled-regions.patch index 16a3506d4..14446eb6d 100644 --- a/kernel/patches-4.14.x-rt/0359-x86-crypto-reduce-preempt-disabled-regions.patch +++ b/kernel/patches-4.14.x-rt/0359-0359-x86-crypto-Reduce-preempt-disabled-regions.patch @@ -1,6 +1,7 @@ -Subject: x86: crypto: Reduce preempt disabled regions +From bb382c7039691c80560e42757e69d9881d214fc2 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 14 Nov 2011 18:19:27 +0100 +Subject: [PATCH 359/414] x86: crypto: Reduce preempt disabled regions Restrict the preempt disabled regions to the actual floating point operations and enable preemption for the administrative actions. @@ -13,12 +14,14 @@ Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner --- - arch/x86/crypto/aesni-intel_glue.c | 22 ++++++++++++---------- + arch/x86/crypto/aesni-intel_glue.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) +diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c +index c690ddc78c03..7a3138d33e33 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -387,14 +387,14 @@ static int ecb_encrypt(struct skcipher_r +@@ -387,14 +387,14 @@ static int ecb_encrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -35,7 +38,7 @@ Signed-off-by: Thomas Gleixner return err; } -@@ -409,14 +409,14 @@ static int ecb_decrypt(struct skcipher_r +@@ -409,14 +409,14 @@ static int ecb_decrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -52,7 +55,7 @@ Signed-off-by: Thomas Gleixner return err; } -@@ -431,14 +431,14 @@ static int cbc_encrypt(struct skcipher_r +@@ -431,14 +431,14 @@ static int cbc_encrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -69,7 +72,7 @@ Signed-off-by: Thomas Gleixner return err; } -@@ -453,14 +453,14 @@ static int cbc_decrypt(struct skcipher_r +@@ -453,14 +453,14 @@ static int cbc_decrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -86,7 +89,7 @@ Signed-off-by: Thomas Gleixner return err; } -@@ -510,18 +510,20 @@ static int ctr_crypt(struct skcipher_req +@@ -510,18 +510,20 @@ static int ctr_crypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -109,3 +112,6 @@ Signed-off-by: Thomas Gleixner return err; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0360-crypto-Reduce-preempt-disabled-regions-more-algos.patch b/kernel/patches-4.14.x-rt/0360-0360-crypto-Reduce-preempt-disabled-regions-more-algos.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0360-crypto-Reduce-preempt-disabled-regions-more-algos.patch rename to kernel/patches-4.14.x-rt/0360-0360-crypto-Reduce-preempt-disabled-regions-more-algos.patch index b48dac2e6..8222335da 100644 --- a/kernel/patches-4.14.x-rt/0360-crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/kernel/patches-4.14.x-rt/0360-0360-crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,6 +1,7 @@ +From aab48463aa3fd43271c5e95307131a4eb2857c6a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 21 Feb 2014 17:24:04 +0100 -Subject: crypto: Reduce preempt disabled regions, more algos +Subject: [PATCH 360/414] 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() @@ -37,13 +38,15 @@ the bug is gone. Reported-by: Don Estabrook Signed-off-by: Sebastian Andrzej Siewior --- - arch/x86/crypto/cast5_avx_glue.c | 21 +++++++++------------ - arch/x86/crypto/glue_helper.c | 31 +++++++++++++++---------------- + arch/x86/crypto/cast5_avx_glue.c | 21 +++++++++------------ + arch/x86/crypto/glue_helper.c | 31 +++++++++++++++---------------- 2 files changed, 24 insertions(+), 28 deletions(-) +diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c +index 575292a33bdf..0a4b0a222b18 100644 --- a/arch/x86/crypto/cast5_avx_glue.c +++ b/arch/x86/crypto/cast5_avx_glue.c -@@ -59,7 +59,7 @@ static inline void cast5_fpu_end(bool fp +@@ -59,7 +59,7 @@ static inline void cast5_fpu_end(bool fpu_enabled) static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk, bool enc) { @@ -52,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct cast5_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); const unsigned int bsize = CAST5_BLOCK_SIZE; unsigned int nbytes; -@@ -73,7 +73,7 @@ static int ecb_crypt(struct blkcipher_de +@@ -73,7 +73,7 @@ static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk, u8 *wsrc = walk->src.virt.addr; u8 *wdst = walk->dst.virt.addr; @@ -61,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Process multi-block batch */ if (nbytes >= bsize * CAST5_PARALLEL_BLOCKS) { -@@ -102,10 +102,9 @@ static int ecb_crypt(struct blkcipher_de +@@ -102,10 +102,9 @@ static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk, } while (nbytes >= bsize); done: @@ -73,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior return err; } -@@ -226,7 +225,7 @@ static unsigned int __cbc_decrypt(struct +@@ -226,7 +225,7 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc, static int cbc_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { @@ -82,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct blkcipher_walk walk; int err; -@@ -235,12 +234,11 @@ static int cbc_decrypt(struct blkcipher_ +@@ -235,12 +234,11 @@ static int cbc_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; while ((nbytes = walk.nbytes)) { @@ -97,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior return err; } -@@ -309,7 +307,7 @@ static unsigned int __ctr_crypt(struct b +@@ -309,7 +307,7 @@ static unsigned int __ctr_crypt(struct blkcipher_desc *desc, static int ctr_crypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { @@ -106,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct blkcipher_walk walk; int err; -@@ -318,13 +316,12 @@ static int ctr_crypt(struct blkcipher_de +@@ -318,13 +316,12 @@ static int ctr_crypt(struct blkcipher_desc *desc, struct scatterlist *dst, desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; while ((nbytes = walk.nbytes) >= CAST5_BLOCK_SIZE) { @@ -122,9 +125,11 @@ Signed-off-by: Sebastian Andrzej Siewior if (walk.nbytes) { ctr_crypt_final(desc, &walk); err = blkcipher_walk_done(desc, &walk, 0); +diff --git a/arch/x86/crypto/glue_helper.c b/arch/x86/crypto/glue_helper.c +index d61e57960fe0..c67560d9718a 100644 --- a/arch/x86/crypto/glue_helper.c +++ b/arch/x86/crypto/glue_helper.c -@@ -40,7 +40,7 @@ static int __glue_ecb_crypt_128bit(const +@@ -40,7 +40,7 @@ static int __glue_ecb_crypt_128bit(const struct common_glue_ctx *gctx, void *ctx = crypto_blkcipher_ctx(desc->tfm); const unsigned int bsize = 128 / 8; unsigned int nbytes, i, func_bytes; @@ -133,7 +138,7 @@ Signed-off-by: Sebastian Andrzej Siewior int err; err = blkcipher_walk_virt(desc, walk); -@@ -50,7 +50,7 @@ static int __glue_ecb_crypt_128bit(const +@@ -50,7 +50,7 @@ static int __glue_ecb_crypt_128bit(const struct common_glue_ctx *gctx, u8 *wdst = walk->dst.virt.addr; fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, @@ -142,7 +147,7 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < gctx->num_funcs; i++) { func_bytes = bsize * gctx->funcs[i].num_blocks; -@@ -72,10 +72,10 @@ static int __glue_ecb_crypt_128bit(const +@@ -72,10 +72,10 @@ static int __glue_ecb_crypt_128bit(const struct common_glue_ctx *gctx, } done: @@ -154,7 +159,7 @@ Signed-off-by: Sebastian Andrzej Siewior return err; } -@@ -192,7 +192,7 @@ int glue_cbc_decrypt_128bit(const struct +@@ -192,7 +192,7 @@ int glue_cbc_decrypt_128bit(const struct common_glue_ctx *gctx, struct scatterlist *src, unsigned int nbytes) { const unsigned int bsize = 128 / 8; @@ -163,7 +168,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct blkcipher_walk walk; int err; -@@ -201,12 +201,12 @@ int glue_cbc_decrypt_128bit(const struct +@@ -201,12 +201,12 @@ int glue_cbc_decrypt_128bit(const struct common_glue_ctx *gctx, while ((nbytes = walk.nbytes)) { fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, @@ -178,7 +183,7 @@ Signed-off-by: Sebastian Andrzej Siewior return err; } EXPORT_SYMBOL_GPL(glue_cbc_decrypt_128bit); -@@ -275,7 +275,7 @@ int glue_ctr_crypt_128bit(const struct c +@@ -275,7 +275,7 @@ int glue_ctr_crypt_128bit(const struct common_glue_ctx *gctx, struct scatterlist *src, unsigned int nbytes) { const unsigned int bsize = 128 / 8; @@ -187,7 +192,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct blkcipher_walk walk; int err; -@@ -284,13 +284,12 @@ int glue_ctr_crypt_128bit(const struct c +@@ -284,13 +284,12 @@ int glue_ctr_crypt_128bit(const struct common_glue_ctx *gctx, while ((nbytes = walk.nbytes) >= bsize) { fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, @@ -203,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (walk.nbytes) { glue_ctr_crypt_final_128bit( gctx->funcs[gctx->num_funcs - 1].fn_u.ctr, desc, &walk); -@@ -380,7 +379,7 @@ int glue_xts_crypt_128bit(const struct c +@@ -380,7 +379,7 @@ int glue_xts_crypt_128bit(const struct common_glue_ctx *gctx, void *tweak_ctx, void *crypt_ctx) { const unsigned int bsize = 128 / 8; @@ -212,7 +217,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct blkcipher_walk walk; int err; -@@ -393,21 +392,21 @@ int glue_xts_crypt_128bit(const struct c +@@ -393,21 +392,21 @@ int glue_xts_crypt_128bit(const struct common_glue_ctx *gctx, /* set minimum length to bsize, for tweak_fn */ fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, @@ -239,3 +244,6 @@ Signed-off-by: Sebastian Andrzej Siewior return err; } EXPORT_SYMBOL_GPL(glue_xts_crypt_128bit); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0361-crypto-limit-more-FPU-enabled-sections.patch b/kernel/patches-4.14.x-rt/0361-0361-crypto-limit-more-FPU-enabled-sections.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0361-crypto-limit-more-FPU-enabled-sections.patch rename to kernel/patches-4.14.x-rt/0361-0361-crypto-limit-more-FPU-enabled-sections.patch index 561716bec..e68f04d39 100644 --- a/kernel/patches-4.14.x-rt/0361-crypto-limit-more-FPU-enabled-sections.patch +++ b/kernel/patches-4.14.x-rt/0361-0361-crypto-limit-more-FPU-enabled-sections.patch @@ -1,6 +1,7 @@ +From 72ffd8b705f59d75d374273d36b81f647a7ba360 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 30 Nov 2017 13:40:10 +0100 -Subject: [PATCH] crypto: limit more FPU-enabled sections +Subject: [PATCH 361/414] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -28,18 +29,20 @@ performance. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - arch/x86/crypto/camellia_aesni_avx2_glue.c | 20 ++++++++++++++++++++ - arch/x86/crypto/camellia_aesni_avx_glue.c | 19 +++++++++++++++++++ - arch/x86/crypto/cast6_avx_glue.c | 24 +++++++++++++++++++----- - arch/x86/crypto/chacha20_glue.c | 9 +++++---- - arch/x86/crypto/serpent_avx2_glue.c | 19 +++++++++++++++++++ - arch/x86/crypto/serpent_avx_glue.c | 23 +++++++++++++++++++---- - arch/x86/crypto/serpent_sse2_glue.c | 23 +++++++++++++++++++---- - arch/x86/crypto/twofish_avx_glue.c | 27 +++++++++++++++++++++++++-- - arch/x86/include/asm/fpu/api.h | 1 + - arch/x86/kernel/fpu/core.c | 12 ++++++++++++ + arch/x86/crypto/camellia_aesni_avx2_glue.c | 20 ++++++++++++++++ + arch/x86/crypto/camellia_aesni_avx_glue.c | 19 +++++++++++++++ + arch/x86/crypto/cast6_avx_glue.c | 24 +++++++++++++++---- + arch/x86/crypto/chacha20_glue.c | 9 ++++---- + arch/x86/crypto/serpent_avx2_glue.c | 19 +++++++++++++++ + arch/x86/crypto/serpent_avx_glue.c | 23 ++++++++++++++---- + arch/x86/crypto/serpent_sse2_glue.c | 23 ++++++++++++++---- + arch/x86/crypto/twofish_avx_glue.c | 27 ++++++++++++++++++++-- + arch/x86/include/asm/fpu/api.h | 1 + + arch/x86/kernel/fpu/core.c | 12 ++++++++++ 10 files changed, 158 insertions(+), 19 deletions(-) +diff --git a/arch/x86/crypto/camellia_aesni_avx2_glue.c b/arch/x86/crypto/camellia_aesni_avx2_glue.c +index 60907c139c4e..0902db7d326a 100644 --- a/arch/x86/crypto/camellia_aesni_avx2_glue.c +++ b/arch/x86/crypto/camellia_aesni_avx2_glue.c @@ -206,6 +206,20 @@ struct crypt_priv { @@ -63,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) { const unsigned int bsize = CAMELLIA_BLOCK_SIZE; -@@ -221,16 +235,19 @@ static void encrypt_callback(void *priv, +@@ -221,16 +235,19 @@ static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) } if (nbytes >= CAMELLIA_AESNI_PARALLEL_BLOCKS * bsize) { @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) camellia_enc_blk(ctx->ctx, srcdst, srcdst); -@@ -251,16 +268,19 @@ static void decrypt_callback(void *priv, +@@ -251,16 +268,19 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) } if (nbytes >= CAMELLIA_AESNI_PARALLEL_BLOCKS * bsize) { @@ -103,6 +106,8 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) camellia_dec_blk(ctx->ctx, srcdst, srcdst); +diff --git a/arch/x86/crypto/camellia_aesni_avx_glue.c b/arch/x86/crypto/camellia_aesni_avx_glue.c +index d96429da88eb..3b8e91841039 100644 --- a/arch/x86/crypto/camellia_aesni_avx_glue.c +++ b/arch/x86/crypto/camellia_aesni_avx_glue.c @@ -210,6 +210,21 @@ struct crypt_priv { @@ -127,7 +132,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) { const unsigned int bsize = CAMELLIA_BLOCK_SIZE; -@@ -225,10 +240,12 @@ static void encrypt_callback(void *priv, +@@ -225,10 +240,12 @@ static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) } while (nbytes >= CAMELLIA_PARALLEL_BLOCKS * bsize) { @@ -140,7 +145,7 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) camellia_enc_blk(ctx->ctx, srcdst, srcdst); -@@ -249,10 +266,12 @@ static void decrypt_callback(void *priv, +@@ -249,10 +266,12 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) } while (nbytes >= CAMELLIA_PARALLEL_BLOCKS * bsize) { @@ -153,6 +158,8 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) camellia_dec_blk(ctx->ctx, srcdst, srcdst); +diff --git a/arch/x86/crypto/cast6_avx_glue.c b/arch/x86/crypto/cast6_avx_glue.c +index 50e684768c55..8caf9ba8c1da 100644 --- a/arch/x86/crypto/cast6_avx_glue.c +++ b/arch/x86/crypto/cast6_avx_glue.c @@ -205,19 +205,33 @@ struct crypt_priv { @@ -192,7 +199,7 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) __cast6_encrypt(ctx->ctx, srcdst, srcdst); } -@@ -228,10 +242,10 @@ static void decrypt_callback(void *priv, +@@ -228,10 +242,10 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) struct crypt_priv *ctx = priv; int i; @@ -205,9 +212,11 @@ Signed-off-by: Sebastian Andrzej Siewior return; } +diff --git a/arch/x86/crypto/chacha20_glue.c b/arch/x86/crypto/chacha20_glue.c +index 1e6af1b35f7b..e7809fd2a4fd 100644 --- a/arch/x86/crypto/chacha20_glue.c +++ b/arch/x86/crypto/chacha20_glue.c -@@ -81,23 +81,24 @@ static int chacha20_simd(struct skcipher +@@ -81,23 +81,24 @@ static int chacha20_simd(struct skcipher_request *req) crypto_chacha20_init(state, ctx, walk.iv); @@ -236,6 +245,8 @@ Signed-off-by: Sebastian Andrzej Siewior return err; } +diff --git a/arch/x86/crypto/serpent_avx2_glue.c b/arch/x86/crypto/serpent_avx2_glue.c +index 870f6d812a2d..5c806bf39f1d 100644 --- a/arch/x86/crypto/serpent_avx2_glue.c +++ b/arch/x86/crypto/serpent_avx2_glue.c @@ -184,6 +184,21 @@ struct crypt_priv { @@ -260,7 +271,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) { const unsigned int bsize = SERPENT_BLOCK_SIZE; -@@ -199,10 +214,12 @@ static void encrypt_callback(void *priv, +@@ -199,10 +214,12 @@ static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) } while (nbytes >= SERPENT_PARALLEL_BLOCKS * bsize) { @@ -273,7 +284,7 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) __serpent_encrypt(ctx->ctx, srcdst, srcdst); -@@ -223,10 +240,12 @@ static void decrypt_callback(void *priv, +@@ -223,10 +240,12 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) } while (nbytes >= SERPENT_PARALLEL_BLOCKS * bsize) { @@ -286,6 +297,8 @@ Signed-off-by: Sebastian Andrzej Siewior for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) __serpent_decrypt(ctx->ctx, srcdst, srcdst); +diff --git a/arch/x86/crypto/serpent_avx_glue.c b/arch/x86/crypto/serpent_avx_glue.c +index 6f778d3daa22..46dcbdbd0518 100644 --- a/arch/x86/crypto/serpent_avx_glue.c +++ b/arch/x86/crypto/serpent_avx_glue.c @@ -218,16 +218,31 @@ struct crypt_priv { @@ -322,7 +335,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; } -@@ -241,10 +256,10 @@ static void decrypt_callback(void *priv, +@@ -241,10 +256,10 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) struct crypt_priv *ctx = priv; int i; @@ -335,6 +348,8 @@ Signed-off-by: Sebastian Andrzej Siewior return; } +diff --git a/arch/x86/crypto/serpent_sse2_glue.c b/arch/x86/crypto/serpent_sse2_glue.c +index ac0e831943f5..d35f607d067f 100644 --- a/arch/x86/crypto/serpent_sse2_glue.c +++ b/arch/x86/crypto/serpent_sse2_glue.c @@ -187,16 +187,31 @@ struct crypt_priv { @@ -371,7 +386,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; } -@@ -210,10 +225,10 @@ static void decrypt_callback(void *priv, +@@ -210,10 +225,10 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) struct crypt_priv *ctx = priv; int i; @@ -384,6 +399,8 @@ Signed-off-by: Sebastian Andrzej Siewior return; } +diff --git a/arch/x86/crypto/twofish_avx_glue.c b/arch/x86/crypto/twofish_avx_glue.c +index b7a3904b953c..de00fe24927e 100644 --- a/arch/x86/crypto/twofish_avx_glue.c +++ b/arch/x86/crypto/twofish_avx_glue.c @@ -218,6 +218,21 @@ struct crypt_priv { @@ -408,7 +425,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) { const unsigned int bsize = TF_BLOCK_SIZE; -@@ -228,12 +243,16 @@ static void encrypt_callback(void *priv, +@@ -228,12 +243,16 @@ static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) if (nbytes == bsize * TWOFISH_PARALLEL_BLOCKS) { twofish_ecb_enc_8way(ctx->ctx, srcdst, srcdst); @@ -426,7 +443,7 @@ Signed-off-by: Sebastian Andrzej Siewior nbytes %= bsize * 3; for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) -@@ -250,11 +269,15 @@ static void decrypt_callback(void *priv, +@@ -250,11 +269,15 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) if (nbytes == bsize * TWOFISH_PARALLEL_BLOCKS) { twofish_ecb_dec_8way(ctx->ctx, srcdst, srcdst); @@ -443,6 +460,8 @@ Signed-off-by: Sebastian Andrzej Siewior nbytes %= bsize * 3; +diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h +index a9caac9d4a72..18b31f22ca5d 100644 --- a/arch/x86/include/asm/fpu/api.h +++ b/arch/x86/include/asm/fpu/api.h @@ -25,6 +25,7 @@ extern void __kernel_fpu_begin(void); @@ -453,6 +472,8 @@ Signed-off-by: Sebastian Andrzej Siewior extern bool irq_fpu_usable(void); /* +diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c +index f92a6593de1e..7128beaf594c 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -137,6 +137,18 @@ void kernel_fpu_end(void) @@ -474,3 +495,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Save the FPU state (mark it for reload if necessary): * +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0362-arm-disable-NEON-in-kernel-mode.patch b/kernel/patches-4.14.x-rt/0362-0362-arm-disable-NEON-in-kernel-mode.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0362-arm-disable-NEON-in-kernel-mode.patch rename to kernel/patches-4.14.x-rt/0362-0362-arm-disable-NEON-in-kernel-mode.patch index 3edb74164..eb7d2c339 100644 --- a/kernel/patches-4.14.x-rt/0362-arm-disable-NEON-in-kernel-mode.patch +++ b/kernel/patches-4.14.x-rt/0362-0362-arm-disable-NEON-in-kernel-mode.patch @@ -1,6 +1,7 @@ +From 54f1647b42f4352aec96c757d71b67cd7e6b6a13 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 1 Dec 2017 10:42:03 +0100 -Subject: [PATCH] arm*: disable NEON in kernel mode +Subject: [PATCH 362/414] 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 @@ -13,11 +14,13 @@ stay on due to possible EFI callbacks so here I disable each algorithm. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - arch/arm/Kconfig | 2 +- - arch/arm64/crypto/Kconfig | 20 ++++++++++---------- - arch/arm64/crypto/crc32-ce-glue.c | 3 ++- + arch/arm/Kconfig | 2 +- + arch/arm64/crypto/Kconfig | 20 ++++++++++---------- + arch/arm64/crypto/crc32-ce-glue.c | 3 ++- 3 files changed, 13 insertions(+), 12 deletions(-) +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index e57221694d28..ac05a027539a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -2164,7 +2164,7 @@ config NEON @@ -29,6 +32,8 @@ Signed-off-by: Sebastian Andrzej Siewior help Say Y to include support for NEON in kernel mode. +diff --git a/arch/arm64/crypto/Kconfig b/arch/arm64/crypto/Kconfig +index 70c517aa4501..2a5f05b5a19a 100644 --- a/arch/arm64/crypto/Kconfig +++ b/arch/arm64/crypto/Kconfig @@ -19,19 +19,19 @@ config CRYPTO_SHA512_ARM64 @@ -113,9 +118,11 @@ Signed-off-by: Sebastian Andrzej Siewior select CRYPTO_BLKCIPHER select CRYPTO_AES_ARM64_NEON_BLK select CRYPTO_AES_ARM64 +diff --git a/arch/arm64/crypto/crc32-ce-glue.c b/arch/arm64/crypto/crc32-ce-glue.c +index 34b4e3d46aab..ae055cdad8cf 100644 --- a/arch/arm64/crypto/crc32-ce-glue.c +++ b/arch/arm64/crypto/crc32-ce-glue.c -@@ -208,7 +208,8 @@ static struct shash_alg crc32_pmull_algs +@@ -208,7 +208,8 @@ static struct shash_alg crc32_pmull_algs[] = { { static int __init crc32_pmull_mod_init(void) { @@ -125,3 +132,6 @@ Signed-off-by: Sebastian Andrzej Siewior crc32_pmull_algs[0].update = crc32_pmull_update; crc32_pmull_algs[1].update = crc32c_pmull_update; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0363-dm-make-rt-aware.patch b/kernel/patches-4.14.x-rt/0363-0363-dm-Make-rt-aware.patch similarity index 68% rename from kernel/patches-4.14.x-rt/0363-dm-make-rt-aware.patch rename to kernel/patches-4.14.x-rt/0363-0363-dm-Make-rt-aware.patch index 6f8e3e635..445014226 100644 --- a/kernel/patches-4.14.x-rt/0363-dm-make-rt-aware.patch +++ b/kernel/patches-4.14.x-rt/0363-0363-dm-Make-rt-aware.patch @@ -1,6 +1,7 @@ -Subject: dm: Make rt aware +From aa78cacfb85f54e41a938a4ceb5d098b332d79ed Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 14 Nov 2011 23:06:09 +0100 +Subject: [PATCH 363/414] dm: Make rt aware Use the BUG_ON_NORT variant for the irq_disabled() checks. RT has interrupts legitimately enabled here as we cant deadlock against the @@ -10,12 +11,14 @@ Reported-by: Luis Claudio R. Goncalves Signed-off-by: Thomas Gleixner --- - drivers/md/dm-rq.c | 2 +- + drivers/md/dm-rq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c +index eadfcfd106ff..8824aeda85cf 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c -@@ -671,7 +671,7 @@ static void dm_old_request_fn(struct req +@@ -671,7 +671,7 @@ 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); @@ -24,3 +27,6 @@ Signed-off-by: Thomas Gleixner } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0364-acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch b/kernel/patches-4.14.x-rt/0364-0364-acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0364-acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch rename to kernel/patches-4.14.x-rt/0364-0364-acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch index 1e8bce7fd..3a086b312 100644 --- a/kernel/patches-4.14.x-rt/0364-acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch +++ b/kernel/patches-4.14.x-rt/0364-0364-acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch @@ -1,6 +1,8 @@ +From a0a4716b65fa6b1bec03a2ef78e31e663f4224c1 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Wed, 13 Feb 2013 09:26:05 -0500 -Subject: acpi/rt: Convert acpi_gbl_hardware lock back to a raw_spinlock_t +Subject: [PATCH 364/414] acpi/rt: Convert acpi_gbl_hardware lock back to a + raw_spinlock_t We hit the following bug with 3.6-rt: @@ -63,16 +65,18 @@ Link: http://lkml.kernel.org/r/1360765565.23152.5.camel@gandalf.local.home Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - drivers/acpi/acpica/acglobal.h | 2 +- - drivers/acpi/acpica/hwregs.c | 4 ++-- - drivers/acpi/acpica/hwxface.c | 4 ++-- - drivers/acpi/acpica/utmutex.c | 4 ++-- - include/acpi/platform/aclinux.h | 15 +++++++++++++++ + drivers/acpi/acpica/acglobal.h | 2 +- + drivers/acpi/acpica/hwregs.c | 4 ++-- + drivers/acpi/acpica/hwxface.c | 4 ++-- + drivers/acpi/acpica/utmutex.c | 4 ++-- + include/acpi/platform/aclinux.h | 15 +++++++++++++++ 5 files changed, 22 insertions(+), 7 deletions(-) +diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h +index 95eed442703f..50bc5b61d899 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h -@@ -116,7 +116,7 @@ ACPI_GLOBAL(u8, acpi_gbl_global_lock_pen +@@ -116,7 +116,7 @@ ACPI_GLOBAL(u8, acpi_gbl_global_lock_pending); * interrupt level */ ACPI_GLOBAL(acpi_spinlock, acpi_gbl_gpe_lock); /* For GPE data structs and registers */ @@ -81,9 +85,11 @@ Signed-off-by: Sebastian Andrzej Siewior ACPI_GLOBAL(acpi_spinlock, acpi_gbl_reference_count_lock); /* Mutex for _OSI support */ +diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c +index acb417b58bbb..ea49e08c263f 100644 --- a/drivers/acpi/acpica/hwregs.c +++ b/drivers/acpi/acpica/hwregs.c -@@ -428,14 +428,14 @@ acpi_status acpi_hw_clear_acpi_status(vo +@@ -428,14 +428,14 @@ acpi_status acpi_hw_clear_acpi_status(void) ACPI_BITMASK_ALL_FIXED_STATUS, ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address))); @@ -100,9 +106,11 @@ Signed-off-by: Sebastian Andrzej Siewior if (ACPI_FAILURE(status)) { goto exit; +diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c +index 34684ae89981..fb84983e1839 100644 --- a/drivers/acpi/acpica/hwxface.c +++ b/drivers/acpi/acpica/hwxface.c -@@ -373,7 +373,7 @@ acpi_status acpi_write_bit_register(u32 +@@ -373,7 +373,7 @@ acpi_status acpi_write_bit_register(u32 register_id, u32 value) return_ACPI_STATUS(AE_BAD_PARAMETER); } @@ -111,7 +119,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * At this point, we know that the parent register is one of the -@@ -434,7 +434,7 @@ acpi_status acpi_write_bit_register(u32 +@@ -434,7 +434,7 @@ acpi_status acpi_write_bit_register(u32 register_id, u32 value) unlock_and_exit: @@ -120,9 +128,11 @@ Signed-off-by: Sebastian Andrzej Siewior return_ACPI_STATUS(status); } +diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c +index 586354788018..3a3c2a86437f 100644 --- a/drivers/acpi/acpica/utmutex.c +++ b/drivers/acpi/acpica/utmutex.c -@@ -88,7 +88,7 @@ acpi_status acpi_ut_mutex_initialize(voi +@@ -88,7 +88,7 @@ acpi_status acpi_ut_mutex_initialize(void) return_ACPI_STATUS (status); } @@ -140,6 +150,8 @@ Signed-off-by: Sebastian Andrzej Siewior acpi_os_delete_lock(acpi_gbl_reference_count_lock); /* Delete the reader/writer lock */ +diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h +index 1b473efd9eb6..89ee5e1dac48 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -134,6 +134,7 @@ @@ -171,3 +183,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * OSL interfaces used by debugger/disassembler */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0365-cpumask-disable-offstack-on-rt.patch b/kernel/patches-4.14.x-rt/0365-0365-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0365-cpumask-disable-offstack-on-rt.patch rename to kernel/patches-4.14.x-rt/0365-0365-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch index 09681f54d..5e4ed2204 100644 --- a/kernel/patches-4.14.x-rt/0365-cpumask-disable-offstack-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0365-0365-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch @@ -1,6 +1,7 @@ -Subject: cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT +From 7947cbb9c75ad46c0237c2ae3348e0e473e7cb50 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 14 Dec 2011 01:03:49 +0100 +Subject: [PATCH 365/414] cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT There are "valid" GFP_ATOMIC allocations such as @@ -40,10 +41,12 @@ which forbid allocations at run-time. Signed-off-by: Thomas Gleixner --- - arch/x86/Kconfig | 2 +- - lib/Kconfig | 1 + + arch/x86/Kconfig | 2 +- + lib/Kconfig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index 310df1ea0d68..c4afdf1be676 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -934,7 +934,7 @@ config IOMMU_HELPER @@ -55,6 +58,8 @@ Signed-off-by: Thomas Gleixner ---help--- Enable maximum number of CPUS and NUMA Nodes for this architecture. If unsure, say N. +diff --git a/lib/Kconfig b/lib/Kconfig +index b1445b22a6de..9ab51b78991a 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -428,6 +428,7 @@ config CHECK_SIGNATURE @@ -65,3 +70,6 @@ Signed-off-by: Thomas Gleixner help Use dynamic allocation for cpumask_var_t, instead of putting them on the stack. This is a bit more expensive, but avoids +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0366-random-make-it-work-on-rt.patch b/kernel/patches-4.14.x-rt/0366-0366-random-Make-it-work-on-rt.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0366-random-make-it-work-on-rt.patch rename to kernel/patches-4.14.x-rt/0366-0366-random-Make-it-work-on-rt.patch index 30054353f..29a4bc538 100644 --- a/kernel/patches-4.14.x-rt/0366-random-make-it-work-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0366-0366-random-Make-it-work-on-rt.patch @@ -1,6 +1,7 @@ -Subject: random: Make it work on rt +From 4b24c3e4d676d2651dedd877c5bb01aae3694212 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 21 Aug 2012 20:38:50 +0200 +Subject: [PATCH 366/414] 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 @@ -8,19 +9,20 @@ descriptor and feed it into the random generator as a source of entropy. Signed-off-by: Thomas Gleixner - --- - drivers/char/random.c | 11 +++++------ - drivers/hv/vmbus_drv.c | 4 +++- - include/linux/irqdesc.h | 1 + - include/linux/random.h | 2 +- - kernel/irq/handle.c | 8 +++++++- - kernel/irq/manage.c | 6 ++++++ + drivers/char/random.c | 11 +++++------ + drivers/hv/vmbus_drv.c | 4 +++- + include/linux/irqdesc.h | 1 + + include/linux/random.h | 2 +- + kernel/irq/handle.c | 8 +++++++- + kernel/irq/manage.c | 6 ++++++ 6 files changed, 23 insertions(+), 9 deletions(-) +diff --git a/drivers/char/random.c b/drivers/char/random.c +index 106abdf67efd..07d3b27db4fb 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c -@@ -1218,28 +1218,27 @@ static __u32 get_reg(struct fast_pool *f +@@ -1218,28 +1218,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs) return *ptr; } @@ -54,6 +56,8 @@ Signed-off-by: Thomas Gleixner fast_mix(fast_pool); add_interrupt_bench(cycles); +diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c +index 2cd134dd94d2..cedf225d4182 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -966,6 +966,8 @@ static void vmbus_isr(void) @@ -74,6 +78,8 @@ Signed-off-by: Thomas Gleixner } +diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h +index b6084898d330..d334476cdca6 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h @@ -70,6 +70,7 @@ struct irq_desc { @@ -84,9 +90,11 @@ Signed-off-by: Thomas Gleixner raw_spinlock_t lock; struct cpumask *percpu_enabled; const struct cpumask *percpu_affinity; +diff --git a/include/linux/random.h b/include/linux/random.h +index 4024f7d9c77d..462d752a739b 100644 --- a/include/linux/random.h +++ b/include/linux/random.h -@@ -32,7 +32,7 @@ static inline void add_latent_entropy(vo +@@ -32,7 +32,7 @@ static inline void add_latent_entropy(void) {} extern void add_input_randomness(unsigned int type, unsigned int code, unsigned int value) __latent_entropy; @@ -95,9 +103,11 @@ Signed-off-by: Thomas Gleixner extern void get_random_bytes(void *buf, int nbytes); extern int wait_for_random_bytes(void); +diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c +index 79f987b942b8..d1dbacc29941 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c -@@ -183,10 +183,16 @@ irqreturn_t handle_irq_event_percpu(stru +@@ -183,10 +183,16 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc) { irqreturn_t retval; unsigned int flags = 0; @@ -115,6 +125,8 @@ Signed-off-by: Thomas Gleixner if (!noirqdebug) note_interrupt(desc, retval); +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index 000c519a35cd..5190abc61d37 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1027,6 +1027,12 @@ static int irq_thread(void *data) @@ -130,3 +142,6 @@ Signed-off-by: Thomas Gleixner wake_threads_waitq(desc); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0367-random-avoid-preempt_disable-ed-section.patch b/kernel/patches-4.14.x-rt/0367-0367-random-avoid-preempt_disable-ed-section.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0367-random-avoid-preempt_disable-ed-section.patch rename to kernel/patches-4.14.x-rt/0367-0367-random-avoid-preempt_disable-ed-section.patch index 179a589af..d5b73dc22 100644 --- a/kernel/patches-4.14.x-rt/0367-random-avoid-preempt_disable-ed-section.patch +++ b/kernel/patches-4.14.x-rt/0367-0367-random-avoid-preempt_disable-ed-section.patch @@ -1,6 +1,7 @@ +From f069ea319e63cc2bc6b32c8a7c45617014acfd32 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 12 May 2017 15:46:17 +0200 -Subject: [PATCH] random: avoid preempt_disable()ed section +Subject: [PATCH 367/414] random: avoid preempt_disable()ed section extract_crng() will use sleeping locks while in a preempt_disable() section due to get_cpu_var(). @@ -9,9 +10,11 @@ Work around it with local_locks. Cc: stable-rt@vger.kernel.org # where it applies to Signed-off-by: Sebastian Andrzej Siewior --- - drivers/char/random.c | 11 +++++++---- + drivers/char/random.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) +diff --git a/drivers/char/random.c b/drivers/char/random.c +index 07d3b27db4fb..74a0f65217f5 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -265,6 +265,7 @@ @@ -22,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include -@@ -2188,6 +2189,7 @@ static rwlock_t batched_entropy_reset_lo +@@ -2188,6 +2189,7 @@ static rwlock_t batched_entropy_reset_lock = __RW_LOCK_UNLOCKED(batched_entropy_ * at any point prior. */ static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u64); @@ -72,3 +75,6 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } EXPORT_SYMBOL(get_random_u32); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0368-char-random-don-t-print-that-the-init-is-done.patch b/kernel/patches-4.14.x-rt/0368-0368-char-random-don-t-print-that-the-init-is-done.patch similarity index 92% rename from kernel/patches-4.14.x-rt/0368-char-random-don-t-print-that-the-init-is-done.patch rename to kernel/patches-4.14.x-rt/0368-0368-char-random-don-t-print-that-the-init-is-done.patch index 4382eaeea..9c94af0ba 100644 --- a/kernel/patches-4.14.x-rt/0368-char-random-don-t-print-that-the-init-is-done.patch +++ b/kernel/patches-4.14.x-rt/0368-0368-char-random-don-t-print-that-the-init-is-done.patch @@ -1,6 +1,7 @@ +From 9037d5fb70c6985cebb474b9904ce78878e5652a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 30 May 2017 16:39:01 +0200 -Subject: char/random: don't print that the init is done +Subject: [PATCH 368/414] char/random: don't print that the init is done On RT we run into circular locking with pendingb_lock (workqueue), port_lock_key (uart) and the primary_crng (random): @@ -141,12 +142,14 @@ also could skip it. Signed-off-by: Sebastian Andrzej Siewior --- - drivers/char/random.c | 8 ++++++-- + drivers/char/random.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) +diff --git a/drivers/char/random.c b/drivers/char/random.c +index 74a0f65217f5..4a8458ff5ee8 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c -@@ -857,7 +857,7 @@ static int crng_fast_load(const char *cp +@@ -857,7 +857,7 @@ static int crng_fast_load(const char *cp, size_t len) invalidate_batched_entropy(); crng_init = 1; wake_up_interruptible(&crng_init_wait); @@ -155,7 +158,7 @@ Signed-off-by: Sebastian Andrzej Siewior } return 1; } -@@ -942,17 +942,21 @@ static void crng_reseed(struct crng_stat +@@ -942,17 +942,21 @@ static void crng_reseed(struct crng_state *crng, struct entropy_store *r) crng_init = 2; process_random_ready_list(); wake_up_interruptible(&crng_init_wait); @@ -178,3 +181,6 @@ Signed-off-by: Sebastian Andrzej Siewior urandom_warning.missed = 0; } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0369-cpu-hotplug--Implement-CPU-pinning.patch b/kernel/patches-4.14.x-rt/0369-0369-cpu-hotplug-Implement-CPU-pinning.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0369-cpu-hotplug--Implement-CPU-pinning.patch rename to kernel/patches-4.14.x-rt/0369-0369-cpu-hotplug-Implement-CPU-pinning.patch index 54ca45d0e..afe2ad862 100644 --- a/kernel/patches-4.14.x-rt/0369-cpu-hotplug--Implement-CPU-pinning.patch +++ b/kernel/patches-4.14.x-rt/0369-0369-cpu-hotplug-Implement-CPU-pinning.patch @@ -1,13 +1,16 @@ -Subject: cpu/hotplug: Implement CPU pinning +From 893b08921fc68e4725cda3606d490c72b5df33bd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 19 Jul 2017 17:31:20 +0200 +Subject: [PATCH 369/414] cpu/hotplug: Implement CPU pinning Signed-off-by: Thomas Gleixner --- - include/linux/sched.h | 1 + - kernel/cpu.c | 40 ++++++++++++++++++++++++++++++++++++++++ + include/linux/sched.h | 1 + + kernel/cpu.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 35f7a037fe1a..d32be8e98b90 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -589,6 +589,7 @@ struct task_struct { @@ -18,9 +21,11 @@ Signed-off-by: Thomas Gleixner # ifdef CONFIG_SCHED_DEBUG int migrate_disable_atomic; # endif +diff --git a/kernel/cpu.c b/kernel/cpu.c +index aa9b1702e115..61ca799b76c5 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c -@@ -73,6 +73,11 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_s +@@ -73,6 +73,11 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { .fail = CPUHP_INVALID, }; @@ -39,7 +44,7 @@ Signed-off-by: Thomas Gleixner + 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); @@ -52,7 +57,7 @@ Signed-off-by: Thomas Gleixner + preempt_enable(); + + __read_rt_lock(cpuhp_pin); -+ + + preempt_disable(); + preempt_lazy_disable(); + if (cpu != smp_processor_id()) { @@ -85,7 +90,7 @@ Signed-off-by: Thomas Gleixner struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); int err; -@@ -781,11 +817,14 @@ static int takedown_cpu(unsigned int cpu +@@ -781,11 +817,14 @@ static int takedown_cpu(unsigned int cpu) */ irq_lock_sparse(); @@ -100,7 +105,7 @@ Signed-off-by: Thomas Gleixner /* CPU refused to die */ irq_unlock_sparse(); /* Unpark the hotplug thread so we can rollback there */ -@@ -804,6 +843,7 @@ static int takedown_cpu(unsigned int cpu +@@ -804,6 +843,7 @@ static int takedown_cpu(unsigned int cpu) wait_for_ap_thread(st, false); BUG_ON(st->state != CPUHP_AP_IDLE_DEAD); @@ -108,3 +113,6 @@ Signed-off-by: Thomas Gleixner /* Interrupts are moved away from the dying cpu, reenable alloc/free */ irq_unlock_sparse(); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0370-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/kernel/patches-4.14.x-rt/0370-0370-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0370-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch rename to kernel/patches-4.14.x-rt/0370-0370-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index ad8ba4623..3f2fdd7bc 100644 --- a/kernel/patches-4.14.x-rt/0370-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/kernel/patches-4.14.x-rt/0370-0370-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch @@ -1,6 +1,7 @@ +From c4e97705f5468e3d8e3db7e52c0cfcc1cd5b8ff6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 18:31:00 +0200 -Subject: [PATCH] hotplug: duct-tape RT-rwlock usage for non-RT +Subject: [PATCH 370/414] 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 @@ -8,12 +9,14 @@ damage. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/cpu.c | 14 +++++++++++++- + kernel/cpu.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) +diff --git a/kernel/cpu.c b/kernel/cpu.c +index 61ca799b76c5..8fbc0f5ac6f9 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c -@@ -73,7 +73,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_s +@@ -73,7 +73,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { .fail = CPUHP_INVALID, }; @@ -64,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); int err; -@@ -817,14 +823,18 @@ static int takedown_cpu(unsigned int cpu +@@ -817,14 +823,18 @@ static int takedown_cpu(unsigned int cpu) */ irq_lock_sparse(); @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* CPU refused to die */ irq_unlock_sparse(); /* Unpark the hotplug thread so we can rollback there */ -@@ -843,7 +853,9 @@ static int takedown_cpu(unsigned int cpu +@@ -843,7 +853,9 @@ static int takedown_cpu(unsigned int cpu) wait_for_ap_thread(st, false); BUG_ON(st->state != CPUHP_AP_IDLE_DEAD); @@ -93,3 +96,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* Interrupts are moved away from the dying cpu, reenable alloc/free */ irq_unlock_sparse(); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0371-scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch b/kernel/patches-4.14.x-rt/0371-0371-scsi-qla2xxx-Use-local_irq_save_nort-in-qla2x00_poll.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0371-scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch rename to kernel/patches-4.14.x-rt/0371-0371-scsi-qla2xxx-Use-local_irq_save_nort-in-qla2x00_poll.patch index 64a759685..1af33c995 100644 --- a/kernel/patches-4.14.x-rt/0371-scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch +++ b/kernel/patches-4.14.x-rt/0371-0371-scsi-qla2xxx-Use-local_irq_save_nort-in-qla2x00_poll.patch @@ -1,6 +1,8 @@ -Subject: scsi: qla2xxx: Use local_irq_save_nort() in qla2x00_poll +From 75d4661de574b2a4349867d41cb3b9222a79ba91 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Fri, 27 Apr 2012 12:48:46 +0200 +Subject: [PATCH 371/414] scsi: qla2xxx: Use local_irq_save_nort() in + qla2x00_poll RT triggers the following: @@ -25,9 +27,11 @@ Link: http://lkml.kernel.org/r/1335523726-10024-1-git-send-email-jkacur@redhat.c Signed-off-by: Thomas Gleixner --- - drivers/scsi/qla2xxx/qla_inline.h | 4 ++-- + drivers/scsi/qla2xxx/qla_inline.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h +index 9a2c86eacf44..28266455b54c 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -59,12 +59,12 @@ qla2x00_poll(struct rsp_que *rsp) @@ -45,3 +49,6 @@ Signed-off-by: Thomas Gleixner } static inline uint8_t * +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0372-upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/kernel/patches-4.14.x-rt/0372-0372-net-Remove-preemption-disabling-in-netif_rx.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0372-upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch rename to kernel/patches-4.14.x-rt/0372-0372-net-Remove-preemption-disabling-in-netif_rx.patch index 2338ed2db..187aba96d 100644 --- a/kernel/patches-4.14.x-rt/0372-upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch +++ b/kernel/patches-4.14.x-rt/0372-0372-net-Remove-preemption-disabling-in-netif_rx.patch @@ -1,6 +1,7 @@ -Subject: net: Remove preemption disabling in netif_rx() +From 10d295e1f35b57caa341211413c8eb12b0cef666 Mon Sep 17 00:00:00 2001 From: Priyanka Jain Date: Thu, 17 May 2012 09:35:11 +0530 +Subject: [PATCH 372/414] 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 @@ -30,14 +31,14 @@ Link: http://lkml.kernel.org/r/1337227511-2271-1-git-send-email-Priyanka.Jain@fr Signed-off-by: Thomas Gleixner --- - Testing: Tested successfully on p4080ds(8-core SMP system) - - net/core/dev.c | 8 ++++---- + net/core/dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/net/core/dev.c b/net/core/dev.c +index 9285dd9f69de..c10852608381 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4046,7 +4046,7 @@ static int netif_rx_internal(struct sk_b +@@ -4046,7 +4046,7 @@ static int netif_rx_internal(struct sk_buff *skb) struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu; @@ -46,7 +47,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); -@@ -4056,14 +4056,14 @@ static int netif_rx_internal(struct sk_b +@@ -4056,14 +4056,14 @@ static int netif_rx_internal(struct sk_buff *skb) ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); @@ -64,3 +65,6 @@ Signed-off-by: Thomas Gleixner } return ret; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0373-net-another-local-irq-disable-alloc-atomic-headache.patch b/kernel/patches-4.14.x-rt/0373-0373-net-Another-local_irq_disable-kmalloc-headache.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0373-net-another-local-irq-disable-alloc-atomic-headache.patch rename to kernel/patches-4.14.x-rt/0373-0373-net-Another-local_irq_disable-kmalloc-headache.patch index 0e4e345c8..249e241dd 100644 --- a/kernel/patches-4.14.x-rt/0373-net-another-local-irq-disable-alloc-atomic-headache.patch +++ b/kernel/patches-4.14.x-rt/0373-0373-net-Another-local_irq_disable-kmalloc-headache.patch @@ -1,14 +1,17 @@ +From 92764f7347026b0fd790c2af3ebbf684ff78f23b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 26 Sep 2012 16:21:08 +0200 -Subject: net: Another local_irq_disable/kmalloc headache +Subject: [PATCH 373/414] net: Another local_irq_disable/kmalloc headache Replace it by a local lock. Though that's pretty inefficient :( Signed-off-by: Thomas Gleixner --- - net/core/skbuff.c | 10 ++++++---- + net/core/skbuff.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) +diff --git a/net/core/skbuff.c b/net/core/skbuff.c +index 564beb7e6d1c..fff48b662872 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -63,6 +63,7 @@ @@ -27,7 +30,7 @@ Signed-off-by: Thomas Gleixner static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) { -@@ -337,10 +339,10 @@ static void *__netdev_alloc_frag(unsigne +@@ -337,10 +339,10 @@ static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) unsigned long flags; void *data; @@ -40,7 +43,7 @@ Signed-off-by: Thomas Gleixner return data; } -@@ -408,13 +410,13 @@ struct sk_buff *__netdev_alloc_skb(struc +@@ -408,13 +410,13 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, if (sk_memalloc_socks()) gfp_mask |= __GFP_MEMALLOC; @@ -56,3 +59,6 @@ Signed-off-by: Thomas Gleixner if (unlikely(!data)) return NULL; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0374-net-core-protect-users-of-napi_alloc_cache-against-r.patch b/kernel/patches-4.14.x-rt/0374-0374-net-core-protect-users-of-napi_alloc_cache-against-r.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0374-net-core-protect-users-of-napi_alloc_cache-against-r.patch rename to kernel/patches-4.14.x-rt/0374-0374-net-core-protect-users-of-napi_alloc_cache-against-r.patch index 9bb65bdaa..0970ec3f5 100644 --- a/kernel/patches-4.14.x-rt/0374-net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/kernel/patches-4.14.x-rt/0374-0374-net-core-protect-users-of-napi_alloc_cache-against-r.patch @@ -1,6 +1,7 @@ +From c601dbc9efd24fb11413a687d79ef05389530536 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 15 Jan 2016 16:33:34 +0100 -Subject: net/core: protect users of napi_alloc_cache against +Subject: [PATCH 374/414] 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 @@ -12,9 +13,11 @@ This patch ensures that each user of napi_alloc_cache uses a local lock. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - net/core/skbuff.c | 25 +++++++++++++++++++------ + net/core/skbuff.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) +diff --git a/net/core/skbuff.c b/net/core/skbuff.c +index fff48b662872..a048bf357fde 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -332,6 +332,7 @@ struct napi_alloc_cache { @@ -53,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior len += NET_SKB_PAD + NET_IP_ALIGN; -@@ -477,7 +483,10 @@ struct sk_buff *__napi_alloc_skb(struct +@@ -477,7 +483,10 @@ struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len, if (sk_memalloc_socks()) gfp_mask |= __GFP_MEMALLOC; @@ -64,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (unlikely(!data)) return NULL; -@@ -488,7 +497,7 @@ struct sk_buff *__napi_alloc_skb(struct +@@ -488,7 +497,7 @@ struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len, } /* use OR instead of assignment to avoid clearing of bits in mask */ @@ -73,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior skb->pfmemalloc = 1; skb->head_frag = 1; -@@ -720,23 +729,26 @@ void __consume_stateless_skb(struct sk_b +@@ -720,23 +729,26 @@ void __consume_stateless_skb(struct sk_buff *skb) void __kfree_skb_flush(void) { @@ -102,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* record skb to CPU local list */ nc->skb_cache[nc->skb_count++] = skb; -@@ -751,6 +763,7 @@ static inline void _kfree_skb_defer(stru +@@ -751,6 +763,7 @@ static inline void _kfree_skb_defer(struct sk_buff *skb) nc->skb_cache); nc->skb_count = 0; } @@ -110,3 +113,6 @@ Signed-off-by: Sebastian Andrzej Siewior } void __kfree_skb_defer(struct sk_buff *skb) { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0375-net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch b/kernel/patches-4.14.x-rt/0375-0375-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0375-net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch rename to kernel/patches-4.14.x-rt/0375-0375-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch index d39c9aff7..16f3c7549 100644 --- a/kernel/patches-4.14.x-rt/0375-net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch +++ b/kernel/patches-4.14.x-rt/0375-0375-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch @@ -1,6 +1,8 @@ -Subject: net: netfilter: Serialize xt_write_recseq sections on RT +From 269b8c1eccda2bb62270940b21248d03f01dcb75 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 28 Oct 2012 11:18:08 +0100 +Subject: [PATCH 375/414] net: netfilter: Serialize xt_write_recseq sections on + RT The netfilter code relies only on the implicit semantics of local_bh_disable() for serializing wt_write_recseq sections. RT breaks @@ -8,12 +10,13 @@ that and needs explicit serialization here. Reported-by: Peter LaDow Signed-off-by: Thomas Gleixner - --- - include/linux/netfilter/x_tables.h | 7 +++++++ - net/netfilter/core.c | 6 ++++++ + include/linux/netfilter/x_tables.h | 7 +++++++ + net/netfilter/core.c | 6 ++++++ 2 files changed, 13 insertions(+) +diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h +index 54f346a45cd0..79723e76af66 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -6,6 +6,7 @@ @@ -24,7 +27,7 @@ Signed-off-by: Thomas Gleixner #include /* Test a struct->invflags and a boolean for inequality */ -@@ -341,6 +342,8 @@ void xt_free_table_info(struct xt_table_ +@@ -341,6 +342,8 @@ void xt_free_table_info(struct xt_table_info *info); */ DECLARE_PER_CPU(seqcount_t, xt_recseq); @@ -33,7 +36,7 @@ Signed-off-by: Thomas Gleixner /* xt_tee_enabled - true if x_tables needs to handle reentrancy * * Enabled if current ip(6)tables ruleset has at least one -j TEE rule. -@@ -361,6 +364,9 @@ static inline unsigned int xt_write_recs +@@ -361,6 +364,9 @@ static inline unsigned int xt_write_recseq_begin(void) { unsigned int addend; @@ -43,7 +46,7 @@ Signed-off-by: Thomas Gleixner /* * Low order bit of sequence is set if we already * called xt_write_recseq_begin(). -@@ -391,6 +397,7 @@ static inline void xt_write_recseq_end(u +@@ -391,6 +397,7 @@ static inline void xt_write_recseq_end(unsigned int addend) /* this is kind of a write_seqcount_end(), but addend is 0 or 1 */ smp_wmb(); __this_cpu_add(xt_recseq.sequence, addend); @@ -51,6 +54,8 @@ Signed-off-by: Thomas Gleixner } /* +diff --git a/net/netfilter/core.c b/net/netfilter/core.c +index 52cd2901a097..c63e937b6676 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c @@ -21,6 +21,7 @@ @@ -73,3 +78,6 @@ Signed-off-by: Thomas Gleixner static DEFINE_MUTEX(afinfo_mutex); const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO] __read_mostly; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0376-net-make-devnet_rename_seq-a-mutex.patch b/kernel/patches-4.14.x-rt/0376-0376-net-Add-a-mutex-around-devnet_rename_seq.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0376-net-make-devnet_rename_seq-a-mutex.patch rename to kernel/patches-4.14.x-rt/0376-0376-net-Add-a-mutex-around-devnet_rename_seq.patch index 122cd3459..a1cdcc410 100644 --- a/kernel/patches-4.14.x-rt/0376-net-make-devnet_rename_seq-a-mutex.patch +++ b/kernel/patches-4.14.x-rt/0376-0376-net-Add-a-mutex-around-devnet_rename_seq.patch @@ -1,6 +1,7 @@ +From 5c92e3bbf42d5dbe3803e78e5639ad6e9f04d93d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 20 Mar 2013 18:06:20 +0100 -Subject: net: Add a mutex around devnet_rename_seq +Subject: [PATCH 376/414] 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 @@ -16,12 +17,14 @@ it when it detects a writer in progress. This keeps the normal case Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner --- - net/core/dev.c | 34 ++++++++++++++++++++-------------- + net/core/dev.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) +diff --git a/net/core/dev.c b/net/core/dev.c +index c10852608381..18de1d6eff2b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -195,6 +195,7 @@ static unsigned int napi_gen_id = NR_CPU +@@ -195,6 +195,7 @@ static unsigned int napi_gen_id = NR_CPUS; static DEFINE_READ_MOSTLY_HASHTABLE(napi_hash, 8); static seqcount_t devnet_rename_seq; @@ -29,7 +32,7 @@ Signed-off-by: Thomas Gleixner static inline void dev_base_seq_inc(struct net *net) { -@@ -920,7 +921,8 @@ int netdev_get_name(struct net *net, cha +@@ -920,7 +921,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)) { @@ -39,7 +42,7 @@ Signed-off-by: Thomas Gleixner goto retry; } -@@ -1189,20 +1191,17 @@ int dev_change_name(struct net_device *d +@@ -1189,20 +1191,17 @@ int dev_change_name(struct net_device *dev, const char *newname) if (dev->flags & IFF_UP) return -EBUSY; @@ -66,7 +69,7 @@ Signed-off-by: Thomas Gleixner if (oldname[0] && !strchr(oldname, '%')) netdev_info(dev, "renamed from %s\n", oldname); -@@ -1215,11 +1214,12 @@ int dev_change_name(struct net_device *d +@@ -1215,11 +1214,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; @@ -82,7 +85,7 @@ Signed-off-by: Thomas Gleixner netdev_adjacent_rename_links(dev, oldname); -@@ -1240,7 +1240,8 @@ int dev_change_name(struct net_device *d +@@ -1240,7 +1240,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; @@ -92,7 +95,7 @@ Signed-off-by: Thomas Gleixner memcpy(dev->name, oldname, IFNAMSIZ); memcpy(oldname, newname, IFNAMSIZ); dev->name_assign_type = old_assign_type; -@@ -1253,6 +1254,11 @@ int dev_change_name(struct net_device *d +@@ -1253,6 +1254,11 @@ int dev_change_name(struct net_device *dev, const char *newname) } return err; @@ -104,3 +107,6 @@ Signed-off-by: Thomas Gleixner } /** +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0377-peterz-srcu-crypto-chain.patch b/kernel/patches-4.14.x-rt/0377-0377-crypto-Convert-crypto-notifier-chain-to-SRCU.patch similarity index 92% rename from kernel/patches-4.14.x-rt/0377-peterz-srcu-crypto-chain.patch rename to kernel/patches-4.14.x-rt/0377-0377-crypto-Convert-crypto-notifier-chain-to-SRCU.patch index a61836256..646a7e5df 100644 --- a/kernel/patches-4.14.x-rt/0377-peterz-srcu-crypto-chain.patch +++ b/kernel/patches-4.14.x-rt/0377-0377-crypto-Convert-crypto-notifier-chain-to-SRCU.patch @@ -1,6 +1,7 @@ -Subject: crypto: Convert crypto notifier chain to SRCU +From 4babb114876d6137ee6f052499cd9876014f61b9 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra -Date: Fri, 05 Oct 2012 09:03:24 +0100 +Date: Fri, 5 Oct 2012 09:03:24 +0100 +Subject: [PATCH 377/414] crypto: Convert crypto notifier chain to SRCU The crypto notifier deadlocks on RT. Though this can be a real deadlock on mainline as well due to fifo fair rwsems. @@ -113,11 +114,13 @@ block the probe thread and the whole party is dead locked. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner --- - crypto/algapi.c | 4 ++-- - crypto/api.c | 6 +++--- - crypto/internal.h | 4 ++-- + crypto/algapi.c | 4 ++-- + crypto/api.c | 6 +++--- + crypto/internal.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) +diff --git a/crypto/algapi.c b/crypto/algapi.c +index 50eb828db767..7bce92a6599a 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -731,13 +731,13 @@ EXPORT_SYMBOL_GPL(crypto_spawn_tfm2); @@ -136,6 +139,8 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL_GPL(crypto_unregister_notifier); +diff --git a/crypto/api.c b/crypto/api.c +index 941cd4c6c7ec..2b1cf0c1dcea 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -31,7 +31,7 @@ EXPORT_SYMBOL_GPL(crypto_alg_list); @@ -147,7 +152,7 @@ Signed-off-by: Thomas Gleixner EXPORT_SYMBOL_GPL(crypto_chain); static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg); -@@ -236,10 +236,10 @@ int crypto_probing_notify(unsigned long +@@ -236,10 +236,10 @@ int crypto_probing_notify(unsigned long val, void *v) { int ok; @@ -160,6 +165,8 @@ Signed-off-by: Thomas Gleixner } return ok; +diff --git a/crypto/internal.h b/crypto/internal.h +index f07320423191..333d985088fe 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -47,7 +47,7 @@ struct crypto_larval { @@ -171,7 +178,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_PROC_FS void __init crypto_init_proc(void); -@@ -143,7 +143,7 @@ static inline int crypto_is_moribund(str +@@ -143,7 +143,7 @@ static inline int crypto_is_moribund(struct crypto_alg *alg) static inline void crypto_notify(unsigned long val, void *v) { @@ -180,3 +187,6 @@ Signed-off-by: Thomas Gleixner } #endif /* _CRYPTO_INTERNAL_H */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0378-lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/kernel/patches-4.14.x-rt/0378-0378-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch similarity index 86% rename from kernel/patches-4.14.x-rt/0378-lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch rename to kernel/patches-4.14.x-rt/0378-0378-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch index 6162cd2da..739af2e57 100644 --- a/kernel/patches-4.14.x-rt/0378-lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch +++ b/kernel/patches-4.14.x-rt/0378-0378-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch @@ -1,8 +1,8 @@ -Subject: lockdep: selftest: Only do hardirq context test for raw spinlock -From: Yong Zhang -Date: Mon, 16 Apr 2012 15:01:56 +0800 - +From cc721997c6efe434a3f37d60287e838b1afc777e Mon Sep 17 00:00:00 2001 From: Yong Zhang +Date: Mon, 16 Apr 2012 15:01:56 +0800 +Subject: [PATCH 378/414] lockdep: selftest: Only do hardirq context test for + raw spinlock On -rt there is no softirq context any more and rwlock is sleepable, disable softirq context test and rwlock+irq test. @@ -12,9 +12,11 @@ Cc: Yong Zhang Link: http://lkml.kernel.org/r/1334559716-18447-3-git-send-email-yong.zhang0@gmail.com Signed-off-by: Thomas Gleixner --- - lib/locking-selftest.c | 23 +++++++++++++++++++++++ + lib/locking-selftest.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) +diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c +index b5c1293ce147..7a452887c9c3 100644 --- a/lib/locking-selftest.c +++ b/lib/locking-selftest.c @@ -2057,6 +2057,7 @@ void locking_selftest(void) @@ -54,3 +56,6 @@ Signed-off-by: Thomas Gleixner ww_tests(); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0379-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/kernel/patches-4.14.x-rt/0379-0379-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0379-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch rename to kernel/patches-4.14.x-rt/0379-0379-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index 01cc757dd..cb95c91e4 100644 --- a/kernel/patches-4.14.x-rt/0379-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/kernel/patches-4.14.x-rt/0379-0379-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,6 +1,8 @@ +From c8e5dfb94ba458b36d99312a74005b9133d22fd7 Mon Sep 17 00:00:00 2001 From: Josh Cartwright Date: Wed, 28 Jan 2015 13:08:45 -0600 -Subject: lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals +Subject: [PATCH 379/414] lockdep: selftest: fix warnings due to missing + PREEMPT_RT conditionals "lockdep: Selftest: Only do hardirq context test for raw spinlock" disabled the execution of certain tests with PREEMPT_RT_FULL, but did @@ -23,9 +25,11 @@ Signed-off-by: Xander Huff Acked-by: Gratian Crisan Signed-off-by: Sebastian Andrzej Siewior --- - lib/locking-selftest.c | 27 +++++++++++++++++++++++++++ + lib/locking-selftest.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) +diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c +index 7a452887c9c3..075e225f4111 100644 --- a/lib/locking-selftest.c +++ b/lib/locking-selftest.c @@ -742,6 +742,8 @@ GENERATE_TESTCASE(init_held_rtmutex); @@ -37,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "locking-selftest-rlock-hardirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_rlock) -@@ -757,9 +759,12 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_ +@@ -757,9 +759,12 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_rlock) #include "locking-selftest-wlock-softirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_wlock) @@ -50,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Enabling hardirqs with a softirq-safe lock held: */ -@@ -792,6 +797,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A +@@ -792,6 +797,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock) #undef E1 #undef E2 @@ -59,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Enabling irqs with an irq-safe lock held: */ -@@ -815,6 +822,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A +@@ -815,6 +822,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock) #include "locking-selftest-spin-hardirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_spin) @@ -68,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "locking-selftest-rlock-hardirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_rlock) -@@ -830,6 +839,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B +@@ -830,6 +839,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_rlock) #include "locking-selftest-wlock-softirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock) @@ -77,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior #undef E1 #undef E2 -@@ -861,6 +872,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B +@@ -861,6 +872,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock) #include "locking-selftest-spin-hardirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_spin) @@ -86,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "locking-selftest-rlock-hardirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_rlock) -@@ -876,6 +889,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_ +@@ -876,6 +889,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_rlock) #include "locking-selftest-wlock-softirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock) @@ -95,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior #undef E1 #undef E2 #undef E3 -@@ -909,6 +924,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_ +@@ -909,6 +924,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock) #include "locking-selftest-spin-hardirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_spin) @@ -104,7 +108,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "locking-selftest-rlock-hardirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_rlock) -@@ -924,10 +941,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_ +@@ -924,10 +941,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_rlock) #include "locking-selftest-wlock-softirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_wlock) @@ -119,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * read-lock / write-lock irq inversion. * -@@ -990,6 +1011,10 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_inver +@@ -990,6 +1011,10 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_wlock) #undef E2 #undef E3 @@ -130,7 +134,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * read-lock / write-lock recursion that is actually safe. */ -@@ -1028,6 +1053,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_ +@@ -1028,6 +1053,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft) #undef E2 #undef E3 @@ -139,3 +143,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * read-lock / write-lock recursion that is unsafe. */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0380-srcu-use-cpu_online-instead-custom-check.patch b/kernel/patches-4.14.x-rt/0380-0380-srcu-use-cpu_online-instead-custom-check.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0380-srcu-use-cpu_online-instead-custom-check.patch rename to kernel/patches-4.14.x-rt/0380-0380-srcu-use-cpu_online-instead-custom-check.patch index 2fe2b226e..9b1be72a1 100644 --- a/kernel/patches-4.14.x-rt/0380-srcu-use-cpu_online-instead-custom-check.patch +++ b/kernel/patches-4.14.x-rt/0380-0380-srcu-use-cpu_online-instead-custom-check.patch @@ -1,6 +1,7 @@ +From 06e9e5bc8f89df6d839f2a1912efbd6a5867eac5 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 14:43:41 +0200 -Subject: [PATCH] srcu: use cpu_online() instead custom check +Subject: [PATCH 380/414] 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 @@ -16,10 +17,12 @@ SRCU won't enqueue a work item before SRCU is up and ready. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/srcutree.c | 22 ++++------------------ - kernel/rcu/tree.c | 6 ------ + kernel/rcu/srcutree.c | 22 ++++------------------ + kernel/rcu/tree.c | 6 ------ 2 files changed, 4 insertions(+), 24 deletions(-) +diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c +index 6d5880089ff6..b72d8c552604 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -36,6 +36,7 @@ @@ -30,10 +33,11 @@ Signed-off-by: Sebastian Andrzej Siewior #include "rcu.h" #include "rcu_segcblist.h" -@@ -425,21 +426,6 @@ static void srcu_gp_start(struct srcu_st +@@ -424,21 +425,6 @@ static void srcu_gp_start(struct srcu_struct *sp) + WARN_ON_ONCE(state != SRCU_STATE_SCAN1); } - /* +-/* - * Track online CPUs to guide callback workqueue placement. - */ -DEFINE_PER_CPU(bool, srcu_online); @@ -48,11 +52,10 @@ Signed-off-by: Sebastian Andrzej Siewior - WRITE_ONCE(per_cpu(srcu_online, cpu), false); -} - --/* + /* * Place the workqueue handler on the specified CPU if online, otherwise * just run it whereever. This is useful for placing workqueue handlers - * that are to invoke the specified CPU's callbacks. -@@ -450,12 +436,12 @@ static bool srcu_queue_delayed_work_on(i +@@ -450,12 +436,12 @@ static bool srcu_queue_delayed_work_on(int cpu, struct workqueue_struct *wq, { bool ret; @@ -68,6 +71,8 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index 55c56b1aece7..85e2dc55a82c 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3775,8 +3775,6 @@ int rcutree_online_cpu(unsigned int cpu) @@ -97,3 +102,6 @@ Signed-off-by: Sebastian Andrzej Siewior } } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0381-srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch b/kernel/patches-4.14.x-rt/0381-0381-srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0381-srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch rename to kernel/patches-4.14.x-rt/0381-0381-srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch index 44d638795..32fc73eb2 100644 --- a/kernel/patches-4.14.x-rt/0381-srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch +++ b/kernel/patches-4.14.x-rt/0381-0381-srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch @@ -1,6 +1,7 @@ +From 3fe897c4db4adfb480672dfce928497ec9602654 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Tue, 10 Oct 2017 13:52:30 -0700 -Subject: srcu: Prohibit call_srcu() use under raw spinlocks +Subject: [PATCH 381/414] srcu: Prohibit call_srcu() use under raw spinlocks Upstream commit 08265b8f1a139c1cff052b35ab7cf929528f88bb @@ -13,10 +14,12 @@ is not ever called while holding a raw spinlock. Reported-by: Sebastian Andrzej Siewior Signed-off-by: Paul E. McKenney --- - include/linux/srcutree.h | 8 +-- - kernel/rcu/srcutree.c | 109 +++++++++++++++++++++++++++++------------------ + include/linux/srcutree.h | 8 +-- + kernel/rcu/srcutree.c | 109 ++++++++++++++++++++++++--------------- 2 files changed, 72 insertions(+), 45 deletions(-) +diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h +index 85ae8c0dddb4..745d4ca4dd50 100644 --- a/include/linux/srcutree.h +++ b/include/linux/srcutree.h @@ -40,7 +40,7 @@ struct srcu_data { @@ -55,9 +58,11 @@ Signed-off-by: Paul E. McKenney .srcu_gp_seq_needed = 0 - 1, \ __SRCU_DEP_MAP_INIT(name) \ } +diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c +index b72d8c552604..c9d1f0e5f899 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c -@@ -54,6 +54,33 @@ static void srcu_invoke_callbacks(struct +@@ -54,6 +54,33 @@ static void srcu_invoke_callbacks(struct work_struct *work); static void srcu_reschedule(struct srcu_struct *sp, unsigned long delay); static void process_srcu(struct work_struct *work); @@ -91,7 +96,7 @@ Signed-off-by: Paul E. McKenney /* * Initialize SRCU combining tree. Note that statically allocated * srcu_struct structures might already have srcu_read_lock() and -@@ -78,7 +105,7 @@ static void init_srcu_struct_nodes(struc +@@ -78,7 +105,7 @@ static void init_srcu_struct_nodes(struct srcu_struct *sp, bool is_static) /* Each pass through this loop initializes one srcu_node structure. */ rcu_for_each_node_breadth_first(sp, snp) { @@ -100,7 +105,7 @@ Signed-off-by: Paul E. McKenney WARN_ON_ONCE(ARRAY_SIZE(snp->srcu_have_cbs) != ARRAY_SIZE(snp->srcu_data_have_cbs)); for (i = 0; i < ARRAY_SIZE(snp->srcu_have_cbs); i++) { -@@ -112,7 +139,7 @@ static void init_srcu_struct_nodes(struc +@@ -112,7 +139,7 @@ static void init_srcu_struct_nodes(struct srcu_struct *sp, bool is_static) snp_first = sp->level[level]; for_each_possible_cpu(cpu) { sdp = per_cpu_ptr(sp->sda, cpu); @@ -109,7 +114,7 @@ Signed-off-by: Paul E. McKenney rcu_segcblist_init(&sdp->srcu_cblist); sdp->srcu_cblist_invoking = false; sdp->srcu_gp_seq_needed = sp->srcu_gp_seq; -@@ -171,7 +198,7 @@ int __init_srcu_struct(struct srcu_struc +@@ -171,7 +198,7 @@ int __init_srcu_struct(struct srcu_struct *sp, const char *name, /* Don't re-initialize a lock while it is held. */ debug_check_no_locks_freed((void *)sp, sizeof(*sp)); lockdep_init_map(&sp->dep_map, name, key, 0); @@ -127,7 +132,7 @@ Signed-off-by: Paul E. McKenney return init_srcu_struct_fields(sp, false); } EXPORT_SYMBOL_GPL(init_srcu_struct); -@@ -211,13 +238,13 @@ static void check_init_srcu_struct(struc +@@ -211,13 +238,13 @@ static void check_init_srcu_struct(struct srcu_struct *sp) /* The smp_load_acquire() pairs with the smp_store_release(). */ if (!rcu_seq_state(smp_load_acquire(&sp->srcu_gp_seq_needed))) /*^^^*/ return; /* Already initialized. */ @@ -144,7 +149,7 @@ Signed-off-by: Paul E. McKenney } /* -@@ -499,7 +526,7 @@ static void srcu_gp_end(struct srcu_stru +@@ -499,7 +526,7 @@ static void srcu_gp_end(struct srcu_struct *sp) mutex_lock(&sp->srcu_cb_mutex); /* End the current grace period. */ @@ -153,7 +158,7 @@ Signed-off-by: Paul E. McKenney idx = rcu_seq_state(sp->srcu_gp_seq); WARN_ON_ONCE(idx != SRCU_STATE_SCAN2); cbdelay = srcu_get_delay(sp); -@@ -508,7 +535,7 @@ static void srcu_gp_end(struct srcu_stru +@@ -508,7 +535,7 @@ static void srcu_gp_end(struct srcu_struct *sp) gpseq = rcu_seq_current(&sp->srcu_gp_seq); if (ULONG_CMP_LT(sp->srcu_gp_seq_needed_exp, gpseq)) sp->srcu_gp_seq_needed_exp = gpseq; @@ -162,7 +167,7 @@ Signed-off-by: Paul E. McKenney mutex_unlock(&sp->srcu_gp_mutex); /* A new grace period can start at this point. But only one. */ -@@ -516,7 +543,7 @@ static void srcu_gp_end(struct srcu_stru +@@ -516,7 +543,7 @@ static void srcu_gp_end(struct srcu_struct *sp) idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs); idxnext = (idx + 1) % ARRAY_SIZE(snp->srcu_have_cbs); rcu_for_each_node_breadth_first(sp, snp) { @@ -171,7 +176,7 @@ Signed-off-by: Paul E. McKenney cbs = false; if (snp >= sp->level[rcu_num_lvls - 1]) cbs = snp->srcu_have_cbs[idx] == gpseq; -@@ -526,7 +553,7 @@ static void srcu_gp_end(struct srcu_stru +@@ -526,7 +553,7 @@ static void srcu_gp_end(struct srcu_struct *sp) snp->srcu_gp_seq_needed_exp = gpseq; mask = snp->srcu_data_have_cbs[idx]; snp->srcu_data_have_cbs[idx] = 0; @@ -180,7 +185,7 @@ Signed-off-by: Paul E. McKenney if (cbs) srcu_schedule_cbs_snp(sp, snp, mask, cbdelay); -@@ -534,11 +561,11 @@ static void srcu_gp_end(struct srcu_stru +@@ -534,11 +561,11 @@ static void srcu_gp_end(struct srcu_struct *sp) if (!(gpseq & counter_wrap_check)) for (cpu = snp->grplo; cpu <= snp->grphi; cpu++) { sdp = per_cpu_ptr(sp->sda, cpu); @@ -194,7 +199,7 @@ Signed-off-by: Paul E. McKenney } } -@@ -546,17 +573,17 @@ static void srcu_gp_end(struct srcu_stru +@@ -546,17 +573,17 @@ static void srcu_gp_end(struct srcu_struct *sp) mutex_unlock(&sp->srcu_cb_mutex); /* Start a new grace period if needed. */ @@ -215,7 +220,7 @@ Signed-off-by: Paul E. McKenney } } -@@ -576,18 +603,18 @@ static void srcu_funnel_exp_start(struct +@@ -576,18 +603,18 @@ static void srcu_funnel_exp_start(struct srcu_struct *sp, struct srcu_node *snp, if (rcu_seq_done(&sp->srcu_gp_seq, s) || ULONG_CMP_GE(READ_ONCE(snp->srcu_gp_seq_needed_exp), s)) return; @@ -239,7 +244,7 @@ Signed-off-by: Paul E. McKenney } /* -@@ -609,12 +636,12 @@ static void srcu_funnel_gp_start(struct +@@ -609,12 +636,12 @@ static void srcu_funnel_gp_start(struct srcu_struct *sp, struct srcu_data *sdp, for (; snp != NULL; snp = snp->srcu_parent) { if (rcu_seq_done(&sp->srcu_gp_seq, s) && snp != sdp->mynode) return; /* GP already done and CBs recorded. */ @@ -254,7 +259,7 @@ Signed-off-by: Paul E. McKenney if (snp == sdp->mynode && snp_seq != s) { srcu_schedule_cbs_sdp(sdp, do_norm ? SRCU_INTERVAL -@@ -630,11 +657,11 @@ static void srcu_funnel_gp_start(struct +@@ -630,11 +657,11 @@ static void srcu_funnel_gp_start(struct srcu_struct *sp, struct srcu_data *sdp, snp->srcu_data_have_cbs[idx] |= sdp->grpmask; if (!do_norm && ULONG_CMP_LT(snp->srcu_gp_seq_needed_exp, s)) snp->srcu_gp_seq_needed_exp = s; @@ -268,7 +273,7 @@ Signed-off-by: Paul E. McKenney if (ULONG_CMP_LT(sp->srcu_gp_seq_needed, s)) { /* * Record need for grace period s. Pair with load -@@ -653,7 +680,7 @@ static void srcu_funnel_gp_start(struct +@@ -653,7 +680,7 @@ static void srcu_funnel_gp_start(struct srcu_struct *sp, struct srcu_data *sdp, queue_delayed_work(system_power_efficient_wq, &sp->work, srcu_get_delay(sp)); } @@ -277,7 +282,7 @@ Signed-off-by: Paul E. McKenney } /* -@@ -816,7 +843,7 @@ void __call_srcu(struct srcu_struct *sp, +@@ -816,7 +843,7 @@ void __call_srcu(struct srcu_struct *sp, struct rcu_head *rhp, rhp->func = func; local_irq_save(flags); sdp = this_cpu_ptr(sp->sda); @@ -286,7 +291,7 @@ Signed-off-by: Paul E. McKenney rcu_segcblist_enqueue(&sdp->srcu_cblist, rhp, false); rcu_segcblist_advance(&sdp->srcu_cblist, rcu_seq_current(&sp->srcu_gp_seq)); -@@ -830,7 +857,7 @@ void __call_srcu(struct srcu_struct *sp, +@@ -830,7 +857,7 @@ void __call_srcu(struct srcu_struct *sp, struct rcu_head *rhp, sdp->srcu_gp_seq_needed_exp = s; needexp = true; } @@ -295,7 +300,7 @@ Signed-off-by: Paul E. McKenney if (needgp) srcu_funnel_gp_start(sp, sdp, s, do_norm); else if (needexp) -@@ -886,7 +913,7 @@ static void __synchronize_srcu(struct sr +@@ -886,7 +913,7 @@ static void __synchronize_srcu(struct srcu_struct *sp, bool do_norm) /* * Make sure that later code is ordered after the SRCU grace @@ -304,7 +309,7 @@ Signed-off-by: Paul E. McKenney * in srcu_invoke_callbacks(). Unlike Tree RCU, this is needed * because the current CPU might have been totally uninvolved with * (and thus unordered against) that grace period. -@@ -1010,7 +1037,7 @@ void srcu_barrier(struct srcu_struct *sp +@@ -1010,7 +1037,7 @@ void srcu_barrier(struct srcu_struct *sp) */ for_each_possible_cpu(cpu) { sdp = per_cpu_ptr(sp->sda, cpu); @@ -313,7 +318,7 @@ Signed-off-by: Paul E. McKenney atomic_inc(&sp->srcu_barrier_cpu_cnt); sdp->srcu_barrier_head.func = srcu_barrier_cb; debug_rcu_head_queue(&sdp->srcu_barrier_head); -@@ -1019,7 +1046,7 @@ void srcu_barrier(struct srcu_struct *sp +@@ -1019,7 +1046,7 @@ void srcu_barrier(struct srcu_struct *sp) debug_rcu_head_unqueue(&sdp->srcu_barrier_head); atomic_dec(&sp->srcu_barrier_cpu_cnt); } @@ -322,7 +327,7 @@ Signed-off-by: Paul E. McKenney } /* Remove the initial count, at which point reaching zero can happen. */ -@@ -1068,17 +1095,17 @@ static void srcu_advance_state(struct sr +@@ -1068,17 +1095,17 @@ static void srcu_advance_state(struct srcu_struct *sp) */ idx = rcu_seq_state(smp_load_acquire(&sp->srcu_gp_seq)); /* ^^^ */ if (idx == SRCU_STATE_IDLE) { @@ -343,7 +348,7 @@ Signed-off-by: Paul E. McKenney if (idx != SRCU_STATE_IDLE) { mutex_unlock(&sp->srcu_gp_mutex); return; /* Someone else started the grace period. */ -@@ -1127,19 +1154,19 @@ static void srcu_invoke_callbacks(struct +@@ -1127,19 +1154,19 @@ static void srcu_invoke_callbacks(struct work_struct *work) sdp = container_of(work, struct srcu_data, work.work); sp = sdp->sp; rcu_cblist_init(&ready_cbs); @@ -366,7 +371,7 @@ Signed-off-by: Paul E. McKenney rhp = rcu_cblist_dequeue(&ready_cbs); for (; rhp != NULL; rhp = rcu_cblist_dequeue(&ready_cbs)) { debug_rcu_head_unqueue(rhp); -@@ -1152,13 +1179,13 @@ static void srcu_invoke_callbacks(struct +@@ -1152,13 +1179,13 @@ static void srcu_invoke_callbacks(struct work_struct *work) * Update counts, accelerate new callbacks, and if needed, * schedule another round of callback invocation. */ @@ -382,7 +387,7 @@ Signed-off-by: Paul E. McKenney if (more) srcu_schedule_cbs_sdp(sdp, 0); } -@@ -1171,7 +1198,7 @@ static void srcu_reschedule(struct srcu_ +@@ -1171,7 +1198,7 @@ static void srcu_reschedule(struct srcu_struct *sp, unsigned long delay) { bool pushgp = true; @@ -391,7 +396,7 @@ Signed-off-by: Paul E. McKenney if (ULONG_CMP_GE(sp->srcu_gp_seq, sp->srcu_gp_seq_needed)) { if (!WARN_ON_ONCE(rcu_seq_state(sp->srcu_gp_seq))) { /* All requests fulfilled, time to go idle. */ -@@ -1181,7 +1208,7 @@ static void srcu_reschedule(struct srcu_ +@@ -1181,7 +1208,7 @@ static void srcu_reschedule(struct srcu_struct *sp, unsigned long delay) /* Outstanding request and no GP. Start one. */ srcu_gp_start(sp); } @@ -400,3 +405,6 @@ Signed-off-by: Paul E. McKenney if (pushgp) queue_delayed_work(system_power_efficient_wq, &sp->work, delay); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0382-srcu-replace-local_irqsave-with-a-locallock.patch b/kernel/patches-4.14.x-rt/0382-0382-srcu-replace-local_irqsave-with-a-locallock.patch similarity index 76% rename from kernel/patches-4.14.x-rt/0382-srcu-replace-local_irqsave-with-a-locallock.patch rename to kernel/patches-4.14.x-rt/0382-0382-srcu-replace-local_irqsave-with-a-locallock.patch index 086c46783..7753a1659 100644 --- a/kernel/patches-4.14.x-rt/0382-srcu-replace-local_irqsave-with-a-locallock.patch +++ b/kernel/patches-4.14.x-rt/0382-0382-srcu-replace-local_irqsave-with-a-locallock.patch @@ -1,6 +1,7 @@ +From 95014a8d2006e935d002fa95f2c03d2f25c1552e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 18:37:12 +0200 -Subject: [PATCH] srcu: replace local_irqsave() with a locallock +Subject: [PATCH 382/414] 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 @@ -10,9 +11,11 @@ version of it. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/srcutree.c | 14 +++++++++----- + kernel/rcu/srcutree.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) +diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c +index c9d1f0e5f899..0e3b2bd3f2ac 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -37,6 +37,7 @@ @@ -23,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "rcu.h" #include "rcu_segcblist.h" -@@ -749,6 +750,8 @@ static void srcu_flip(struct srcu_struct +@@ -749,6 +750,8 @@ static void srcu_flip(struct srcu_struct *sp) * negligible when amoritized over that time period, and the extra latency * of a needlessly non-expedited grace period is similarly negligible. */ @@ -32,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior static bool srcu_might_be_idle(struct srcu_struct *sp) { unsigned long curseq; -@@ -757,13 +760,13 @@ static bool srcu_might_be_idle(struct sr +@@ -757,13 +760,13 @@ static bool srcu_might_be_idle(struct srcu_struct *sp) unsigned long t; /* If the local srcu_data structure has callbacks, not idle. */ @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * No local callbacks, so probabalistically probe global state. -@@ -841,7 +844,7 @@ void __call_srcu(struct srcu_struct *sp, +@@ -841,7 +844,7 @@ void __call_srcu(struct srcu_struct *sp, struct rcu_head *rhp, return; } rhp->func = func; @@ -58,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior sdp = this_cpu_ptr(sp->sda); spin_lock_rcu_node(sdp); rcu_segcblist_enqueue(&sdp->srcu_cblist, rhp, false); -@@ -857,7 +860,8 @@ void __call_srcu(struct srcu_struct *sp, +@@ -857,7 +860,8 @@ void __call_srcu(struct srcu_struct *sp, struct rcu_head *rhp, sdp->srcu_gp_seq_needed_exp = s; needexp = true; } @@ -68,3 +71,6 @@ Signed-off-by: Sebastian Andrzej Siewior if (needgp) srcu_funnel_gp_start(sp, sdp, s, do_norm); else if (needexp) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0383-rcu-disable-rcu-fast-no-hz-on-rt.patch b/kernel/patches-4.14.x-rt/0383-0383-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch similarity index 72% rename from kernel/patches-4.14.x-rt/0383-rcu-disable-rcu-fast-no-hz-on-rt.patch rename to kernel/patches-4.14.x-rt/0383-0383-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch index 13b4e6beb..d029acc6a 100644 --- a/kernel/patches-4.14.x-rt/0383-rcu-disable-rcu-fast-no-hz-on-rt.patch +++ b/kernel/patches-4.14.x-rt/0383-0383-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch @@ -1,16 +1,18 @@ -Subject: rcu: Disable RCU_FAST_NO_HZ on RT +From b08a08bd302bc6b774de5d028c355562bd119c8b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 28 Oct 2012 13:26:09 +0000 +Subject: [PATCH 383/414] 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. Signed-off-by: Thomas Gleixner - --- - kernel/rcu/Kconfig | 2 +- + kernel/rcu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig +index 9210379c0353..644264be90f0 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -172,7 +172,7 @@ config RCU_FANOUT_LEAF @@ -22,3 +24,6 @@ Signed-off-by: Thomas Gleixner default n help This option permits CPUs to enter dynticks-idle state even if +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0384-rcu-Eliminate-softirq-processing-from-rcutree.patch b/kernel/patches-4.14.x-rt/0384-0384-rcu-Eliminate-softirq-processing-from-rcutree.patch similarity index 89% rename from kernel/patches-4.14.x-rt/0384-rcu-Eliminate-softirq-processing-from-rcutree.patch rename to kernel/patches-4.14.x-rt/0384-0384-rcu-Eliminate-softirq-processing-from-rcutree.patch index 8afe96b18..c6871c4cf 100644 --- a/kernel/patches-4.14.x-rt/0384-rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/kernel/patches-4.14.x-rt/0384-0384-rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,6 +1,7 @@ +From b8ac0f1d53e5447260a112a0659c2f7df8fa0a59 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Mon, 4 Nov 2013 13:21:10 -0800 -Subject: rcu: Eliminate softirq processing from rcutree +Subject: [PATCH 384/414] 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, @@ -16,11 +17,13 @@ Tested-by: Mike Galbraith Signed-off-by: Paul E. McKenney Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/tree.c | 110 ++++++++++++++++++++++++++++++---- - kernel/rcu/tree.h | 5 - - kernel/rcu/tree_plugin.h | 152 ++++------------------------------------------- - 3 files changed, 114 insertions(+), 153 deletions(-) + kernel/rcu/tree.c | 112 ++++++++++++++++++++++++++--- + kernel/rcu/tree.h | 5 +- + kernel/rcu/tree_plugin.h | 152 ++++----------------------------------- + 3 files changed, 115 insertions(+), 154 deletions(-) +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index 85e2dc55a82c..0a722b56d90b 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -58,6 +58,11 @@ @@ -35,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "tree.h" #include "rcu.h" -@@ -2946,18 +2951,17 @@ static void +@@ -2946,18 +2951,17 @@ __rcu_process_callbacks(struct rcu_state *rsp) /* * Do RCU core processing for the current CPU. */ @@ -56,12 +59,15 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Schedule RCU callback invocation. If the specified type of RCU * does not support RCU priority boosting, just do a direct call, -@@ -2969,18 +2973,105 @@ static void invoke_rcu_callbacks(struct +@@ -2969,18 +2973,105 @@ static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp) { if (unlikely(!READ_ONCE(rcu_scheduler_fully_active))) return; - if (likely(!rsp->boost)) { - rcu_do_batch(rsp, rdp); +- return; +- } +- invoke_rcu_callbacks_kthread(); + rcu_do_batch(rsp, rdp); +} + @@ -73,18 +79,20 @@ Signed-off-by: Sebastian Andrzej Siewior + */ + if (t && (status != RCU_KTHREAD_YIELDING || is_idle_task(current))) + wake_up_process(t); -+} -+ + } + +/* + * Wake up this CPU's rcuc kthread to do RCU core processing. + */ -+static void invoke_rcu_core(void) -+{ + static void invoke_rcu_core(void) + { +- if (cpu_online(smp_processor_id())) +- raise_softirq(RCU_SOFTIRQ); + unsigned long flags; + struct task_struct *t; + + if (!cpu_online(smp_processor_id())) - return; ++ return; + local_irq_save(flags); + __this_cpu_write(rcu_cpu_has_work, 1); + t = __this_cpu_read(rcu_cpu_kthread_task); @@ -131,16 +139,14 @@ Signed-off-by: Sebastian Andrzej Siewior + *statusp = RCU_KTHREAD_WAITING; + return; + } - } -- invoke_rcu_callbacks_kthread(); ++ } + *statusp = RCU_KTHREAD_YIELDING; + trace_rcu_utilization(TPS("Start CPU kthread@rcu_yield")); + schedule_timeout_interruptible(2); + trace_rcu_utilization(TPS("End CPU kthread@rcu_yield")); + *statusp = RCU_KTHREAD_WAITING; - } - --static void invoke_rcu_core(void) ++} ++ +static struct smp_hotplug_thread rcu_cpu_thread_spec = { + .store = &rcu_cpu_kthread_task, + .thread_should_run = rcu_cpu_kthread_should_run, @@ -154,9 +160,7 @@ Signed-off-by: Sebastian Andrzej Siewior + * Spawn per-CPU RCU core processing kthreads. + */ +static int __init rcu_spawn_core_kthreads(void) - { -- if (cpu_online(smp_processor_id())) -- raise_softirq(RCU_SOFTIRQ); ++{ + int cpu; + + for_each_possible_cpu(cpu) @@ -176,9 +180,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * We don't need protection against CPU-hotplug here because +diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h +index ac4296f85278..7acc23da94e2 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h -@@ -438,12 +438,10 @@ extern struct rcu_state rcu_preempt_stat +@@ -438,12 +438,10 @@ extern struct rcu_state rcu_preempt_state; int rcu_dynticks_snap(struct rcu_dynticks *rdtp); bool rcu_eqs_special_set(int cpu); @@ -191,7 +197,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifndef RCU_TREE_NONCORE -@@ -463,10 +461,9 @@ void call_rcu(struct rcu_head *head, rcu +@@ -463,10 +461,9 @@ void call_rcu(struct rcu_head *head, rcu_callback_t func); static void __init __rcu_init_preempt(void); static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags); static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); @@ -203,6 +209,8 @@ Signed-off-by: Sebastian Andrzej Siewior static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, struct rcu_node *rnp); #endif /* #ifdef CONFIG_RCU_BOOST */ +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index 5426b8733293..c6098f60e641 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -24,39 +24,16 @@ @@ -245,7 +253,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_RCU_NOCB_CPU static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */ static bool have_rcu_nocb_mask; /* Was rcu_nocb_mask allocated? */ -@@ -682,15 +659,6 @@ static void rcu_preempt_check_callbacks( +@@ -682,15 +659,6 @@ static void rcu_preempt_check_callbacks(void) t->rcu_read_unlock_special.b.need_qs = true; } @@ -270,11 +278,18 @@ Signed-off-by: Sebastian Andrzej Siewior + */ +static void rcu_cpu_kthread_setup(unsigned int cpu) +{ - #ifdef CONFIG_RCU_BOOST ++#ifdef CONFIG_RCU_BOOST + struct sched_param sp; ++ ++ sp.sched_priority = kthread_prio; ++ sched_setscheduler_nocheck(current, SCHED_FIFO, &sp); ++#endif /* #ifdef CONFIG_RCU_BOOST */ ++} ++ + #ifdef CONFIG_RCU_BOOST + + #include "../locking/rtmutex_common.h" --#include "../locking/rtmutex_common.h" -- -static void rcu_wake_cond(struct task_struct *t, int status) -{ - /* @@ -283,22 +298,16 @@ Signed-off-by: Sebastian Andrzej Siewior - */ - if (status != RCU_KTHREAD_YIELDING || is_idle_task(current)) - wake_up_process(t); -+ sp.sched_priority = kthread_prio; -+ sched_setscheduler_nocheck(current, SCHED_FIFO, &sp); -+#endif /* #ifdef CONFIG_RCU_BOOST */ - } - -+#ifdef CONFIG_RCU_BOOST -+ -+#include "../locking/rtmutex_common.h" -+ +-} +- /* * Carry out RCU priority boosting on the task indicated by ->exp_tasks * or ->boost_tasks, advancing the pointer to the next task in the -@@ -1069,23 +1040,6 @@ static void rcu_initiate_boost(struct rc +@@ -1068,23 +1039,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) + } } - /* +-/* - * Wake up the per-CPU kthread to invoke RCU callbacks. - */ -static void invoke_rcu_callbacks_kthread(void) @@ -315,11 +324,10 @@ Signed-off-by: Sebastian Andrzej Siewior - local_irq_restore(flags); -} - --/* + /* * Is the current CPU running the RCU-callbacks kthread? * Caller must have preemption disabled. - */ -@@ -1139,67 +1093,6 @@ static int rcu_spawn_one_boost_kthread(s +@@ -1139,67 +1093,6 @@ static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, return 0; } @@ -387,7 +395,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * 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 -@@ -1230,26 +1123,12 @@ static void rcu_boost_kthread_setaffinit +@@ -1230,26 +1123,12 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu) free_cpumask_var(cm); } @@ -414,7 +422,7 @@ Signed-off-by: Sebastian Andrzej Siewior rcu_for_each_leaf_node(rcu_state_p, rnp) (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp); } -@@ -1272,11 +1151,6 @@ static void rcu_initiate_boost(struct rc +@@ -1272,11 +1151,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) raw_spin_unlock_irqrestore_rcu_node(rnp, flags); } @@ -426,3 +434,6 @@ Signed-off-by: Sebastian Andrzej Siewior static bool rcu_is_callbacks_kthread(void) { return false; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0385-rcu-make-RCU_BOOST-default-on-RT.patch b/kernel/patches-4.14.x-rt/0385-0385-rcu-make-RCU_BOOST-default-on-RT.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0385-rcu-make-RCU_BOOST-default-on-RT.patch rename to kernel/patches-4.14.x-rt/0385-0385-rcu-make-RCU_BOOST-default-on-RT.patch index bda5c6289..0d4c9e4fe 100644 --- a/kernel/patches-4.14.x-rt/0385-rcu-make-RCU_BOOST-default-on-RT.patch +++ b/kernel/patches-4.14.x-rt/0385-0385-rcu-make-RCU_BOOST-default-on-RT.patch @@ -1,6 +1,7 @@ +From 2ac331bf4f61f795ba8fc5babf7f30d5b03ea6ef Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 21 Mar 2014 20:19:05 +0100 -Subject: rcu: make RCU_BOOST default on RT +Subject: [PATCH 385/414] 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 @@ -9,9 +10,11 @@ someone knows better. Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/Kconfig | 4 ++-- + kernel/rcu/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig +index 644264be90f0..0be2c96fb640 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -36,7 +36,7 @@ config TINY_RCU @@ -32,3 +35,6 @@ Signed-off-by: Sebastian Andrzej Siewior help This option boosts the priority of preempted RCU readers that block the current preemptible RCU grace period for too long. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0386-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/kernel/patches-4.14.x-rt/0386-0386-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0386-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch rename to kernel/patches-4.14.x-rt/0386-0386-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index ad00b652f..5cca46fad 100644 --- a/kernel/patches-4.14.x-rt/0386-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/kernel/patches-4.14.x-rt/0386-0386-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,6 +1,7 @@ +From 369eda2e641a3e7b096bdcacf9f782d1a37e3b1c Mon Sep 17 00:00:00 2001 From: Julia Cartwright Date: Wed, 12 Oct 2016 11:21:14 -0500 -Subject: [PATCH] rcu: enable rcu_normal_after_boot by default for RT +Subject: [PATCH 386/414] 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 @@ -13,12 +14,14 @@ Suggested-by: Luiz Capitulino Signed-off-by: Julia Cartwright Signed-off-by: Sebastian Andrzej Siewior --- - kernel/rcu/update.c | 2 +- + kernel/rcu/update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c +index c63c88a0de7e..2006a09680aa 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c -@@ -66,7 +66,7 @@ extern int rcu_expedited; /* from sysctl +@@ -66,7 +66,7 @@ extern int rcu_expedited; /* from sysctl */ module_param(rcu_expedited, int, 0); extern int rcu_normal; /* from sysctl */ module_param(rcu_normal, int, 0); @@ -27,3 +30,6 @@ Signed-off-by: Sebastian Andrzej Siewior module_param(rcu_normal_after_boot, int, 0); #endif /* #ifndef CONFIG_TINY_RCU */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0387-preempt-lazy-support.patch b/kernel/patches-4.14.x-rt/0387-0387-sched-Add-support-for-lazy-preemption.patch similarity index 81% rename from kernel/patches-4.14.x-rt/0387-preempt-lazy-support.patch rename to kernel/patches-4.14.x-rt/0387-0387-sched-Add-support-for-lazy-preemption.patch index a6e1a6f90..74fc21901 100644 --- a/kernel/patches-4.14.x-rt/0387-preempt-lazy-support.patch +++ b/kernel/patches-4.14.x-rt/0387-0387-sched-Add-support-for-lazy-preemption.patch @@ -1,6 +1,7 @@ -Subject: sched: Add support for lazy preemption +From 3d1a0cca98ea826dc8de30a99069cef2abaa9850 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 26 Oct 2012 18:50:54 +0100 +Subject: [PATCH 387/414] 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 @@ -52,20 +53,22 @@ performance. Signed-off-by: Thomas Gleixner --- - include/linux/preempt.h | 35 +++++++++++++++++- - include/linux/sched.h | 38 +++++++++++++++++++ - include/linux/thread_info.h | 12 +++++- - include/linux/trace_events.h | 1 - kernel/Kconfig.preempt | 6 +++ - kernel/sched/core.c | 83 +++++++++++++++++++++++++++++++++++++++++-- - kernel/sched/fair.c | 16 ++++---- - kernel/sched/features.h | 3 + - kernel/sched/sched.h | 9 ++++ - kernel/trace/trace.c | 36 ++++++++++-------- - kernel/trace/trace.h | 2 + - kernel/trace/trace_output.c | 14 ++++++- + include/linux/preempt.h | 35 ++++++++++++++- + include/linux/sched.h | 38 +++++++++++++++++ + include/linux/thread_info.h | 12 +++++- + include/linux/trace_events.h | 1 + + kernel/Kconfig.preempt | 6 +++ + kernel/sched/core.c | 83 +++++++++++++++++++++++++++++++++++- + kernel/sched/fair.c | 16 +++---- + kernel/sched/features.h | 3 ++ + kernel/sched/sched.h | 9 ++++ + kernel/trace/trace.c | 36 +++++++++------- + kernel/trace/trace.h | 2 + + kernel/trace/trace_output.c | 14 +++++- 12 files changed, 226 insertions(+), 29 deletions(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index fd2efc6ffc3f..0591df500e9d 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -180,6 +180,20 @@ extern void preempt_count_sub(int val); @@ -138,9 +141,11 @@ Signed-off-by: Thomas Gleixner set_preempt_need_resched(); \ } while (0) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index d32be8e98b90..0322503084a5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1613,6 +1613,44 @@ static inline int test_tsk_need_resched( +@@ -1613,6 +1613,44 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } @@ -185,9 +190,11 @@ Signed-off-by: Thomas Gleixner static inline bool __task_is_stopped_or_traced(struct task_struct *task) { if (task->state & (__TASK_STOPPED | __TASK_TRACED)) +diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h +index 34f053a150a9..c2041d5b161b 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h -@@ -90,7 +90,17 @@ static inline int test_ti_thread_flag(st +@@ -90,7 +90,17 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) #define test_thread_flag(flag) \ test_ti_thread_flag(current_thread_info(), flag) @@ -206,6 +213,8 @@ Signed-off-by: Thomas Gleixner #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 ffd595ab5008..edd1e42e8a2f 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -64,6 +64,7 @@ struct trace_entry { @@ -216,6 +225,8 @@ Signed-off-by: Thomas Gleixner }; #define TRACE_EVENT_TYPE_MAX \ +diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt +index f8a2982bdbde..11dbe26a8279 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -6,6 +6,12 @@ config PREEMPT_RT_BASE @@ -231,6 +242,8 @@ Signed-off-by: Thomas Gleixner choice prompt "Preemption Model" default PREEMPT_NONE +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 44a529ca00e0..6387a157fb41 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -518,6 +518,48 @@ void resched_curr(struct rq *rq) @@ -282,7 +295,7 @@ Signed-off-by: Thomas Gleixner void resched_cpu(int cpu) { struct rq *rq = cpu_rq(cpu); -@@ -2445,6 +2487,9 @@ int sched_fork(unsigned long clone_flags +@@ -2445,6 +2487,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) p->on_cpu = 0; #endif init_task_preempt_count(p); @@ -292,7 +305,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_SMP plist_node_init(&p->pushable_tasks, MAX_PRIO); RB_CLEAR_NODE(&p->pushable_dl_tasks); -@@ -3362,6 +3407,7 @@ static void __sched notrace __schedule(b +@@ -3362,6 +3407,7 @@ static void __sched notrace __schedule(bool preempt) next = pick_next_task(rq, prev, &rf); clear_tsk_need_resched(prev); @@ -300,7 +313,7 @@ Signed-off-by: Thomas Gleixner clear_preempt_need_resched(); if (likely(prev != next)) { -@@ -3552,6 +3598,30 @@ static void __sched notrace preempt_sche +@@ -3552,6 +3598,30 @@ static void __sched notrace preempt_schedule_common(void) } while (need_resched()); } @@ -331,7 +344,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_PREEMPT /* * this is the entry point to schedule() from in-kernel preemption -@@ -3566,7 +3636,8 @@ asmlinkage __visible void __sched notrac +@@ -3566,7 +3636,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) */ if (likely(!preemptible())) return; @@ -341,7 +354,7 @@ Signed-off-by: Thomas Gleixner preempt_schedule_common(); } NOKPROBE_SYMBOL(preempt_schedule); -@@ -3593,6 +3664,9 @@ asmlinkage __visible void __sched notrac +@@ -3593,6 +3664,9 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) if (likely(!preemptible())) return; @@ -351,7 +364,7 @@ Signed-off-by: Thomas Gleixner do { /* * Because the function tracer can trace preempt_count_sub() -@@ -5332,7 +5406,9 @@ void init_idle(struct task_struct *idle, +@@ -5332,7 +5406,9 @@ void init_idle(struct task_struct *idle, int cpu) /* Set the preempt count _outside_ the spinlocks! */ init_idle_preempt_count(idle, cpu); @@ -386,9 +399,11 @@ Signed-off-by: Thomas Gleixner preempt_enable(); } EXPORT_SYMBOL(migrate_enable); +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index d1916d33f7ff..d00cceff9ba1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -3840,7 +3840,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq +@@ -3840,7 +3840,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) { @@ -397,7 +412,7 @@ Signed-off-by: Thomas Gleixner /* * The current task ran long enough, ensure it doesn't get * re-elected due to buddy favours. -@@ -3864,7 +3864,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq +@@ -3864,7 +3864,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) return; if (delta > ideal_runtime) @@ -406,7 +421,7 @@ Signed-off-by: Thomas Gleixner } static void -@@ -4006,7 +4006,7 @@ entity_tick(struct cfs_rq *cfs_rq, struc +@@ -4006,7 +4006,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) * validating it and just reschedule. */ if (queued) { @@ -415,7 +430,7 @@ Signed-off-by: Thomas Gleixner return; } /* -@@ -4188,7 +4188,7 @@ static void __account_cfs_rq_runtime(str +@@ -4188,7 +4188,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)) @@ -424,7 +439,7 @@ Signed-off-by: Thomas Gleixner } static __always_inline -@@ -4837,7 +4837,7 @@ static void hrtick_start_fair(struct rq +@@ -4837,7 +4837,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) if (delta < 0) { if (rq->curr == p) @@ -433,7 +448,7 @@ Signed-off-by: Thomas Gleixner return; } hrtick_start(rq, delta); -@@ -6230,7 +6230,7 @@ static void check_preempt_wakeup(struct +@@ -6230,7 +6230,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ return; preempt: @@ -442,7 +457,7 @@ Signed-off-by: Thomas Gleixner /* * Only set the backward buddy when the current task is still * on the rq. This can happen when a wakeup gets interleaved -@@ -9084,7 +9084,7 @@ static void task_fork_fair(struct task_s +@@ -9084,7 +9084,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); @@ -451,7 +466,7 @@ Signed-off-by: Thomas Gleixner } se->vruntime -= cfs_rq->min_vruntime; -@@ -9108,7 +9108,7 @@ prio_changed_fair(struct rq *rq, struct +@@ -9108,7 +9108,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) */ if (rq->curr == p) { if (p->prio > oldprio) @@ -460,6 +475,8 @@ Signed-off-by: Thomas Gleixner } else check_preempt_curr(rq, p, 0); } +diff --git a/kernel/sched/features.h b/kernel/sched/features.h +index c675ee1694f5..fb069998b518 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -48,6 +48,9 @@ SCHED_FEAT(NONTASK_CAPACITY, true) @@ -472,6 +489,8 @@ Signed-off-by: Thomas Gleixner #else /* +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index df2a22e591cc..d71161d063ea 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1546,6 +1546,15 @@ extern void init_sched_fair_class(void); @@ -490,9 +509,11 @@ Signed-off-by: Thomas Gleixner extern struct rt_bandwidth def_rt_bandwidth; 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 5796c41319c8..aae582536839 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2129,6 +2129,7 @@ tracing_generic_entry_update(struct trac +@@ -2129,6 +2129,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, struct task_struct *tsk = current; entry->preempt_count = pc & 0xff; @@ -500,7 +521,7 @@ Signed-off-by: Thomas Gleixner entry->pid = (tsk) ? tsk->pid : 0; entry->flags = #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT -@@ -2139,7 +2140,8 @@ tracing_generic_entry_update(struct trac +@@ -2139,7 +2140,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, ((pc & NMI_MASK ) ? TRACE_FLAG_NMI : 0) | ((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) | ((pc & SOFTIRQ_OFFSET) ? TRACE_FLAG_SOFTIRQ : 0) | @@ -510,7 +531,7 @@ Signed-off-by: Thomas Gleixner (test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0); entry->migrate_disable = (tsk) ? __migrate_disabled(tsk) & 0xFF : 0; -@@ -3341,15 +3343,17 @@ get_total_entries(struct trace_buffer *b +@@ -3341,15 +3343,17 @@ get_total_entries(struct trace_buffer *buf, static void print_lat_help_header(struct seq_file *m) { @@ -537,7 +558,7 @@ Signed-off-by: Thomas Gleixner } static void print_event_info(struct trace_buffer *buf, struct seq_file *m) -@@ -3385,15 +3389,17 @@ static void print_func_help_header_irq(s +@@ -3385,15 +3389,17 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file tgid ? tgid_space : space); seq_printf(m, "# %s / _----=> need-resched\n", tgid ? tgid_space : space); @@ -560,6 +581,8 @@ Signed-off-by: Thomas Gleixner tgid ? " | " : space); } +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 40f2130b3047..fd8a400404cc 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -127,6 +127,7 @@ struct kretprobe_trace_entry_head { @@ -578,9 +601,11 @@ Signed-off-by: Thomas Gleixner }; #define TRACE_BUF_SIZE 1024 +diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c +index 2bccb364a483..5af6d7d1b1e9 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c -@@ -447,6 +447,7 @@ int trace_print_lat_fmt(struct trace_seq +@@ -447,6 +447,7 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) { char hardsoft_irq; char need_resched; @@ -588,7 +613,7 @@ Signed-off-by: Thomas Gleixner char irqs_off; int hardirq; int softirq; -@@ -477,6 +478,9 @@ int trace_print_lat_fmt(struct trace_seq +@@ -477,6 +478,9 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) break; } @@ -598,7 +623,7 @@ Signed-off-by: Thomas Gleixner hardsoft_irq = (nmi && hardirq) ? 'Z' : nmi ? 'z' : -@@ -485,14 +489,20 @@ int trace_print_lat_fmt(struct trace_seq +@@ -485,14 +489,20 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) softirq ? 's' : '.' ; @@ -621,3 +646,6 @@ Signed-off-by: Thomas Gleixner if (entry->migrate_disable) trace_seq_printf(s, "%x", entry->migrate_disable); else +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0388-ftrace-Fix-trace-header-alignment.patch b/kernel/patches-4.14.x-rt/0388-0388-ftrace-Fix-trace-header-alignment.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0388-ftrace-Fix-trace-header-alignment.patch rename to kernel/patches-4.14.x-rt/0388-0388-ftrace-Fix-trace-header-alignment.patch index 7ecf9031c..bc323ac1b 100644 --- a/kernel/patches-4.14.x-rt/0388-ftrace-Fix-trace-header-alignment.patch +++ b/kernel/patches-4.14.x-rt/0388-0388-ftrace-Fix-trace-header-alignment.patch @@ -1,6 +1,7 @@ +From 7ac8dc098409ee5e16b03ac65b573d0fa699dd6c Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 16 Oct 2016 05:08:30 +0200 -Subject: [PATCH] ftrace: Fix trace header alignment +Subject: [PATCH 388/414] ftrace: Fix trace header alignment Line up helper arrows to the right column. @@ -9,12 +10,14 @@ Signed-off-by: Mike Galbraith [bigeasy: fixup function tracer header] Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace.c | 22 +++++++++++----------- + kernel/trace/trace.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index aae582536839..d936c4352742 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -3343,17 +3343,17 @@ get_total_entries(struct trace_buffer *b +@@ -3343,17 +3343,17 @@ get_total_entries(struct trace_buffer *buf, static void print_lat_help_header(struct seq_file *m) { @@ -43,3 +46,6 @@ Signed-off-by: Sebastian Andrzej Siewior } static void print_event_info(struct trace_buffer *buf, struct seq_file *m) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0389-x86-preempt-lazy.patch b/kernel/patches-4.14.x-rt/0389-0389-x86-Support-for-lazy-preemption.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0389-x86-preempt-lazy.patch rename to kernel/patches-4.14.x-rt/0389-0389-x86-Support-for-lazy-preemption.patch index 93964f4b1..c98fbe2e0 100644 --- a/kernel/patches-4.14.x-rt/0389-x86-preempt-lazy.patch +++ b/kernel/patches-4.14.x-rt/0389-0389-x86-Support-for-lazy-preemption.patch @@ -1,20 +1,23 @@ -Subject: x86: Support for lazy preemption +From 91fc56ed798072c101b895ba2c4d952d22d2a551 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Thu, 01 Nov 2012 11:03:47 +0100 +Date: Thu, 1 Nov 2012 11:03:47 +0100 +Subject: [PATCH 389/414] x86: Support for lazy preemption Implement the x86 pieces for lazy preempt. Signed-off-by: Thomas Gleixner --- - arch/x86/Kconfig | 1 + - arch/x86/entry/common.c | 4 ++-- - arch/x86/entry/entry_32.S | 17 +++++++++++++++++ - arch/x86/entry/entry_64.S | 16 ++++++++++++++++ - arch/x86/include/asm/preempt.h | 31 ++++++++++++++++++++++++++++++- - arch/x86/include/asm/thread_info.h | 11 +++++++++++ - arch/x86/kernel/asm-offsets.c | 2 ++ + arch/x86/Kconfig | 1 + + arch/x86/entry/common.c | 4 ++-- + arch/x86/entry/entry_32.S | 17 ++++++++++++++++ + arch/x86/entry/entry_64.S | 16 +++++++++++++++ + arch/x86/include/asm/preempt.h | 31 +++++++++++++++++++++++++++++- + arch/x86/include/asm/thread_info.h | 11 +++++++++++ + arch/x86/kernel/asm-offsets.c | 2 ++ 7 files changed, 79 insertions(+), 3 deletions(-) +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index c4afdf1be676..f40962b7f158 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -169,6 +169,7 @@ config X86 @@ -25,9 +28,11 @@ Signed-off-by: Thomas Gleixner select HAVE_RCU_TABLE_FREE select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE if X86_64 && UNWINDER_FRAME_POINTER && STACK_VALIDATION +diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c +index 121f804a9dcb..0e27f35febe7 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -133,7 +133,7 @@ static long syscall_trace_enter(struct p +@@ -133,7 +133,7 @@ static long syscall_trace_enter(struct pt_regs *regs) #define EXIT_TO_USERMODE_LOOP_FLAGS \ (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ @@ -36,7 +41,7 @@ Signed-off-by: Thomas Gleixner static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) { -@@ -148,7 +148,7 @@ static void exit_to_usermode_loop(struct +@@ -148,7 +148,7 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) /* We have work to do. */ local_irq_enable(); @@ -45,6 +50,8 @@ Signed-off-by: Thomas Gleixner schedule(); #ifdef ARCH_RT_DELAYS_SIGNAL_SEND +diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S +index 60c4c342316c..cd0c7c56e2dd 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -350,8 +350,25 @@ END(ret_from_exception) @@ -73,9 +80,11 @@ Signed-off-by: Thomas Gleixner testl $X86_EFLAGS_IF, PT_EFLAGS(%esp) # interrupts off (exception path) ? jz restore_all call preempt_schedule_irq +diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S +index d1f3e2c8320b..e5168e9672e7 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -633,7 +633,23 @@ GLOBAL(swapgs_restore_regs_and_return_to +@@ -633,7 +633,23 @@ retint_kernel: bt $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f 0: cmpl $0, PER_CPU_VAR(__preempt_count) @@ -99,9 +108,11 @@ Signed-off-by: Thomas Gleixner call preempt_schedule_irq jmp 0b 1: +diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h +index 7f2dbd91fc74..22992c837795 100644 --- a/arch/x86/include/asm/preempt.h +++ b/arch/x86/include/asm/preempt.h -@@ -86,17 +86,46 @@ static __always_inline void __preempt_co +@@ -86,17 +86,46 @@ static __always_inline void __preempt_count_sub(int val) * a decrement which hits zero means we have no preempt_count and should * reschedule. */ @@ -149,6 +160,8 @@ Signed-off-by: Thomas Gleixner } #ifdef CONFIG_PREEMPT +diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h +index eda3b6823ca4..0242d91734ee 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -56,11 +56,14 @@ struct task_struct; @@ -202,6 +215,8 @@ Signed-off-by: Thomas Gleixner #define STACK_WARN (THREAD_SIZE/8) /* +diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c +index 76417a9aab73..62c3e27c8e1c 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c @@ -38,6 +38,7 @@ void common(void) { @@ -220,3 +235,6 @@ Signed-off-by: Thomas Gleixner /* TLB state for the entry code */ OFFSET(TLB_STATE_user_pcid_flush_mask, tlb_state, user_pcid_flush_mask); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0390-arm-preempt-lazy-support.patch b/kernel/patches-4.14.x-rt/0390-0390-arm-Add-support-for-lazy-preemption.patch similarity index 74% rename from kernel/patches-4.14.x-rt/0390-arm-preempt-lazy-support.patch rename to kernel/patches-4.14.x-rt/0390-0390-arm-Add-support-for-lazy-preemption.patch index 52faabe2e..00353c2b7 100644 --- a/kernel/patches-4.14.x-rt/0390-arm-preempt-lazy-support.patch +++ b/kernel/patches-4.14.x-rt/0390-0390-arm-Add-support-for-lazy-preemption.patch @@ -1,19 +1,22 @@ -Subject: arm: Add support for lazy preemption +From 11d916532aae957aa181b29e68343fde1e963141 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 31 Oct 2012 12:04:11 +0100 +Subject: [PATCH 390/414] arm: Add support for lazy preemption Implement the arm pieces for lazy preempt. Signed-off-by: Thomas Gleixner --- - arch/arm/Kconfig | 1 + - arch/arm/include/asm/thread_info.h | 8 ++++++-- - arch/arm/kernel/asm-offsets.c | 1 + - arch/arm/kernel/entry-armv.S | 19 ++++++++++++++++--- - arch/arm/kernel/entry-common.S | 9 +++++++-- - arch/arm/kernel/signal.c | 3 ++- + arch/arm/Kconfig | 1 + + arch/arm/include/asm/thread_info.h | 8 ++++++-- + arch/arm/kernel/asm-offsets.c | 1 + + arch/arm/kernel/entry-armv.S | 19 ++++++++++++++++--- + arch/arm/kernel/entry-common.S | 9 +++++++-- + arch/arm/kernel/signal.c | 3 ++- 6 files changed, 33 insertions(+), 8 deletions(-) +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index ac05a027539a..558b0995e94a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -85,6 +85,7 @@ config ARM @@ -24,6 +27,8 @@ Signed-off-by: Thomas Gleixner select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE) select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_SYSCALL_TRACEPOINTS +diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h +index 776757d1604a..1f36a4eccc72 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -49,6 +49,7 @@ struct cpu_context_save { @@ -34,7 +39,7 @@ Signed-off-by: Thomas Gleixner mm_segment_t addr_limit; /* address limit */ struct task_struct *task; /* main task structure */ __u32 cpu; /* cpu */ -@@ -142,7 +143,8 @@ extern int vfp_restore_user_hwstate(stru +@@ -142,7 +143,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, #define TIF_SYSCALL_TRACE 4 /* syscall trace active */ #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */ @@ -44,7 +49,7 @@ Signed-off-by: Thomas Gleixner #define TIF_NOHZ 12 /* in adaptive nohz mode */ #define TIF_USING_IWMMXT 17 -@@ -152,6 +154,7 @@ extern int vfp_restore_user_hwstate(stru +@@ -152,6 +154,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) @@ -52,7 +57,7 @@ Signed-off-by: Thomas Gleixner #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) -@@ -167,7 +170,8 @@ extern int vfp_restore_user_hwstate(stru +@@ -167,7 +170,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, * Change these and you break ASM code in entry-common.S */ #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ @@ -62,6 +67,8 @@ Signed-off-by: Thomas Gleixner #endif /* __KERNEL__ */ #endif /* __ASM_ARM_THREAD_INFO_H */ +diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c +index 608008229c7d..3866da3f7bb7 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c @@ -65,6 +65,7 @@ int main(void) @@ -72,9 +79,11 @@ Signed-off-by: Thomas Gleixner DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); DEFINE(TI_TASK, offsetof(struct thread_info, task)); DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); +diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S +index fbc707626b3e..b434c59d2b64 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S -@@ -220,11 +220,18 @@ ENDPROC(__dabt_svc) +@@ -220,11 +220,18 @@ __irq_svc: #ifdef CONFIG_PREEMPT ldr r8, [tsk, #TI_PREEMPT] @ get preempt count @@ -95,7 +104,7 @@ Signed-off-by: Thomas Gleixner #endif svc_exit r5, irq = 1 @ return from exception -@@ -239,8 +246,14 @@ ENDPROC(__irq_svc) +@@ -239,8 +246,14 @@ svc_preempt: 1: bl preempt_schedule_irq @ irq en/disable is done inside ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS tst r0, #_TIF_NEED_RESCHED @@ -111,9 +120,11 @@ Signed-off-by: Thomas Gleixner #endif __und_fault: +diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S +index 99c908226065..5ffd7188af2d 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S -@@ -53,7 +53,9 @@ saved_pc .req lr +@@ -53,7 +53,9 @@ ret_fast_syscall: cmp r2, #TASK_SIZE blne addr_limit_check_failed ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing @@ -124,7 +135,7 @@ Signed-off-by: Thomas Gleixner bne fast_work_pending -@@ -83,8 +85,11 @@ ENDPROC(ret_fast_syscall) +@@ -83,8 +85,11 @@ ret_fast_syscall: cmp r2, #TASK_SIZE blne addr_limit_check_failed ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing @@ -137,9 +148,11 @@ Signed-off-by: Thomas Gleixner UNWIND(.fnend ) ENDPROC(ret_fast_syscall) +diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c +index b67ae12503f3..7039988510bb 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c -@@ -615,7 +615,8 @@ do_work_pending(struct pt_regs *regs, un +@@ -615,7 +615,8 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) */ trace_hardirqs_off(); do { @@ -149,3 +162,6 @@ Signed-off-by: Thomas Gleixner schedule(); } else { if (unlikely(!user_mode(regs))) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0391-powerpc-preempt-lazy-support.patch b/kernel/patches-4.14.x-rt/0391-0391-powerpc-Add-support-for-lazy-preemption.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0391-powerpc-preempt-lazy-support.patch rename to kernel/patches-4.14.x-rt/0391-0391-powerpc-Add-support-for-lazy-preemption.patch index ae6a746dd..34b26691b 100644 --- a/kernel/patches-4.14.x-rt/0391-powerpc-preempt-lazy-support.patch +++ b/kernel/patches-4.14.x-rt/0391-0391-powerpc-Add-support-for-lazy-preemption.patch @@ -1,18 +1,21 @@ +From 43d18880d0fdc513998e0e2719a35a31a121108f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 1 Nov 2012 10:14:11 +0100 -Subject: powerpc: Add support for lazy preemption +Subject: [PATCH 391/414] powerpc: Add support for lazy preemption Implement the powerpc pieces for lazy preempt. Signed-off-by: Thomas Gleixner --- - arch/powerpc/Kconfig | 1 + - arch/powerpc/include/asm/thread_info.h | 11 ++++++++--- - arch/powerpc/kernel/asm-offsets.c | 1 + - arch/powerpc/kernel/entry_32.S | 17 ++++++++++++----- - arch/powerpc/kernel/entry_64.S | 14 +++++++++++--- + arch/powerpc/Kconfig | 1 + + arch/powerpc/include/asm/thread_info.h | 11 ++++++++--- + arch/powerpc/kernel/asm-offsets.c | 1 + + arch/powerpc/kernel/entry_32.S | 17 ++++++++++++----- + arch/powerpc/kernel/entry_64.S | 14 +++++++++++--- 5 files changed, 33 insertions(+), 11 deletions(-) +diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig +index f3201bf888ad..b5658e925465 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -216,6 +216,7 @@ config PPC @@ -23,6 +26,8 @@ Signed-off-by: Thomas Gleixner select HAVE_RCU_TABLE_FREE if SMP select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_SYSCALL_TRACEPOINTS +diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h +index a264c3ad366b..020afb8329a1 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h @@ -36,6 +36,8 @@ struct thread_info { @@ -34,7 +39,7 @@ Signed-off-by: Thomas Gleixner unsigned long local_flags; /* private flags for thread */ #ifdef CONFIG_LIVEPATCH unsigned long *livepatch_sp; -@@ -81,8 +83,7 @@ static inline struct thread_info *curren +@@ -81,8 +83,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ #define TIF_SIGPENDING 1 /* signal pending */ #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ @@ -44,7 +49,7 @@ Signed-off-by: Thomas Gleixner #define TIF_32BIT 4 /* 32 bit binary */ #define TIF_RESTORE_TM 5 /* need to restore TM FP/VEC/VSX */ #define TIF_PATCH_PENDING 6 /* pending live patching update */ -@@ -101,6 +102,8 @@ static inline struct thread_info *curren +@@ -101,6 +102,8 @@ static inline struct thread_info *current_thread_info(void) #if defined(CONFIG_PPC64) #define TIF_ELF2ABI 18 /* function descriptors must die! */ #endif @@ -53,7 +58,7 @@ Signed-off-by: Thomas Gleixner /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1< /* 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 748cdc4bb89a..90c2d96aff6f 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c @@ -156,6 +156,7 @@ int main(void) @@ -81,9 +88,11 @@ Signed-off-by: Thomas Gleixner OFFSET(TI_TASK, thread_info, task); OFFSET(TI_CPU, thread_info, cpu); +diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S +index e780e1fbf6c2..dc7fe90ff6a9 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S -@@ -866,7 +866,14 @@ user_exc_return: /* r10 contains MSR_KE +@@ -866,7 +866,14 @@ resume_kernel: cmpwi 0,r0,0 /* if non-zero, just restore regs and return */ bne restore andi. r8,r8,_TIF_NEED_RESCHED @@ -98,7 +107,7 @@ Signed-off-by: Thomas Gleixner lwz r3,_MSR(r1) andi. r0,r3,MSR_EE /* interrupts off? */ beq restore /* don't schedule if so */ -@@ -877,11 +884,11 @@ user_exc_return: /* r10 contains MSR_KE +@@ -877,11 +884,11 @@ resume_kernel: */ bl trace_hardirqs_off #endif @@ -113,7 +122,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_TRACE_IRQFLAGS /* And now, to properly rebalance the above, we tell lockdep they * are being turned back on, which will happen when we return -@@ -1204,7 +1211,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRE +@@ -1204,7 +1211,7 @@ global_dbcr0: #endif /* !(CONFIG_4xx || CONFIG_BOOKE) */ do_work: /* r10 contains MSR_KERNEL here */ @@ -122,7 +131,7 @@ Signed-off-by: Thomas Gleixner beq do_user_signal do_resched: /* r10 contains MSR_KERNEL here */ -@@ -1225,7 +1232,7 @@ do_resched: /* r10 contains MSR_KERNEL +@@ -1225,7 +1232,7 @@ recheck: MTMSRD(r10) /* disable interrupts */ CURRENT_THREAD_INFO(r9, r1) lwz r9,TI_FLAGS(r9) @@ -131,9 +140,11 @@ Signed-off-by: Thomas Gleixner bne- do_resched 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 6f07c687fc05..24ae3d343084 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S -@@ -689,7 +689,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -689,7 +689,7 @@ _GLOBAL(ret_from_except_lite) bl restore_math b restore #endif @@ -142,7 +153,7 @@ Signed-off-by: Thomas Gleixner beq 2f bl restore_interrupts SCHEDULE_USER -@@ -751,10 +751,18 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -751,10 +751,18 @@ resume_kernel: #ifdef CONFIG_PREEMPT /* Check if we need to preempt */ @@ -162,7 +173,7 @@ Signed-off-by: Thomas Gleixner cmpwi cr1,r8,0 ld r0,SOFTE(r1) cmpdi r0,0 -@@ -771,7 +779,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -771,7 +779,7 @@ resume_kernel: /* Re-test flags and eventually loop */ CURRENT_THREAD_INFO(r9, r1) ld r4,TI_FLAGS(r9) @@ -171,3 +182,6 @@ Signed-off-by: Thomas Gleixner bne 1b /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0392-arch-arm64-Add-lazy-preempt-support.patch b/kernel/patches-4.14.x-rt/0392-0392-arch-arm64-Add-lazy-preempt-support.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0392-arch-arm64-Add-lazy-preempt-support.patch rename to kernel/patches-4.14.x-rt/0392-0392-arch-arm64-Add-lazy-preempt-support.patch index 15d442b6e..8a1f212c7 100644 --- a/kernel/patches-4.14.x-rt/0392-arch-arm64-Add-lazy-preempt-support.patch +++ b/kernel/patches-4.14.x-rt/0392-0392-arch-arm64-Add-lazy-preempt-support.patch @@ -1,6 +1,7 @@ +From 24b4d4f5deeb374106d6864e3f213f4efbeda8e7 Mon Sep 17 00:00:00 2001 From: Anders Roxell Date: Thu, 14 May 2015 17:52:17 +0200 -Subject: arch/arm64: Add lazy preempt support +Subject: [PATCH 392/414] 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, @@ -11,13 +12,15 @@ indicate that support for full RT preemption is now available. Signed-off-by: Anders Roxell --- - arch/arm64/Kconfig | 1 + - arch/arm64/include/asm/thread_info.h | 6 +++++- - arch/arm64/kernel/asm-offsets.c | 1 + - arch/arm64/kernel/entry.S | 12 +++++++++--- - arch/arm64/kernel/signal.c | 2 +- + arch/arm64/Kconfig | 1 + + arch/arm64/include/asm/thread_info.h | 6 +++++- + arch/arm64/kernel/asm-offsets.c | 1 + + arch/arm64/kernel/entry.S | 12 +++++++++--- + arch/arm64/kernel/signal.c | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig +index c8bcd6e41192..7e08c4fd1ae0 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -103,6 +103,7 @@ config ARM64 @@ -28,6 +31,8 @@ Signed-off-by: Anders Roxell select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RCU_TABLE_FREE select HAVE_SYSCALL_TRACEPOINTS +diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h +index ddded6497a8a..935271f5914d 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -43,6 +43,7 @@ struct thread_info { @@ -65,6 +70,8 @@ Signed-off-by: Anders Roxell #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ _TIF_NOHZ) +diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c +index af247d10252f..215a48154042 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -39,6 +39,7 @@ int main(void) @@ -75,9 +82,11 @@ Signed-off-by: Anders Roxell DEFINE(TSK_TI_ADDR_LIMIT, offsetof(struct task_struct, thread_info.addr_limit)); #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 93958d1341bb..ed6959beb5a4 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S -@@ -607,11 +607,16 @@ ENDPROC(el1_sync) +@@ -607,11 +607,16 @@ el1_irq: #ifdef CONFIG_PREEMPT ldr w24, [tsk, #TSK_TI_PREEMPT] // get preempt count @@ -97,7 +106,7 @@ Signed-off-by: Anders Roxell #endif #ifdef CONFIG_TRACE_IRQFLAGS bl trace_hardirqs_on -@@ -625,6 +630,7 @@ ENDPROC(el1_irq) +@@ -625,6 +630,7 @@ el1_preempt: 1: bl preempt_schedule_irq // irq en/disable is done inside ldr x0, [tsk, #TSK_TI_FLAGS] // get new tasks TI_FLAGS tbnz x0, #TIF_NEED_RESCHED, 1b // needs rescheduling? @@ -105,9 +114,11 @@ Signed-off-by: Anders Roxell ret x24 #endif +diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c +index 0bdc96c61bc0..5393eb231209 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c -@@ -755,7 +755,7 @@ asmlinkage void do_notify_resume(struct +@@ -755,7 +755,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, /* Check valid user FS if needed */ addr_limit_user_check(); @@ -116,3 +127,6 @@ Signed-off-by: Anders Roxell schedule(); } else { local_irq_enable(); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0393-leds-trigger-disable-CPU-trigger-on-RT.patch b/kernel/patches-4.14.x-rt/0393-0393-leds-trigger-disable-CPU-trigger-on-RT.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0393-leds-trigger-disable-CPU-trigger-on-RT.patch rename to kernel/patches-4.14.x-rt/0393-0393-leds-trigger-disable-CPU-trigger-on-RT.patch index e59b96299..2c87f4589 100644 --- a/kernel/patches-4.14.x-rt/0393-leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/kernel/patches-4.14.x-rt/0393-0393-leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,6 +1,7 @@ +From 4b69f33ec0a1ce5cb6cca8feabb64703a8924631 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 23 Jan 2014 14:45:59 +0100 -Subject: leds: trigger: disable CPU trigger on -RT +Subject: [PATCH 393/414] leds: trigger: disable CPU trigger on -RT as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 @@ -19,9 +20,11 @@ as it triggers: Signed-off-by: Sebastian Andrzej Siewior --- - drivers/leds/trigger/Kconfig | 2 +- + drivers/leds/trigger/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig +index 3f9ddb9fafa7..09da5b6b44a1 100644 --- a/drivers/leds/trigger/Kconfig +++ b/drivers/leds/trigger/Kconfig @@ -69,7 +69,7 @@ config LEDS_TRIGGER_BACKLIGHT @@ -33,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior help 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.17.0 + diff --git a/kernel/patches-4.14.x-rt/0394-mmci-remove-bogus-irq-save.patch b/kernel/patches-4.14.x-rt/0394-0394-mmci-Remove-bogus-local_irq_save.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0394-mmci-remove-bogus-irq-save.patch rename to kernel/patches-4.14.x-rt/0394-0394-mmci-Remove-bogus-local_irq_save.patch index f7f4487ae..5a33b33be 100644 --- a/kernel/patches-4.14.x-rt/0394-mmci-remove-bogus-irq-save.patch +++ b/kernel/patches-4.14.x-rt/0394-0394-mmci-Remove-bogus-local_irq_save.patch @@ -1,18 +1,21 @@ -Subject: mmci: Remove bogus local_irq_save() +From 34019af11510661afc37fb072b054520515d9056 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Wed, 09 Jan 2013 12:11:12 +0100 +Date: Wed, 9 Jan 2013 12:11:12 +0100 +Subject: [PATCH 394/414] mmci: Remove bogus local_irq_save() On !RT interrupt runs with interrupts disabled. On RT it's in a thread, so no need to disable interrupts at all. Signed-off-by: Thomas Gleixner --- - drivers/mmc/host/mmci.c | 5 ----- + drivers/mmc/host/mmci.c | 5 ----- 1 file changed, 5 deletions(-) +diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c +index f1f54a818489..ce102378df02 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c -@@ -1200,15 +1200,12 @@ static irqreturn_t mmci_pio_irq(int irq, +@@ -1200,15 +1200,12 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id) struct sg_mapping_iter *sg_miter = &host->sg_miter; struct variant_data *variant = host->variant; void __iomem *base = host->base; @@ -28,7 +31,7 @@ Signed-off-by: Thomas Gleixner do { unsigned int remain, len; char *buffer; -@@ -1248,8 +1245,6 @@ static irqreturn_t mmci_pio_irq(int irq, +@@ -1248,8 +1245,6 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id) sg_miter_stop(sg_miter); @@ -37,3 +40,6 @@ Signed-off-by: Thomas Gleixner /* * If we have less than the fifo 'half-full' threshold to transfer, * trigger a PIO interrupt as soon as any data is available. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0395-cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/kernel/patches-4.14.x-rt/0395-0395-cpufreq-drop-K8-s-driver-from-beeing-selected.patch similarity index 79% rename from kernel/patches-4.14.x-rt/0395-cpufreq-drop-K8-s-driver-from-beeing-selected.patch rename to kernel/patches-4.14.x-rt/0395-0395-cpufreq-drop-K8-s-driver-from-beeing-selected.patch index 6b60722a5..c72201edc 100644 --- a/kernel/patches-4.14.x-rt/0395-cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/kernel/patches-4.14.x-rt/0395-0395-cpufreq-drop-K8-s-driver-from-beeing-selected.patch @@ -1,6 +1,7 @@ +From 46d66cff29b8a1cdfc64a0e69171aa510315f9ca Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 9 Apr 2015 15:23:01 +0200 -Subject: cpufreq: drop K8's driver from beeing selected +Subject: [PATCH 395/414] cpufreq: drop K8's driver from beeing selected Ralf posted a picture of a backtrace from @@ -16,9 +17,11 @@ I have no machine with this, I simply switch it off. Reported-by: Ralf Mardorf Signed-off-by: Sebastian Andrzej Siewior --- - drivers/cpufreq/Kconfig.x86 | 2 +- + drivers/cpufreq/Kconfig.x86 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86 +index 35f71825b7f3..bb4a6160d0f7 100644 --- a/drivers/cpufreq/Kconfig.x86 +++ b/drivers/cpufreq/Kconfig.x86 @@ -125,7 +125,7 @@ config X86_POWERNOW_K7_ACPI @@ -30,3 +33,6 @@ Signed-off-by: Sebastian Andrzej Siewior help This adds the CPUFreq driver for K8/early Opteron/Athlon64 processors. Support for K10 and newer processors is now in acpi-cpufreq. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0396-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/kernel/patches-4.14.x-rt/0396-0396-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch similarity index 82% rename from kernel/patches-4.14.x-rt/0396-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch rename to kernel/patches-4.14.x-rt/0396-0396-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index f91af26e9..366bc6d6b 100644 --- a/kernel/patches-4.14.x-rt/0396-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/kernel/patches-4.14.x-rt/0396-0396-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -1,7 +1,8 @@ +From a88fd249ccff219250a01059ff52291023859f57 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 16 Oct 2016 05:11:54 +0200 -Subject: [PATCH] connector/cn_proc: Protect send_msg() with a local lock - on RT +Subject: [PATCH 396/414] 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 |in_atomic(): 1, irqs_disabled(): 0, pid: 31807, name: sleep @@ -30,9 +31,11 @@ delivery") which is v4.7-rc6. Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - drivers/connector/cn_proc.c | 6 ++++-- + drivers/connector/cn_proc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) +diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c +index a782ce87715c..19d265948526 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -32,6 +32,7 @@ @@ -43,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Size of a cn_msg followed by a proc_event structure. Since the -@@ -54,10 +55,11 @@ static struct cb_id cn_proc_event_id = { +@@ -54,10 +55,11 @@ static struct cb_id cn_proc_event_id = { CN_IDX_PROC, CN_VAL_PROC }; /* proc_event_counts is used as the sequence number of the netlink message */ static DEFINE_PER_CPU(__u32, proc_event_counts) = { 0 }; @@ -56,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior msg->seq = __this_cpu_inc_return(proc_event_counts) - 1; ((struct proc_event *)msg->data)->cpu = smp_processor_id(); -@@ -70,7 +72,7 @@ static inline void send_msg(struct cn_ms +@@ -70,7 +72,7 @@ static inline void send_msg(struct cn_msg *msg) */ cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_NOWAIT); @@ -65,3 +68,6 @@ Signed-off-by: Sebastian Andrzej Siewior } void proc_fork_connector(struct task_struct *task) +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0397-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/kernel/patches-4.14.x-rt/0397-0397-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch similarity index 73% rename from kernel/patches-4.14.x-rt/0397-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch rename to kernel/patches-4.14.x-rt/0397-0397-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index 3f0fb4e9b..345bd9c5d 100644 --- a/kernel/patches-4.14.x-rt/0397-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/kernel/patches-4.14.x-rt/0397-0397-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -1,7 +1,8 @@ +From b05b3cdd91f22a30a51afb1dca1b69e24ab7fdbd Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Thu, 31 Mar 2016 04:08:28 +0200 -Subject: [PATCH] drivers/block/zram: Replace bit spinlocks with rtmutex - for -rt +Subject: [PATCH 397/414] drivers/block/zram: Replace bit spinlocks with + rtmutex for -rt They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. @@ -9,10 +10,12 @@ OTOH, they're a lot less wasteful than an rtmutex per page. Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - drivers/block/zram/zram_drv.c | 26 ++++++++++++++++++++++++++ - drivers/block/zram/zram_drv.h | 3 +++ + drivers/block/zram/zram_drv.c | 26 ++++++++++++++++++++++++++ + drivers/block/zram/zram_drv.h | 3 +++ 2 files changed, 29 insertions(+) +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index f149d3e61234..0fc72950be2d 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -756,6 +756,30 @@ static DEVICE_ATTR_RO(io_stat); @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void zram_slot_lock(struct zram *zram, u32 index) { bit_spin_lock(ZRAM_ACCESS, &zram->table[index].value); -@@ -765,6 +789,7 @@ static void zram_slot_unlock(struct zram +@@ -765,6 +789,7 @@ static void zram_slot_unlock(struct zram *zram, u32 index) { bit_spin_unlock(ZRAM_ACCESS, &zram->table[index].value); } @@ -54,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void zram_meta_free(struct zram *zram, u64 disksize) { -@@ -794,6 +819,7 @@ static bool zram_meta_alloc(struct zram +@@ -794,6 +819,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) return false; } @@ -62,6 +65,8 @@ Signed-off-by: Sebastian Andrzej Siewior return true; } +diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h +index 31762db861e3..a417c96b8f3f 100644 --- a/drivers/block/zram/zram_drv.h +++ b/drivers/block/zram/zram_drv.h @@ -77,6 +77,9 @@ struct zram_table_entry { @@ -74,3 +79,6 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct zram_stats { +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0398-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/kernel/patches-4.14.x-rt/0398-0398-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch similarity index 69% rename from kernel/patches-4.14.x-rt/0398-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch rename to kernel/patches-4.14.x-rt/0398-0398-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index c39243eb1..a8e6d93f2 100644 --- a/kernel/patches-4.14.x-rt/0398-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/kernel/patches-4.14.x-rt/0398-0398-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -1,6 +1,7 @@ +From 709ce2ad069cc2ba297c371894fcee3b596eb210 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Thu, 20 Oct 2016 11:15:22 +0200 -Subject: [PATCH] drivers/zram: Don't disable preemption in +Subject: [PATCH 398/414] drivers/zram: Don't disable preemption in zcomp_stream_get/put() In v4.7, the driver switched to percpu compression streams, disabling @@ -13,14 +14,16 @@ Signed-off-by: Mike Galbraith [bigeasy: get_locked_var() -> per zcomp_strm lock] Signed-off-by: Sebastian Andrzej Siewior --- - drivers/block/zram/zcomp.c | 12 ++++++++++-- - drivers/block/zram/zcomp.h | 1 + - drivers/block/zram/zram_drv.c | 5 +++-- + drivers/block/zram/zcomp.c | 12 ++++++++++-- + drivers/block/zram/zcomp.h | 1 + + drivers/block/zram/zram_drv.c | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) +diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c +index 5b8992beffec..374931245128 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c -@@ -116,12 +116,19 @@ ssize_t zcomp_available_show(const char +@@ -116,12 +116,19 @@ ssize_t zcomp_available_show(const char *comp, char *buf) struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) { @@ -42,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior } int zcomp_compress(struct zcomp_strm *zstrm, -@@ -171,6 +178,7 @@ int zcomp_cpu_up_prepare(unsigned int cp +@@ -171,6 +178,7 @@ int zcomp_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) pr_err("Can't allocate a compression stream\n"); return -ENOMEM; } @@ -50,6 +53,8 @@ Signed-off-by: Sebastian Andrzej Siewior *per_cpu_ptr(comp->stream, cpu) = zstrm; return 0; } +diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h +index 41c1002a7d7d..d424eafcbf8e 100644 --- a/drivers/block/zram/zcomp.h +++ b/drivers/block/zram/zcomp.h @@ -14,6 +14,7 @@ struct zcomp_strm { @@ -60,9 +65,11 @@ Signed-off-by: Sebastian Andrzej Siewior }; /* dynamic per-device compression frontend */ +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index 0fc72950be2d..9839656465ea 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c -@@ -871,6 +871,7 @@ static int __zram_bvec_read(struct zram +@@ -871,6 +871,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, unsigned long handle; unsigned int size; void *src, *dst; @@ -70,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (zram_wb_enabled(zram)) { zram_slot_lock(zram, index); -@@ -905,6 +906,7 @@ static int __zram_bvec_read(struct zram +@@ -905,6 +906,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, size = zram_get_obj_size(zram, index); @@ -78,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior src = zs_map_object(zram->mem_pool, handle, ZS_MM_RO); if (size == PAGE_SIZE) { dst = kmap_atomic(page); -@@ -912,14 +914,13 @@ static int __zram_bvec_read(struct zram +@@ -912,14 +914,13 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, kunmap_atomic(dst); ret = 0; } else { @@ -94,3 +101,6 @@ Signed-off-by: Sebastian Andrzej Siewior zram_slot_unlock(zram, index); /* Should NEVER happen. Return bio error if it does. */ +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0399-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch b/kernel/patches-4.14.x-rt/0399-0399-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch similarity index 65% rename from kernel/patches-4.14.x-rt/0399-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch rename to kernel/patches-4.14.x-rt/0399-0399-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch index fde000b05..a24140543 100644 --- a/kernel/patches-4.14.x-rt/0399-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +++ b/kernel/patches-4.14.x-rt/0399-0399-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch @@ -1,7 +1,8 @@ +From 59328b250989984f4e719fd01d9d7e5999c2f70d Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 23 Aug 2017 11:57:29 +0200 -Subject: [PATCH] drivers/zram: fix zcomp_stream_get() smp_processor_id() use - in preemptible code +Subject: [PATCH 399/414] 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 smp_processor_id() in preemptible code. @@ -13,12 +14,14 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - drivers/block/zram/zcomp.c | 3 ++- + drivers/block/zram/zcomp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c +index 374931245128..40345483a022 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c -@@ -118,7 +118,7 @@ struct zcomp_strm *zcomp_stream_get(stru +@@ -118,7 +118,7 @@ struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) { struct zcomp_strm *zstrm; @@ -27,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior spin_lock(&zstrm->zcomp_lock); return zstrm; } -@@ -129,6 +129,7 @@ void zcomp_stream_put(struct zcomp *comp +@@ -129,6 +129,7 @@ void zcomp_stream_put(struct zcomp *comp) zstrm = *this_cpu_ptr(comp->stream); spin_unlock(&zstrm->zcomp_lock); @@ -35,3 +38,6 @@ Signed-off-by: Sebastian Andrzej Siewior } int zcomp_compress(struct zcomp_strm *zstrm, +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0400-tpm_tis-fix-stall-after-iowrite-s.patch b/kernel/patches-4.14.x-rt/0400-0400-tpm_tis-fix-stall-after-iowrite-s.patch similarity index 78% rename from kernel/patches-4.14.x-rt/0400-tpm_tis-fix-stall-after-iowrite-s.patch rename to kernel/patches-4.14.x-rt/0400-0400-tpm_tis-fix-stall-after-iowrite-s.patch index 8f1ae7443..1c53ec4f7 100644 --- a/kernel/patches-4.14.x-rt/0400-tpm_tis-fix-stall-after-iowrite-s.patch +++ b/kernel/patches-4.14.x-rt/0400-0400-tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,6 +1,7 @@ +From c04bec112ba6dc9ad2c611b6bdf83b16c57ffb63 Mon Sep 17 00:00:00 2001 From: Haris Okanovic Date: Tue, 15 Aug 2017 15:13:08 -0500 -Subject: [PATCH] tpm_tis: fix stall after iowrite*()s +Subject: [PATCH 400/414] 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. @@ -20,12 +21,14 @@ amortize the cost of flushing data to chip across multiple instructions. Signed-off-by: Haris Okanovic Signed-off-by: Sebastian Andrzej Siewior --- - drivers/char/tpm/tpm_tis.c | 29 +++++++++++++++++++++++++++-- + drivers/char/tpm/tpm_tis.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) +diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c +index 50b59a69dc33..cbdb0a6c5337 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c -@@ -52,6 +52,31 @@ static inline struct tpm_tis_tcg_phy *to +@@ -52,6 +52,31 @@ static inline struct tpm_tis_tcg_phy *to_tpm_tis_tcg_phy(struct tpm_tis_data *da return container_of(data, struct tpm_tis_tcg_phy, priv); } @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior static bool interrupts = true; module_param(interrupts, bool, 0444); MODULE_PARM_DESC(interrupts, "Enable interrupts"); -@@ -149,7 +174,7 @@ static int tpm_tcg_write_bytes(struct tp +@@ -149,7 +174,7 @@ static int tpm_tcg_write_bytes(struct tpm_tis_data *data, u32 addr, u16 len, struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); while (len--) @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -176,7 +201,7 @@ static int tpm_tcg_write32(struct tpm_ti +@@ -176,7 +201,7 @@ static int tpm_tcg_write32(struct tpm_tis_data *data, u32 addr, u32 value) { struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); @@ -75,3 +78,6 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0401-pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/kernel/patches-4.14.x-rt/0401-0401-pci-switchtec-Don-t-use-completion-s-wait-queue.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0401-pci-switchtec-Don-t-use-completion-s-wait-queue.patch rename to kernel/patches-4.14.x-rt/0401-0401-pci-switchtec-Don-t-use-completion-s-wait-queue.patch index e3accac42..bba56a31a 100644 --- a/kernel/patches-4.14.x-rt/0401-pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/kernel/patches-4.14.x-rt/0401-0401-pci-switchtec-Don-t-use-completion-s-wait-queue.patch @@ -1,6 +1,7 @@ +From 23dc17f0f46092fc3c5eb2d0df3cf99ed7624171 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 10:24:23 +0200 -Subject: [PATCH] pci/switchtec: Don't use completion's wait queue +Subject: [PATCH 401/414] 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 @@ -18,9 +19,11 @@ Cc: Kurt Schwemmer Cc: Logan Gunthorpe Signed-off-by: Sebastian Andrzej Siewior --- - drivers/pci/switch/switchtec.c | 22 +++++++++++++--------- + drivers/pci/switch/switchtec.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) +diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c +index af81b2dec42e..1910c6c72fcd 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -306,10 +306,11 @@ struct switchtec_user { @@ -36,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior u32 cmd; u32 status; u32 return_code; -@@ -331,7 +332,7 @@ static struct switchtec_user *stuser_cre +@@ -331,7 +332,7 @@ static struct switchtec_user *stuser_create(struct switchtec_dev *stdev) stuser->stdev = stdev; kref_init(&stuser->kref); INIT_LIST_HEAD(&stuser->list); @@ -45,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior stuser->event_cnt = atomic_read(&stdev->event_cnt); dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); -@@ -414,7 +415,7 @@ static int mrpc_queue_cmd(struct switcht +@@ -414,7 +415,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); @@ -54,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior list_add_tail(&stuser->list, &stdev->mrpc_queue); mrpc_cmd_submit(stdev); -@@ -451,7 +452,8 @@ static void mrpc_complete_cmd(struct swi +@@ -451,7 +452,8 @@ static void mrpc_complete_cmd(struct switchtec_dev *stdev) stuser->read_len); out: @@ -64,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior list_del_init(&stuser->list); stuser_put(stuser); stdev->mrpc_busy = 0; -@@ -721,10 +723,11 @@ static ssize_t switchtec_dev_read(struct +@@ -721,10 +723,11 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data, mutex_unlock(&stdev->mrpc_mutex); if (filp->f_flags & O_NONBLOCK) { @@ -78,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (rc < 0) return rc; } -@@ -772,7 +775,7 @@ static unsigned int switchtec_dev_poll(s +@@ -772,7 +775,7 @@ static unsigned int switchtec_dev_poll(struct file *filp, poll_table *wait) struct switchtec_dev *stdev = stuser->stdev; int ret = 0; @@ -87,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior poll_wait(filp, &stdev->event_wq, wait); if (lock_mutex_and_test_alive(stdev)) -@@ -780,7 +783,7 @@ static unsigned int switchtec_dev_poll(s +@@ -780,7 +783,7 @@ static unsigned int switchtec_dev_poll(struct file *filp, poll_table *wait) mutex_unlock(&stdev->mrpc_mutex); @@ -96,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret |= POLLIN | POLLRDNORM; if (stuser->event_cnt != atomic_read(&stdev->event_cnt)) -@@ -1255,7 +1258,8 @@ static void stdev_kill(struct switchtec_ +@@ -1255,7 +1258,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) { @@ -106,3 +109,6 @@ Signed-off-by: Sebastian Andrzej Siewior list_del_init(&stuser->list); stuser_put(stuser); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0402-drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/kernel/patches-4.14.x-rt/0402-0402-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch similarity index 60% rename from kernel/patches-4.14.x-rt/0402-drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch rename to kernel/patches-4.14.x-rt/0402-0402-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch index 7d2fd54c3..149d2c9f3 100644 --- a/kernel/patches-4.14.x-rt/0402-drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch +++ b/kernel/patches-4.14.x-rt/0402-0402-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch @@ -1,6 +1,8 @@ -Subject: drm,radeon,i915: Use preempt_disable/enable_rt() where recommended +From e4f0423400949818dc4e1d198927d4151b9014af Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sat, 27 Feb 2016 08:09:11 +0100 +Subject: [PATCH 402/414] drm,radeon,i915: Use preempt_disable/enable_rt() + where recommended DRM folks identified the spots, so use them. @@ -9,13 +11,15 @@ Cc: Sebastian Andrzej Siewior Cc: linux-rt-users Signed-off-by: Thomas Gleixner --- - drivers/gpu/drm/i915/i915_irq.c | 2 ++ - drivers/gpu/drm/radeon/radeon_display.c | 2 ++ + drivers/gpu/drm/i915/i915_irq.c | 2 ++ + drivers/gpu/drm/radeon/radeon_display.c | 2 ++ 2 files changed, 4 insertions(+) +diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c +index b63893eeca73..78f86d4fba2f 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c -@@ -867,6 +867,7 @@ static bool i915_get_crtc_scanoutpos(str +@@ -867,6 +867,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ @@ -23,7 +27,7 @@ Signed-off-by: Thomas Gleixner /* Get optional system timestamp before query. */ if (stime) -@@ -918,6 +919,7 @@ static bool i915_get_crtc_scanoutpos(str +@@ -918,6 +919,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, *etime = ktime_get(); /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ @@ -31,9 +35,11 @@ Signed-off-by: Thomas Gleixner 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 ddfe91efa61e..3157bcf6428f 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c -@@ -1839,6 +1839,7 @@ int radeon_get_crtc_scanoutpos(struct dr +@@ -1839,6 +1839,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. */ @@ -41,7 +47,7 @@ Signed-off-by: Thomas Gleixner /* Get optional system timestamp before query. */ if (stime) -@@ -1931,6 +1932,7 @@ int radeon_get_crtc_scanoutpos(struct dr +@@ -1931,6 +1932,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. */ @@ -49,3 +55,6 @@ Signed-off-by: Thomas Gleixner /* Decode into vertical and horizontal scanout position. */ *vpos = position & 0x1fff; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0403-drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch b/kernel/patches-4.14.x-rt/0403-0403-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0403-drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch rename to kernel/patches-4.14.x-rt/0403-0403-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch index 9b8583a4f..bb87df48a 100644 --- a/kernel/patches-4.14.x-rt/0403-drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch +++ b/kernel/patches-4.14.x-rt/0403-0403-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch @@ -1,7 +1,8 @@ -Subject: drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end() +From 6f0d16eed6c75fed003708bd20642e258421b029 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sat, 27 Feb 2016 09:01:42 +0100 - +Subject: [PATCH 403/414] 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 [ 8.014041] in_atomic(): 0, irqs_disabled(): 1, pid: 78, name: kworker/u4:4 @@ -56,9 +57,11 @@ Cc: Sebastian Andrzej Siewior Cc: linux-rt-users Signed-off-by: Thomas Gleixner --- - drivers/gpu/drm/i915/intel_sprite.c | 11 ++++++----- + drivers/gpu/drm/i915/intel_sprite.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) +diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c +index 41e31a454604..7e0cadf51b31 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -36,6 +36,7 @@ @@ -69,7 +72,7 @@ Signed-off-by: Thomas Gleixner #include "intel_drv.h" #include "intel_frontbuffer.h" #include -@@ -67,7 +68,7 @@ int intel_usecs_to_scanlines(const struc +@@ -67,7 +68,7 @@ int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode, } #define VBLANK_EVASION_TIME_US 100 @@ -78,7 +81,7 @@ Signed-off-by: Thomas Gleixner /** * intel_pipe_update_start() - start update of a set of display registers * @crtc: the crtc of which the registers are going to be updated -@@ -102,7 +103,7 @@ void intel_pipe_update_start(struct inte +@@ -102,7 +103,7 @@ void intel_pipe_update_start(struct intel_crtc *crtc) VBLANK_EVASION_TIME_US); max = vblank_start - 1; @@ -87,7 +90,7 @@ Signed-off-by: Thomas Gleixner if (min <= 0 || max <= 0) return; -@@ -132,11 +133,11 @@ void intel_pipe_update_start(struct inte +@@ -132,11 +133,11 @@ void intel_pipe_update_start(struct intel_crtc *crtc) break; } @@ -101,7 +104,7 @@ Signed-off-by: Thomas Gleixner } finish_wait(wq, &wait); -@@ -201,7 +202,7 @@ void intel_pipe_update_end(struct intel_ +@@ -201,7 +202,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc) crtc->base.state->event = NULL; } @@ -110,3 +113,6 @@ Signed-off-by: Thomas Gleixner if (intel_vgpu_active(dev_priv)) return; +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0404-cgroups-use-simple-wait-in-css_release.patch b/kernel/patches-4.14.x-rt/0404-0404-cgroups-use-simple-wait-in-css_release.patch similarity index 85% rename from kernel/patches-4.14.x-rt/0404-cgroups-use-simple-wait-in-css_release.patch rename to kernel/patches-4.14.x-rt/0404-0404-cgroups-use-simple-wait-in-css_release.patch index f44dd7145..eb603e2e7 100644 --- a/kernel/patches-4.14.x-rt/0404-cgroups-use-simple-wait-in-css_release.patch +++ b/kernel/patches-4.14.x-rt/0404-0404-cgroups-use-simple-wait-in-css_release.patch @@ -1,6 +1,7 @@ +From 656a7d61286664379bcc2cbcfa4522acecebf2ea Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 15:52:24 +0100 -Subject: cgroups: use simple wait in css_release() +Subject: [PATCH 404/414] cgroups: use simple wait in css_release() To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 @@ -28,10 +29,12 @@ To avoid: Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/cgroup-defs.h | 2 ++ - kernel/cgroup/cgroup.c | 9 +++++---- + include/linux/cgroup-defs.h | 2 ++ + kernel/cgroup/cgroup.c | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) +diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h +index 4e8f77504a57..8155c26315b7 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -19,6 +19,7 @@ @@ -50,9 +53,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* * PI: the parent css. Placed here for cache proximity to following +diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c +index 76c0ef2cb509..cfa3505f2b3b 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -4508,10 +4508,10 @@ static void css_free_rcu_fn(struct rcu_h +@@ -4508,10 +4508,10 @@ static void css_free_rcu_fn(struct rcu_head *rcu_head) queue_work(cgroup_destroy_wq, &css->destroy_work); } @@ -65,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct cgroup_subsys *ss = css->ss; struct cgroup *cgrp = css->cgroup; -@@ -4562,8 +4562,8 @@ static void css_release(struct percpu_re +@@ -4562,8 +4562,8 @@ static void css_release(struct percpu_ref *ref) struct cgroup_subsys_state *css = container_of(ref, struct cgroup_subsys_state, refcnt); @@ -84,3 +89,6 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } core_initcall(cgroup_wq_init); +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0405-cgroups-scheduling-while-atomic-in-cgroup-code.patch b/kernel/patches-4.14.x-rt/0405-0405-memcontrol-Prevent-scheduling-while-atomic-in-cgroup.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0405-cgroups-scheduling-while-atomic-in-cgroup-code.patch rename to kernel/patches-4.14.x-rt/0405-0405-memcontrol-Prevent-scheduling-while-atomic-in-cgroup.patch index 8bf4ffaa1..e8e0add59 100644 --- a/kernel/patches-4.14.x-rt/0405-cgroups-scheduling-while-atomic-in-cgroup-code.patch +++ b/kernel/patches-4.14.x-rt/0405-0405-memcontrol-Prevent-scheduling-while-atomic-in-cgroup.patch @@ -1,6 +1,8 @@ +From 21233f953d4c583ab75d8fb7a2050a1d6620bffd Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sat, 21 Jun 2014 10:09:48 +0200 -Subject: memcontrol: Prevent scheduling while atomic in cgroup code +Subject: [PATCH 405/414] memcontrol: Prevent scheduling while atomic in cgroup + code mm, memcg: make refill_stock() use get_cpu_light() @@ -37,9 +39,11 @@ Signed-off-by: Mike Galbraith [bigeasy: use memcg_stock_ll as a locallock since it is now IRQ-off region] Signed-off-by: Sebastian Andrzej Siewior --- - mm/memcontrol.c | 13 +++++++------ + mm/memcontrol.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index b2fb2903137e..325a6b702688 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1723,6 +1723,7 @@ struct memcg_stock_pcp { @@ -50,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior static DEFINE_MUTEX(percpu_charge_mutex); /** -@@ -1745,7 +1746,7 @@ static bool consume_stock(struct mem_cgr +@@ -1745,7 +1746,7 @@ static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) if (nr_pages > CHARGE_BATCH) return ret; @@ -59,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior stock = this_cpu_ptr(&memcg_stock); if (memcg == stock->cached && stock->nr_pages >= nr_pages) { -@@ -1753,7 +1754,7 @@ static bool consume_stock(struct mem_cgr +@@ -1753,7 +1754,7 @@ static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) ret = true; } @@ -68,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -1784,13 +1785,13 @@ static void drain_local_stock(struct wor +@@ -1784,13 +1785,13 @@ static void drain_local_stock(struct work_struct *dummy) * The only protection from memory hotplug vs. drain_stock races is * that we always operate on local CPU stock here with IRQ disabled */ @@ -84,7 +88,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -1802,7 +1803,7 @@ static void refill_stock(struct mem_cgro +@@ -1802,7 +1803,7 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) struct memcg_stock_pcp *stock; unsigned long flags; @@ -93,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior stock = this_cpu_ptr(&memcg_stock); if (stock->cached != memcg) { /* reset if necessary */ -@@ -1814,7 +1815,7 @@ static void refill_stock(struct mem_cgro +@@ -1814,7 +1815,7 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) if (stock->nr_pages > CHARGE_BATCH) drain_stock(stock); @@ -102,3 +106,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0406-Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch b/kernel/patches-4.14.x-rt/0406-0406-Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0406-Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch rename to kernel/patches-4.14.x-rt/0406-0406-Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch index eadbbd252..44d62f29f 100644 --- a/kernel/patches-4.14.x-rt/0406-Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch +++ b/kernel/patches-4.14.x-rt/0406-0406-Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch @@ -1,7 +1,8 @@ +From 11a553a1afd9ef106c890a84248644664efb4556 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" Date: Wed, 22 Nov 2017 07:31:19 -0500 -Subject: [PATCH] Revert "memcontrol: Prevent scheduling while atomic in cgroup - code" +Subject: [PATCH 406/414] Revert "memcontrol: Prevent scheduling while atomic + in cgroup code" The commit "memcontrol: Prevent scheduling while atomic in cgroup code" fixed this issue: @@ -33,9 +34,11 @@ Signed-off-by: Steven Rostedt (VMware) ] Signed-off-by: Sebastian Andrzej Siewior --- - mm/memcontrol.c | 13 ++++++------- + mm/memcontrol.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index 325a6b702688..b2fb2903137e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1723,7 +1723,6 @@ struct memcg_stock_pcp { @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior static DEFINE_MUTEX(percpu_charge_mutex); /** -@@ -1746,7 +1745,7 @@ static bool consume_stock(struct mem_cgr +@@ -1746,7 +1745,7 @@ static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) if (nr_pages > CHARGE_BATCH) return ret; @@ -55,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior stock = this_cpu_ptr(&memcg_stock); if (memcg == stock->cached && stock->nr_pages >= nr_pages) { -@@ -1754,7 +1753,7 @@ static bool consume_stock(struct mem_cgr +@@ -1754,7 +1753,7 @@ static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) ret = true; } @@ -64,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -1785,13 +1784,13 @@ static void drain_local_stock(struct wor +@@ -1785,13 +1784,13 @@ static void drain_local_stock(struct work_struct *dummy) * The only protection from memory hotplug vs. drain_stock races is * that we always operate on local CPU stock here with IRQ disabled */ @@ -80,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -1803,7 +1802,7 @@ static void refill_stock(struct mem_cgro +@@ -1803,7 +1802,7 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) struct memcg_stock_pcp *stock; unsigned long flags; @@ -89,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior stock = this_cpu_ptr(&memcg_stock); if (stock->cached != memcg) { /* reset if necessary */ -@@ -1815,7 +1814,7 @@ static void refill_stock(struct mem_cgro +@@ -1815,7 +1814,7 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) if (stock->nr_pages > CHARGE_BATCH) drain_stock(stock); @@ -98,3 +101,6 @@ Signed-off-by: Sebastian Andrzej Siewior } /* +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0407-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/kernel/patches-4.14.x-rt/0407-0407-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch similarity index 87% rename from kernel/patches-4.14.x-rt/0407-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch rename to kernel/patches-4.14.x-rt/0407-0407-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index 821fb08d6..38bdfc430 100644 --- a/kernel/patches-4.14.x-rt/0407-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/kernel/patches-4.14.x-rt/0407-0407-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,6 +1,7 @@ +From 9afd87a6135a234daae35c8e97775162f3da7a24 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Sun, 8 Jan 2017 09:32:25 +0100 -Subject: [PATCH] cpuset: Convert callback_lock to raw_spinlock_t +Subject: [PATCH 407/414] cpuset: Convert callback_lock to raw_spinlock_t The two commits below add up to a cpuset might_sleep() splat for RT: @@ -45,9 +46,11 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - kernel/cgroup/cpuset.c | 66 ++++++++++++++++++++++++------------------------- + kernel/cgroup/cpuset.c | 66 +++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) +diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c +index 7bb7384b543a..bda2af78277a 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -288,7 +288,7 @@ static struct cpuset top_cpuset = { @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct workqueue_struct *cpuset_migrate_mm_wq; -@@ -926,9 +926,9 @@ static void update_cpumasks_hier(struct +@@ -926,9 +926,9 @@ static void update_cpumasks_hier(struct cpuset *cs, struct cpumask *new_cpus) continue; rcu_read_unlock(); @@ -71,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior WARN_ON(!is_in_v2_mode() && !cpumask_equal(cp->cpus_allowed, cp->effective_cpus)); -@@ -993,9 +993,9 @@ static int update_cpumask(struct cpuset +@@ -993,9 +993,9 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, if (retval < 0) return retval; @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* use trialcs->cpus_allowed as a temp variable */ update_cpumasks_hier(cs, trialcs->cpus_allowed); -@@ -1179,9 +1179,9 @@ static void update_nodemasks_hier(struct +@@ -1179,9 +1179,9 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems) continue; rcu_read_unlock(); @@ -95,7 +98,7 @@ Signed-off-by: Sebastian Andrzej Siewior WARN_ON(!is_in_v2_mode() && !nodes_equal(cp->mems_allowed, cp->effective_mems)); -@@ -1249,9 +1249,9 @@ static int update_nodemask(struct cpuset +@@ -1249,9 +1249,9 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, if (retval < 0) goto done; @@ -107,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* use trialcs->mems_allowed as a temp variable */ update_nodemasks_hier(cs, &trialcs->mems_allowed); -@@ -1342,9 +1342,9 @@ static int update_flag(cpuset_flagbits_t +@@ -1342,9 +1342,9 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, spread_flag_changed = ((is_spread_slab(cs) != is_spread_slab(trialcs)) || (is_spread_page(cs) != is_spread_page(trialcs))); @@ -119,7 +122,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!cpumask_empty(trialcs->cpus_allowed) && balance_flag_changed) rebuild_sched_domains_locked(); -@@ -1759,7 +1759,7 @@ static int cpuset_common_seq_show(struct +@@ -1759,7 +1759,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) cpuset_filetype_t type = seq_cft(sf)->private; int ret = 0; @@ -128,7 +131,7 @@ Signed-off-by: Sebastian Andrzej Siewior switch (type) { case FILE_CPULIST: -@@ -1778,7 +1778,7 @@ static int cpuset_common_seq_show(struct +@@ -1778,7 +1778,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) ret = -EINVAL; } @@ -137,7 +140,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -1993,12 +1993,12 @@ static int cpuset_css_online(struct cgro +@@ -1993,12 +1993,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) cpuset_inc(); @@ -152,7 +155,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags)) goto out_unlock; -@@ -2025,12 +2025,12 @@ static int cpuset_css_online(struct cgro +@@ -2025,12 +2025,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) } rcu_read_unlock(); @@ -167,7 +170,7 @@ Signed-off-by: Sebastian Andrzej Siewior out_unlock: mutex_unlock(&cpuset_mutex); return 0; -@@ -2069,7 +2069,7 @@ static void cpuset_css_free(struct cgrou +@@ -2069,7 +2069,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css) static void cpuset_bind(struct cgroup_subsys_state *root_css) { mutex_lock(&cpuset_mutex); @@ -176,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (is_in_v2_mode()) { cpumask_copy(top_cpuset.cpus_allowed, cpu_possible_mask); -@@ -2080,7 +2080,7 @@ static void cpuset_bind(struct cgroup_su +@@ -2080,7 +2080,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) top_cpuset.mems_allowed = top_cpuset.effective_mems; } @@ -185,7 +188,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_unlock(&cpuset_mutex); } -@@ -2178,12 +2178,12 @@ hotplug_update_tasks_legacy(struct cpuse +@@ -2178,12 +2178,12 @@ hotplug_update_tasks_legacy(struct cpuset *cs, { bool is_empty; @@ -213,7 +216,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (cpus_updated) update_tasks_cpumask(cs); -@@ -2316,21 +2316,21 @@ static void cpuset_hotplug_workfn(struct +@@ -2316,21 +2316,21 @@ static void cpuset_hotplug_workfn(struct work_struct *work) /* synchronize cpus_allowed to cpu_active_mask */ if (cpus_updated) { @@ -239,7 +242,7 @@ Signed-off-by: Sebastian Andrzej Siewior update_tasks_nodemask(&top_cpuset); } -@@ -2429,11 +2429,11 @@ void cpuset_cpus_allowed(struct task_str +@@ -2429,11 +2429,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) { unsigned long flags; @@ -253,7 +256,7 @@ Signed-off-by: Sebastian Andrzej Siewior } void cpuset_cpus_allowed_fallback(struct task_struct *tsk) -@@ -2481,11 +2481,11 @@ nodemask_t cpuset_mems_allowed(struct ta +@@ -2481,11 +2481,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk) nodemask_t mask; unsigned long flags; @@ -267,7 +270,7 @@ Signed-off-by: Sebastian Andrzej Siewior return mask; } -@@ -2577,14 +2577,14 @@ bool __cpuset_node_allowed(int node, gfp +@@ -2577,14 +2577,14 @@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask) return true; /* Not hardwall and node outside mems_allowed: scan up cpusets */ @@ -284,3 +287,6 @@ Signed-off-by: Sebastian Andrzej Siewior return allowed; } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0408-move_sched_delayed_work_to_helper.patch b/kernel/patches-4.14.x-rt/0408-0408-rt-ntp-Move-call-to-schedule_delayed_work-to-helper-.patch similarity index 83% rename from kernel/patches-4.14.x-rt/0408-move_sched_delayed_work_to_helper.patch rename to kernel/patches-4.14.x-rt/0408-0408-rt-ntp-Move-call-to-schedule_delayed_work-to-helper-.patch index 29b2b852e..f2a759517 100644 --- a/kernel/patches-4.14.x-rt/0408-move_sched_delayed_work_to_helper.patch +++ b/kernel/patches-4.14.x-rt/0408-0408-rt-ntp-Move-call-to-schedule_delayed_work-to-helper-.patch @@ -1,6 +1,8 @@ -Date: Wed, 26 Jun 2013 15:28:11 -0400 +From f5ba4db7166bc5e7e3e1690b121ee9ae07147ee1 Mon Sep 17 00:00:00 2001 From: Steven Rostedt -Subject: rt,ntp: Move call to schedule_delayed_work() to helper thread +Date: Wed, 26 Jun 2013 15:28:11 -0400 +Subject: [PATCH 408/414] rt,ntp: Move call to schedule_delayed_work() to + helper thread The ntp code for notify_cmos_timer() is called from a hard interrupt context. schedule_delayed_work() under PREEMPT_RT_FULL calls spinlocks @@ -21,9 +23,11 @@ Signed-off-by: Steven Rostedt [bigeasy: use swork_queue() instead a helper thread] Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/ntp.c | 26 ++++++++++++++++++++++++++ + kernel/time/ntp.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) +diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c +index 99e03bec68e4..2c226b90c231 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -18,6 +18,7 @@ @@ -34,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "ntp_internal.h" #include "timekeeping_internal.h" -@@ -569,10 +570,35 @@ static void sync_cmos_clock(struct work_ +@@ -569,10 +570,35 @@ static void sync_cmos_clock(struct work_struct *work) &sync_cmos_work, timespec64_to_jiffies(&next)); } @@ -70,3 +74,6 @@ Signed-off-by: Sebastian Andrzej Siewior #else void ntp_notify_cmos_timer(void) { } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0409-Revert-rt-ntp-Move-call-to-schedule_delayed_work-to-.patch b/kernel/patches-4.14.x-rt/0409-0409-Revert-rt-ntp-Move-call-to-schedule_delayed_work-to-.patch similarity index 80% rename from kernel/patches-4.14.x-rt/0409-Revert-rt-ntp-Move-call-to-schedule_delayed_work-to-.patch rename to kernel/patches-4.14.x-rt/0409-0409-Revert-rt-ntp-Move-call-to-schedule_delayed_work-to-.patch index 967d8a561..bc66a3817 100644 --- a/kernel/patches-4.14.x-rt/0409-Revert-rt-ntp-Move-call-to-schedule_delayed_work-to-.patch +++ b/kernel/patches-4.14.x-rt/0409-0409-Revert-rt-ntp-Move-call-to-schedule_delayed_work-to-.patch @@ -1,7 +1,8 @@ +From 7e07cab1bb10cb2dddecafdcd248e67e168fbf46 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Fri, 2 Mar 2018 11:37:57 +0100 -Subject: Revert "rt,ntp: Move call to schedule_delayed_work() to - helper thread" +Subject: [PATCH 409/414] Revert "rt,ntp: Move call to schedule_delayed_work() + to helper thread" I've been looking at this in v3.10-RT where it got in. The patch description says @@ -20,9 +21,11 @@ Reverting the patch. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- - kernel/time/ntp.c | 26 -------------------------- + kernel/time/ntp.c | 26 -------------------------- 1 file changed, 26 deletions(-) +diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c +index 2c226b90c231..99e03bec68e4 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -18,7 +18,6 @@ @@ -33,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "ntp_internal.h" #include "timekeeping_internal.h" -@@ -570,35 +569,10 @@ static void sync_cmos_clock(struct work_ +@@ -570,35 +569,10 @@ static void sync_cmos_clock(struct work_struct *work) &sync_cmos_work, timespec64_to_jiffies(&next)); } @@ -69,3 +72,6 @@ Signed-off-by: Sebastian Andrzej Siewior #else void ntp_notify_cmos_timer(void) { } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0410-md-disable-bcache.patch b/kernel/patches-4.14.x-rt/0410-0410-md-disable-bcache.patch similarity index 75% rename from kernel/patches-4.14.x-rt/0410-md-disable-bcache.patch rename to kernel/patches-4.14.x-rt/0410-0410-md-disable-bcache.patch index fdfe59336..b0cfe04f6 100644 --- a/kernel/patches-4.14.x-rt/0410-md-disable-bcache.patch +++ b/kernel/patches-4.14.x-rt/0410-0410-md-disable-bcache.patch @@ -1,6 +1,10 @@ +From 44d90ce07aab86a74bf6dab84f99da53fbc46c42 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 11:48:57 +0200 -Subject: md: disable bcache +Subject: [PATCH 410/414] md: disable bcache +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit It uses anon semaphores |drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’: @@ -16,9 +20,11 @@ either we get rid of those or we have to introduce them… Signed-off-by: Sebastian Andrzej Siewior --- - drivers/md/bcache/Kconfig | 1 + + drivers/md/bcache/Kconfig | 1 + 1 file changed, 1 insertion(+) +diff --git a/drivers/md/bcache/Kconfig b/drivers/md/bcache/Kconfig +index 4d200883c505..98b64ed5cb81 100644 --- a/drivers/md/bcache/Kconfig +++ b/drivers/md/bcache/Kconfig @@ -1,6 +1,7 @@ @@ -29,3 +35,6 @@ Signed-off-by: Sebastian Andrzej Siewior ---help--- Allows a block device to be used as cache for other devices; uses a btree for indexing and the layout is optimized for SSDs. +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0411-apparmor-use-a-locallock-instead-preempt_disable.patch b/kernel/patches-4.14.x-rt/0411-0411-apparmor-use-a-locallock-instead-preempt_disable.patch similarity index 77% rename from kernel/patches-4.14.x-rt/0411-apparmor-use-a-locallock-instead-preempt_disable.patch rename to kernel/patches-4.14.x-rt/0411-0411-apparmor-use-a-locallock-instead-preempt_disable.patch index b3d8f2cca..afb3ed438 100644 --- a/kernel/patches-4.14.x-rt/0411-apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/kernel/patches-4.14.x-rt/0411-0411-apparmor-use-a-locallock-instead-preempt_disable.patch @@ -1,6 +1,7 @@ +From affbcba2a6b297ac5fdcef095f08b2c85ee92ac4 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 11 Oct 2017 17:43:49 +0200 -Subject: apparmor: use a locallock instead preempt_disable() +Subject: [PATCH 411/414] 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 @@ -9,10 +10,12 @@ than one user within the critical section. Signed-off-by: Sebastian Andrzej Siewior --- - security/apparmor/include/path.h | 21 +++++++++++++++++---- - security/apparmor/lsm.c | 2 +- + security/apparmor/include/path.h | 21 +++++++++++++++++---- + security/apparmor/lsm.c | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) +diff --git a/security/apparmor/include/path.h b/security/apparmor/include/path.h +index 05fb3305671e..b26c16b02662 100644 --- a/security/apparmor/include/path.h +++ b/security/apparmor/include/path.h @@ -39,9 +39,10 @@ struct aa_buffers { @@ -27,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior #define COUNT_ARGS(X...) COUNT_ARGS_HELPER(, ##X, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) #define COUNT_ARGS_HELPER(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, n, X...) n -@@ -55,12 +56,24 @@ DECLARE_PER_CPU(struct aa_buffers, aa_bu +@@ -55,12 +56,24 @@ DECLARE_PER_CPU(struct aa_buffers, aa_buffers); #define for_each_cpu_buffer(I) for ((I) = 0; (I) < MAX_PATH_BUFFERS; (I)++) @@ -53,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior #define __get_buffer(N) ({ \ struct aa_buffers *__cpu_var; \ AA_BUG_PREEMPT_ENABLED("__get_buffer without preempt disabled"); \ -@@ -73,14 +86,14 @@ DECLARE_PER_CPU(struct aa_buffers, aa_bu +@@ -73,14 +86,14 @@ DECLARE_PER_CPU(struct aa_buffers, aa_buffers); #define get_buffers(X...) \ do { \ @@ -70,6 +73,8 @@ Signed-off-by: Sebastian Andrzej Siewior } while (0) #endif /* __AA_PATH_H */ +diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c +index 1346ee5be04f..aa7e4dee107b 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -44,7 +44,7 @@ @@ -81,3 +86,6 @@ Signed-off-by: Sebastian Andrzej Siewior /* * LSM hook functions +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0412-workqueue-prevent-deadlock-stall.patch b/kernel/patches-4.14.x-rt/0412-0412-workqueue-Prevent-deadlock-stall-on-RT.patch similarity index 84% rename from kernel/patches-4.14.x-rt/0412-workqueue-prevent-deadlock-stall.patch rename to kernel/patches-4.14.x-rt/0412-0412-workqueue-Prevent-deadlock-stall-on-RT.patch index 74d79e9a1..b05e68751 100644 --- a/kernel/patches-4.14.x-rt/0412-workqueue-prevent-deadlock-stall.patch +++ b/kernel/patches-4.14.x-rt/0412-0412-workqueue-Prevent-deadlock-stall-on-RT.patch @@ -1,6 +1,7 @@ -Subject: workqueue: Prevent deadlock/stall on RT +From 4990d9b7df490a978da681368b9df34ad2608141 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner -Date: Fri, 27 Jun 2014 16:24:52 +0200 (CEST) +Date: Fri, 27 Jun 2014 16:24:52 +0200 +Subject: [PATCH 412/414] 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. @@ -35,12 +36,13 @@ Signed-off-by: Thomas Gleixner Link: http://vger.kernel.org/r/alpine.DEB.2.10.1406271249510.5170@nanos Cc: Richard Weinberger Cc: Steven Rostedt - --- - kernel/sched/core.c | 7 ++++-- - kernel/workqueue.c | 60 ++++++++++++++++++++++++++++++++++++++++------------ + kernel/sched/core.c | 7 ++++-- + kernel/workqueue.c | 60 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 52 insertions(+), 15 deletions(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 6387a157fb41..310256350540 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3475,9 +3475,8 @@ void __noreturn do_task_dead(void) @@ -54,7 +56,7 @@ Cc: Steven Rostedt /* * If a worker went to sleep, notify and ask workqueue whether * it wants to wake up a task to maintain concurrency. -@@ -3485,6 +3484,10 @@ static inline void sched_submit_work(str +@@ -3485,6 +3484,10 @@ static inline void sched_submit_work(struct task_struct *tsk) if (tsk->flags & PF_WQ_WORKER) wq_worker_sleeping(tsk); @@ -65,6 +67,8 @@ Cc: Steven Rostedt /* * 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 a02ce94e5871..e4ae52492a51 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -125,6 +125,11 @@ enum { @@ -79,7 +83,7 @@ Cc: Steven Rostedt * A: pool->attach_mutex protected. * * PL: wq_pool_mutex protected. -@@ -432,6 +437,31 @@ static void workqueue_sysfs_unregister(s +@@ -432,6 +437,31 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \ else @@ -111,7 +115,7 @@ Cc: Steven Rostedt #ifdef CONFIG_DEBUG_OBJECTS_WORK static struct debug_obj_descr work_debug_descr; -@@ -838,10 +868,16 @@ static struct worker *first_idle_worker( +@@ -838,10 +868,16 @@ static struct worker *first_idle_worker(struct worker_pool *pool) */ static void wake_up_worker(struct worker_pool *pool) { @@ -129,7 +133,7 @@ Cc: Steven Rostedt } /** -@@ -870,7 +906,7 @@ void wq_worker_running(struct task_struc +@@ -870,7 +906,7 @@ void wq_worker_running(struct task_struct *task) */ void wq_worker_sleeping(struct task_struct *task) { @@ -138,7 +142,7 @@ Cc: Steven Rostedt struct worker_pool *pool; /* -@@ -887,26 +923,18 @@ void wq_worker_sleeping(struct task_stru +@@ -887,26 +923,18 @@ void wq_worker_sleeping(struct task_struct *task) return; worker->sleeping = 1; @@ -168,7 +172,7 @@ Cc: Steven Rostedt } /** -@@ -1637,7 +1665,9 @@ static void worker_enter_idle(struct wor +@@ -1637,7 +1665,9 @@ static void worker_enter_idle(struct worker *worker) worker->last_active = jiffies; /* idle_list is LIFO */ @@ -178,7 +182,7 @@ Cc: Steven Rostedt if (too_many_workers(pool) && !timer_pending(&pool->idle_timer)) mod_timer(&pool->idle_timer, jiffies + IDLE_WORKER_TIMEOUT); -@@ -1670,7 +1700,9 @@ static void worker_leave_idle(struct wor +@@ -1670,7 +1700,9 @@ static void worker_leave_idle(struct worker *worker) return; worker_clr_flags(worker, WORKER_IDLE); pool->nr_idle--; @@ -188,7 +192,7 @@ Cc: Steven Rostedt } static struct worker *alloc_worker(int node) -@@ -1836,7 +1868,9 @@ static void destroy_worker(struct worker +@@ -1836,7 +1868,9 @@ static void destroy_worker(struct worker *worker) pool->nr_workers--; pool->nr_idle--; @@ -198,3 +202,6 @@ Cc: Steven Rostedt worker->flags |= WORKER_DIE; wake_up_process(worker->task); } +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0413-0413-Add-localversion-for-RT-release.patch b/kernel/patches-4.14.x-rt/0413-0413-Add-localversion-for-RT-release.patch new file mode 100644 index 000000000..ad0418376 --- /dev/null +++ b/kernel/patches-4.14.x-rt/0413-0413-Add-localversion-for-RT-release.patch @@ -0,0 +1,21 @@ +From c4b11b37243218d9e977d9a42d5064ffba5f9c9c Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Fri, 8 Jul 2011 20:25:16 +0200 +Subject: [PATCH 413/414] Add localversion for -RT release + +Signed-off-by: Thomas Gleixner +--- + localversion-rt | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 localversion-rt + +diff --git a/localversion-rt b/localversion-rt +new file mode 100644 +index 000000000000..90290c642ed5 +--- /dev/null ++++ b/localversion-rt +@@ -0,0 +1 @@ ++-rt29 +-- +2.17.0 + diff --git a/kernel/patches-4.14.x-rt/0413-localversion.patch b/kernel/patches-4.14.x-rt/0413-localversion.patch deleted file mode 100644 index 20f03714e..000000000 --- a/kernel/patches-4.14.x-rt/0413-localversion.patch +++ /dev/null @@ -1,13 +0,0 @@ -Subject: Add localversion for -RT release -From: Thomas Gleixner -Date: Fri, 08 Jul 2011 20:25:16 +0200 - -Signed-off-by: Thomas Gleixner ---- - localversion-rt | 1 + - 1 file changed, 1 insertion(+) - ---- /dev/null -+++ b/localversion-rt -@@ -0,0 +1 @@ -+-rt29 diff --git a/kernel/patches-4.14.x-rt/0414-0414-Linux-4.14.40-rt30-REBASE.patch b/kernel/patches-4.14.x-rt/0414-0414-Linux-4.14.40-rt30-REBASE.patch new file mode 100644 index 000000000..05626b753 --- /dev/null +++ b/kernel/patches-4.14.x-rt/0414-0414-Linux-4.14.40-rt30-REBASE.patch @@ -0,0 +1,19 @@ +From 10a87e7fb2bb7bf20af50a4fa11e60ead439e2f5 Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Mon, 14 May 2018 12:48:00 -0400 +Subject: [PATCH 414/414] Linux 4.14.40-rt30 REBASE + +--- + localversion-rt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/localversion-rt b/localversion-rt +index 90290c642ed5..b72862e06be4 100644 +--- a/localversion-rt ++++ b/localversion-rt +@@ -1 +1 @@ +--rt29 ++-rt30 +-- +2.17.0 +