What are cgroups, and how is cgroup v2 different from v1?
AdvancedConceptKernel Parameters, Namespaces & cgroups
Answer
Control groups organize processes into a hierarchy and apply resource accounting and limits (CPU, memory, I/O, PIDs). v1 had a separate hierarchy per controller, so a process could be in different trees for cpu and memory, leading to inconsistencies. v2 has a single unified hierarchy, better memory accounting (including page cache and kernel memory), PSI pressure metrics, and safer delegation. RHEL 9, Ubuntu 22.04+ and Debian 11+ default to v2.
stat -fc %T /sys/fs/cgroup # cgroup2fs = v2
More on Kernel Parameters, Namespaces & cgroups
What is sysctl and how do you make a change persistent?BeginnerWhy does Kubernetes require `net.ipv4.ip_forward=1` and `br_netfilter`?AdvancedAre sysctl settings global, or per namespace?AdvancedWhat are Linux namespaces? List all types.BeginnerHow do you create and enter namespaces by hand?AdvancedHow does a network namespace get connectivity?Advanced