<s>
The	O
Completely	B-Application
Fair	I-Application
Scheduler	I-Application
(	O
CFS	O
)	O
is	O
a	O
process	O
scheduler	O
that	O
was	O
merged	O
into	O
the	O
2.6.23	O
(	O
October	O
2007	O
)	O
release	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
and	O
is	O
the	O
default	O
scheduler	O
of	O
the	O
tasks	O
of	O
the	O
SCHED_NORMAL	O
class	O
(	O
i.e.	O
,	O
tasks	O
that	O
have	O
no	O
real-time	O
execution	O
constraints	O
)	O
.	O
</s>
<s>
It	O
handles	O
CPU	B-General_Concept
resource	O
allocation	O
for	O
executing	O
processes	B-Operating_System
,	O
and	O
aims	O
to	O
maximize	O
overall	O
CPU	B-General_Concept
utilization	O
while	O
also	O
maximizing	O
interactive	O
performance	O
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
previous	O
O(1 )	O
scheduler	O
used	O
in	O
older	O
Linux	B-Operating_System
2.6	I-Operating_System
kernels	B-Operating_System
,	O
which	O
maintained	O
and	O
switched	O
run	B-Application
queues	I-Application
of	O
active	O
and	O
expired	O
tasks	O
,	O
the	O
CFS	B-Application
scheduler	I-Application
implementation	O
is	O
based	O
on	O
per-CPU	O
run	B-Application
queues	I-Application
,	O
whose	O
nodes	O
are	O
time-ordered	O
schedulable	O
entities	O
that	O
are	O
kept	O
sorted	O
by	O
red	O
–	O
black	O
trees	O
.	O
</s>
<s>
The	O
CFS	O
does	O
away	O
with	O
the	O
old	O
notion	O
of	O
per-priorities	O
fixed	O
time-slices	O
and	O
instead	O
it	O
aims	O
at	O
giving	O
a	O
fair	O
share	O
of	O
CPU	B-General_Concept
time	O
to	O
tasks	O
(	O
or	O
,	O
better	O
,	O
schedulable	O
entities	O
)	O
.	O
</s>
<s>
A	O
task	O
(	O
i.e.	O
,	O
a	O
synonym	O
for	O
thread	O
)	O
is	O
the	O
minimal	O
entity	O
that	O
Linux	B-Operating_System
can	O
schedule	O
.	O
</s>
<s>
However	O
,	O
it	O
can	O
also	O
manage	O
groups	O
of	O
threads	O
,	O
whole	O
multi-threaded	O
processes	B-Operating_System
,	O
and	O
even	O
all	O
the	O
processes	B-Operating_System
of	O
a	O
given	O
user	O
.	O
</s>
<s>
Each	O
per-CPU	O
run-queue	O
of	O
type	O
cfs_rq	O
sorts	O
sched_entity	O
structures	O
in	O
a	O
time-ordered	O
fashion	O
into	O
a	O
red-black	O
tree	O
(	O
or	O
'	O
rbtree	O
 '	O
in	O
Linux	B-Operating_System
lingo	O
)	O
,	O
where	O
the	O
leftmost	O
node	O
is	O
occupied	O
by	O
the	O
entity	O
that	O
has	O
received	O
the	O
least	O
slice	O
of	O
execution	O
time	O
(	O
which	O
is	O
saved	O
in	O
the	O
vruntime	O
field	O
of	O
the	O
entity	O
)	O
.	O
</s>
<s>
This	O
is	O
the	O
time	O
the	O
process	O
has	O
been	O
waiting	O
to	O
run	O
,	O
divided	O
by	O
the	O
total	O
number	O
of	O
processes	B-Operating_System
.	O
</s>
<s>
The	O
complexity	O
of	O
the	O
algorithm	O
that	O
inserts	O
nodes	O
into	O
the	O
cfs_rq	O
runqueue	O
of	O
the	O
CFS	B-Application
scheduler	I-Application
is	O
O(log N )	O
,	O
where	O
N	O
is	O
the	O
total	O
number	O
of	O
entities	O
.	O
</s>
<s>
Con	O
Kolivas	O
's	O
work	O
with	O
scheduling	O
,	O
most	O
significantly	O
his	O
implementation	O
of	O
"	O
fair	B-Operating_System
scheduling	I-Operating_System
"	O
named	O
Rotating	O
Staircase	O
Deadline	O
,	O
inspired	O
Ingo	O
Molnár	O
to	O
develop	O
his	O
CFS	O
,	O
as	O
a	O
replacement	O
for	O
the	O
earlier	O
O(1 )	O
scheduler	O
,	O
crediting	O
Kolivas	O
in	O
his	O
announcement	O
.	O
</s>
<s>
CFS	O
is	O
an	O
implementation	O
of	O
a	O
well-studied	O
,	O
classic	O
scheduling	O
algorithm	O
called	O
weighted	B-Algorithm
fair	I-Algorithm
queuing	I-Algorithm
.	O
</s>
<s>
Originally	O
invented	O
for	O
packet	B-Protocol
networks	I-Protocol
,	O
fair	O
queuing	O
had	O
been	O
previously	O
applied	O
to	O
CPU	B-General_Concept
scheduling	O
under	O
the	O
name	O
stride	B-Operating_System
scheduling	I-Operating_System
.	O
</s>
<s>
The	O
Linux	B-Operating_System
kernel	I-Operating_System
received	O
a	O
patch	O
for	O
CFS	O
in	O
November	O
2010	O
for	O
the	O
2.6.38	O
kernel	B-Operating_System
that	O
has	O
made	O
the	O
scheduler	O
"	O
fairer	O
"	O
for	O
use	O
on	O
desktops	O
and	O
workstations	O
.	O
</s>
<s>
The	O
algorithm	O
puts	O
parent	O
processes	B-Operating_System
in	O
the	O
same	O
task	O
group	O
as	O
child	O
processes	B-Operating_System
.	O
</s>
<s>
This	O
solved	O
the	O
problem	O
of	O
slow	O
interactive	O
response	O
times	O
on	O
multi-core	O
and	O
multi-CPU	O
(	O
SMP	B-Operating_System
)	O
systems	O
when	O
they	O
were	O
performing	O
other	O
tasks	O
that	O
use	O
many	O
CPU-intensive	O
threads	O
in	O
those	O
tasks	O
.	O
</s>
<s>
A	O
simple	O
explanation	O
is	O
that	O
,	O
with	O
this	O
patch	O
applied	O
,	O
one	O
is	O
able	O
to	O
still	O
watch	O
a	O
video	O
,	O
read	O
email	O
and	O
perform	O
other	O
typical	O
desktop	O
activities	O
without	O
glitches	O
or	O
choppiness	O
while	O
,	O
say	O
,	O
compiling	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
or	O
encoding	O
video	O
.	O
</s>
<s>
In	O
2016	O
,	O
the	O
Linux	B-Operating_System
scheduler	O
was	O
patched	O
for	O
better	O
multicore	O
performance	O
,	O
based	O
on	O
the	O
suggestions	O
outlined	O
in	O
the	O
paper	O
,	O
"	O
The	O
Linux	B-Operating_System
Scheduler	O
:	O
A	O
Decade	O
of	O
Wasted	O
Cores	O
"	O
.	O
</s>
