The Linux Kernel/System/CGroup v2

Introduction

Terminology

What is cgroup?

Basic Operations

Mounting

nsdelegate
favordynmods
memory_localevents
memory_recursiveprot
memory_hugetlb_accounting
pids_localevents

Organizing Processes and Threads

Processes
Threads

[Un]populated Notification

Controlling Controllers

Enabling and Disabling
Top-down Constraint
No Internal Process Constraint

Delegation

Model of Delegation
Delegation Containment

Guidelines

Organize Once and Control
Avoid Name Collisions

Resource Distribution Models

Weights

Limits

Protections

Allocations

Interface Files

Format

Conventions

Core Interface Files

cgroup.type
cgroup.procs
cgroup.threads
cgroup.controllers
cgroup.subtree_control
cgroup.events
populated
frozen
cgroup.max.descendants
cgroup.max.depth
cgroup.stat
nr_descendants
nr_dying_descendants
nr_subsys_<cgroup_subsys>
nr_dying_subsys_<cgroup_subsys>
cgroup.freeze
cgroup.kill
cgroup.pressure
irq.pressure

Controllers

CPU

CPU Interface Files
cpu.stat
cpu.weight
cpu.weight.nice
cpu.max
cpu.max.burst
cpu.pressure
cpu.uclamp.min
cpu.uclamp.max
cpu.idle

Memory

Memory Interface Files
memory.current
memory.min
memory.low
memory.high
memory.max
memory.reclaim
memory.peak
memory.oom.group
memory.events
low
high
max
oom
oom_kill
oom_group_kill
memory.events.local
memory.stat
anon
file
kernel
kernel_stack
pagetables
sec_pagetables
percpu
sock
vmalloc
shmem
zswap
zswapped
file_mapped
file_dirty
file_writeback
swapcached
anon_thp
file_thp
shmem_thp
inactive_anon,
slab_reclaimable
slab_unreclaimable
slab
workingset_refault_anon
workingset_refault_file
workingset_activate_anon
workingset_activate_file
workingset_restore_anon
workingset_restore_file
workingset_nodereclaim
pswpin
pswpout
pgscan
pgsteal
pgscan_kswapd
pgscan_direct
pgscan_khugepaged
pgscan_proactive
pgsteal_kswapd
pgsteal_direct
pgsteal_khugepaged
pgsteal_proactive
pgfault
pgmajfault
pgrefill
pgactivate
pgdeactivate
pglazyfree
pglazyfreed
swpin_zero
swpout_zero
zswpin
zswpout
zswpwb
thp_fault_alloc
thp_collapse_alloc
thp_swpout
thp_swpout_fallback
numa_pages_migrated
numa_pte_updates
numa_hint_faults
pgdemote_kswapd
pgdemote_direct
pgdemote_khugepaged
pgdemote_proactive
hugetlb
memory.numa_stat
memory.swap.current
memory.swap.high
memory.swap.peak
memory.swap.max
memory.swap.events
high
max
fail
memory.zswap.current
memory.zswap.max
memory.zswap.writeback
memory.pressure
Usage Guidelines
Memory Ownership

IO

IO Interface Files
io.stat
io.cost.qos
io.cost.model
io.weight
io.max
io.pressure
Writeback
vm.dirty_background_ratio,
vm.dirty_background_bytes,
IO Latency
How IO Latency Throttling Works
IO Latency Interface Files
io.latency
io.stat
depth
avg_lat
win
IO Priority
no-change
promote-to-rt
restrict-to-be
idle
none-to-rt

PID

PID Interface Files
pids.max
pids.current
pids.peak
pids.events
max
pids.events.local

Cpuset

Cpuset Interface Files
cpuset.cpus
cpuset.cpus.effective
cpuset.mems
cpuset.mems.effective
cpuset.cpus.exclusive
cpuset.cpus.exclusive.effective
cpuset.cpus.isolated
cpuset.cpus.partition

Device controller

RDMA

RDMA Interface Files
rdma.max
rdma.current

DMEM

DMEM Interface Files
dmem.max,
dmem.capacity
dmem.current

HugeTLB

HugeTLB Interface Files
hugetlb.<hugepagesize>.current
hugetlb.<hugepagesize>.max
hugetlb.<hugepagesize>.events
max
hugetlb.<hugepagesize>.events.local
hugetlb.<hugepagesize>.numa_stat

Misc

Misc Interface Files
misc.capacity
misc.current
misc.peak
misc.max
misc.events
max
misc.events.local
Migration and Ownership

Others

perf_event

Non-normative information

CPU controller root cgroup process behaviour
IO controller root cgroup process behaviour

Namespace

Basics

The Root and Views

Migration and setns(2)

Interaction with Other Namespaces

Information on Kernel Programming

Filesystem Support for Writeback

wbc_init_bio
wbc_account_cgroup_owner

Deprecated v1 Core Features

Issues with v1 and Rationales for v2

Multiple Hierarchies

Thread Granularity

Competition Between Inner Nodes and Threads

Other Interface Issues

Controller Issues and Remedies

Memory
Category:Book:The Linux Kernel#System/CGroup%20v2%20
Category:Book:The Linux Kernel