From ec78e8248a229f03b95e5a7609b1ca49023233fa Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Wed, 3 Jun 2009 15:41:20 +0200 Subject: [PATCH] --- yaml --- r: 158333 b: refs/heads/master c: e709715915d69b6a929d77e7652c9c3fea61c317 h: refs/heads/master i: 158331: 47907a6ee37d31f68818c46d753d661f3cb17fbe v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 97645e90f81b..13c067e98077 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5004278f0525dcb9aa43703ef77bf371ea837cd +refs/heads/master: e709715915d69b6a929d77e7652c9c3fea61c317 diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 26976cd8be0f..ca1f76ba7773 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -1629,8 +1629,14 @@ static int tg_load_down(struct task_group *tg, void *data) static void update_shares(struct sched_domain *sd) { - u64 now = cpu_clock(raw_smp_processor_id()); - s64 elapsed = now - sd->last_update; + s64 elapsed; + u64 now; + + if (root_task_group_empty()) + return; + + now = cpu_clock(raw_smp_processor_id()); + elapsed = now - sd->last_update; if (elapsed >= (s64)(u64)sysctl_sched_shares_ratelimit) { sd->last_update = now; @@ -1640,6 +1646,9 @@ static void update_shares(struct sched_domain *sd) static void update_shares_locked(struct rq *rq, struct sched_domain *sd) { + if (root_task_group_empty()) + return; + spin_unlock(&rq->lock); update_shares(sd); spin_lock(&rq->lock); @@ -1647,6 +1656,9 @@ static void update_shares_locked(struct rq *rq, struct sched_domain *sd) static void update_h_load(long cpu) { + if (root_task_group_empty()) + return; + walk_tg_tree(tg_load_down, tg_nop, (void *)cpu); }