<s>
cgroups	B-Application
(	O
abbreviated	O
from	O
control	O
groups	O
)	O
is	O
a	O
Linux	B-Operating_System
kernel	I-Operating_System
feature	O
that	O
limits	O
,	O
accounts	O
for	O
,	O
and	O
isolates	O
the	O
resource	B-General_Concept
usage	I-General_Concept
(	O
CPU	O
,	O
memory	O
,	O
disk	O
I/O	O
,	O
network	O
,	O
etc	O
.	O
)	O
</s>
<s>
of	O
a	O
collection	O
of	O
processes	B-Operating_System
.	O
</s>
<s>
Engineers	O
at	O
Google	B-Application
started	O
the	O
work	O
on	O
this	O
feature	O
in	O
2006	O
under	O
the	O
name	O
"	O
process	B-Application
containers	I-Application
"	O
.	O
</s>
<s>
In	O
late	O
2007	O
,	O
the	O
nomenclature	O
changed	O
to	O
"	O
control	O
groups	O
"	O
to	O
avoid	O
confusion	O
caused	O
by	O
multiple	O
meanings	O
of	O
the	O
term	O
"	O
container	B-Application
"	O
in	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
context	O
,	O
and	O
the	O
control	O
groups	O
functionality	O
was	O
merged	O
into	O
the	O
Linux	B-Application
kernel	I-Application
mainline	I-Application
in	O
kernel	B-Operating_System
version	O
2.6.24	O
,	O
which	O
was	O
released	O
in	O
January	O
2008	O
.	O
</s>
<s>
Since	O
then	O
,	O
developers	O
have	O
added	O
many	O
new	O
features	O
and	O
controllers	O
,	O
such	O
as	O
support	O
for	O
kernfs	B-Application
in	O
2014	O
,	O
firewalling	B-Application
,	O
and	O
unified	O
hierarchy	O
.	O
</s>
<s>
cgroup	B-Application
v2	O
was	O
merged	O
in	O
Linux	B-Operating_System
kernel	I-Operating_System
4.5	O
with	O
significant	O
changes	O
to	O
the	O
interface	O
and	O
internal	O
functionality	O
.	O
</s>
<s>
There	O
are	O
two	O
versions	O
of	O
cgroups	B-Application
.	O
</s>
<s>
Cgroups	B-Application
was	O
originally	O
written	O
by	O
Paul	O
Menage	O
and	O
Rohit	O
Seth	O
,	O
and	O
merged	O
into	O
the	O
mainline	B-Application
Linux	I-Application
kernel	B-Operating_System
in	O
2007	O
.	O
</s>
<s>
Afterwards	O
this	O
is	O
called	O
cgroups	B-Application
version	O
1	O
.	O
</s>
<s>
Development	O
and	O
maintenance	O
of	O
cgroups	B-Application
was	O
then	O
taken	O
over	O
by	O
Tejun	O
Heo	O
.	O
</s>
<s>
Tejun	O
Heo	O
redesigned	O
and	O
rewrote	O
cgroups	B-Application
.	O
</s>
<s>
This	O
rewrite	O
is	O
now	O
called	O
version	O
2	O
,	O
the	O
documentation	O
of	O
cgroup-v2	O
first	O
appeared	O
in	O
Linux	B-Operating_System
kernel	I-Operating_System
4.5	O
released	O
on	O
14	O
March	O
2016	O
.	O
</s>
<s>
Unlike	O
v1	O
,	O
cgroup	B-Application
v2	O
has	O
only	O
a	O
single	O
process	O
hierarchy	O
and	O
discriminates	O
between	O
processes	B-Operating_System
,	O
not	O
threads	O
.	O
</s>
<s>
One	O
of	O
the	O
design	O
goals	O
of	O
cgroups	B-Application
is	O
to	O
provide	O
a	O
unified	O
interface	O
to	O
many	O
different	O
use	B-Architecture
cases	I-Architecture
,	O
from	O
controlling	O
single	O
processes	B-Operating_System
(	O
by	O
using	O
nice	B-Device
,	O
for	O
example	O
)	O
to	O
full	O
operating	B-Application
system-level	I-Application
virtualization	I-Application
(	O
as	O
provided	O
by	O
OpenVZ	B-Language
,	O
Linux-VServer	B-Application
or	O
LXC	B-Application
,	O
for	O
example	O
)	O
.	O
</s>
<s>
Cgroups	B-Application
provides	O
:	O
</s>
<s>
groups	O
can	O
be	O
set	O
to	O
not	O
exceed	O
a	O
configured	O
memory	O
limit	O
,	O
which	O
also	O
includes	O
the	O
file	B-General_Concept
system	I-General_Concept
cache	I-General_Concept
,	O
I/O	O
bandwidth	O
limit	O
,	O
CPU	O
quota	O
limit	O
,	O
or	O
CPU	O
set	O
limit	O
.	O
</s>
<s>
A	O
control	O
group	O
(	O
abbreviated	O
as	O
cgroup	B-Application
)	O
is	O
a	O
collection	O
of	O
processes	B-Operating_System
that	O
are	O
bound	O
by	O
the	O
same	O
criteria	O
and	O
associated	O
with	O
a	O
set	O
of	O
parameters	O
or	O
limits	O
.	O
</s>
<s>
The	O
kernel	B-Operating_System
provides	O
access	O
to	O
multiple	O
controllers	O
(	O
also	O
called	O
subsystems	O
)	O
through	O
the	O
cgroup	B-Application
interface	O
;	O
for	O
example	O
,	O
the	O
"	O
memory	O
"	O
controller	O
limits	O
memory	O
use	O
,	O
"	O
cpuacct	O
"	O
accounts	O
CPU	O
usage	O
,	O
etc	O
.	O
</s>
<s>
By	O
accessing	O
the	O
cgroup	B-Application
virtual	O
file	O
system	O
manually	O
.	O
</s>
<s>
Through	O
the	O
"	O
rules	O
engine	O
daemon	O
"	O
that	O
can	O
automatically	O
move	O
processes	B-Operating_System
of	O
certain	O
users	O
,	O
groups	O
,	O
or	O
commands	O
to	O
cgroups	B-Application
as	O
specified	O
in	O
its	O
configuration	O
.	O
</s>
<s>
Indirectly	O
through	O
other	O
software	O
that	O
uses	O
cgroups	B-Application
,	O
such	O
as	O
Docker	B-Language
,	O
Firejail	O
,	O
LXC	B-Application
,	O
libvirt	B-Language
,	O
systemd	B-Application
,	O
Open	B-Operating_System
Grid	I-Operating_System
Scheduler/Grid	I-Operating_System
Engine	I-Operating_System
,	O
and	O
Google	B-Application
's	I-Application
developmentally	O
defunct	O
lmctfy	B-Application
.	O
</s>
<s>
The	O
Linux	B-Operating_System
kernel	I-Operating_System
documentation	O
contains	O
some	O
technical	O
details	O
of	O
the	O
setup	O
and	O
use	O
of	O
control	O
groups	O
version	O
1	O
and	O
version	O
2	O
.	O
systemd-cgtop	O
command	O
can	O
be	O
used	O
to	O
show	O
top	O
control	O
groups	O
by	O
their	O
resource	B-General_Concept
usage	I-General_Concept
.	O
</s>
<s>
Redesign	O
of	O
cgroups	B-Application
started	O
in	O
2013	O
,	O
with	O
additional	O
changes	O
brought	O
by	O
versions	O
3.15	O
and	O
3.16	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
.	O
</s>
<s>
While	O
not	O
technically	O
part	O
of	O
the	O
cgroups	B-Application
work	O
,	O
a	O
related	O
feature	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
is	O
namespace	O
isolation	O
,	O
where	O
groups	O
of	O
processes	B-Operating_System
are	O
separated	O
such	O
that	O
they	O
cannot	O
"	O
see	O
"	O
resources	O
in	O
other	O
groups	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
PID	O
namespace	O
provides	O
a	O
separate	O
enumeration	O
of	O
process	B-Operating_System
identifiers	I-Operating_System
within	O
each	O
namespace	O
.	O
</s>
<s>
Also	O
available	O
are	O
mount	B-Application
,	O
user	O
,	O
UTS	O
,	O
network	O
and	O
SysV	O
IPC	O
namespaces	O
.	O
</s>
<s>
The	O
PID	O
namespace	O
provides	O
isolation	O
for	O
the	O
allocation	O
of	O
process	B-Operating_System
identifiers	I-Operating_System
(	O
PIDs	O
)	O
,	O
lists	O
of	O
processes	B-Operating_System
and	O
their	O
details	O
.	O
</s>
<s>
While	O
the	O
new	O
namespace	O
is	O
isolated	O
from	O
other	O
siblings	O
,	O
processes	B-Operating_System
in	O
its	O
"	O
parent	O
"	O
namespace	O
still	O
see	O
all	O
processes	B-Operating_System
in	O
child	O
namespaces	O
—	O
albeit	O
with	O
different	O
PID	O
numbers	O
.	O
</s>
<s>
Network	O
namespace	O
isolates	O
the	O
network	B-Protocol
interface	I-Protocol
controllers	I-Protocol
(	O
physical	O
or	O
virtual	O
)	O
,	O
iptables	B-Application
firewall	B-Application
rules	O
,	O
routing	O
tables	O
etc	O
.	O
</s>
<s>
"	O
UTS	O
"	O
namespace	O
allows	O
changing	O
the	O
hostname	B-Protocol
.	O
</s>
<s>
Mount	B-Application
namespace	O
allows	O
creating	O
a	O
different	O
file	O
system	O
layout	O
,	O
or	O
making	O
certain	O
mount	B-Application
points	O
read-only	O
.	O
</s>
<s>
IPC	O
namespace	O
isolates	O
the	O
System	O
V	O
inter-process	B-Operating_System
communication	I-Operating_System
between	O
namespaces	O
.	O
</s>
<s>
Namespaces	O
are	O
created	O
with	O
the	O
"	O
unshare	O
"	O
command	O
or	O
syscall	B-Operating_System
,	O
or	O
as	O
new	O
flags	O
in	O
a	O
"	O
clone	O
"	O
syscall	B-Operating_System
.	O
</s>
<s>
The	O
"	O
ns	O
"	O
subsystem	O
was	O
added	O
early	O
in	O
cgroups	B-Application
development	O
to	O
integrate	O
namespaces	O
and	O
control	O
groups	O
.	O
</s>
<s>
If	O
the	O
"	O
ns	O
"	O
cgroup	B-Application
was	O
mounted	O
,	O
each	O
namespace	O
would	O
also	O
create	O
a	O
new	O
group	O
in	O
the	O
cgroup	B-Application
hierarchy	O
.	O
</s>
<s>
This	O
was	O
an	O
experiment	O
that	O
was	O
later	O
judged	O
to	O
be	O
a	O
poor	O
fit	O
for	O
the	O
cgroups	B-Application
API	O
,	O
and	O
removed	O
from	O
the	O
kernel	B-Operating_System
.	O
</s>
<s>
Linux	B-Operating_System
namespaces	O
were	O
inspired	O
by	O
the	O
more	O
general	O
namespace	O
functionality	O
used	O
heavily	O
throughout	O
Plan	B-Operating_System
9	I-Operating_System
from	I-Operating_System
Bell	I-Operating_System
Labs	I-Operating_System
.	O
</s>
<s>
Kernfs	B-Application
was	O
introduced	O
into	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
with	O
version	O
3.14	O
in	O
March	O
2014	O
,	O
the	O
main	O
author	O
being	O
Tejun	O
Heo	O
.	O
</s>
<s>
One	O
of	O
the	O
main	O
motivators	O
for	O
a	O
separate	O
kernfs	B-Application
is	O
the	O
cgroups	B-Application
file	O
system	O
.	O
</s>
<s>
Kernfs	B-Application
is	O
basically	O
created	O
by	O
splitting	O
off	O
some	O
of	O
the	O
sysfs	B-Application
logic	O
into	O
an	O
independent	O
entity	O
,	O
thus	O
easing	O
for	O
other	O
kernel	B-Operating_System
subsystems	O
the	O
implementation	O
of	O
their	O
own	O
virtual	O
file	O
system	O
with	O
handling	O
for	O
device	O
connect	O
and	O
disconnect	O
,	O
dynamic	O
creation	O
and	O
removal	O
,	O
and	O
other	O
attributes	O
.	O
</s>
<s>
Redesign	O
continued	O
into	O
version	O
3.15	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
.	O
</s>
<s>
Kernel	B-Operating_System
memory	O
control	O
groups	O
(	O
kmemcg	O
)	O
were	O
merged	O
into	O
version	O
3.8	O
(	O
)	O
of	O
the	O
Linux	B-Application
kernel	I-Application
mainline	I-Application
.	O
</s>
<s>
The	O
kmemcg	O
controller	O
can	O
limit	O
the	O
amount	O
of	O
memory	O
that	O
the	O
kernel	B-Operating_System
can	O
utilize	O
to	O
manage	O
its	O
own	O
internal	O
processes	B-Operating_System
.	O
</s>
<s>
Linux	B-Operating_System
Kernel	I-Operating_System
4.19	O
(	O
October	O
2018	O
)	O
introduced	O
cgroup	B-Application
awareness	O
of	O
OOM	B-General_Concept
killer	I-General_Concept
implementation	O
which	O
adds	O
an	O
ability	O
to	O
kill	O
a	O
cgroup	B-Application
as	O
a	O
single	O
unit	O
and	O
so	O
guarantee	O
the	O
integrity	O
of	O
the	O
workload	O
.	O
</s>
<s>
Various	O
projects	O
use	O
cgroups	B-Application
as	O
their	O
basis	O
,	O
including	O
CoreOS	B-Application
,	O
Docker	B-Language
(	O
in	O
2013	O
)	O
,	O
Hadoop	B-Application
,	O
Jelastic	B-General_Concept
,	O
Kubernetes	B-General_Concept
,	O
lmctfy	B-Application
(	O
Let	B-Application
Me	I-Application
Contain	I-Application
That	I-Application
For	I-Application
You	I-Application
)	O
,	O
LXC	B-Application
(	O
LinuX	B-Operating_System
Containers	B-Application
)	O
,	O
systemd	B-Application
,	O
Mesos	B-General_Concept
and	O
Mesosphere	B-General_Concept
,	O
and	O
HTCondor	B-Operating_System
.	O
</s>
<s>
Major	O
Linux	B-Operating_System
distributions	O
also	O
adopted	O
it	O
such	O
as	O
Red	O
Hat	O
Enterprise	O
Linux	B-Operating_System
(	O
RHEL	O
)	O
6.0	O
in	O
November	O
2010	O
,	O
three	O
years	O
before	O
adoption	O
by	O
the	O
mainline	B-Application
Linux	I-Application
kernel	B-Operating_System
.	O
</s>
