[lug] Am I using cgroups?

Lee Woodworth blug-mail at duboulder.com
Thu Mar 7 12:55:35 MST 2013


On 03/07/2013 10:56 AM, Davide Del Vento wrote:
> I'm trying to understand if my machine:
> - has cgroups "enabled" (whatever that may mean, e.g. I may starting
> use them without any system change [let alone a reboot!!] possibly
> besides the cgroup creation)
> - is actually using cgroups.
>
> I base what I know and what I read from:
> https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt
>
> $ cat /proc/cgroups
> #subsys_name    hierarchy       num_cgroups     enabled
> cpuset  0       1       1
> ns      0       1       1
> cpu     0       1       1
> cpuacct 0       1       1
> memory  0       1       1
> devices 0       1       1
> freezer 0       1       1
> net_cls 0       1       1
> blkio   0       1       1
> perf_event      0       1       1
> $ mount | grep group
> $

Not an expert on this, but on a machine with LXC containers (requires cgroups to run):

# cat /proc/cgroups
#subsys_name    hierarchy       num_cgroups     enabled
cpuset  2       9       1
cpu     3       9       1
cpuacct 4       9       1
memory  5       9       1
devices 6       9       1
freezer 7       9       1
blkio   8       9       1
perf_event      9       9       1

So I would guess your kernel has various cgroups configured, but the cgroups are not mounted.

# mount | grep cgroup
cgroup_root on /sys/fs/cgroup type tmpfs 
(rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
openrc on /sys/fs/cgroup/openrc type cgroup 
(rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc)
cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
memory on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
devices on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
blkio on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
perf_event on /sys/fs/cgroup/perf_event type cgroup 
(rw,nosuid,nodev,noexec,relatime,perf_event)

HTH

>
> Does this mean that I have cgroups enabled but I am not using them at present?
>
> Thanks!
> Davide
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety




More information about the LUG mailing list