[systemd-devel] Systemd and cgroups

Kevin Wilson wkevils at gmail.com
Thu Apr 11 03:46:11 PDT 2013


Hello,
This is a default fedore 18 machine with default kernel. Kernel came
with the F18 disto, no changes. No special things like LXC/OpenVZ. So
I guess no 3rd party mount any cgroup.

>then systemd itself will mount all the resource controllers
that are compiled into the kernel.

How ?
I don't know of an API to query from userspace which cgroups are built
in into the kernel. Is there such an API ?!
I will appreciate if someone will point where in systemd code this
mounting of all built in kernel cgroups controllers is done.


I suppose that systemd mount all controllers **without** name=systemd,
am I right ? because the name=systemd does not appear in any
controller except  /sys/fs/cgroup/systemd (see the initial post in
this thread).

Is there a way to know whether a mount was done by systemd or not ?

Sorry for so much questions, I simply try to fully understand.

Regards,
Kevin


On Wed, Apr 10, 2013 at 1:14 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
> On Wed, Apr 10, 2013 at 12:43:56PM +0300, Kevin Wilson wrote:
>> Hello,
>> I have a question about systemd and cgroups:
>> "mount | grep cgroups" shows that only one entry has name=systemd.
>> and is mounted on /sys/fs/cgroup/systemd . (see below the full output
>> of "mount | grep cgroups"
>>
>> Is it true that all other cgroup entry shown by "mount | grep cgroups"
>> were not mounted by systemd (and may be unmounted without directly
>> causing problems is systemd)?
>
> If some 3rd party application has mounted cgroups controllers before
> systemd starts, it will honour that setup. If they were not already
> mounted, then systemd itself will mount all the resource controllers
> that are compiled into the kernel.
>
> Systemd will only actually create sub-dirs in those controllers
> that are listed in the 'DefaultControllers' setting of systemd.conf,
> which defaults to 'cpu'.
>
> Daniel
> --
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the systemd-devel mailing list