lkml.org 
[lkml]   [2009]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpuacct: add a branch prediction
* Li Zefan <lizf@cn.fujitsu.com> [2009-02-26 16:41:20]:

> Balbir Singh wrote:
> > * Li Zefan <lizf@cn.fujitsu.com> [2009-02-26 15:40:15]:
> >
> >> 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>
> >> ---
> >> kernel/sched.c | 2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/kernel/sched.c b/kernel/sched.c
> >> index 410eec4..fd2f7fc 100644
> >> --- a/kernel/sched.c
> >> +++ b/kernel/sched.c
> >> @@ -9589,7 +9589,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))
> >
> > What happens if most distros make cpuacct_subsys active? Can we decide
> > on unlikely depending on how the system is configured?
> >
>
> Note, it's ->active but not ->disabled. ;)
>

I've seen that

> And note, I make it "unlikely(!cpuacct_subsys.active)", but not "unlikely(cpuacct_subsys.active)"
>
> ->active can't be configured by users. If CONFIG_CGROUP_CPUACCT is enabled,
> cpuacct_subsys.active will be set to true after cpuacct is initialized.
>

My point is the likely/unlikely in this case depends on turning on/off
CONFIG_CGROUP_CPUACCT? Am I missing something?


--
Balbir


\
 
 \ /
  Last update: 2009-02-26 11:43    [W:0.076 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site