summaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups/cpuacct.txt
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-07 18:31:54 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-07 18:31:54 +0100
commit673f8205914a12e928c65afbcd78ae748f78df53 (patch)
tree38c60215646d079fab3bff812e094e914960c7ec /Documentation/cgroups/cpuacct.txt
parentBtrfs: stop spinning on mutex_trylock and let the adaptive code spin for us (diff)
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable (diff)
downloadlinux-673f8205914a12e928c65afbcd78ae748f78df53.tar.xz
linux-673f8205914a12e928c65afbcd78ae748f78df53.zip
Merge branch 'linus' into core/locking
Conflicts: fs/btrfs/locking.c
Diffstat (limited to 'Documentation/cgroups/cpuacct.txt')
-rw-r--r--Documentation/cgroups/cpuacct.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/Documentation/cgroups/cpuacct.txt b/Documentation/cgroups/cpuacct.txt
new file mode 100644
index 000000000000..bb775fbe43d7
--- /dev/null
+++ b/Documentation/cgroups/cpuacct.txt
@@ -0,0 +1,32 @@
+CPU Accounting Controller
+-------------------------
+
+The CPU accounting controller is used to group tasks using cgroups and
+account the CPU usage of these groups of tasks.
+
+The CPU accounting controller supports multi-hierarchy groups. An accounting
+group accumulates the CPU usage of all of its child groups and the tasks
+directly present in its group.
+
+Accounting groups can be created by first mounting the cgroup filesystem.
+
+# mkdir /cgroups
+# mount -t cgroup -ocpuacct none /cgroups
+
+With the above step, the initial or the parent accounting group
+becomes visible at /cgroups. At bootup, this group includes all the
+tasks in the system. /cgroups/tasks lists the tasks in this cgroup.
+/cgroups/cpuacct.usage gives the CPU time (in nanoseconds) obtained by
+this group which is essentially the CPU time obtained by all the tasks
+in the system.
+
+New accounting groups can be created under the parent group /cgroups.
+
+# cd /cgroups
+# mkdir g1
+# echo $$ > g1
+
+The above steps create a new group g1 and move the current shell
+process (bash) into it. CPU time consumed by this bash and its children
+can be obtained from g1/cpuacct.usage and the same is accumulated in
+/cgroups/cpuacct.usage also.