3

I know that ./systemd-219/src/core/mount-setup.c define some cgroup mount path .

But I do not know why systemd create directory /sys/fs/cgroup/systemd/ and what's difference between /sys/fs/cgroup/systemd/ and /sys/fs/cgroup/memory/?

Is /sys/fs/cgroup/systemd/ mount path just mean default cgroup path?

#ll /sys/fs/cgroup/systemd/
total 0
-rw-r--r--  1 root root 0 Jul  6  2017 cgroup.clone_children
--w--w--w-  1 root root 0 Jul  6  2017 cgroup.event_control
-rw-r--r--  1 root root 0 Jul  6 15:24 cgroup.procs
-r--r--r--  1 root root 0 Jul  6  2017 cgroup.sane_behavior
drwxr-xr-x  3 root root 0 Jul  6 15:23 docker.slice
-rw-r--r--  1 root root 0 Jul  6  2017 notify_on_release
-rw-r--r--  1 root root 0 Jul  6  2017 release_agent
drwxr-xr-x 65 root root 0 Jul  6 15:38 system.slice
-rw-r--r--  1 root root 0 Jul  6  2017 tasks
drwxr-xr-x  4 root root 0 Jul  6 21:18 user.slice
1

Systemd 219 uses the Linux kernel cgroup v1 feature and mounts multiple hierarchies under /sys/fs/cgroup, some for controllers, some without.

/sys/fs/cgroup/systemd is a hierarchy without croup controllers, just for systemd usage (tracking which processes are part of which cgroups).

This will change once the migration to cgroup v2 is complete and there will be only one cgroup hierarchy (unified hierarchy).

  • But even with cgroup_no_v1=all system /sys/fs/cgroup/systemd still exist. – 炸鱼薯条德里克 Feb 6 '19 at 5:19
  • If you want systemd to only use the new v2 hierarchy, you should set systemd.unified_cgroup_hierarchy to true on the kernel command line. Those options may differ depending on your systemd version. – Siosm Feb 7 '19 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.