Skip to content

linux/kernel/cgroup/cgroup.c

Imported from _research/manual-study-linux/file-notes/linux__kernel__cgroup__cgroup.c.md.

File Notes: kernel/cgroup/cgroup.c

Status: reviewed.

Purpose: cgroup hierarchy and resource-control implementation.

Review target: hierarchy model, controllers, membership, lifecycle, and AI-job resource boundaries.

Evidence

  • The file implements the generic process-grouping system.
  • cgroup_mutex and css_set_lock are documented as core synchronization boundaries around lines 71-82.
  • Separate cgroup workqueues for offline/release/free work are documented around lines 109-138.
  • Controller arrays are generated from linux/cgroup_subsys.h around lines 140-151.
  • The default hierarchy root appears around line 179.

Design Notes

Cgroups combine hierarchy, membership, controller policy, stats, and lifecycle. AI job sandboxes should borrow that shape: resource domains with explicit membership, limits, teardown, and telemetry.