|author||Srivatsa Vaddagiri <firstname.lastname@example.org>||2007-12-02 20:04:49 +0100|
|committer||Ingo Molnar <email@example.com>||2007-12-02 20:04:49 +0100|
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 <firstname.lastname@example.org> 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 <email@example.com> Signed-off-by: Balbir Singh <firstname.lastname@example.org> Signed-off-by: Ingo Molnar <email@example.com>
Diffstat (limited to 'init')
1 files changed, 7 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig
index d35e44f4dd6..404bbf3699b 100644
@@ -354,6 +354,13 @@ config FAIR_CGROUP_SCHED
+ bool "Simple CPU accounting cgroup subsystem"
+ depends on CGROUPS
+ Provides a simple Resource Controller for monitoring the
+ total CPU consumed by the tasks in a cgroup
bool "Create deprecated sysfs files"