summaryrefslogtreecommitdiffstats
path: root/meta-eas/recipes-kernel/linux/linux-renesas/0058-sched-fair-Add-energy_diff-dead-zone-margin.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-eas/recipes-kernel/linux/linux-renesas/0058-sched-fair-Add-energy_diff-dead-zone-margin.patch')
-rw-r--r--meta-eas/recipes-kernel/linux/linux-renesas/0058-sched-fair-Add-energy_diff-dead-zone-margin.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta-eas/recipes-kernel/linux/linux-renesas/0058-sched-fair-Add-energy_diff-dead-zone-margin.patch b/meta-eas/recipes-kernel/linux/linux-renesas/0058-sched-fair-Add-energy_diff-dead-zone-margin.patch
new file mode 100644
index 0000000..163fb7c
--- /dev/null
+++ b/meta-eas/recipes-kernel/linux/linux-renesas/0058-sched-fair-Add-energy_diff-dead-zone-margin.patch
@@ -0,0 +1,53 @@
+From 91820aa3145f93421c29834315616f338b4fcca2 Mon Sep 17 00:00:00 2001
+From: Morten Rasmussen <morten.rasmussen@arm.com>
+Date: Wed, 30 Mar 2016 14:20:12 +0100
+Subject: [PATCH 58/92] sched/fair: Add energy_diff dead-zone margin
+
+It is not worth the overhead to migrate tasks for tiny insignificant
+energy savings. To prevent this, an energy margin is introduced in
+energy_diff() which effectively adds a dead-zone that rounds tiny energy
+differences to zero. Since no scale is enforced for energy model data
+the margin can't be absolute. Instead it is defined as +/-1.56% energy
+saving compared to the current total estimated energy consumption.
+
+(cherry picked from commit c36ecf27db72f60934ce2c9ca7e3d97a80926c1c)
+Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
+---
+ kernel/sched/fair.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
+index 799e2b5..5e13787 100644
+--- a/kernel/sched/fair.c
++++ b/kernel/sched/fair.c
+@@ -5556,6 +5556,7 @@ static int energy_diff(struct energy_env *eenv)
+ struct sched_domain *sd;
+ struct sched_group *sg;
+ int sd_cpu = -1, energy_before = 0, energy_after = 0;
++ int diff, margin;
+
+ struct energy_env eenv_before = {
+ .util_delta = 0,
+@@ -5588,7 +5589,18 @@ static int energy_diff(struct energy_env *eenv)
+ }
+ } while (sg = sg->next, sg != sd->groups);
+
+- return energy_after-energy_before;
++ /*
++ * Dead-zone margin preventing too many migrations.
++ */
++
++ margin = energy_before >> 6; /* ~1.56% */
++
++ diff = energy_after-energy_before;
++
++ if (abs(diff) < margin)
++ return 0;
++
++ return diff;
+ }
+
+ /*
+--
+1.9.1
+