<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
cache	B-General_Concept
coloring	I-General_Concept
(	O
also	O
known	O
as	O
page	B-General_Concept
coloring	I-General_Concept
)	O
is	O
the	O
process	O
of	O
attempting	O
to	O
allocate	O
free	O
pages	B-General_Concept
that	O
are	O
contiguous	O
from	O
the	O
CPU	B-General_Concept
cache	I-General_Concept
's	O
point	O
of	O
view	O
,	O
in	O
order	O
to	O
maximize	O
the	O
total	O
number	O
of	O
pages	B-General_Concept
cached	O
by	O
the	O
processor	O
.	O
</s>
<s>
Cache	B-General_Concept
coloring	I-General_Concept
is	O
typically	O
employed	O
by	O
low-level	O
dynamic	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
code	O
in	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
when	O
mapping	O
virtual	B-Architecture
memory	I-Architecture
to	O
physical	O
memory	O
.	O
</s>
<s>
A	O
virtual	B-Architecture
memory	I-Architecture
subsystem	O
that	O
lacks	O
cache	B-General_Concept
coloring	I-General_Concept
is	O
less	O
deterministic	O
with	O
regards	O
to	O
cache	O
performance	O
,	O
as	O
differences	O
in	O
page	O
allocation	O
from	O
one	O
program	O
run	O
to	O
the	O
next	O
can	O
lead	O
to	O
large	O
differences	O
in	O
program	O
performance	O
.	O
</s>
<s>
A	O
physically	O
indexed	O
CPU	B-General_Concept
cache	I-General_Concept
is	O
designed	O
such	O
that	O
addresses	O
in	O
adjacent	O
physical	O
memory	O
blocks	O
take	O
different	O
positions	O
(	O
"	O
cache	O
lines	O
"	O
)	O
in	O
the	O
cache	O
,	O
but	O
this	O
is	O
not	O
the	O
case	O
when	O
it	O
comes	O
to	O
virtual	B-Architecture
memory	I-Architecture
;	O
when	O
virtually	O
adjacent	O
but	O
not	O
physically	O
adjacent	O
memory	O
blocks	O
are	O
allocated	O
,	O
they	O
could	O
potentially	O
both	O
take	O
the	O
same	O
position	O
in	O
the	O
cache	O
.	O
</s>
<s>
Coloring	O
is	O
a	O
technique	O
implemented	O
in	O
memory	B-General_Concept
management	I-General_Concept
software	O
,	O
which	O
solves	O
this	O
problem	O
by	O
selecting	O
pages	B-General_Concept
that	O
do	O
not	O
contend	O
with	O
neighbor	O
pages	B-General_Concept
.	O
</s>
<s>
Physical	O
memory	B-General_Concept
pages	I-General_Concept
are	O
"	O
colored	O
"	O
so	O
that	O
pages	B-General_Concept
with	O
different	O
"	O
colors	O
"	O
have	O
different	O
positions	O
in	O
CPU	B-General_Concept
cache	I-General_Concept
memory	O
.	O
</s>
<s>
When	O
allocating	O
sequential	O
pages	B-General_Concept
in	O
virtual	B-Architecture
memory	I-Architecture
for	O
processes	O
,	O
the	O
kernel	O
collects	O
pages	B-General_Concept
with	O
different	O
"	O
colors	O
"	O
and	O
maps	O
them	O
to	O
the	O
virtual	B-Architecture
memory	I-Architecture
.	O
</s>
<s>
In	O
this	O
way	O
,	O
sequential	O
pages	B-General_Concept
in	O
virtual	B-Architecture
memory	I-Architecture
do	O
not	O
contend	O
for	O
the	O
same	O
cache	O
line	O
.	O
</s>
<s>
This	O
code	O
adds	O
a	O
significant	O
amount	O
of	O
complexity	O
to	O
the	O
virtual	B-Architecture
memory	I-Architecture
allocation	O
subsystem	O
,	O
but	O
the	O
result	O
is	O
well	O
worth	O
the	O
effort	O
.	O
</s>
<s>
Page	B-General_Concept
coloring	I-General_Concept
makes	O
virtual	B-Architecture
memory	I-Architecture
as	O
deterministic	O
as	O
physical	O
memory	O
with	O
regard	O
to	O
cache	O
performance	O
.	O
</s>
<s>
Page	B-General_Concept
coloring	I-General_Concept
is	O
employed	O
in	O
operating	B-General_Concept
systems	I-General_Concept
such	O
as	O
Solaris	B-Application
,	O
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
,	O
and	O
Windows	B-Device
NT	I-Device
.	O
</s>
