Subject: Re: [vserver] util vserver and cgroups
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Tue, 24 Feb 2009 11:33:53 +0100

On Tue, Feb 24, 2009 at 08:30:26AM +0100, ADNET Ghislain wrote:
> Herbert Poetzl a écrit :
> >On Mon, Feb 23, 2009 at 10:40:42PM +0100, ADNET Ghislain wrote:

> >>Hello,

> >> Is this possible to configure cgroups in the latest vserver patch so
> >>we can divide cpu between guest in a non even way. Like for exemple
> >>20%/20%/50%/10% ?

> >>  The utils create one cgroups for each vserver but i cannnot see 
> >>  a way to divide cpu power between them :)

> >just assign the proper shares to each cgroup,
> >no idea if util-vserver has a config entry for
> >them, Daniel?

> >HTH,
> >Herbert

> i am not sure if this is me but i do not find anywhere anything for 
> giving share to different cgroups. I see how to create cpusets ok but 
> those are not capable of dividing the cpu power but just the cpu cores 
> (so you can make 1/4 x4 or 1/2  x2 but not a custom 37% for exemple. I 
> readed the  util-vserver docs and the 
> http://www.mjmwired.net/kernel/Documentation/cgroups.txt docs but i do 
> not find any hints on it.
> 
> I have this in my cgroup for a vserver guest:

cpusets and cgroups are related, but not identical,

> drwxr-xr-x 2 root root 0 fév 23 15:03 .
> drwxr-xr-x 6 root root 0 fév 19 18:28 ..
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuacct.usage
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.cpu_exclusive
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.cpus
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.mem_exclusive
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.mem_hardwall
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.memory_migrate
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.memory_pressure
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.memory_spread_page
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.memory_spread_slab
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.mems
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.sched_load_balance
> -rw-r--r-- 1 root root 0 fév 23 15:03 cpuset.sched_relax_domain_level
> -rw-r--r-- 1 root root 0 fév 23 15:03 devices.allow
> -rw-r--r-- 1 root root 0 fév 23 15:03 devices.deny
> -rw-r--r-- 1 root root 0 fév 23 15:03 devices.list
> -rw-r--r-- 1 root root 0 fév 23 15:03 freezer.state
> -rw-r--r-- 1 root root 0 fév 23 15:03 notify_on_release
> -rw-r--r-- 1 root root 0 fév 23 15:03 tasks
> 
> 
> my kernel is compiled with :
> 
> CONFIG_CGROUPS=y
> # CONFIG_CGROUP_DEBUG is not set
> # CONFIG_CGROUP_NS is not set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
you want to enable the namespace here

> CONFIG_CGROUP_FREEZER=y
> CONFIG_CGROUP_DEVICE=y
> # CONFIG_CGROUP_SCHED is not set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
you want to use the scheduler too

> CONFIG_CGROUP_CPUACCT=y
> # CONFIG_CGROUP_MEM_RES_CTLR is not set

> Can anyone point me toward the direction ? :)

HTH,
Herbert

> -- 
> Cordialement,
> Ghislain
>