diff options
author | Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> | 2007-12-02 20:04:49 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-12-02 20:04:49 +0100 |
commit | d842de871c8c5e2110c7e4f3f29bbe7b1a519ab8 (patch) | |
tree | 3a0be7d00de97c561e486242f11eec0e1281074b /include/linux/cgroup_subsys.h | |
parent | 92d499d991ec4f5cbd00d6f33967eab9d3ee8d6c (diff) | |
download | linux-stable-d842de871c8c5e2110c7e4f3f29bbe7b1a519ab8.tar.gz linux-stable-d842de871c8c5e2110c7e4f3f29bbe7b1a519ab8.tar.bz2 linux-stable-d842de871c8c5e2110c7e4f3f29bbe7b1a519ab8.zip |
sched: cpu accounting controller (V2)
Commit cfb5285660aad4931b2ebbfa902ea48a37dfffa1 removed a useful feature for
us, which provided a cpu accounting resource controller. This feature would be
useful if someone wants to group tasks only for accounting purpose and doesnt
really want to exercise any control over their cpu consumption.
The patch below reintroduces the feature. It is based on Paul Menage's
original patch (Commit 62d0df64065e7c135d0002f069444fbdfc64768f), with
these differences:
- Removed load average information. I felt it needs more thought (esp
to deal with SMP and virtualized platforms) and can be added for
2.6.25 after more discussions.
- Convert group cpu usage to be nanosecond accurate (as rest of the cfs
stats are) and invoke cpuacct_charge() from the respective scheduler
classes
- Make accounting scalable on SMP systems by splitting the usage
counter to be per-cpu
- Move the code from kernel/cpu_acct.c to kernel/sched.c (since the
code is not big enough to warrant a new file and also this rightly
needs to live inside the scheduler. Also things like accessing
rq->lock while reading cpu usage becomes easier if the code lived in
kernel/sched.c)
The patch also modifies the cpu controller not to provide the same accounting
information.
Tested-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Tested the patches on top of 2.6.24-rc3. The patches work fine. Ran
some simple tests like cpuspin (spin on the cpu), ran several tasks in
the same group and timed them. Compared their time stamps with
cpuacct.usage.
Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/cgroup_subsys.h')
-rw-r--r-- | include/linux/cgroup_subsys.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index d62fcee9a08a..9ec43186ba80 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h @@ -30,3 +30,10 @@ SUBSYS(cpu_cgroup) #endif /* */ + +#ifdef CONFIG_CGROUP_CPUACCT +SUBSYS(cpuacct) +#endif + +/* */ + |