[systemd-devel] Avoiding creating systemd memory and blkio controllers under /sys/fs/cgroup/memory and /sys/fs/cgroup/blkio.

Kevin Wilson wkevils at gmail.com
Tue Jan 19 00:35:21 PST 2016


Hi,

Thank you for you quick response.

I run Fedora 23 and made "dnf upgrade" today and rebooted. I have
systemd-222-12.fc23.x86_64, and under
/sys/fs/cgroup/memory
and
 /sys/fs/cgroup/blkio/
 I do see:
system.slice
and
user.slice

And there are some processes attached to subgroups:
cat   /sys/fs/cgroup/blkio/user.slice/user-0.slice/session-1.scope/tasks
852
973

cat   /sys/fs/cgroup/blkio/user.slice/user-0.slice/session-4.scope/tasks
9913
9915
9916
10934
cat   /sys/fs/cgroup/blkio/user.slice/user-0.slice/user at 0.service/tasks
968
970

So  my understanding is (please correct me if I am wrong) that this
version is not high enough
and not what you meant; in case it is so, from which systemd version
is this supprted ?
I am considering installing the latest RawHide Fedora for tests if it is include
systemd which do not add all controllers to "delegation" scopes or services.

Kevin

On Sun, Jan 17, 2016 at 6:09 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Fri, 15.01.16 22:17, Kevin Wilson (wkevils at gmail.com) wrote:
>
>> Hi everyone,
>>
>> I had a Fedora 20 Machine (x86_64) on which I installed the
>> latest 4.4 kernel released this week (I had built it from source). It
>> had systemd  208.
>>
>> I wanted to test cgroup v2 (not in relation to systemd). In order to
>> be able to activate
>> cgoupv2 memory and cgroup controllers, the cgroup v1 controllers must
>> be disabled.
>>
>> When I unmounted /sys/fs/cgroup/memory and /sys/fs/cgroup/blkio and mounted
>> cgroup v2 on /testv2, cat /testv2/cgroup.controllers showed
>> "memeory" and "io", and everything was fine.
>>
>> Then I installed Fedora 22 on this machine, and it has systemd 219.
>> When I tried this
>> same sequence, of unmounting /sys/fs/cgroup/memory and /sys/fs/cgroup/blkio and
>> mounting cgroup v2 on /testv2, cat /testv2/cgroup.controllers showed nothing.
>>
>> Trying to add disabling cgroup memory controller, by adding
>> cgroup_disable=memory,
>> to the kernel command line caused the system to hang in boot (which is
>> what I expected,
>> but tried anyway...)
>>
>> Trying to solve the problem, I came to the conclusion that this is
>> probably because
>> there are processes in the memory and blkio groups which are held by
>> systemd in F22, and  which are not held in F20.
>>
>> On the F22, when I look under /sys/fs/cgouop/memory, I see
>>
>> /sys/fs/cgroup/memory/user.slice/
>> /sys/fs/cgroup/memory/user.slice/user-0.slice/
>> /sys/fs/cgroup/memory/user.slice/user-0.slice/session-10.scope
>> /sys/fs/cgroup/memory/user.slice/user-0.slice/session-2.scope
>> /sys/fs/cgroup/memory/user.slice/user-0.slice/session-9.scope
>> and more
>>
>> And there are pids in many of the tasks entries under this directories.
>>
>> And for the blkio:
>>  /sys/fs/cgroup/blkio/system.slice/
>>  /sys/fs/cgroup/blkio/user.slice/
>>  /sys/fs/cgroup/blkio/user.slice/user-0.slice/
>>  /sys/fs/cgroup/blkio/user.slice/user-0.slice/session-10.scope/
>>  /sys/fs/cgroup/blkio/user.slice/user-0.slice/session-2.scope/
>> /sys/fs/cgroup/blkio/user.slice/user-0.slice/session-9.scope/
>> and more.
>>
>> And here again there are pids in many of the tasks entries under this
>> directories.
>>
>> On the Fedora 20 machine, these entries do not exist, namely there are no
>> systemd entries under both  /sys/fs/cgroup/memory/ and
>> /sys/fs/cgroup/blkio.
>>
>> Is there a way to disable creating these entries by systemd ?
>
> Upgrade your systemd version. Old versions will add all controllers to
> "delegation" scopes or services. Newer version don't do that.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat


More information about the systemd-devel mailing list