From c2da06c175b7ce286c2acdf44d891bfdf8cd8def Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 26 Jun 2014 13:53:30 +0200 Subject: initial commit for Enea Linux 4.0 Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau --- ...eneric-vtime-obsolete-dependency-on-CONFI.patch | 39 ++++++++++++++ ...Fix-overflow-error-in-scheduler_tick_max_.patch | 42 +++++++++++++++ ...add-debugfs-control-over-sched_tick_max_d.patch | 61 ++++++++++++++++++++++ recipes-kernel/linux/linux-keystone_3.10.bbappend | 12 +++++ recipes-kernel/linux/linux-yocto_3.10.bbappend | 9 ++++ 5 files changed, 163 insertions(+) create mode 100644 recipes-kernel/linux/files/patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch create mode 100644 recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch create mode 100644 recipes-kernel/linux/files/patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch create mode 100644 recipes-kernel/linux/linux-keystone_3.10.bbappend create mode 100644 recipes-kernel/linux/linux-yocto_3.10.bbappend (limited to 'recipes-kernel') diff --git a/recipes-kernel/linux/files/patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch b/recipes-kernel/linux/files/patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch new file mode 100644 index 0000000..d43249e --- /dev/null +++ b/recipes-kernel/linux/files/patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch @@ -0,0 +1,39 @@ +From 6f8a3d2a1ea680295815e5460fc13ca596893e3c Mon Sep 17 00:00:00 2001 +From: Martin Borg +Date: Mon, 3 Mar 2014 13:35:08 +0100 +Subject: [PATCH 2/2] nohz: Drop generic vtime obsolete dependency on + CONFIG_64BIT + +--- + init/Kconfig | 2 +- + kernel/time/Kconfig | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/init/Kconfig b/init/Kconfig +index 0b5d0c8..d7411e5 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -325,7 +325,7 @@ config VIRT_CPU_ACCOUNTING_NATIVE + + config VIRT_CPU_ACCOUNTING_GEN + bool "Full dynticks CPU time accounting" +- depends on HAVE_CONTEXT_TRACKING && 64BIT ++ depends on HAVE_CONTEXT_TRACKING + select VIRT_CPU_ACCOUNTING + select CONTEXT_TRACKING + help +diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig +index 70f27e8..c270b48 100644 +--- a/kernel/time/Kconfig ++++ b/kernel/time/Kconfig +@@ -100,7 +100,6 @@ config NO_HZ_FULL + # RCU_USER_QS dependency + depends on HAVE_CONTEXT_TRACKING + # VIRT_CPU_ACCOUNTING_GEN dependency +- depends on 64BIT + select NO_HZ_COMMON + select RCU_USER_QS + select RCU_NOCB_CPU +-- +1.7.10.4 + diff --git a/recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch b/recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch new file mode 100644 index 0000000..0c60d55 --- /dev/null +++ b/recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch @@ -0,0 +1,42 @@ +From 619480006f78ebf87d80b73d4085a52a1de56feb Mon Sep 17 00:00:00 2001 +From: Martin Borg +Date: Mon, 3 Mar 2014 13:34:43 +0100 +Subject: [PATCH 1/2] sched/nohz: Fix overflow error in + scheduler_tick_max_deferment() + +--- + include/linux/jiffies.h | 4 ++++ + kernel/sched/core.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h +index 8fb8edf..ac69959 100644 +--- a/include/linux/jiffies.h ++++ b/include/linux/jiffies.h +@@ -290,6 +290,10 @@ extern unsigned long preset_lpj; + */ + extern unsigned int jiffies_to_msecs(const unsigned long j); + extern unsigned int jiffies_to_usecs(const unsigned long j); ++static inline u64 jiffies_to_nsecs(const unsigned long j) ++{ ++ return (u64)jiffies_to_usecs(j) * NSEC_PER_USEC; ++} + extern unsigned long msecs_to_jiffies(const unsigned int m); + extern unsigned long usecs_to_jiffies(const unsigned int u); + extern unsigned long timespec_to_jiffies(const struct timespec *value); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 59c7367..8c3d8bf 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -2779,7 +2779,7 @@ u64 scheduler_tick_max_deferment(void) + if (time_before_eq(next, now)) + return 0; + +- return jiffies_to_usecs(next - now) * NSEC_PER_USEC; ++ return jiffies_to_nsecs(next - now); + } + + static __init int sched_nohz_full_init_debug(void) +-- +1.7.10.4 + diff --git a/recipes-kernel/linux/files/patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch b/recipes-kernel/linux/files/patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch new file mode 100644 index 0000000..349604c --- /dev/null +++ b/recipes-kernel/linux/files/patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch @@ -0,0 +1,61 @@ +From 92f0d4f695198fcb935cf0360f93a15bf0a6af1e Mon Sep 17 00:00:00 2001 +From: Kevin Hilman +Date: Mon, 16 Sep 2013 15:43:48 -0700 +Subject: [PATCH 3/3] sched/nohz: add debugfs control over + sched_tick_max_deferment + +Allow debugfs override of sched_tick_max_deferment in order to ease +finding/fixing the remaining issues with full nohz. + +The value to be written is in jiffies, and -1 means the max deferment +is disabled (scheduler_tick_max_deferment() returns KTIME_MAX.) + +Cc: Frederic Weisbecker +Signed-off-by: Kevin Hilman +--- + kernel/sched/core.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index e8b3350..59c7367 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -2753,6 +2753,8 @@ void scheduler_tick(void) + } + + #ifdef CONFIG_NO_HZ_FULL ++static u32 sched_tick_max_deferment = HZ; ++ + /** + * scheduler_tick_max_deferment + * +@@ -2769,13 +2771,25 @@ u64 scheduler_tick_max_deferment(void) + struct rq *rq = this_rq(); + unsigned long next, now = ACCESS_ONCE(jiffies); + +- next = rq->last_sched_tick + HZ; ++ if (sched_tick_max_deferment == -1) ++ return KTIME_MAX; ++ ++ next = rq->last_sched_tick + sched_tick_max_deferment; + + if (time_before_eq(next, now)) + return 0; + + return jiffies_to_usecs(next - now) * NSEC_PER_USEC; + } ++ ++static __init int sched_nohz_full_init_debug(void) ++{ ++ debugfs_create_u32("sched_tick_max_deferment", 0644, NULL, ++ &sched_tick_max_deferment); ++ ++ return 0; ++} ++late_initcall(sched_nohz_full_init_debug); + #endif + + notrace unsigned long get_parent_ip(unsigned long addr) +-- +1.7.10.4 + diff --git a/recipes-kernel/linux/linux-keystone_3.10.bbappend b/recipes-kernel/linux/linux-keystone_3.10.bbappend new file mode 100644 index 0000000..b7f72dc --- /dev/null +++ b/recipes-kernel/linux/linux-keystone_3.10.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "\ + file://cfg/00039-nohz.cfg \ + file://patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch \ + file://patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch \ + file://patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch \ + " + +KERNEL_FEATURES += " \ + cfg/00039-nohz \ + " diff --git a/recipes-kernel/linux/linux-yocto_3.10.bbappend b/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000..c7365b1 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -0,0 +1,9 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "\ + file://cfg/00038-hotplug_cpu.cfg \ + file://cfg/00039-nohz.cfg \ + file://patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch \ + file://patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch \ + file://patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch \ + " -- cgit v1.2.3-54-g00ecf