Skip to content

Commit cfb5285

Browse files
akpm00Linus Torvalds
authored andcommitted
revert "Task Control Groups: example CPU accounting subsystem"
Revert 62d0df6. This was originally intended as a simple initial example of how to create a control groups subsystem; it wasn't intended for mainline, but I didn't make this clear enough to Andrew. The CFS cgroup subsystem now has better functionality for the per-cgroup usage accounting (based directly on CFS stats) than the "usage" status file in this patch, and the "load" status file is rather simplistic - although having a per-cgroup load average report would be a useful feature, I don't believe this patch actually provides it. If it gets into the final 2.6.24 we'd probably have to support this interface for ever. Cc: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 45c682a commit cfb5285

6 files changed

Lines changed: 3 additions & 225 deletions

File tree

‎include/linux/cgroup_subsys.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ SUBSYS(cpuset)
1313

1414
/* */
1515

16-
#ifdef CONFIG_CGROUP_CPUACCT
17-
SUBSYS(cpuacct)
18-
#endif
19-
20-
/* */
21-
2216
#ifdef CONFIG_CGROUP_DEBUG
2317
SUBSYS(debug)
2418
#endif

‎include/linux/cpu_acct.h‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎init/Kconfig‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,6 @@ config CGROUP_NS
301301
for instance virtual servers and checkpoint/restart
302302
jobs.
303303

304-
config CGROUP_CPUACCT
305-
bool "Simple CPU accounting cgroup subsystem"
306-
depends on CGROUPS
307-
help
308-
Provides a simple Resource Controller for monitoring the
309-
total CPU consumed by the tasks in a cgroup
310-
311304
config CPUSETS
312305
bool "Cpuset support"
313306
depends on SMP && CGROUPS

‎kernel/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ obj-$(CONFIG_COMPAT) += compat.o
4040
obj-$(CONFIG_CGROUPS) += cgroup.o
4141
obj-$(CONFIG_CGROUP_DEBUG) += cgroup_debug.o
4242
obj-$(CONFIG_CPUSETS) += cpuset.o
43-
obj-$(CONFIG_CGROUP_CPUACCT) += cpu_acct.o
4443
obj-$(CONFIG_CGROUP_NS) += ns_cgroup.o
4544
obj-$(CONFIG_IKCONFIG) += configs.o
4645
obj-$(CONFIG_STOP_MACHINE) += stop_machine.o

‎kernel/cpu_acct.c‎

Lines changed: 0 additions & 186 deletions
This file was deleted.

‎kernel/sched.c‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#include <linux/cpu.h>
5353
#include <linux/cpuset.h>
5454
#include <linux/percpu.h>
55-
#include <linux/cpu_acct.h>
5655
#include <linux/kthread.h>
5756
#include <linux/seq_file.h>
5857
#include <linux/sysctl.h>
@@ -3338,13 +3337,9 @@ void account_user_time(struct task_struct *p, cputime_t cputime)
33383337
{
33393338
struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
33403339
cputime64_t tmp;
3341-
struct rq *rq = this_rq();
33423340

33433341
p->utime = cputime_add(p->utime, cputime);
33443342

3345-
if (p != rq->idle)
3346-
cpuacct_charge(p, cputime);
3347-
33483343
/* Add user time to cpustat. */
33493344
tmp = cputime_to_cputime64(cputime);
33503345
if (TASK_NICE(p) > 0)
@@ -3408,10 +3403,9 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
34083403
cpustat->irq = cputime64_add(cpustat->irq, tmp);
34093404
else if (softirq_count())
34103405
cpustat->softirq = cputime64_add(cpustat->softirq, tmp);
3411-
else if (p != rq->idle) {
3406+
else if (p != rq->idle)
34123407
cpustat->system = cputime64_add(cpustat->system, tmp);
3413-
cpuacct_charge(p, cputime);
3414-
} else if (atomic_read(&rq->nr_iowait) > 0)
3408+
else if (atomic_read(&rq->nr_iowait) > 0)
34153409
cpustat->iowait = cputime64_add(cpustat->iowait, tmp);
34163410
else
34173411
cpustat->idle = cputime64_add(cpustat->idle, tmp);
@@ -3447,10 +3441,8 @@ void account_steal_time(struct task_struct *p, cputime_t steal)
34473441
cpustat->iowait = cputime64_add(cpustat->iowait, tmp);
34483442
else
34493443
cpustat->idle = cputime64_add(cpustat->idle, tmp);
3450-
} else {
3444+
} else
34513445
cpustat->steal = cputime64_add(cpustat->steal, tmp);
3452-
cpuacct_charge(p, -tmp);
3453-
}
34543446
}
34553447

34563448
/*

0 commit comments

Comments
 (0)