Home

sysfscgroups

Sysfscgroups refers to the sysfs-based interface used to manage Linux control groups (cgroups). Through the sysfs filesystem, typically mounted at /sys/fs/cgroup, the kernel exposes cgroup hierarchies as directories and control files. This interface enables inspecting the structure of cgroups, creating and deleting groups, and attaching processes to specific groups. It also provides a location to view resource usage and to adjust limits by writing values to appropriate control files within each cgroup.

Cgroups are a kernel feature that allow limiting, accounting for, and isolating the resource usage of processes.

Typical operations include creating a new cgroup by creating a directory under the appropriate hierarchy, adding

Access to the sysfscgroups interface generally requires elevated privileges (such as CAP_SYS_ADMIN). The exact layout and

See also: cgroups, sysfs, /sys/fs/cgroup, Linux namespaces.

Systems
may
implement
cgroups
in
two
major
ways:
cgroup
v1,
which
uses
separate
hierarchies
for
different
controllers
(such
as
CPU,
memory,
and
I/O),
and
cgroup
v2,
which
introduces
a
unified
hierarchy
with
a
common
set
of
control
files.
The
sysfscgroups
interface
adapts
to
these
architectures,
exposing
the
relevant
directories
and
files
in
a
way
that
is
consistent
with
the
active
cgroup
model.
a
process
to
a
cgroup
by
moving
its
PID
into
a
tasks
or
cgroup.procs
file,
and
configuring
limits
by
writing
values
to
specific
limit
or
max
files.
Practical
management
is
often
performed
by
higher-level
tools
and
services
(for
example,
container
runtimes
or
systemd),
which
interact
with
the
sysfscgroups
interface
or
with
dedicated
libraries
to
manage
cgroups.
file
names
can
vary
between
kernel
versions
and
distributions,
so
consult
system
documentation
for
specifics.