1. cat /proc/<pid>/cgroup 看到的数字0 1 2 3 4 5 来自于每个 group 的 hierarchy_id:
# cat /proc/19809/cgroup 5:freezer:/ 4:memory:/apps 3:cpuset:/top-app 2:cpu:/top-app 1:blkio:/ 0::/uid_10270/pid_19809 cat /proc/<pid>/cgroup proc_cgroup_show //proc/fs/base.c struct pid_entry tgid_base_stuff[] list_for_each_entry((root), &cgroup_roots, root_list) { seq_printf(m, "%d:", root->hierarchy_id); }