aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-02-26 02:40:15 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-26 07:22:38 -0500
commitc40c6f85a7594ad842233885386a0ca4cd40eafe (patch)
treec04285769854afb32bb9d97224eb0a27f40b343c /kernel/sched.c
parent4434e5156409eb3ec98f5ad7f0a0c07ebafe970d (diff)
cpuacct: add a branch prediction
cpuacct_charge() is in fast-path, and checking of !cpuacct_susys.active always returns false after cpuacct has been initialized at system boot. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Menage <menage@google.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 5475d56a20f1..8e63ffb6ed05 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -9684,7 +9684,7 @@ static void cpuacct_charge(struct task_struct *tsk, u64 cputime)
9684 struct cpuacct *ca; 9684 struct cpuacct *ca;
9685 int cpu; 9685 int cpu;
9686 9686
9687 if (!cpuacct_subsys.active) 9687 if (unlikely(!cpuacct_subsys.active))
9688 return; 9688 return;
9689 9689
9690 cpu = task_cpu(tsk); 9690 cpu = task_cpu(tsk);