On 04/19/2011 12:32 PM, Balbir Singh wrote: > * Jan Safranek <jsafr...@redhat.com> [2011-04-18 14:59:43]: > >> cgconfig.conf man page should describe how to work with named hierarchies, >> including a simple example. >> >> Signed-off-by: Jan Safranek <jsafr...@redhat.com> >> --- >> >> doc/man/cgconfig.conf.5 | 84 >> +++++++++++++++++++++++++++++++++++++++++++---- >> 1 files changed, 77 insertions(+), 7 deletions(-) >> >> diff --git a/doc/man/cgconfig.conf.5 b/doc/man/cgconfig.conf.5 >> index 5d0be4b..ee80910 100644 >> --- a/doc/man/cgconfig.conf.5 >> +++ b/doc/man/cgconfig.conf.5 >> @@ -38,7 +38,10 @@ mount { >> Name of kernel subsystem. List of subsystems supported by kernel >> can be found in >> .I /proc/cgroups >> -file. >> +file. Named hierarchy can be specified as controller >> +\fB"name=<somename>"\fR. Do not forget to use double quotes around >> +this controller name (see examples below). >> + >> .B Libcgroup >> merges all subsystems mounted to the same directory (see >> Example 1) and the directory is mounted only once. >> @@ -87,7 +90,7 @@ The root control group is always created automatically in >> all hierarchies >> and it is the base of the group hierarchy. It can be explicitly specified in >> .B cgconfig.conf >> file by using '.' as group name. This can be used e.g. to set its >> permissions, >> -as shown in Example 5. >> +as shown in Example 6. >> >> When the parent control group of a subgroup is not specified, >> then it is created automatically. >> @@ -168,7 +171,7 @@ parameters. >> .B param value >> Value, which should be written to the file when the control group is >> created. Optionally it can be enclosed in double quotes `"', it can >> -contain spaces then. >> +contain spaces and other special characters then. >> .RE >> >> .\"********************************************" >> @@ -208,6 +211,73 @@ The configuration file: >> mount { >> .RS >> cpu = /mnt/cgroups/cpu; >> +"name=scheduler" = /mnt/cgroups/cpu; >> +"name=noctrl" = /mnt/cgroups/noctrl; >> +.RE >> +} >> + >> +group daemons { >> +.RS >> +cpu { >> +.RS >> +cpu.shares = "1000"; >> +.RE >> +} >> +.RE >> +} >> +group test { >> +.RS >> +"name=noctrl" { >> +} >> +.RE >> +} >> +.RE >> +.fi >> +creates two hierarchies. One hierarchy named \fBscheduler\fR controlled by >> cpu >> +subsystem, with group \fBdaemons\fR inside. Second hierarchy is named >> +\fBnoctrl\fR without any controller, with group \fBtest\fR. It corresponds >> to >> +following operations: >> +.LP >> +.RS >> +.nf >> +mkdir /mnt/cgroups/cpu >> +mount -t cgroup -o cpu,name=scheduler cpu /mnt/cgroups/cpu >> +mount -t cgroup -o none,name=noctrl none /mnt/cgroups/noctrl >> + >> +mkdir /mnt/cgroups/cpu/daemons >> +echo 1000 > /mnt/cgroups/cpu/daemons/www/cpu.shares >> + >> +mkdir /mnt/cgroups/noctrl/tests >> +.fi >> +.RE >> + >> +The >> +.I daemons >> +group is created automatically when its first subgroup is >> +created. All its parameters have the default value and only root can >> +access group's files. >> +.LP > > From here to > >> +Since both >> +.I cpuacct >> +and >> +.I cpu >> +subsystems are mounted to the same directory, all >> +groups are implicitly controlled also by >> +.I cpuacct >> +subsystem, even if there is no >> +.I cpuacct >> +section in any of the groups. >> +.RE > > here, This is a little confusing, since it applies to example 1, but appears > after example 2.
Oops, I forgot to delete it while copying Example 3 - you can notice the exactly same text is there (+ also the previous paragraph). I'll remove these paragraphs completely. Thanks for review! Jan ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel