From: Li Zefan Date: Thu, 26 Feb 2009 07:40:15 +0000 (+0800) Subject: cpuacct: add a branch prediction X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c40c6f85a7594ad842233885386a0ca4cd40eafe;p=linux-beck.git 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 Cc: Peter Zijlstra Cc: Paul Menage Cc: Balbir Singh Signed-off-by: Ingo Molnar --- 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) struct cpuacct *ca; int cpu; - if (!cpuacct_subsys.active) + if (unlikely(!cpuacct_subsys.active)) return; cpu = task_cpu(tsk);