From bf3a812ac976264e44696b033676575f4cfcc070 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Fri, 27 Jun 2008 13:41:39 +0200 Subject: [PATCH] --- yaml --- r: 100241 b: refs/heads/master c: f5bfb7d9ff73d72ee4f2f4830a6f0c9088d00f92 h: refs/heads/master i: 100239: cd9515bb7fa1d3f3e5cc495ddb3cbb78fc088096 v: v3 --- [refs] | 2 +- trunk/kernel/sched_fair.c | 28 ++++++++++++++++++++++++++++ trunk/kernel/sched_features.h | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 9300715ba7b9..20cf0aa339b5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f1d239f73200a5803a89e5929fb3abc1596b7589 +refs/heads/master: f5bfb7d9ff73d72ee4f2f4830a6f0c9088d00f92 diff --git a/trunk/kernel/sched_fair.c b/trunk/kernel/sched_fair.c index e87f1a52f625..9bcc0030a58b 100644 --- a/trunk/kernel/sched_fair.c +++ b/trunk/kernel/sched_fair.c @@ -1074,6 +1074,27 @@ static inline int wake_idle(int cpu, struct task_struct *p) static const struct sched_class fair_sched_class; #ifdef CONFIG_FAIR_GROUP_SCHED +/* + * effective_load() calculates the load change as seen from the root_task_group + * + * Adding load to a group doesn't make a group heavier, but can cause movement + * of group shares between cpus. Assuming the shares were perfectly aligned one + * can calculate the shift in shares. + * + * The problem is that perfectly aligning the shares is rather expensive, hence + * we try to avoid doing that too often - see update_shares(), which ratelimits + * this change. + * + * We compensate this by not only taking the current delta into account, but + * also considering the delta between when the shares were last adjusted and + * now. + * + * We still saw a performance dip, some tracing learned us that between + * cgroup:/ and cgroup:/foo balancing the number of affine wakeups increased + * significantly. Therefore try to bias the error in direction of failing + * the affine wakeup. + * + */ static long effective_load(struct task_group *tg, int cpu, long wl, long wg) { @@ -1083,6 +1104,13 @@ static long effective_load(struct task_group *tg, int cpu, if (!tg->parent) return wl; + /* + * By not taking the decrease of shares on the other cpu into + * account our error leans towards reducing the affine wakeups. + */ + if (!wl && sched_feat(ASYM_EFF_LOAD)) + return wl; + /* * Instead of using this increment, also add the difference * between when the shares were last updated and now. diff --git a/trunk/kernel/sched_features.h b/trunk/kernel/sched_features.h index 7d616d2a2a3f..862b06bd560a 100644 --- a/trunk/kernel/sched_features.h +++ b/trunk/kernel/sched_features.h @@ -10,3 +10,4 @@ SCHED_FEAT(DOUBLE_TICK, 0) SCHED_FEAT(ASYM_GRAN, 1) SCHED_FEAT(LB_BIAS, 0) SCHED_FEAT(LB_WAKEUP_UPDATE, 1) +SCHED_FEAT(ASYM_EFF_LOAD, 1)