Skip to main content
InterviewHubPRO
Section Overview
Q38

Question 38 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

76%
Linux OS Internals (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

Linux Cgroups v1 vs Cgroups v2: Architecture differences and modern unified hierarchy.

senior LevelSystem Design

In Simple Words:

  • Cgroups v1 (Legacy): Orthogonal multi-hierarchy design where each resource (CPU, Memory, BlkIO) had its own independent tree structure. Controllers could not communicate, causing resource leaks and priority inversion where memory limits could not correlate with block I/O throttling.
  • Cgroups v2 (Unified Hierarchy): Single unified tree structure rooted at /sys/fs/cgroup.
    • Single Root of Control: A process belongs to exactly one cgroup node.
    • Pressure Stall Information (PSI): Provides kernel metrics on CPU, Memory, and I/O starvation.
    • Memory Controller Integration: Seamlessly accounts for socket buffers, swap, and page caches together.