[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-b815f1963e47b9b69bb17e0588bd5af5b1114ae0@git.kernel.org>
Date: Wed, 26 Jan 2011 12:10:13 GMT
From: tip-bot for Paul Turner <pjt@...gle.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
a.p.zijlstra@...llo.nl, pjt@...gle.com, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:sched/core] sched: Fix/remove redundant cfs_rq checks
Commit-ID: b815f1963e47b9b69bb17e0588bd5af5b1114ae0
Gitweb: http://git.kernel.org/tip/b815f1963e47b9b69bb17e0588bd5af5b1114ae0
Author: Paul Turner <pjt@...gle.com>
AuthorDate: Fri, 21 Jan 2011 20:45:00 -0800
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 26 Jan 2011 12:31:02 +0100
sched: Fix/remove redundant cfs_rq checks
Since updates are against an entity's queuing cfs_rq it's not possible to
enter update_cfs_{shares,load} with a NULL cfs_rq. (Indeed, update_cfs_load
would crash prior to the check if we did anyway since we load is examined
during the initializers).
Also, in the update_cfs_load case there's no point
in maintaining averages for rq->cfs_rq since we don't perform shares
distribution at that level -- NULL check is replaced accordingly.
Thanks to Dan Carpenter for pointing out the deference before NULL check.
Signed-off-by: Paul Turner <pjt@...gle.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
LKML-Reference: <20110122044851.825284940@...gle.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/sched_fair.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index ccecfec..1997383 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -722,7 +722,7 @@ static void update_cfs_load(struct cfs_rq *cfs_rq, int global_update)
u64 now, delta;
unsigned long load = cfs_rq->load.weight;
- if (!cfs_rq)
+ if (cfs_rq->tg == &root_task_group)
return;
now = rq_of(cfs_rq)->clock;
@@ -830,9 +830,6 @@ static void update_cfs_shares(struct cfs_rq *cfs_rq, long weight_delta)
struct sched_entity *se;
long shares;
- if (!cfs_rq)
- return;
-
tg = cfs_rq->tg;
se = tg->se[cpu_of(rq_of(cfs_rq))];
if (!se)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists