summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2014-06-26 13:53:30 +0200
committerAdrian Dudau <adrian.dudau@enea.com>2014-06-26 13:53:30 +0200
commitc2da06c175b7ce286c2acdf44d891bfdf8cd8def (patch)
treec8a087a3fc67757076dad105f45ed86d618e2ae6
downloadmeta-nohz-daisy.tar.gz
initial commit for Enea Linux 4.0HEADdaisy-eneadaisy
Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
-rw-r--r--README31
-rw-r--r--conf/layer.conf13
-rw-r--r--images-append/enea-image-test-bash.bbappend7
-rw-r--r--recipes-kernel/linux/files/patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch39
-rw-r--r--recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch42
-rw-r--r--recipes-kernel/linux/files/patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch61
-rw-r--r--recipes-kernel/linux/linux-keystone_3.10.bbappend12
-rw-r--r--recipes-kernel/linux/linux-yocto_3.10.bbappend9
-rwxr-xr-xrecipes-test/test-nohz-stability/files/test-nohz-stability37
-rw-r--r--recipes-test/test-nohz-stability/test-nohz-stability.bb21
-rwxr-xr-xrecipes-test/test-nohz-ticks/files/test-nohz-ticks32
-rw-r--r--recipes-test/test-nohz-ticks/test-nohz-ticks.bb21
12 files changed, 325 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..e822179
--- /dev/null
+++ b/README
@@ -0,0 +1,31 @@
1Enea Linux support for tickless operation
2=========================================
3
4This layer provides support for tickless operation in Enea Linux.
5Kernel patches and configurations are applied to be able to turn off the 1 Hz
6periodic tick that remains in CONFIG_NO_HZ_FULL mode.
7
8Supported Platforms
9-------------------
10x86, ARM (Keystone)
11
12Dependencies
13------------
14meta-enea:
15 URI: git://git.enea.com/linux/meta-enea
16 branch: daisy
17
18Maintenance
19-----------
20Maintainers: Enea Linux Team <linux-maintainers@enea.com>
21
22Contributing
23------------
24Contributions and patches can be sent to the Enea Linux following mailing list:
25 enealinux@lists.enea.com
26
27License
28-------
29All metadata is MIT licensed unless otherwise stated. Source code
30included in tree for individual recipes is under the LICENSE stated
31in each recipe (.bb file) unless otherwise stated.
diff --git a/conf/layer.conf b/conf/layer.conf
new file mode 100644
index 0000000..b0dd027
--- /dev/null
+++ b/conf/layer.conf
@@ -0,0 +1,13 @@
1# We have a packages directory, add to BBFILES
2BBPATH .= ":${LAYERDIR}"
3
4BBFILES += "${LAYERDIR}/recipes-*/*/*.bb*"
5BBFILES += "${LAYERDIR}/images/*.bb*"
6BBFILES += "${LAYERDIR}/images-append/*.bb*"
7
8BBFILE_COLLECTIONS += "enea-nohz"
9BBFILE_PATTERN_enea-nohz := "^${LAYERDIR}/"
10BBFILE_PRIORITY_enea-nohz = "7"
11LAYERDEPENDS_enea-nohz = "enea"
12
13BB_DANGLINGAPPENDS_WARNONLY = "yes"
diff --git a/images-append/enea-image-test-bash.bbappend b/images-append/enea-image-test-bash.bbappend
new file mode 100644
index 0000000..680959d
--- /dev/null
+++ b/images-append/enea-image-test-bash.bbappend
@@ -0,0 +1,7 @@
1IMAGE_FSTYPES += "cpio.gz"
2
3IMAGE_INSTALL += " \
4 test-nohz-ticks \
5 test-nohz-stability \
6 stress \
7 "
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 @@
1From 6f8a3d2a1ea680295815e5460fc13ca596893e3c Mon Sep 17 00:00:00 2001
2From: Martin Borg <martin.borg@enea.com>
3Date: Mon, 3 Mar 2014 13:35:08 +0100
4Subject: [PATCH 2/2] nohz: Drop generic vtime obsolete dependency on
5 CONFIG_64BIT
6
7---
8 init/Kconfig | 2 +-
9 kernel/time/Kconfig | 1 -
10 2 files changed, 1 insertion(+), 2 deletions(-)
11
12diff --git a/init/Kconfig b/init/Kconfig
13index 0b5d0c8..d7411e5 100644
14--- a/init/Kconfig
15+++ b/init/Kconfig
16@@ -325,7 +325,7 @@ config VIRT_CPU_ACCOUNTING_NATIVE
17
18 config VIRT_CPU_ACCOUNTING_GEN
19 bool "Full dynticks CPU time accounting"
20- depends on HAVE_CONTEXT_TRACKING && 64BIT
21+ depends on HAVE_CONTEXT_TRACKING
22 select VIRT_CPU_ACCOUNTING
23 select CONTEXT_TRACKING
24 help
25diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
26index 70f27e8..c270b48 100644
27--- a/kernel/time/Kconfig
28+++ b/kernel/time/Kconfig
29@@ -100,7 +100,6 @@ config NO_HZ_FULL
30 # RCU_USER_QS dependency
31 depends on HAVE_CONTEXT_TRACKING
32 # VIRT_CPU_ACCOUNTING_GEN dependency
33- depends on 64BIT
34 select NO_HZ_COMMON
35 select RCU_USER_QS
36 select RCU_NOCB_CPU
37--
381.7.10.4
39
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 @@
1From 619480006f78ebf87d80b73d4085a52a1de56feb Mon Sep 17 00:00:00 2001
2From: Martin Borg <martin.borg@enea.com>
3Date: Mon, 3 Mar 2014 13:34:43 +0100
4Subject: [PATCH 1/2] sched/nohz: Fix overflow error in
5 scheduler_tick_max_deferment()
6
7---
8 include/linux/jiffies.h | 4 ++++
9 kernel/sched/core.c | 2 +-
10 2 files changed, 5 insertions(+), 1 deletion(-)
11
12diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
13index 8fb8edf..ac69959 100644
14--- a/include/linux/jiffies.h
15+++ b/include/linux/jiffies.h
16@@ -290,6 +290,10 @@ extern unsigned long preset_lpj;
17 */
18 extern unsigned int jiffies_to_msecs(const unsigned long j);
19 extern unsigned int jiffies_to_usecs(const unsigned long j);
20+static inline u64 jiffies_to_nsecs(const unsigned long j)
21+{
22+ return (u64)jiffies_to_usecs(j) * NSEC_PER_USEC;
23+}
24 extern unsigned long msecs_to_jiffies(const unsigned int m);
25 extern unsigned long usecs_to_jiffies(const unsigned int u);
26 extern unsigned long timespec_to_jiffies(const struct timespec *value);
27diff --git a/kernel/sched/core.c b/kernel/sched/core.c
28index 59c7367..8c3d8bf 100644
29--- a/kernel/sched/core.c
30+++ b/kernel/sched/core.c
31@@ -2779,7 +2779,7 @@ u64 scheduler_tick_max_deferment(void)
32 if (time_before_eq(next, now))
33 return 0;
34
35- return jiffies_to_usecs(next - now) * NSEC_PER_USEC;
36+ return jiffies_to_nsecs(next - now);
37 }
38
39 static __init int sched_nohz_full_init_debug(void)
40--
411.7.10.4
42
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 @@
1From 92f0d4f695198fcb935cf0360f93a15bf0a6af1e Mon Sep 17 00:00:00 2001
2From: Kevin Hilman <khilman@linaro.org>
3Date: Mon, 16 Sep 2013 15:43:48 -0700
4Subject: [PATCH 3/3] sched/nohz: add debugfs control over
5 sched_tick_max_deferment
6
7Allow debugfs override of sched_tick_max_deferment in order to ease
8finding/fixing the remaining issues with full nohz.
9
10The value to be written is in jiffies, and -1 means the max deferment
11is disabled (scheduler_tick_max_deferment() returns KTIME_MAX.)
12
13Cc: Frederic Weisbecker <fweisbec@gmail.com>
14Signed-off-by: Kevin Hilman <khilman@linaro.org>
15---
16 kernel/sched/core.c | 16 +++++++++++++++-
17 1 file changed, 15 insertions(+), 1 deletion(-)
18
19diff --git a/kernel/sched/core.c b/kernel/sched/core.c
20index e8b3350..59c7367 100644
21--- a/kernel/sched/core.c
22+++ b/kernel/sched/core.c
23@@ -2753,6 +2753,8 @@ void scheduler_tick(void)
24 }
25
26 #ifdef CONFIG_NO_HZ_FULL
27+static u32 sched_tick_max_deferment = HZ;
28+
29 /**
30 * scheduler_tick_max_deferment
31 *
32@@ -2769,13 +2771,25 @@ u64 scheduler_tick_max_deferment(void)
33 struct rq *rq = this_rq();
34 unsigned long next, now = ACCESS_ONCE(jiffies);
35
36- next = rq->last_sched_tick + HZ;
37+ if (sched_tick_max_deferment == -1)
38+ return KTIME_MAX;
39+
40+ next = rq->last_sched_tick + sched_tick_max_deferment;
41
42 if (time_before_eq(next, now))
43 return 0;
44
45 return jiffies_to_usecs(next - now) * NSEC_PER_USEC;
46 }
47+
48+static __init int sched_nohz_full_init_debug(void)
49+{
50+ debugfs_create_u32("sched_tick_max_deferment", 0644, NULL,
51+ &sched_tick_max_deferment);
52+
53+ return 0;
54+}
55+late_initcall(sched_nohz_full_init_debug);
56 #endif
57
58 notrace unsigned long get_parent_ip(unsigned long addr)
59--
601.7.10.4
61
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 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3SRC_URI += "\
4 file://cfg/00039-nohz.cfg \
5 file://patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch \
6 file://patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch \
7 file://patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch \
8 "
9
10KERNEL_FEATURES += " \
11 cfg/00039-nohz \
12 "
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 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3SRC_URI += "\
4 file://cfg/00038-hotplug_cpu.cfg \
5 file://cfg/00039-nohz.cfg \
6 file://patches/sched-nohz-add-debugfs-control-over-sched_tick_max_d.patch \
7 file://patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch \
8 file://patches/nohz-Drop-generic-vtime-obsolete-dependency-on-CONFI.patch \
9 "
diff --git a/recipes-test/test-nohz-stability/files/test-nohz-stability b/recipes-test/test-nohz-stability/files/test-nohz-stability
new file mode 100755
index 0000000..b65fd96
--- /dev/null
+++ b/recipes-test/test-nohz-stability/files/test-nohz-stability
@@ -0,0 +1,37 @@
1#!/bin/sh
2
3partitioning_done=false
4
5cleanup () {
6 $partitioning_done && partrt undo
7 exit $1
8}
9
10cd /opt/ltp || cleanup 1
11
12# Perform partitioning, if not already done
13if [ ! -d /sys/fs/cgroup/cpuset/rt ]; then
14 partrt create $(list2mask --nohz) || cleanup 1
15 partitioning_done=true
16fi
17
18echo
19echo "*******"
20echo "* NRT *"
21echo "*******"
22echo
23
24partrt run rt stress -i 1 || cleanup 1 &
25CHILD_PID=$!
26partrt run nrt systest-runner || cleanup 1
27kill $CHILD_PID || cleanup 1
28
29echo
30echo "******"
31echo "* RT *"
32echo "******"
33echo
34
35partrt run rt systest-runner || cleanup 1
36
37cleanup 0
diff --git a/recipes-test/test-nohz-stability/test-nohz-stability.bb b/recipes-test/test-nohz-stability/test-nohz-stability.bb
new file mode 100644
index 0000000..5c2405a
--- /dev/null
+++ b/recipes-test/test-nohz-stability/test-nohz-stability.bb
@@ -0,0 +1,21 @@
1
2LICENSE = "BSD"
3LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
4INHIBIT_DEFAULT_DEPS = "1"
5
6SRC_URI = "file://${PN} \
7 "
8
9FILES_${PN} += "${bindir}/${PN}"
10
11RDEPENDS_${PN} = "ltp packagegroup-enea-rt-tools systest-runner"
12
13do_install () {
14 install -D ${WORKDIR}/${PN} ${D}${bindir}/${PN}
15}
16
17# Only a script, no need for patch, configure, compile or build
18do_patch[noexec] = "1"
19do_configure[noexec] = "1"
20do_compile[noexec] = "1"
21do_build[noexec] = "1"
diff --git a/recipes-test/test-nohz-ticks/files/test-nohz-ticks b/recipes-test/test-nohz-ticks/files/test-nohz-ticks
new file mode 100755
index 0000000..f6d7546
--- /dev/null
+++ b/recipes-test/test-nohz-ticks/files/test-nohz-ticks
@@ -0,0 +1,32 @@
1#!/bin/sh
2
3cd /opt/ltp >/dev/null
4
5partitioning_done=false
6
7# Perform partitioning, if not already done
8if [ ! -d /sys/fs/cgroup/cpuset/rt ]; then
9 partrt create 0x$(list2mask --nohz)
10 partitioning_done=true
11fi
12
13logname=`date +"%Y_%m_%d_%H_%M_%S"`".log"
14./runltp -n -i 5 -p -d /tmp -l $logname -f partrt_nohz_full
15
16if [ ! -d ./results ]; then
17 echo "FAIL: no result found"
18 $partitioning_done && partrt undo
19 exit 1
20fi
21
22cat ./results/$logname | while read line
23do
24 resultLine=`echo $line | grep -c -E "PASS|FAIL"`
25 if [ $resultLine -eq 1 ]; then
26 testcase=`echo $line | awk '{print $1}'`
27 result=`echo $line | awk '{print $2}'`
28 echo "$result: $testcase"
29 fi
30done
31
32$partitioning_done && partrt undo
diff --git a/recipes-test/test-nohz-ticks/test-nohz-ticks.bb b/recipes-test/test-nohz-ticks/test-nohz-ticks.bb
new file mode 100644
index 0000000..047cffd
--- /dev/null
+++ b/recipes-test/test-nohz-ticks/test-nohz-ticks.bb
@@ -0,0 +1,21 @@
1
2LICENSE = "BSD"
3LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
4INHIBIT_DEFAULT_DEPS = "1"
5
6SRC_URI = "file://${PN} \
7 "
8
9FILES_${PN} += "${bindir}/${PN}"
10
11RDEPENDS_${PN} = "ltp packagegroup-enea-rt-tools"
12
13do_install () {
14 install -D ${WORKDIR}/${PN} ${D}${bindir}/${PN}
15}
16
17# Only a script, no need for patch, configure, compile or build
18do_patch[noexec] = "1"
19do_configure[noexec] = "1"
20do_compile[noexec] = "1"
21do_build[noexec] = "1"