PAYLOAD_CGROUP and cgroups

My container is listed in many cgroup.procs files, but a TRACE shows liblxc is only finding two cgroup hierarchies, both of which have lxc.payload in the name.

Why is it that the only cgroups that are found seem to be the ones containing “lxc.payload” (defined by the PAYLOAD_CGROUP macro).

What’s this “lxc.payload”?

Why are all the other cgroups that are linked to my PID not being included?

Its also odd that I don’t see that PAYLOAD_CGROUP macro being used anywhere in the repo.

Here’s some terse data:

vagrant@ubuntu-bionic:~/lxc$ lxc-info d1 2>/dev/null | grep PID
PID:            9765
vagrant@ubuntu-bionic:~/lxc$ 

vagrant@ubuntu-bionic:~/lxc$ grep -rI 9765 /sys/fs/cgroup/* 2>/dev/null | wc -l
34
vagrant@ubuntu-bionic:~/lxc$ 

vagrant@ubuntu-bionic:~/lxc$ grep -rI 9765 /sys/fs/cgroup/* 2>/dev/null | head
/sys/fs/cgroup/blkio/user.slice/cgroup.procs:9765
/sys/fs/cgroup/blkio/user.slice/tasks:9765
/sys/fs/cgroup/cpu/user.slice/cgroup.procs:9765
/sys/fs/cgroup/cpu/user.slice/tasks:9765
/sys/fs/cgroup/cpu,cpuacct/user.slice/cgroup.procs:9765
/sys/fs/cgroup/cpu,cpuacct/user.slice/tasks:9765
/sys/fs/cgroup/cpuacct/user.slice/cgroup.procs:9765
/sys/fs/cgroup/cpuacct/user.slice/tasks:9765
/sys/fs/cgroup/cpuset/cgroup.procs:9765
/sys/fs/cgroup/cpuset/tasks:9765

vagrant@ubuntu-bionic:~/lxc$ grep -rI 9765 /sys/fs/cgroup/* 2>/dev/null | grep lxc.payload
/sys/fs/cgroup/freezer/user/vagrant/0/lxc.payload/d1/cgroup.procs:9765
/sys/fs/cgroup/freezer/user/vagrant/0/lxc.payload/d1/tasks:9765
/sys/fs/cgroup/systemd/user.slice/user-1000.slice/session-1.scope/lxc.payload/d1/init.scope/cgroup.procs:9765
/sys/fs/cgroup/systemd/user.slice/user-1000.slice/session-1.scope/lxc.payload/d1/init.scope/tasks:9765
vagrant@ubuntu-bionic:~/lxc$

#some log lines from lxc-info d1 -l TRACE showing the two hierarchies
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:cg_hybrid_init:2593 - Writable cgroup hierarchies:
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:999 -   Hierarchies:
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1004 -   0: base_cgroup: /user.slice/user-1000.slice/session-1.scope
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1005 -       mountpoint:  /sys/fs/cgroup/systemd
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1006 -       controllers:
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1008 -       0: name=systemd
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1004 -   1: base_cgroup: /user/vagrant/0
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1005 -       mountpoint:  /sys/fs/cgroup/freezer
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1006 -       controllers:
lxc-info d1 20190708012536.792 TRACE    cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1008 -       0: freezer