From ed8c0a7cf8ad14ca6a6c1dcab4d9f936fcd59bdf Mon Sep 17 00:00:00 2001 From: Frode Isaksen Date: Tue, 5 Dec 2017 17:21:44 +0000 Subject: blsched: user space big.LITTLE scheduler Optimizes task placement on big.LITTLE platforms. Currently enabled for renesas r-car gen3 boards with the machine feature 'biglittle' defined. Change-Id: Idee5e759f13b3942496a831c444799b880caac89 Signed-off-by: Frode Isaksen --- meta-blsched/COPYING.MIT | 17 +++++++++ meta-blsched/README.md | 42 ++++++++++++++++++++++ meta-blsched/conf/layer.conf | 10 ++++++ .../arm-trusted-firmware_git.bbappend | 1 + meta-blsched/recipes-core/blsched/blsched_git.bb | 36 +++++++++++++++++++ .../recipes-core/blsched/files/blsched.service | 9 +++++ .../recipes-kernel/linux/linux-renesas_%.bbappend | 4 +++ templates/feature/blsched/50_bblayers.conf.inc | 3 ++ templates/feature/blsched/50_local.conf.inc | 1 + 9 files changed, 123 insertions(+) create mode 100644 meta-blsched/COPYING.MIT create mode 100644 meta-blsched/README.md create mode 100644 meta-blsched/conf/layer.conf create mode 100644 meta-blsched/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend create mode 100644 meta-blsched/recipes-core/blsched/blsched_git.bb create mode 100644 meta-blsched/recipes-core/blsched/files/blsched.service create mode 100644 meta-blsched/recipes-kernel/linux/linux-renesas_%.bbappend create mode 100644 templates/feature/blsched/50_bblayers.conf.inc create mode 100644 templates/feature/blsched/50_local.conf.inc diff --git a/meta-blsched/COPYING.MIT b/meta-blsched/COPYING.MIT new file mode 100644 index 0000000..89de354 --- /dev/null +++ b/meta-blsched/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/meta-blsched/README.md b/meta-blsched/README.md new file mode 100644 index 0000000..e3a9475 --- /dev/null +++ b/meta-blsched/README.md @@ -0,0 +1,42 @@ +# Baylibre's AGL blsched layer + +This README file contains information on the contents of the +meta-blsched layer. + +Please see the corresponding sections below for details. + +### Dependencies +------------------------- + +The linux kernel must have the following config options enabled: +CONFIG_CONNECTOR +CONFIG_PROC_EVENTS +CONFIG_SCHED_DEBUG + +### Patches +----------- + +Please submit any patches against the meta-blsched layer to the +the maintainers: + +* Michael Turquette +* Frode Isaksen +* Jerome Brunet + +## I. Description and provided packages: + +The layer provides blsched utility. This package is a utility to improve scheduling efficiency on big.LITTLE architecture. + ++ Provided packages : + - blsched : see https://github.com/BayLibre/bLsched/blob/master/README.md + - blsched-daemon : systemd service tailored for r8a7795 and r8a7796 SoCs + +## II. Adding the meta-blsched layer to your AGL build + +1. Download meta-agl-extra at `$AGL_TOP` +2. Add `blsched` to the feature of your AGL build
+```shell +source meta-agl/scripts/aglsetup.sh -m $MACHINE -b blsched +``` + +With this `meta-blsched` will be added to your `conf/bblayers.conf`. `blsched` and `blsched-daemon` will be appended to your image. diff --git a/meta-blsched/conf/layer.conf b/meta-blsched/conf/layer.conf new file mode 100644 index 0000000..68a179a --- /dev/null +++ b/meta-blsched/conf/layer.conf @@ -0,0 +1,10 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "blsched" +BBFILE_PATTERN_blsched = "^${LAYERDIR}/" +BBFILE_PRIORITY_blsched = "6" diff --git a/meta-blsched/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend b/meta-blsched/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend new file mode 100644 index 0000000..b5a7aaa --- /dev/null +++ b/meta-blsched/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend @@ -0,0 +1 @@ +export PSCI_DISABLE_BIGLITTLE_IN_CA57BOOT="${@bb.utils.contains('MACHINE_FEATURES','biglittle','0','1',d)}" diff --git a/meta-blsched/recipes-core/blsched/blsched_git.bb b/meta-blsched/recipes-core/blsched/blsched_git.bb new file mode 100644 index 0000000..af7db3a --- /dev/null +++ b/meta-blsched/recipes-core/blsched/blsched_git.bb @@ -0,0 +1,36 @@ +SUMMARY = "big.LITTLE scheduler" +HOMEPAGE = "https://github.com/BayLibre/bLsched" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b0df75b2edb80ee98b732ee0514a265c" + +SRC_URI = "git://github.com/baylibre/blsched.git \ + file://blsched.service \ + " + +SRCREV = "b6bf199bc2def486857fb7003a6cb07708ed685e" + +S = "${WORKDIR}/git" + +inherit autotools + +COMPATIBLE_MACHINE ="((h|m)3ulcb|salvator-x)" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +DAEMONARGS_r8a7795 = "-b 0 -b 1 -b 2 -b 3" +DAEMONARGS_r8a7796 = "-b 0 -b 1" + +RDEPENDS_${PN} += " blsched" + +inherit systemd + +SYSTEMD_SERVICE_${PN} = "blsched.service" + +do_install_append () { + # Install the systemd init file + install -d ${D}${systemd_unitdir}/system + install -c -m 0644 ${WORKDIR}/blsched.service ${D}${systemd_unitdir}/system + + sed -i -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@ARGS@,${DAEMONARGS},g' \ + ${D}${systemd_unitdir}/system/*.service +} diff --git a/meta-blsched/recipes-core/blsched/files/blsched.service b/meta-blsched/recipes-core/blsched/files/blsched.service new file mode 100644 index 0000000..b26b1fa --- /dev/null +++ b/meta-blsched/recipes-core/blsched/files/blsched.service @@ -0,0 +1,9 @@ +[Unit] +Description=blsched big.LITTLE cpu manager service +After=local-fs.target + +[Service] +ExecStart=@SBINDIR@/blsched @ARGS@ + +[Install] +WantedBy=multi-user.target diff --git a/meta-blsched/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-blsched/recipes-kernel/linux/linux-renesas_%.bbappend new file mode 100644 index 0000000..354734e --- /dev/null +++ b/meta-blsched/recipes-kernel/linux/linux-renesas_%.bbappend @@ -0,0 +1,4 @@ +SRC_URI_append = " \ + ${@bb.utils.contains('MACHINE_FEATURES','biglittle','file://procevent.cfg','',d)} \ + ${@bb.utils.contains('MACHINE_FEATURES','biglittle','file://scheddebug.cfg','',d)} \ + " diff --git a/templates/feature/blsched/50_bblayers.conf.inc b/templates/feature/blsched/50_bblayers.conf.inc new file mode 100644 index 0000000..0db260d --- /dev/null +++ b/templates/feature/blsched/50_bblayers.conf.inc @@ -0,0 +1,3 @@ +BBLAYERS =+ "\ + ${METADIR}/meta-agl-extra/meta-blsched \ + " diff --git a/templates/feature/blsched/50_local.conf.inc b/templates/feature/blsched/50_local.conf.inc new file mode 100644 index 0000000..658230e --- /dev/null +++ b/templates/feature/blsched/50_local.conf.inc @@ -0,0 +1 @@ +IMAGE_INSTALL_append = " blsched" -- cgit 1.2.3-korg