From 3de433a3b1667c7223702fb9e3e81e424cdaedcb Mon Sep 17 00:00:00 2001 From: "Martin, Chen" Date: Tue, 18 Dec 2018 12:38:07 +0800 Subject: [PATCH] rebase rt kernel patch to CentOS7.6 3.10.0-957.1.3 timer-Reduce-timer-migration-overhead-if-disabled.patch timer-Minimize-nohz-off-overhead.patch two patches already included in upgraded kernel remove description in meta patch. fix compile error in drbd_req.c for improper usage of request queue API; fix warning in kernel/bpf/core.c for implicit declaration trace call for CFLAG -Werror-implicit-function-declaration. remove patch change is_swiotlb_buffer in lib/swiotlb.c As change already in new kernel code. explicitly disable three config, CONFIG_TORTURE_TEST=n, CONFIG_RCU_TORTURE_TEST=n, CONFIG_LOCK_TORTURE_TEST=n. As torture.c, locktorture.c, rcutorture.c are introduced by new kernel release, which request CONFIG_PERCPU_RWSEM be enabled. But config file generated by merge kernel-3.10.0-x86_64-rt.config in source rpm and kernel-3.10.0-x86_64-rt.config.tis_extra in meta_patch, disable CONFIG_PERCPU_RWSEM, which makes build error with "undefined symbol". These three file are built to generate one module for one upper layer torture test tool, so explicitly disable these config. Depends-On: https://review.openstack.org/625773/ Story: 2004521 Task: 28352 Change-Id: I0f7e7db51aa38e98eae1219196a926ed8fc1b152 Signed-off-by: Martin, Chen Signed-off-by: Shuicheng Lin --- kernel/kernel-rt/centos/build_srpm.data | 2 +- .../Build-logic-and-sources-for-TiC.patch | 20 +- .../centos/meta_patches/Compile-issues.patch | 17 +- .../Kernel-source-patches-for-TiC.patch | 20 +- ...rqs-and-workqueues-with-kthread_cpus.patch | 6 +- ...do-not-cache-fib-route-info-on-local.patch | 2 +- ...xpose-pm_qos_resume_latency-for-CPUs.patch | 6 +- ...e-kernel-start-eth-devices-at-offset.patch | 2 +- ...tion-of-death-of-arbitrary-processes.patch | 16 +- ...d-ACS-quirk-for-Intel-Fortville-NICs.patch | 2 +- ...orting-Cacheinfo-from-Kernel-4.10.17.patch | 25 +- ...01216-IMA-support-in-Titanium-kernel.patch | 17 +- .../US103091-IMA-System-Configuration.patch | 2 +- .../affine-compute-kernel-threads.patch | 8 +- ...t-specifier-for-cma-kernel-parameter.patch | 4 +- .../centos/patches/debrand-single-cpu.patch | 2 +- ...fix-CentOS-7.6-upgrade-compile-error.patch | 67 +++ ...w-ignoring-Ethernet-device-RMRR-with.patch | 8 +- .../kernel-3.10.0-x86_64-rt.config.tis_extra | 5 + ...block-introduce-memblock_alloc_range.patch | 2 +- ...-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch | 2 +- ...kthreads-to-CPUs-in-cpu_kthread_mask.patch | 2 +- .../timer-Minimize-nohz-off-overhead.patch | 168 ------ ...timer-migration-overhead-if-disabled.patch | 533 ------------------ ...rn-off-write-same-in-smartqpi-driver.patch | 2 +- .../x86-enable-DMA-CMA-with-swiotlb.patch | 30 +- kernel/kernel-rt/centos/srpm_path | 2 +- 27 files changed, 159 insertions(+), 813 deletions(-) create mode 100644 kernel/kernel-rt/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch delete mode 100644 kernel/kernel-rt/centos/patches/timer-Minimize-nohz-off-overhead.patch delete mode 100644 kernel/kernel-rt/centos/patches/timer-Reduce-timer-migration-overhead-if-disabled.patch diff --git a/kernel/kernel-rt/centos/build_srpm.data b/kernel/kernel-rt/centos/build_srpm.data index ae352ddf0..c06f85d68 100644 --- a/kernel/kernel-rt/centos/build_srpm.data +++ b/kernel/kernel-rt/centos/build_srpm.data @@ -1,4 +1,4 @@ COPY_LIST="files/*" -TIS_PATCH_VER=43 +TIS_PATCH_VER=1 BUILD_IS_BIG=11 BUILD_IS_SLOW=12 diff --git a/kernel/kernel-rt/centos/meta_patches/Build-logic-and-sources-for-TiC.patch b/kernel/kernel-rt/centos/meta_patches/Build-logic-and-sources-for-TiC.patch index 457842310..e1c996480 100644 --- a/kernel/kernel-rt/centos/meta_patches/Build-logic-and-sources-for-TiC.patch +++ b/kernel/kernel-rt/centos/meta_patches/Build-logic-and-sources-for-TiC.patch @@ -282,10 +282,10 @@ index c05b910..dfbbe1f 100644 mv $i .config Arch=`head -1 .config | cut -b 3-` + -+ # Handle Titanium Cloud customizations. Use -n to match oldnoconfig below. We want this before ++ # Handle StarlingX Cloud customizations. Use -n to match oldnoconfig below. We want this before + # the make line below so that the one below removes any dependencies of ones that we + # turn off here. We also want it before "make listnewconfig" so that we can set the -+ # config option for new configs introduced in the Titanium Cloud patches. ++ # config option for new configs introduced in the StarlingX Cloud patches. + if [ -f ${i}.tis_extra ]; then + scripts/kconfig/merge_config.sh -m -n .config ${i}.tis_extra + fi @@ -313,9 +313,9 @@ index c05b910..dfbbe1f 100644 cp signing_key.priv signing_key.priv.sign${Flavour:+.${Flavour}} cp signing_key.x509 signing_key.x509.sign${Flavour:+.${Flavour}} -+ # WRS: Copy these keys as part of the devel package ++ # STX: Copy these keys as part of the devel package + # The Module signing keys are to ensure that only Out-of-tree -+ # built against the Titanium Kernel get signed and loaded sans warnings ++ # built against the StarlingX Kernel get signed and loaded sans warnings + cp signing_key.priv ${RPM_BUILD_ROOT}/lib/modules/${KernelVer}/build/ + cp signing_key.x509 ${RPM_BUILD_ROOT}/lib/modules/${KernelVer}/build/ + @@ -443,7 +443,7 @@ index c05b910..dfbbe1f 100644 %if %{buildheaders} # Install kernel headers make ARCH=%{hdrarch} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install -@@ -1153,6 +1367,14 @@ rm -rf $RPM_BUILD_ROOT +@@ -1165,6 +1379,14 @@ rm -rf $RPM_BUILD_ROOT ### scripts ### @@ -458,7 +458,7 @@ index c05b910..dfbbe1f 100644 # # This macro defines a %%post script for a kernel*-devel package. # %%kernel_devel_post [] -@@ -1316,6 +1538,43 @@ fi +@@ -1328,6 +1550,43 @@ fi %endif %endif @@ -502,7 +502,7 @@ index c05b910..dfbbe1f 100644 # This is %{image_install_path} on an arch where that includes ELF files, # or empty otherwise. %global elf_image_install_path %{?kernel_image_elf:%{image_install_path}} -@@ -1332,6 +1591,7 @@ fi +@@ -1344,6 +1603,7 @@ fi /%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\ /%{image_install_path}/.vmlinuz-%{KVERREL}%{?2:.%{2}}.hmac\ /boot/System.map-%{KVERREL}%{?2:.%{2}}\ @@ -510,7 +510,7 @@ index c05b910..dfbbe1f 100644 /boot/config-%{KVERREL}%{?2:.%{2}}\ %exclude /lib/modules/%{KVERREL}%{?2:.%{2}}/kernel/arch/x86/kvm\ %exclude /lib/modules/%{KVERREL}%{?2:.%{2}}/kernel/drivers/gpu/drm/i915/gvt\ -@@ -1410,6 +1670,11 @@ fi +@@ -1422,6 +1682,11 @@ fi %kernel_variant_files %{buildvanilla} vanilla %endif @@ -520,8 +520,8 @@ index c05b910..dfbbe1f 100644 +%endif # do_sign + %changelog - * Fri Aug 10 2018 Luis Claudio R. Goncalves [3.10.0-862.11.6.rt56.819.el7] - - [rt] Update source tree to match RHEL 7.5 tree [1549768 1462329] + * Thu Nov 15 2018 Luis Claudio R. Goncalves [3.10.0-957.1.3.rt56.913.el7] + - [rt] Update source tree to match RHEL 7.6.z tree [1632386 1642619] -- 2.7.4 diff --git a/kernel/kernel-rt/centos/meta_patches/Compile-issues.patch b/kernel/kernel-rt/centos/meta_patches/Compile-issues.patch index 42bc8e52c..9cf178368 100644 --- a/kernel/kernel-rt/centos/meta_patches/Compile-issues.patch +++ b/kernel/kernel-rt/centos/meta_patches/Compile-issues.patch @@ -6,26 +6,29 @@ Subject: [PATCH 1/1] Compile issues Signed-off-by: Jim Somerville --- - SPECS/kernel-rt.spec | 2 ++ - 1 file changed, 2 insertions(+) + SPECS/kernel-rt.spec | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec index ab6daf3..3c0e4b4 100644 --- a/SPECS/kernel-rt.spec +++ b/SPECS/kernel-rt.spec -@@ -420,6 +420,7 @@ Patch1029: dpt_i2o-fix-build-warning.patch +@@ -418,6 +418,9 @@ Patch1027: dpt_i2o-fix-build-warning.patch # DRBD was choking on write same - Patch1030: turn-off-write-same-in-smartqpi-driver.patch - Patch1031: restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch -+Patch1032: fix-compilation-issues.patch + Patch1028: turn-off-write-same-in-smartqpi-driver.patch + Patch1029: restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch ++Patch1030: fix-compilation-issues.patch ++# Fix CentOS 7.6 upgrade compile error ++Patch1031: fix-CentOS-7.6-upgrade-compile-error.patch BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root -@@ -784,6 +785,7 @@ ApplyPatch aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch +@@ -780,6 +783,8 @@ ApplyPatch aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch ApplyPatch dpt_i2o-fix-build-warning.patch ApplyPatch turn-off-write-same-in-smartqpi-driver.patch ApplyPatch restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch +ApplyPatch fix-compilation-issues.patch ++ApplyPatch fix-CentOS-7.6-upgrade-compile-error.patch # move off upstream version mechanism if [ -e localversion-rt ]; then diff --git a/kernel/kernel-rt/centos/meta_patches/Kernel-source-patches-for-TiC.patch b/kernel/kernel-rt/centos/meta_patches/Kernel-source-patches-for-TiC.patch index 04c04ae39..b899b65a4 100644 --- a/kernel/kernel-rt/centos/meta_patches/Kernel-source-patches-for-TiC.patch +++ b/kernel/kernel-rt/centos/meta_patches/Kernel-source-patches-for-TiC.patch @@ -8,14 +8,14 @@ Subject: [PATCH 2/3] Kernel source patches for TiC Signed-off-by: Jim Somerville --- - SPECS/kernel-rt.spec | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 66 insertions(+) + SPECS/kernel-rt.spec | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 62 insertions(+) diff --git a/SPECS/kernel-rt.spec b/SPECS/kernel-rt.spec index 905ae52..15114e6 100644 --- a/SPECS/kernel-rt.spec +++ b/SPECS/kernel-rt.spec -@@ -386,6 +386,40 @@ Source1000: modprobe-dccp-blacklist.conf +@@ -386,6 +386,38 @@ Source1000: modprobe-dccp-blacklist.conf # Empty final patch file to facilitate testing of kernel patches Patch999999: linux-kernel-test.patch @@ -45,18 +45,16 @@ index 905ae52..15114e6 100644 +Patch1023: cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch +Patch1024: US101216-IMA-support-in-Titanium-kernel.patch +Patch1025: US103091-IMA-System-Configuration.patch -+Patch1026: timer-Reduce-timer-migration-overhead-if-disabled.patch -+Patch1027: timer-Minimize-nohz-off-overhead.patch +# Fix compile warnings that break the build -+Patch1028: aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch -+Patch1029: dpt_i2o-fix-build-warning.patch ++Patch1026: aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch ++Patch1027: dpt_i2o-fix-build-warning.patch +# DRBD was choking on write same -+Patch1030: turn-off-write-same-in-smartqpi-driver.patch -+Patch1031: restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch ++Patch1028: turn-off-write-same-in-smartqpi-driver.patch ++Patch1029: restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root -@@ -718,6 +752,38 @@ cp %{SOURCE38} . +@@ -718,6 +750,36 @@ cp %{SOURCE38} . ## Apply Patches here ApplyPatch linux-kernel-test.patch @@ -86,8 +84,6 @@ index 905ae52..15114e6 100644 +ApplyPatch cpuidle-menu-Avoid-taking-spinlock-for-accessing-QoS.patch +ApplyPatch US101216-IMA-support-in-Titanium-kernel.patch +ApplyPatch US103091-IMA-System-Configuration.patch -+ApplyPatch timer-Reduce-timer-migration-overhead-if-disabled.patch -+ApplyPatch timer-Minimize-nohz-off-overhead.patch +ApplyPatch aic94xx-Skip-reading-user-settings-if-flash-is-not-f.patch +ApplyPatch dpt_i2o-fix-build-warning.patch +ApplyPatch turn-off-write-same-in-smartqpi-driver.patch diff --git a/kernel/kernel-rt/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch b/kernel/kernel-rt/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch index c32e5e083..21500b770 100644 --- a/kernel/kernel-rt/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch +++ b/kernel/kernel-rt/centos/patches/Affine-irqs-and-workqueues-with-kthread_cpus.patch @@ -32,7 +32,7 @@ diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index bd59426..bad147c 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -404,6 +404,13 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask) +@@ -410,6 +410,13 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask) if (cpumask_intersects(mask, nodemask)) cpumask_and(mask, mask, nodemask); } @@ -50,7 +50,7 @@ diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 986e283..7160e71 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c -@@ -5466,6 +5466,8 @@ static int __init init_workqueues(void) +@@ -5483,6 +5483,8 @@ static int __init init_workqueues(void) BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); attrs->nice = std_nice[i]; @@ -59,7 +59,7 @@ index 986e283..7160e71 100644 unbound_std_wq_attrs[i] = attrs; /* -@@ -5476,6 +5478,8 @@ static int __init init_workqueues(void) +@@ -5493,6 +5495,8 @@ static int __init init_workqueues(void) BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); attrs->nice = std_nice[i]; attrs->no_numa = true; diff --git a/kernel/kernel-rt/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch b/kernel/kernel-rt/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch index 68f8f8eab..f49e30677 100644 --- a/kernel/kernel-rt/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch +++ b/kernel/kernel-rt/centos/patches/CGTS-3744-route-do-not-cache-fib-route-info-on-local.patch @@ -35,7 +35,7 @@ diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f19aca2..5246096 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c -@@ -2057,6 +2057,17 @@ static struct rtable *__mkroute_output(const struct fib_result *res, +@@ -2121,6 +2121,17 @@ static struct rtable *__mkroute_output(const struct fib_result *res, */ if (fi && res->prefixlen < 4) fi = NULL; diff --git a/kernel/kernel-rt/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch b/kernel/kernel-rt/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch index 0ef0d1d7b..5c338438d 100644 --- a/kernel/kernel-rt/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch +++ b/kernel/kernel-rt/centos/patches/CPU-PM-expose-pm_qos_resume_latency-for-CPUs.patch @@ -39,15 +39,15 @@ diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 65e786d..91d620f 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c -@@ -16,6 +16,7 @@ +@@ -15,6 +15,7 @@ + #include #include #include - #include +#include #include "base.h" -@@ -319,6 +320,7 @@ int register_cpu(struct cpu *cpu, int num) +@@ -318,6 +319,7 @@ int register_cpu(struct cpu *cpu, int num) per_cpu(cpu_sys_devices, num) = &cpu->dev; if (!error) register_cpu_under_node(num, cpu_to_node(num)); diff --git a/kernel/kernel-rt/centos/patches/Make-kernel-start-eth-devices-at-offset.patch b/kernel/kernel-rt/centos/patches/Make-kernel-start-eth-devices-at-offset.patch index 2f41a1f1a..c121e668f 100644 --- a/kernel/kernel-rt/centos/patches/Make-kernel-start-eth-devices-at-offset.patch +++ b/kernel/kernel-rt/centos/patches/Make-kernel-start-eth-devices-at-offset.patch @@ -23,7 +23,7 @@ index 1425f9d..db04f3b 100644 set_bit(i, inuse); } -+ /* WRS extension, want kernel to start at eth1000 */ ++ /* STX extension, want kernel to start at eth1000 */ + if (strcmp(name, "eth%d") == 0) { + for (i=0; i < 1000; i++) + set_bit(i, inuse); diff --git a/kernel/kernel-rt/centos/patches/Notification-of-death-of-arbitrary-processes.patch b/kernel/kernel-rt/centos/patches/Notification-of-death-of-arbitrary-processes.patch index fc36f39ed..385f4d78e 100644 --- a/kernel/kernel-rt/centos/patches/Notification-of-death-of-arbitrary-processes.patch +++ b/kernel/kernel-rt/centos/patches/Notification-of-death-of-arbitrary-processes.patch @@ -65,7 +65,7 @@ diff --git a/include/linux/sched.h b/include/linux/sched.h index 97ff026..0785453 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1664,6 +1664,12 @@ struct task_struct { +@@ -1682,6 +1682,12 @@ struct task_struct { short il_next; short pref_node_fork; #endif @@ -111,7 +111,7 @@ diff --git a/init/Kconfig b/init/Kconfig index 1d645a1..37e48c0 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1539,6 +1539,21 @@ config VM_EVENT_COUNTERS +@@ -1581,6 +1581,21 @@ config VM_EVENT_COUNTERS on EXPERT systems. /proc/vmstat will only show page counts if VM event counters are disabled. @@ -137,10 +137,10 @@ diff --git a/kernel/Makefile b/kernel/Makefile index 762218c..d357e7d 100644 --- a/kernel/Makefile +++ b/kernel/Makefile -@@ -117,6 +117,7 @@ obj-$(CONFIG_RING_BUFFER) += trace/ - obj-$(CONFIG_TRACEPOINTS) += trace/ +@@ -120,6 +120,7 @@ obj-$(CONFIG_TRACEPOINTS) += trace/ obj-$(CONFIG_IRQ_WORK) += irq_work.o obj-$(CONFIG_CPU_PM) += cpu_pm.o + obj-$(CONFIG_BPF) += bpf/ +obj-$(CONFIG_SIGEXIT) += death_notify.o obj-$(CONFIG_PERF_EVENTS) += events/ @@ -457,7 +457,7 @@ diff --git a/kernel/fork.c b/kernel/fork.c index 6bda4c0..f3cd3ad 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1512,6 +1512,10 @@ static struct task_struct *copy_process(unsigned long clone_flags, +@@ -1518,6 +1518,10 @@ static struct task_struct *copy_process(unsigned long clone_flags, p->sequential_io = 0; p->sequential_io_avg = 0; #endif @@ -472,7 +472,7 @@ diff --git a/kernel/signal.c b/kernel/signal.c index 59e84a2..728daa9 100644 --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -48,6 +48,9 @@ +@@ -47,6 +47,9 @@ #include #include #include "audit.h" /* audit_signal_info() */ @@ -482,7 +482,7 @@ index 59e84a2..728daa9 100644 /* * SLAB caches for signal bits. -@@ -1853,6 +1856,10 @@ bool do_notify_parent(struct task_struct *tsk, int sig) +@@ -1849,6 +1852,10 @@ bool do_notify_parent(struct task_struct *tsk, int sig) __wake_up_parent(tsk, tsk->parent); spin_unlock_irqrestore(&psig->siglock, flags); @@ -493,7 +493,7 @@ index 59e84a2..728daa9 100644 return autoreap; } -@@ -1924,6 +1931,10 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, +@@ -1920,6 +1927,10 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, */ __wake_up_parent(tsk, parent); spin_unlock_irqrestore(&sighand->siglock, flags); diff --git a/kernel/kernel-rt/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch b/kernel/kernel-rt/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch index 22e0fec68..c80c1f27d 100644 --- a/kernel/kernel-rt/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch +++ b/kernel/kernel-rt/centos/patches/PCI-Add-ACS-quirk-for-Intel-Fortville-NICs.patch @@ -18,7 +18,7 @@ diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 5614e3f..4a0bfed 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c -@@ -4289,6 +4289,10 @@ static const struct pci_dev_acs_enabled { +@@ -4401,6 +4401,10 @@ static const struct pci_dev_acs_enabled { /* I219 */ { PCI_VENDOR_ID_INTEL, 0x15b7, pci_quirk_mf_endpoint_acs }, { PCI_VENDOR_ID_INTEL, 0x15b8, pci_quirk_mf_endpoint_acs }, diff --git a/kernel/kernel-rt/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch b/kernel/kernel-rt/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch index e0025f635..6c8cb0ba4 100644 --- a/kernel/kernel-rt/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch +++ b/kernel/kernel-rt/centos/patches/Porting-Cacheinfo-from-Kernel-4.10.17.patch @@ -47,7 +47,7 @@ This helps in: Signed-off-by: Jim Somerville --- Documentation/ABI/testing/sysfs-devices-system-cpu | 65 ++ - arch/x86/kernel/cpu/intel_cacheinfo.c | 830 +++++++-------------- + arch/x86/kernel/cpu/cacheinfo.c | 830 +++++++-------------- drivers/base/Makefile | 2 +- drivers/base/cacheinfo.c | 662 ++++++++++++++++ drivers/base/cpu.c | 54 ++ @@ -133,10 +133,10 @@ index ff65f15..7521be8 100644 What: /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/turbo_stat /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/sub_turbo_stat -diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c +diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c index d529019..bf23bd2 100644 ---- a/arch/x86/kernel/cpu/intel_cacheinfo.c -+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c +--- a/arch/x86/kernel/cpu/cacheinfo.c ++++ b/arch/x86/kernel/cpu/cacheinfo.c @@ -1,5 +1,5 @@ /* - * Routines to indentify caches on Intel CPU. @@ -499,7 +499,7 @@ index d529019..bf23bd2 100644 return -EIO; /* better error ? */ this_leaf->eax = eax; -@@ -576,14 +631,14 @@ static int find_num_cache_leaves(struct cpuinfo_x86 *c) +@@ -576,7 +631,7 @@ static int find_num_cache_leaves(struct cpuinfo_x86 *c) /* Do cpuid(op) loop to find out num_cache_leaves */ cpuid_count(op, i, &eax, &ebx, &ecx, &edx); cache_eax.full = eax; @@ -508,6 +508,7 @@ index d529019..bf23bd2 100644 return i; } +@@ -622,7 +677,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id) void init_amd_cacheinfo(struct cpuinfo_x86 *c) { @@ -516,7 +517,7 @@ index d529019..bf23bd2 100644 num_cache_leaves = find_num_cache_leaves(c); } else if (c->extended_cpuid_level >= 0x80000006) { if (cpuid_edx(0x80000006) & 0xf000) -@@ -600,7 +655,7 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) +@@ -639,7 +694,7 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */ unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */ unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb; @@ -525,7 +526,7 @@ index d529019..bf23bd2 100644 unsigned int cpu = c->cpu_index; #endif -@@ -618,36 +673,34 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) +@@ -657,36 +712,34 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) * parameters cpuid leaf to find the cache details */ for (i = 0; i < num_cache_leaves; i++) { @@ -587,7 +588,7 @@ index d529019..bf23bd2 100644 } } } -@@ -721,34 +774,40 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) +@@ -760,34 +813,40 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) if (new_l2) { l2 = new_l2; @@ -640,7 +641,7 @@ index d529019..bf23bd2 100644 int i, sibling; /* -@@ -757,40 +816,43 @@ static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) +@@ -796,40 +855,43 @@ static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) */ if (index == 3) { for_each_cpu(i, cpu_llc_shared_mask(cpu)) { @@ -697,7 +698,7 @@ index d529019..bf23bd2 100644 } } } else -@@ -799,72 +861,70 @@ static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) +@@ -838,72 +900,70 @@ static int cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) return 1; } @@ -814,7 +815,7 @@ index d529019..bf23bd2 100644 } /* -@@ -886,411 +946,37 @@ static void get_cache_id(int cpu, struct _cpuid4_info_regs *id4_regs) +@@ -925,411 +985,37 @@ static void get_cache_id(int cpu, struct _cpuid4_info_regs *id4_regs) int get_cpu_cache_id(int cpu, int level) { int i; @@ -1931,7 +1932,7 @@ diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 290609b..65e786d 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c -@@ -340,6 +340,60 @@ struct device *get_cpu_device(unsigned cpu) +@@ -338,6 +338,60 @@ struct device *get_cpu_device(unsigned cpu) } EXPORT_SYMBOL_GPL(get_cpu_device); diff --git a/kernel/kernel-rt/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch b/kernel/kernel-rt/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch index 3d8140961..7b0b229ae 100644 --- a/kernel/kernel-rt/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch +++ b/kernel/kernel-rt/centos/patches/US101216-IMA-support-in-Titanium-kernel.patch @@ -31,7 +31,7 @@ diff --git a/fs/namei.c b/fs/namei.c index 9f90b63..bf91ea0 100644 --- a/fs/namei.c +++ b/fs/namei.c -@@ -3236,7 +3236,7 @@ opened: +@@ -3225,7 +3225,7 @@ opened: error = open_check_o_direct(file); if (error) goto exit_fput; @@ -44,7 +44,7 @@ diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 00e98c3..cb9250e 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c -@@ -883,7 +883,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, +@@ -898,7 +898,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, goto out_nfserr; } @@ -80,7 +80,7 @@ index eb6f994..2dbaf80 100644 void *i_private; /* fs or device private pointer */ }; -@@ -2827,7 +2826,6 @@ static inline bool inode_is_open_for_write(const struct inode *inode) +@@ -2830,7 +2829,6 @@ static inline bool inode_is_open_for_write(const struct inode *inode) return atomic_read(&inode->i_writecount) > 0; } @@ -88,7 +88,7 @@ index eb6f994..2dbaf80 100644 static inline void i_readcount_dec(struct inode *inode) { BUG_ON(!atomic_read(&inode->i_readcount)); -@@ -2837,16 +2835,7 @@ static inline void i_readcount_inc(struct inode *inode) +@@ -2840,16 +2838,7 @@ static inline void i_readcount_inc(struct inode *inode) { atomic_inc(&inode->i_readcount); } @@ -229,7 +229,7 @@ diff --git a/security/security.c b/security/security.c index f069482..646a0e3 100644 --- a/security/security.c +++ b/security/security.c -@@ -156,6 +156,110 @@ EXPORT_SYMBOL(unregister_lsm_notifier); +@@ -157,6 +157,110 @@ EXPORT_SYMBOL(unregister_lsm_notifier); /* Security operations */ @@ -340,7 +340,7 @@ index f069482..646a0e3 100644 int security_ptrace_access_check(struct task_struct *child, unsigned int mode) { #ifdef CONFIG_SECURITY_YAMA_STACKED -@@ -715,8 +819,11 @@ EXPORT_SYMBOL(security_inode_listsecurity); +@@ -716,8 +820,11 @@ EXPORT_SYMBOL(security_inode_listsecurity); void security_inode_getsecid(struct inode *inode, u32 *secid) { @@ -353,7 +353,7 @@ index f069482..646a0e3 100644 int security_inode_copy_up(struct dentry *src, struct cred **new) { -@@ -1525,6 +1632,7 @@ int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule) +@@ -1526,6 +1633,7 @@ int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule) { return security_ops->audit_rule_init(field, op, rulestr, lsmrule); } @@ -361,13 +361,14 @@ index f069482..646a0e3 100644 int security_audit_rule_known(struct audit_krule *krule) { -@@ -1541,5 +1649,6 @@ int security_audit_rule_match(u32 secid, u32 field, u32 op, void *lsmrule, +@@ -1542,6 +1650,7 @@ int security_audit_rule_match(u32 secid, u32 field, u32 op, void *lsmrule, { return security_ops->audit_rule_match(secid, field, op, lsmrule, actx); } +EXPORT_SYMBOL_GPL(security_audit_rule_match); #endif /* CONFIG_AUDIT */ + -- 1.8.3.1 diff --git a/kernel/kernel-rt/centos/patches/US103091-IMA-System-Configuration.patch b/kernel/kernel-rt/centos/patches/US103091-IMA-System-Configuration.patch index 936b2a0db..9e8ada317 100644 --- a/kernel/kernel-rt/centos/patches/US103091-IMA-System-Configuration.patch +++ b/kernel/kernel-rt/centos/patches/US103091-IMA-System-Configuration.patch @@ -50,7 +50,7 @@ index d357e7d..f333b29 100644 obj-$(CONFIG_MODULES) += module.o obj-$(CONFIG_MODULE_SIG) += module_signing.o obj-$(CONFIG_MODULE_SIG_UEFI) += modsign_uefi.o -@@ -202,7 +202,45 @@ targets += $(obj)/.x509.list +@@ -206,7 +206,45 @@ targets += $(obj)/.x509.list $(obj)/.x509.list: @echo $(X509_CERTIFICATES) >$@ diff --git a/kernel/kernel-rt/centos/patches/affine-compute-kernel-threads.patch b/kernel/kernel-rt/centos/patches/affine-compute-kernel-threads.patch index 8603e7c60..6299a6f1e 100644 --- a/kernel/kernel-rt/centos/patches/affine-compute-kernel-threads.patch +++ b/kernel/kernel-rt/centos/patches/affine-compute-kernel-threads.patch @@ -42,7 +42,7 @@ diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-paramete index 02cfdf6..4eeda61 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -1539,6 +1539,16 @@ bytes respectively. Such letter suffixes can also be entirely omitted. +@@ -1551,6 +1551,16 @@ bytes respectively. Such letter suffixes can also be entirely omitted. kpti [X86-64] Enable kernel page table isolation. @@ -83,7 +83,7 @@ diff --git a/init/main.c b/init/main.c index 2e4ecd4..6e265d0 100644 --- a/init/main.c +++ b/init/main.c -@@ -958,10 +958,6 @@ static noinline void __init kernel_init_freeable(void) +@@ -961,10 +961,6 @@ static noinline void __init kernel_init_freeable(void) * init can allocate pages on any node */ set_mems_allowed(node_states[N_MEMORY]); @@ -94,7 +94,7 @@ index 2e4ecd4..6e265d0 100644 cad_pid = task_pid(current); -@@ -977,6 +973,8 @@ static noinline void __init kernel_init_freeable(void) +@@ -980,6 +976,8 @@ static noinline void __init kernel_init_freeable(void) do_basic_setup(); @@ -107,7 +107,7 @@ diff --git a/kernel/cpu.c b/kernel/cpu.c index 6fe84e4..325a47a 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c -@@ -1073,6 +1073,19 @@ static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly; +@@ -1308,6 +1308,19 @@ static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly; const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits); EXPORT_SYMBOL(cpu_active_mask); diff --git a/kernel/kernel-rt/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch b/kernel/kernel-rt/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch index 6b73a28cc..c320990c9 100644 --- a/kernel/kernel-rt/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch +++ b/kernel/kernel-rt/centos/patches/cma-add-placement-specifier-for-cma-kernel-parameter.patch @@ -52,7 +52,7 @@ diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-paramete index 4eeda61..685554b 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -579,8 +579,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. +@@ -580,8 +580,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. Also note the kernel might malfunction if you disable some critical bits. @@ -70,7 +70,7 @@ diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 9eca4ac..4e39287 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -1283,7 +1283,7 @@ void __init setup_arch(char **cmdline_p) +@@ -1298,7 +1298,7 @@ void __init setup_arch(char **cmdline_p) setup_real_mode(); memblock_set_current_limit(get_max_mapped()); diff --git a/kernel/kernel-rt/centos/patches/debrand-single-cpu.patch b/kernel/kernel-rt/centos/patches/debrand-single-cpu.patch index 1845131e0..80ebf8946 100644 --- a/kernel/kernel-rt/centos/patches/debrand-single-cpu.patch +++ b/kernel/kernel-rt/centos/patches/debrand-single-cpu.patch @@ -13,7 +13,7 @@ diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f27ca00..9eca4ac 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -922,7 +922,7 @@ static void rh_check_supported(void) +@@ -931,7 +931,7 @@ static void rh_check_supported(void) if (((boot_cpu_data.x86_max_cores * smp_num_siblings) == 1) && !x86_hyper && !cpu_has_hypervisor && !is_kdump_kernel()) { pr_crit("Detected single cpu native boot.\n"); diff --git a/kernel/kernel-rt/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch b/kernel/kernel-rt/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch new file mode 100644 index 000000000..c8069c82f --- /dev/null +++ b/kernel/kernel-rt/centos/patches/fix-CentOS-7.6-upgrade-compile-error.patch @@ -0,0 +1,67 @@ +From c48d3f2683c28939b3c11bdfa67e4446cd11beee Mon Sep 17 00:00:00 2001 +From: "Martin, Chen" +Date: Mon, 14 Jan 2019 17:59:03 +0000 +Subject: [PATCH] fix CentOS 7.6 upgrade compile error + +1, fix improper call of part_round_stats and part_inc_in_flight +in drbd_req.c, as CONFIG_BLK_DEV_DRBD=m defined in +kernel-3.10.0-x86_64.config.tis_extra + +2, add explicit declaration for trace_bpf_int_jit_compile, +trace_bpf_jit_compile, trace_bpf_jit_free, if pmd_read_atomic not +defined + +Signed-off-by: Martin, Chen +--- + drivers/block/drbd/drbd_req.c | 8 ++++---- + include/linux/filter.h | 4 ++++ + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c +index a6f13f7..cbd0a49 100644 +--- a/drivers/block/drbd/drbd_req.c ++++ b/drivers/block/drbd/drbd_req.c +@@ -39,12 +39,12 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req + const int rw = bio_data_dir(req->master_bio); + int cpu; + cpu = part_stat_lock(); +- part_round_stats(cpu, &mdev->vdisk->part0); ++ part_round_stats(mdev->rq_queue, cpu, &mdev->vdisk->part0); + part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]); + part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], req->i.size >> 9); + (void) cpu; /* The macro invocations above want the cpu argument, I do not like + the compiler warning about cpu only assigned but never used... */ +- part_inc_in_flight(&mdev->vdisk->part0, rw); ++ part_inc_in_flight(mdev->rq_queue, &mdev->vdisk->part0, rw); + part_stat_unlock(); + } + +@@ -56,8 +56,8 @@ static void _drbd_end_io_acct(struct drbd_conf *mdev, struct drbd_request *req) + int cpu; + cpu = part_stat_lock(); + part_stat_add(cpu, &mdev->vdisk->part0, ticks[rw], duration); +- part_round_stats(cpu, &mdev->vdisk->part0); +- part_dec_in_flight(&mdev->vdisk->part0, rw); ++ part_round_stats(mdev->rq_queue, cpu, &mdev->vdisk->part0); ++ part_dec_in_flight(mdev->rq_queue, &mdev->vdisk->part0, rw); + part_stat_unlock(); + } + +diff --git a/include/linux/filter.h b/include/linux/filter.h +index cddbb31..15ce55f 100644 +--- a/include/linux/filter.h ++++ b/include/linux/filter.h +@@ -665,6 +665,10 @@ static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog) + return true; + } + #else ++struct bpf_prog * __weak trace_bpf_int_jit_compile(struct bpf_prog *prog); ++void __weak trace_bpf_jit_compile(struct bpf_prog *prog); ++void __weak trace_bpf_jit_free(struct bpf_prog *fp); ++ + static inline bool ebpf_jit_enabled(void) + { + return false; +-- +1.8.3.1 + diff --git a/kernel/kernel-rt/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch b/kernel/kernel-rt/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch index 899207924..ef125f87f 100644 --- a/kernel/kernel-rt/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch +++ b/kernel/kernel-rt/centos/patches/intel-iommu-allow-ignoring-Ethernet-device-RMRR-with.patch @@ -59,7 +59,7 @@ diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-paramete index 685554b..0ca635a 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -1306,6 +1306,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. +@@ -1318,6 +1318,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. than 32-bit addressing. The default is to look for translation below 32-bit and if not available then look in the higher range. @@ -75,7 +75,7 @@ diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 05b0971..d6f4723 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c -@@ -504,6 +504,7 @@ static int dmar_forcedac; +@@ -480,6 +480,7 @@ static int dmar_forcedac; static int intel_iommu_strict; static int intel_iommu_superpage = 1; static int intel_iommu_ecs = 1; @@ -83,7 +83,7 @@ index 05b0971..d6f4723 100644 /* We only actually use ECS when PASID support (on the new bit 40) * is also advertised. Some early implementations — the ones with -@@ -563,6 +564,15 @@ static int __init intel_iommu_setup(char *str) +@@ -539,6 +540,15 @@ static int __init intel_iommu_setup(char *str) } else if (!strncmp(str, "forcedac", 8)) { pr_info("Forcing DAC for PCI devices\n"); dmar_forcedac = 1; @@ -99,7 +99,7 @@ index 05b0971..d6f4723 100644 } else if (!strncmp(str, "strict", 6)) { pr_info("Disable batched IOTLB flush\n"); intel_iommu_strict = 1; -@@ -2733,6 +2743,15 @@ static bool device_is_rmrr_locked(struct device *dev) +@@ -2779,6 +2789,15 @@ static bool device_is_rmrr_locked(struct device *dev) if (IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev)) return false; diff --git a/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt.config.tis_extra b/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt.config.tis_extra index 642ab74c1..9499c311d 100644 --- a/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt.config.tis_extra +++ b/kernel/kernel-rt/centos/patches/kernel-3.10.0-x86_64-rt.config.tis_extra @@ -951,3 +951,8 @@ CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=n # Make performance default governor CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=n CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y + +CONFIG_TORTURE_TEST=n +CONFIG_RCU_TORTURE_TEST=n +CONFIG_LOCK_TORTURE_TEST=n + diff --git a/kernel/kernel-rt/centos/patches/memblock-introduce-memblock_alloc_range.patch b/kernel/kernel-rt/centos/patches/memblock-introduce-memblock_alloc_range.patch index 8dd2ded65..a30ef9e1e 100644 --- a/kernel/kernel-rt/centos/patches/memblock-introduce-memblock_alloc_range.patch +++ b/kernel/kernel-rt/centos/patches/memblock-introduce-memblock_alloc_range.patch @@ -35,7 +35,7 @@ diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 5a439c9..d6bcbef 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h -@@ -304,6 +304,8 @@ static inline bool memblock_bottom_up(void) { return false; } +@@ -306,6 +306,8 @@ static inline bool memblock_bottom_up(void) { return false; } #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) #define MEMBLOCK_ALLOC_ACCESSIBLE 0 diff --git a/kernel/kernel-rt/centos/patches/rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch b/kernel/kernel-rt/centos/patches/rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch index 9991f4806..9e3a00cb2 100644 --- a/kernel/kernel-rt/centos/patches/rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch +++ b/kernel/kernel-rt/centos/patches/rcu-Don-t-wake-rcuc-X-kthreads-on-NOCB-CPUs.patch @@ -33,7 +33,7 @@ diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 9648918..fb7b2a8 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c -@@ -319,7 +319,7 @@ static int +@@ -367,7 +367,7 @@ static int cpu_has_callbacks_ready_to_invoke(struct rcu_data *rdp) { return &rdp->nxtlist != rdp->nxttail[RCU_DONE_TAIL] && diff --git a/kernel/kernel-rt/centos/patches/restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch b/kernel/kernel-rt/centos/patches/restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch index a98e0b376..6b5315def 100644 --- a/kernel/kernel-rt/centos/patches/restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch +++ b/kernel/kernel-rt/centos/patches/restrict-iSCSI-kthreads-to-CPUs-in-cpu_kthread_mask.patch @@ -19,7 +19,7 @@ diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_ta index d8f587e..17b08b7 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c -@@ -3594,8 +3594,8 @@ void iscsit_thread_get_cpumask(struct iscsi_conn *conn) +@@ -3575,8 +3575,8 @@ void iscsit_thread_get_cpumask(struct iscsi_conn *conn) * iSCSI connection's RX/TX threads will be scheduled to * execute upon. */ diff --git a/kernel/kernel-rt/centos/patches/timer-Minimize-nohz-off-overhead.patch b/kernel/kernel-rt/centos/patches/timer-Minimize-nohz-off-overhead.patch deleted file mode 100644 index 6f83a72e3..000000000 --- a/kernel/kernel-rt/centos/patches/timer-Minimize-nohz-off-overhead.patch +++ /dev/null @@ -1,168 +0,0 @@ -From ecfd98039a9be52230746b209010c77adb575629 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: Thomas Gleixner -Date: Tue, 26 May 2015 22:50:35 +0000 -Subject: [PATCH 28/32] timer: Minimize nohz off overhead - -If nohz is disabled on the kernel command line the [hr]timer code -still calls wake_up_nohz_cpu() and tick_nohz_full_cpu(), a pretty -pointless exercise. Cache nohz_active in [hr]timer per cpu bases and -avoid the overhead. - -Before: - 48.10% hog [.] main - 15.25% [kernel] [k] _raw_spin_lock_irqsave - 9.76% [kernel] [k] _raw_spin_unlock_irqrestore - 6.50% [kernel] [k] mod_timer - 6.44% [kernel] [k] lock_timer_base.isra.38 - 3.87% [kernel] [k] detach_if_pending - 3.80% [kernel] [k] del_timer - 2.67% [kernel] [k] internal_add_timer - 1.33% [kernel] [k] __internal_add_timer - 0.73% [kernel] [k] timerfn - 0.54% [kernel] [k] wake_up_nohz_cpu - -After: - 48.73% hog [.] main - 15.36% [kernel] [k] _raw_spin_lock_irqsave - 9.77% [kernel] [k] _raw_spin_unlock_irqrestore - 6.61% [kernel] [k] lock_timer_base.isra.38 - 6.42% [kernel] [k] mod_timer - 3.90% [kernel] [k] detach_if_pending - 3.76% [kernel] [k] del_timer - 2.41% [kernel] [k] internal_add_timer - 1.39% [kernel] [k] __internal_add_timer - 0.76% [kernel] [k] timerfn - -We probably should have a cached value for nohz full in the per cpu -bases as well to avoid the cpumask check. The base cache line is hot -already, the cpumask not necessarily. - -Signed-off-by: Thomas Gleixner -Cc: Peter Zijlstra -Cc: Paul McKenney -Cc: Frederic Weisbecker -Cc: Eric Dumazet -Cc: Viresh Kumar -Cc: John Stultz -Cc: Joonwoo Park -Cc: Wenbo Wang -Link: http://lkml.kernel.org/r/20150526224512.207378134@linutronix.de -Signed-off-by: Thomas Gleixner -Signed-off-by: Alex Kozyrev -Signed-off-by: Jim Somerville ---- - include/linux/hrtimer.h | 2 ++ - kernel/time/tick-internal.h | 4 ++-- - kernel/time/tick-sched.c | 2 +- - kernel/timer.c | 14 +++++++++++--- - 4 files changed, 16 insertions(+), 6 deletions(-) - -diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h -index 00d4c9b..6183bf8 100644 ---- a/include/linux/hrtimer.h -+++ b/include/linux/hrtimer.h -@@ -176,6 +176,7 @@ enum hrtimer_base_type { - * Note that in RHEL7 clock_was_set is upstream's - * clock_was_set_seq (KABI). - * @migration_enabled: The migration of hrtimers to other cpus is enabled -+ * @nohz_active: The nohz functionality is enabled - * @expires_next: absolute time of the next event which was scheduled - * via clock_set_next_event() - * @hres_active: State of high resolution mode -@@ -191,6 +192,7 @@ struct hrtimer_cpu_base { - unsigned int active_bases; - unsigned int clock_was_set; /* clock_was_set_seq */ - bool migration_enabled; -+ bool nohz_active; - #ifdef CONFIG_HIGH_RES_TIMERS - ktime_t expires_next; - int hres_active; -diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h -index 3ebdda4..13468bd 100644 ---- a/kernel/time/tick-internal.h -+++ b/kernel/time/tick-internal.h -@@ -173,9 +173,9 @@ extern unsigned long tick_nohz_active; - #endif - - #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) --extern void timers_update_migration(void); -+extern void timers_update_migration(bool update_nohz); - #else --static inline void timers_update_migration(void) { } -+static inline void timers_update_migration(bool update_nohz) { } - #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 6c92920..3ccc18c 100644 ---- a/kernel/time/tick-sched.c -+++ b/kernel/time/tick-sched.c -@@ -980,7 +980,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)) -- timers_update_migration(); -+ timers_update_migration(true); - } - - /** -diff --git a/kernel/timer.c b/kernel/timer.c -index 4fcb630..08c96e1 100644 ---- a/kernel/timer.c -+++ b/kernel/timer.c -@@ -88,6 +88,7 @@ struct tvec_base { - unsigned long active_timers; - int cpu; - bool migration_enabled; -+ bool nohz_active; - struct tvec_root tv1; - struct tvec tv2; - struct tvec tv3; -@@ -103,7 +104,7 @@ static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases; - #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) - unsigned int sysctl_timer_migration = 1; - --void timers_update_migration(void) -+void timers_update_migration(bool update_nohz) - { - bool on = sysctl_timer_migration && tick_nohz_active; - unsigned int cpu; -@@ -119,6 +120,10 @@ void timers_update_migration(void) - tvec_base->migration_enabled = on; - hrtimer_base = &per_cpu(hrtimer_bases, cpu); - hrtimer_base->migration_enabled = on; -+ if (!update_nohz) -+ continue; -+ tvec_base->nohz_active = true; -+ hrtimer_base->nohz_active = true; - } - } - -@@ -132,7 +137,7 @@ int timer_migration_handler(struct ctl_table *table, int write, - mutex_lock(&mutex); - ret = proc_dointvec(table, write, buffer, lenp, ppos); - if (!ret && write) -- timers_update_migration(); -+ timers_update_migration(false); - mutex_unlock(&mutex); - return ret; - } -@@ -482,8 +487,11 @@ static void internal_add_timer(struct tvec_base *base, struct timer_list *timer) - * require special care against races with idle_cpu(), lets deal - * with that later. - */ -- if (!tbase_get_deferrable(base) || tick_nohz_full_cpu(base->cpu)) -+ if (base->nohz_active) { -+ if (!tbase_get_deferrable(base) || -+ tick_nohz_full_cpu(base->cpu)) - wake_up_nohz_cpu(base->cpu); -+ } - } - - #ifdef CONFIG_TIMER_STATS --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/timer-Reduce-timer-migration-overhead-if-disabled.patch b/kernel/kernel-rt/centos/patches/timer-Reduce-timer-migration-overhead-if-disabled.patch deleted file mode 100644 index 92674a069..000000000 --- a/kernel/kernel-rt/centos/patches/timer-Reduce-timer-migration-overhead-if-disabled.patch +++ /dev/null @@ -1,533 +0,0 @@ -From 100eaa897b32405365ce13248c20fcbfd6e4a85d Mon Sep 17 00:00:00 2001 -Message-Id: <100eaa897b32405365ce13248c20fcbfd6e4a85d.1528226387.git.Jim.Somerville@windriver.com> -In-Reply-To: -References: -From: Thomas Gleixner -Date: Tue, 26 May 2015 22:50:33 +0000 -Subject: [PATCH 27/32] timer: Reduce timer migration overhead if disabled - -Eric reported that the timer_migration sysctl is not really nice -performance wise as it needs to check at every timer insertion whether -the feature is enabled or not. Further the check does not live in the -timer code, so we have an extra function call which checks an extra -cache line to figure out that it is disabled. - -We can do better and store that information in the per cpu (hr)timer -bases. I pondered to use a static key, but that's a nightmare to -update from the nohz code and the timer base cache line is hot anyway -when we select a timer base. - -The old logic enabled the timer migration unconditionally if -CONFIG_NO_HZ was set even if nohz was disabled on the kernel command -line. - -With this modification, we start off with migration disabled. The user -visible sysctl is still set to enabled. If the kernel switches to NOHZ -migration is enabled, if the user did not disable it via the sysctl -prior to the switch. If nohz=off is on the kernel command line, -migration stays disabled no matter what. - -Before: - 47.76% hog [.] main - 14.84% [kernel] [k] _raw_spin_lock_irqsave - 9.55% [kernel] [k] _raw_spin_unlock_irqrestore - 6.71% [kernel] [k] mod_timer - 6.24% [kernel] [k] lock_timer_base.isra.38 - 3.76% [kernel] [k] detach_if_pending - 3.71% [kernel] [k] del_timer - 2.50% [kernel] [k] internal_add_timer - 1.51% [kernel] [k] get_nohz_timer_target - 1.28% [kernel] [k] __internal_add_timer - 0.78% [kernel] [k] timerfn - 0.48% [kernel] [k] wake_up_nohz_cpu - -After: - 48.10% hog [.] main - 15.25% [kernel] [k] _raw_spin_lock_irqsave - 9.76% [kernel] [k] _raw_spin_unlock_irqrestore - 6.50% [kernel] [k] mod_timer - 6.44% [kernel] [k] lock_timer_base.isra.38 - 3.87% [kernel] [k] detach_if_pending - 3.80% [kernel] [k] del_timer - 2.67% [kernel] [k] internal_add_timer - 1.33% [kernel] [k] __internal_add_timer - 0.73% [kernel] [k] timerfn - 0.54% [kernel] [k] wake_up_nohz_cpu - -Reported-by: Eric Dumazet -Signed-off-by: Thomas Gleixner -Cc: Peter Zijlstra -Cc: Paul McKenney -Cc: Frederic Weisbecker -Cc: Viresh Kumar -Cc: John Stultz -Cc: Joonwoo Park -Cc: Wenbo Wang -Link: http://lkml.kernel.org/r/20150526224512.127050787@linutronix.de -Signed-off-by: Thomas Gleixner -Signed-off-by: Alex Kozyrev -Signed-off-by: Jim Somerville ---- - include/linux/hrtimer.h | 2 ++ - include/linux/sched/sysctl.h | 12 -------- - include/linux/timer.h | 8 +++++ - kernel/hrtimer.c | 48 +++++++++++++++++------------- - kernel/rcutree_plugin.h | 2 -- - kernel/sched/core.c | 2 -- - kernel/sysctl.c | 18 ++++++------ - kernel/time/tick-internal.h | 14 +++++++++ - kernel/time/tick-sched.c | 25 +++++++++------- - kernel/time/timer_list.c | 3 +- - kernel/timer.c | 70 ++++++++++++++++++++++++++++++++++++-------- - 11 files changed, 133 insertions(+), 71 deletions(-) - -diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h -index cd04b77..00d4c9b 100644 ---- a/include/linux/hrtimer.h -+++ b/include/linux/hrtimer.h -@@ -175,6 +175,7 @@ enum hrtimer_base_type { - * @clock_was_set: Sequence counter of clock was set events - * Note that in RHEL7 clock_was_set is upstream's - * clock_was_set_seq (KABI). -+ * @migration_enabled: The migration of hrtimers to other cpus is enabled - * @expires_next: absolute time of the next event which was scheduled - * via clock_set_next_event() - * @hres_active: State of high resolution mode -@@ -189,6 +190,7 @@ struct hrtimer_cpu_base { - raw_spinlock_t lock; - unsigned int active_bases; - unsigned int clock_was_set; /* clock_was_set_seq */ -+ bool migration_enabled; - #ifdef CONFIG_HIGH_RES_TIMERS - ktime_t expires_next; - int hres_active; -diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h -index 4895484..02ab10e 100644 ---- a/include/linux/sched/sysctl.h -+++ b/include/linux/sched/sysctl.h -@@ -54,24 +54,12 @@ extern unsigned int sysctl_numa_balancing_settle_count; - extern unsigned int sysctl_sched_migration_cost; - extern unsigned int sysctl_sched_nr_migrate; - extern unsigned int sysctl_sched_time_avg; --extern unsigned int sysctl_timer_migration; - extern unsigned int sysctl_sched_shares_window; - - int sched_proc_update_handler(struct ctl_table *table, int write, - void __user *buffer, size_t *length, - loff_t *ppos); - #endif --#ifdef CONFIG_SCHED_DEBUG --static inline unsigned int get_sysctl_timer_migration(void) --{ -- return sysctl_timer_migration; --} --#else --static inline unsigned int get_sysctl_timer_migration(void) --{ -- return 1; --} --#endif - - /* - * control realtime throttling: -diff --git a/include/linux/timer.h b/include/linux/timer.h -index c37d9b9..8eb4558 100644 ---- a/include/linux/timer.h -+++ b/include/linux/timer.h -@@ -249,6 +249,14 @@ extern void run_local_timers(void); - struct hrtimer; - extern enum hrtimer_restart it_real_fn(struct hrtimer *); - -+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) -+#include -+extern unsigned int sysctl_timer_migration; -+int timer_migration_handler(struct ctl_table *table, int write, -+ void __user *buffer, size_t *lenp, -+ loff_t *ppos); -+#endif -+ - unsigned long __round_jiffies(unsigned long j, int cpu); - unsigned long __round_jiffies_relative(unsigned long j, int cpu); - unsigned long round_jiffies(unsigned long j); -diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c -index 40655c8..55444ab 100644 ---- a/kernel/hrtimer.c -+++ b/kernel/hrtimer.c -@@ -168,19 +168,6 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, - } - } - -- --/* -- * Get the preferred target CPU for NOHZ -- */ --static int hrtimer_get_target(int this_cpu, int pinned) --{ --#ifdef CONFIG_NO_HZ_COMMON -- if (!pinned && get_sysctl_timer_migration()) -- return get_nohz_timer_target(); --#endif -- return this_cpu; --} -- - /* - * With HIGHRES=y we do not migrate the timer when it is expiring - * before the next event on the target cpu because we cannot reprogram -@@ -204,6 +191,24 @@ hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base) - #endif - } - -+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) -+static inline -+struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base, -+ int pinned) -+{ -+ if (pinned || !base->migration_enabled) -+ return this_cpu_ptr(&hrtimer_bases); -+ return &per_cpu(hrtimer_bases, get_nohz_timer_target()); -+} -+#else -+static inline -+struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base, -+ int pinned) -+{ -+ return this_cpu_ptr(&hrtimer_bases); -+} -+#endif -+ - /* - * Switch the timer base to the current CPU when possible. - */ -@@ -211,14 +216,13 @@ static inline struct hrtimer_clock_base * - switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, - int pinned) - { -+ struct hrtimer_cpu_base *new_cpu_base, *this_base; - struct hrtimer_clock_base *new_base; -- struct hrtimer_cpu_base *new_cpu_base; -- int this_cpu = smp_processor_id(); -- int cpu = hrtimer_get_target(this_cpu, pinned); - int basenum = base->index; - -+ this_base = this_cpu_ptr(&hrtimer_bases); -+ new_cpu_base = get_target_base(this_base, pinned); - again: -- new_cpu_base = &per_cpu(hrtimer_bases, cpu); - new_base = &new_cpu_base->clock_base[basenum]; - - if (base != new_base) { -@@ -239,17 +243,19 @@ again: - raw_spin_unlock(&base->cpu_base->lock); - raw_spin_lock(&new_base->cpu_base->lock); - -- if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) { -- cpu = this_cpu; -+ if (new_cpu_base != this_base && -+ hrtimer_check_target(timer, new_base)) { - raw_spin_unlock(&new_base->cpu_base->lock); - raw_spin_lock(&base->cpu_base->lock); -+ new_cpu_base = this_base; - timer->base = base; - goto again; - } - timer->base = new_base; - } else { -- if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) { -- cpu = this_cpu; -+ if (new_cpu_base != this_base && -+ hrtimer_check_target(timer, new_base)) { -+ new_cpu_base = this_base; - goto again; - } - } -diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h -index 8f410cc..7232ecb 100644 ---- a/kernel/rcutree_plugin.h -+++ b/kernel/rcutree_plugin.h -@@ -1502,8 +1502,6 @@ module_param(rcu_idle_gp_delay, int, 0644); - static int rcu_idle_lazy_gp_delay = RCU_IDLE_LAZY_GP_DELAY; - module_param(rcu_idle_lazy_gp_delay, int, 0644); - --extern int tick_nohz_active; -- - /* - * Try to advance callbacks for all flavors of RCU on the current CPU. - * Afterwards, if there are any callbacks ready for immediate invocation, -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index b2333b7..d82e745 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -8824,8 +8824,6 @@ void __init sched_init_smp(void) - } - #endif /* CONFIG_SMP */ - --const_debug unsigned int sysctl_timer_migration = 1; -- - int in_sched_functions(unsigned long addr) - { - return in_lock_functions(addr) || -diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index 8516049..b435155 100644 ---- a/kernel/sysctl.c -+++ b/kernel/sysctl.c -@@ -376,15 +376,6 @@ static struct ctl_table kern_table[] = { - .mode = 0644, - .proc_handler = proc_dointvec, - }, -- { -- .procname = "timer_migration", -- .data = &sysctl_timer_migration, -- .maxlen = sizeof(unsigned int), -- .mode = 0644, -- .proc_handler = proc_dointvec_minmax, -- .extra1 = &zero, -- .extra2 = &one, -- }, - #ifdef CONFIG_SCHEDSTATS - { - .procname = "sched_schedstats", -@@ -1200,6 +1191,15 @@ static struct ctl_table kern_table[] = { - .extra1 = &zero, - .extra2 = &one, - }, -+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) -+ { -+ .procname = "timer_migration", -+ .data = &sysctl_timer_migration, -+ .maxlen = sizeof(unsigned int), -+ .mode = 0644, -+ .proc_handler = timer_migration_handler, -+ }, -+#endif - { } - }; - -diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h -index ecd2ff4..3ebdda4 100644 ---- a/kernel/time/tick-internal.h -+++ b/kernel/time/tick-internal.h -@@ -165,3 +165,17 @@ extern void do_timer(unsigned long ticks); - extern void update_wall_time(void); - - extern u64 get_next_timer_interrupt(unsigned long basej, u64 basem); -+ -+#ifdef CONFIG_NO_HZ_COMMON -+extern unsigned long tick_nohz_active; -+#else -+#define tick_nohz_active (0) -+#endif -+ -+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) -+extern void timers_update_migration(void); -+#else -+static inline void timers_update_migration(void) { } -+#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 625c116..6c92920 100644 ---- a/kernel/time/tick-sched.c -+++ b/kernel/time/tick-sched.c -@@ -412,7 +412,7 @@ void __init tick_nohz_init(void) - /* - * NO HZ enabled ? - */ --int tick_nohz_active __read_mostly; -+unsigned long tick_nohz_active __read_mostly; - /* - * Enable / Disable tickless mode - */ -@@ -973,6 +973,16 @@ static void tick_nohz_handler(struct clock_event_device *dev) - tick_program_event(hrtimer_get_expires(&ts->sched_timer), 1); - } - -+static inline void tick_nohz_activate(struct tick_sched *ts, int mode) -+{ -+ if (!tick_nohz_enabled) -+ return; -+ ts->nohz_mode = mode; -+ /* One update is enough */ -+ if (!test_and_set_bit(0, &tick_nohz_active)) -+ timers_update_migration(); -+} -+ - /** - * tick_nohz_switch_to_nohz - switch to nohz mode - */ -@@ -987,9 +997,6 @@ static void tick_nohz_switch_to_nohz(void) - if (tick_switch_to_oneshot(tick_nohz_handler)) - return; - -- tick_nohz_active = 1; -- ts->nohz_mode = NOHZ_MODE_LOWRES; -- - /* - * Recycle the hrtimer in ts, so we can share the - * hrtimer_forward with the highres code. -@@ -1001,6 +1008,7 @@ static void tick_nohz_switch_to_nohz(void) - hrtimer_forward_now(&ts->sched_timer, tick_period); - hrtimer_set_expires(&ts->sched_timer, next); - tick_program_event(next, 1); -+ tick_nohz_activate(ts, NOHZ_MODE_LOWRES); - } - - /* -@@ -1052,6 +1060,7 @@ static inline void tick_check_nohz_this_cpu(void) - - static inline void tick_nohz_switch_to_nohz(void) { } - static inline void tick_check_nohz_this_cpu(void) { } -+static inline void tick_nohz_activate(struct tick_sched *ts, int mode) { } - - #endif /* CONFIG_NO_HZ_COMMON */ - -@@ -1137,13 +1146,7 @@ void tick_setup_sched_timer(void) - - hrtimer_forward(&ts->sched_timer, now, tick_period); - hrtimer_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS_PINNED); -- --#ifdef CONFIG_NO_HZ_COMMON -- if (tick_nohz_enabled) { -- ts->nohz_mode = NOHZ_MODE_HIGHRES; -- tick_nohz_active = 1; -- } --#endif -+ tick_nohz_activate(ts, NOHZ_MODE_HIGHRES); - } - #endif /* HIGH_RES_TIMERS */ - -diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c -index 9174c0a..d7dd92a 100644 ---- a/kernel/time/timer_list.c -+++ b/kernel/time/timer_list.c -@@ -20,6 +20,7 @@ - - #include - -+#include "tick-internal.h" - - struct timer_list_iter { - int cpu; -@@ -29,8 +30,6 @@ struct timer_list_iter { - - typedef void (*print_fn_t)(struct seq_file *m, unsigned int *classes); - --DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases); -- - /* - * This allows printing both to /proc/timer_list and - * to the console (on SysRq-Q): -diff --git a/kernel/timer.c b/kernel/timer.c -index dc85e24..4fcb630 100644 ---- a/kernel/timer.c -+++ b/kernel/timer.c -@@ -49,6 +49,8 @@ - #include - #include - -+#include "time/tick-internal.h" -+ - #define CREATE_TRACE_POINTS - #include - -@@ -85,6 +87,7 @@ struct tvec_base { - unsigned long next_timer; - unsigned long active_timers; - int cpu; -+ bool migration_enabled; - struct tvec_root tv1; - struct tvec tv2; - struct tvec tv3; -@@ -97,6 +100,58 @@ struct tvec_base boot_tvec_bases; - EXPORT_SYMBOL(boot_tvec_bases); - static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases; - -+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) -+unsigned int sysctl_timer_migration = 1; -+ -+void timers_update_migration(void) -+{ -+ bool on = sysctl_timer_migration && tick_nohz_active; -+ unsigned int cpu; -+ struct tvec_base *tvec_base = this_cpu_read(tvec_bases); -+ struct hrtimer_cpu_base *hrtimer_base = this_cpu_ptr(&hrtimer_bases); -+ -+ /* Avoid the loop, if nothing to update */ -+ if (tvec_base->migration_enabled == on) -+ return; -+ -+ for_each_possible_cpu(cpu) { -+ tvec_base = per_cpu(tvec_bases, cpu); -+ tvec_base->migration_enabled = on; -+ hrtimer_base = &per_cpu(hrtimer_bases, cpu); -+ hrtimer_base->migration_enabled = on; -+ } -+} -+ -+int timer_migration_handler(struct ctl_table *table, int write, -+ void __user *buffer, size_t *lenp, -+ loff_t *ppos) -+{ -+ static DEFINE_MUTEX(mutex); -+ int ret; -+ -+ mutex_lock(&mutex); -+ ret = proc_dointvec(table, write, buffer, lenp, ppos); -+ if (!ret && write) -+ timers_update_migration(); -+ mutex_unlock(&mutex); -+ return ret; -+} -+ -+static inline struct tvec_base *get_target_base(struct tvec_base *base, -+ int pinned) -+{ -+ if (pinned || !base->migration_enabled) -+ return this_cpu_read(tvec_bases); -+ return per_cpu(tvec_bases, get_nohz_timer_target()); -+} -+#else -+static inline struct tvec_base *get_target_base(struct tvec_base *base, -+ int pinned) -+{ -+ return this_cpu_read(tvec_bases); -+} -+#endif -+ - /* Functions below help us manage 'deferrable' flag */ - static inline unsigned int tbase_get_deferrable(struct tvec_base *base) - { -@@ -793,11 +848,11 @@ static inline struct tvec_base *switch_timer_base(struct timer_list *timer, - - static inline int - __mod_timer(struct timer_list *timer, unsigned long expires, -- bool pending_only, int pinned) -+ bool pending_only, int pinned) - { - struct tvec_base *base, *new_base; - unsigned long flags; -- int ret = 0 , cpu; -+ int ret = 0; - - timer_stats_timer_set_start_info(timer); - BUG_ON(!timer->function); -@@ -810,16 +865,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires, - - debug_activate(timer, expires); - -- preempt_disable_rt(); -- cpu = smp_processor_id(); -- --#if defined(CONFIG_NO_HZ_COMMON) && defined(CONFIG_SMP) -- if (!pinned && get_sysctl_timer_migration()) -- cpu = get_nohz_timer_target(); --#endif -- preempt_enable_rt(); -- -- new_base = per_cpu(tvec_bases, cpu); -+ new_base = get_target_base(base, pinned); - - if (base != new_base) { - /* --- -1.8.3.1 - diff --git a/kernel/kernel-rt/centos/patches/turn-off-write-same-in-smartqpi-driver.patch b/kernel/kernel-rt/centos/patches/turn-off-write-same-in-smartqpi-driver.patch index 61dc4c1f4..5e18fa8d7 100644 --- a/kernel/kernel-rt/centos/patches/turn-off-write-same-in-smartqpi-driver.patch +++ b/kernel/kernel-rt/centos/patches/turn-off-write-same-in-smartqpi-driver.patch @@ -15,7 +15,7 @@ diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smart index 2c6b546..6968c48 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c -@@ -5843,6 +5843,7 @@ static struct scsi_host_template pqi_driver_template = { +@@ -5814,6 +5814,7 @@ static struct scsi_host_template pqi_driver_template = { .slave_alloc = pqi_slave_alloc, .sdev_attrs = pqi_sdev_attrs, .shost_attrs = pqi_shost_attrs, diff --git a/kernel/kernel-rt/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch b/kernel/kernel-rt/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch index 3cbe751a4..e10aadfa0 100644 --- a/kernel/kernel-rt/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch +++ b/kernel/kernel-rt/centos/patches/x86-enable-DMA-CMA-with-swiotlb.patch @@ -53,15 +53,13 @@ Signed-off-by: Jim Somerville arch/x86/kernel/amd_gart_64.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 9 ++++++--- arch/x86/pci/sta2x11-fixup.c | 6 ++---- - include/linux/swiotlb.h | 2 ++ - lib/swiotlb.c | 2 +- - 7 files changed, 20 insertions(+), 10 deletions(-) + 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index bdcca71..f67aa39 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -44,7 +44,7 @@ config X86 +@@ -47,7 +47,7 @@ config X86 select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH if SMP select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_WANT_FRAME_POINTERS @@ -153,30 +151,6 @@ index 9d8a509..5ceda85 100644 .map_page = swiotlb_map_page, .unmap_page = swiotlb_unmap_page, .map_sg = swiotlb_map_sg_attrs, -diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h -index 16c296a..65c4a7a 100644 ---- a/include/linux/swiotlb.h -+++ b/include/linux/swiotlb.h -@@ -117,4 +117,6 @@ static inline void swiotlb_free(void) { } - #endif - - extern void swiotlb_print_info(void); -+extern int is_swiotlb_buffer(phys_addr_t paddr); -+ - #endif /* __LINUX_SWIOTLB_H */ -diff --git a/lib/swiotlb.c b/lib/swiotlb.c -index ffcaff5..d89c82a 100644 ---- a/lib/swiotlb.c -+++ b/lib/swiotlb.c -@@ -404,7 +404,7 @@ void __init swiotlb_free(void) - io_tlb_nslabs = 0; - } - --static int is_swiotlb_buffer(phys_addr_t paddr) -+int is_swiotlb_buffer(phys_addr_t paddr) - { - return paddr >= io_tlb_start && paddr < io_tlb_end; - } -- 1.8.3.1 diff --git a/kernel/kernel-rt/centos/srpm_path b/kernel/kernel-rt/centos/srpm_path index 7250e62d6..ea91ad861 100644 --- a/kernel/kernel-rt/centos/srpm_path +++ b/kernel/kernel-rt/centos/srpm_path @@ -1 +1 @@ -mirror:Source/kernel-rt-3.10.0-862.11.6.rt56.819.el7.src.rpm +mirror:Source/kernel-rt-3.10.0-957.1.3.rt56.913.el7.src.rpm