<s>
In	O
computing	O
,	O
cache	B-General_Concept
algorithms	O
(	O
also	O
frequently	O
called	O
cache	B-General_Concept
replacement	O
algorithms	O
or	O
cache	B-General_Concept
replacement	O
policies	O
)	O
are	O
optimizing	O
instructions	O
,	O
or	O
algorithms	O
,	O
that	O
a	O
computer	B-Application
program	I-Application
or	O
a	O
hardware-maintained	O
structure	O
can	O
utilize	O
in	O
order	O
to	O
manage	O
a	O
cache	B-General_Concept
of	O
information	O
stored	O
on	O
the	O
computer	O
.	O
</s>
<s>
Caching	B-General_Concept
improves	O
performance	O
by	O
keeping	O
recent	O
or	O
often-used	O
data	O
items	O
in	O
memory	O
locations	O
that	O
are	O
faster	O
or	O
computationally	O
cheaper	O
to	O
access	O
than	O
normal	O
memory	O
stores	O
.	O
</s>
<s>
When	O
the	O
cache	B-General_Concept
is	O
full	O
,	O
the	O
algorithm	O
must	O
choose	O
which	O
items	O
to	O
discard	O
to	O
make	O
room	O
for	O
the	O
new	O
ones	O
.	O
</s>
<s>
There	O
are	O
two	O
primary	O
figures	O
of	O
merit	O
of	O
a	O
cache	B-General_Concept
:	O
</s>
<s>
There	O
are	O
also	O
a	O
number	O
of	O
secondary	O
factors	O
affecting	O
cache	B-General_Concept
performance	O
.	O
</s>
<s>
The	O
"	O
hit	O
ratio	O
"	O
of	O
a	O
cache	B-General_Concept
describes	O
how	O
often	O
a	O
searched-for	O
item	O
is	O
actually	O
found	O
in	O
the	O
cache	B-General_Concept
.	O
</s>
<s>
More	O
efficient	O
replacement	O
policies	O
keep	O
track	O
of	O
more	O
usage	O
information	O
in	O
order	O
to	O
improve	O
the	O
hit	O
rate	O
(	O
for	O
a	O
given	O
cache	B-General_Concept
size	O
)	O
.	O
</s>
<s>
The	O
"	O
latency	O
"	O
of	O
a	O
cache	B-General_Concept
describes	O
how	O
long	O
after	O
requesting	O
a	O
desired	O
item	O
the	O
cache	B-General_Concept
can	O
return	O
that	O
item	O
(	O
when	O
there	O
is	O
a	O
hit	O
)	O
.	O
</s>
<s>
Faster	O
replacement	O
strategies	O
typically	O
keep	O
track	O
of	O
less	O
usage	O
information	O
—	O
or	O
,	O
in	O
the	O
case	O
of	O
direct-mapped	O
cache	B-General_Concept
,	O
no	O
information	O
—	O
to	O
reduce	O
the	O
amount	O
of	O
time	O
required	O
to	O
update	O
that	O
information	O
.	O
</s>
<s>
Even	O
worse	O
,	O
many	O
cache	B-General_Concept
algorithms	O
(	O
in	O
particular	O
,	O
LRU	O
)	O
allow	O
this	O
streaming	O
data	O
to	O
fill	O
the	O
cache	B-General_Concept
,	O
pushing	O
out	O
of	O
the	O
cache	B-General_Concept
information	O
that	O
will	O
be	O
used	O
again	O
soon	O
(	O
cache	B-General_Concept
pollution	I-General_Concept
)	O
.	O
</s>
<s>
Items	O
taking	O
up	O
more	O
cache	B-General_Concept
:	O
If	O
items	O
have	O
different	O
sizes	O
,	O
the	O
cache	B-General_Concept
may	O
want	O
to	O
discard	O
a	O
large	O
item	O
to	O
store	O
several	O
smaller	O
ones	O
.	O
</s>
<s>
Items	O
that	O
expire	O
with	O
time	O
:	O
Some	O
caches	B-General_Concept
keep	O
information	O
that	O
expires	O
(	O
e.g.	O
</s>
<s>
a	O
news	O
cache	B-General_Concept
,	O
a	O
DNS	O
cache	B-General_Concept
,	O
or	O
a	O
web	O
browser	O
cache	B-General_Concept
)	O
.	O
</s>
<s>
Depending	O
on	O
the	O
size	O
of	O
the	O
cache	B-General_Concept
no	O
further	O
caching	B-General_Concept
algorithm	O
to	O
discard	O
items	O
may	O
be	O
necessary	O
.	O
</s>
<s>
Various	O
algorithms	O
also	O
exist	O
to	O
maintain	O
cache	B-General_Concept
coherency	I-General_Concept
.	O
</s>
<s>
This	O
applies	O
only	O
to	O
situation	O
where	O
multiple	O
independent	O
caches	B-General_Concept
are	O
used	O
for	O
the	O
same	O
data	O
(	O
for	O
example	O
multiple	O
database	O
servers	O
updating	O
the	O
single	O
shared	O
data	O
file	O
)	O
.	O
</s>
<s>
The	O
most	O
efficient	O
caching	B-General_Concept
algorithm	O
would	O
be	O
to	O
always	O
discard	O
the	O
information	O
that	O
will	O
not	O
be	O
needed	O
for	O
the	O
longest	O
time	O
in	O
the	O
future	O
.	O
</s>
<s>
The	O
practical	O
minimum	O
can	O
be	O
calculated	O
only	O
after	O
experimentation	O
,	O
and	O
one	O
can	O
compare	O
the	O
effectiveness	O
of	O
the	O
actually	O
chosen	O
cache	B-General_Concept
algorithm	O
.	O
</s>
<s>
At	O
the	O
moment	O
when	O
a	O
page	B-General_Concept
fault	I-General_Concept
occurs	O
,	O
some	O
set	O
of	O
pages	O
is	O
in	O
memory	O
.	O
</s>
<s>
Because	O
a	O
real-life	O
general	O
purpose	O
operating	B-General_Concept
system	I-General_Concept
cannot	O
actually	O
predict	O
when	O
'	O
5	O
 '	O
will	O
be	O
accessed	O
,	O
Bélády	O
's	O
Algorithm	O
cannot	O
be	O
implemented	O
on	O
such	O
a	O
system	O
.	O
</s>
<s>
For	O
its	O
simplicity	O
,	O
it	O
has	O
been	O
used	O
in	O
ARM	B-Architecture
processors	I-Architecture
.	O
</s>
<s>
Using	O
this	O
algorithm	O
the	O
cache	B-General_Concept
behaves	O
in	O
the	O
same	O
way	O
as	O
a	O
FIFO	B-Operating_System
queue	I-Operating_System
.	O
</s>
<s>
The	O
cache	B-General_Concept
evicts	O
the	O
blocks	O
in	O
the	O
order	O
they	O
were	O
added	O
,	O
without	O
any	O
regard	O
to	O
how	O
often	O
or	O
how	O
many	O
times	O
they	O
were	O
accessed	O
before	O
.	O
</s>
<s>
Using	O
this	O
algorithm	O
the	O
cache	B-General_Concept
behaves	O
in	O
the	O
same	O
way	O
as	O
a	O
stack	O
and	O
opposite	O
way	O
as	O
a	O
FIFO	B-Operating_System
queue	I-Operating_System
.	O
</s>
<s>
The	O
cache	B-General_Concept
evicts	O
the	O
block	O
added	O
most	O
recently	O
first	O
without	O
any	O
regard	O
to	O
how	O
often	O
or	O
how	O
many	O
times	O
it	O
was	O
accessed	O
before	O
.	O
</s>
<s>
Discards	O
the	O
least	B-General_Concept
recently	I-General_Concept
used	I-General_Concept
items	O
first	O
.	O
</s>
<s>
This	O
algorithm	O
requires	O
keeping	O
track	O
of	O
what	O
was	O
used	O
when	O
,	O
which	O
is	O
expensive	O
if	O
one	O
wants	O
to	O
make	O
sure	O
the	O
algorithm	O
always	O
discards	O
the	O
least	B-General_Concept
recently	I-General_Concept
used	I-General_Concept
item	O
.	O
</s>
<s>
General	O
implementations	O
of	O
this	O
technique	O
require	O
keeping	O
"	O
age	O
bits	O
"	O
for	O
cache-lines	O
and	O
track	O
the	O
"	O
Least	B-General_Concept
Recently	I-General_Concept
Used	I-General_Concept
"	O
cache-line	O
based	O
on	O
age-bits	O
.	O
</s>
<s>
In	O
such	O
an	O
implementation	O
,	O
every	O
time	O
a	O
cache-line	O
is	O
used	O
,	O
the	O
age	O
of	O
all	O
other	O
cache-lines	O
change	O
.	O
</s>
<s>
LRU	O
is	O
actually	O
a	O
family	O
of	O
caching	B-General_Concept
algorithms	O
with	O
members	O
including	O
2Q	O
by	O
Theodore	O
Johnson	O
and	O
Dennis	O
Shasha	O
,	O
and	O
LRU/K	O
by	O
Pat	O
O'Neil	O
,	O
Betty	O
O'Neil	O
and	O
Gerhard	O
Weikum	O
.	O
</s>
<s>
The	O
Time	O
aware	O
Least	B-General_Concept
Recently	I-General_Concept
Used	I-General_Concept
(	O
TLRU	O
)	O
is	O
a	O
variant	O
of	O
LRU	O
designed	O
for	O
the	O
situation	O
where	O
the	O
stored	O
contents	O
in	O
cache	B-General_Concept
have	O
a	O
valid	O
life	O
time	O
.	O
</s>
<s>
The	O
algorithm	O
is	O
suitable	O
in	O
network	O
cache	B-General_Concept
applications	O
,	O
such	O
as	O
Information-centric	B-Protocol
networking	I-Protocol
(	O
ICN	O
)	O
,	O
Content	B-Operating_System
Delivery	I-Operating_System
Networks	I-Operating_System
(	O
CDNs	O
)	O
and	O
distributed	O
networks	O
in	O
general	O
.	O
</s>
<s>
In	O
the	O
TLRU	O
algorithm	O
,	O
when	O
a	O
piece	O
of	O
content	O
arrives	O
,	O
a	O
cache	B-General_Concept
node	O
calculates	O
the	O
local	O
TTU	O
value	O
based	O
on	O
the	O
TTU	O
value	O
assigned	O
by	O
the	O
content	O
publisher	O
.	O
</s>
<s>
Once	O
the	O
local	O
TTU	O
value	O
is	O
calculated	O
the	O
replacement	O
of	O
content	O
is	O
performed	O
on	O
a	O
subset	O
of	O
the	O
total	O
content	O
stored	O
in	O
cache	B-General_Concept
node	O
.	O
</s>
<s>
In	O
contrast	O
to	O
Least	B-General_Concept
Recently	I-General_Concept
Used	I-General_Concept
(	O
LRU	O
)	O
,	O
MRU	O
discards	O
the	O
most	O
recently	O
used	O
items	O
first	O
.	O
</s>
<s>
Subsequently	O
,	O
other	O
researchers	O
presenting	O
at	O
the	O
22nd	O
VLDB	O
conference	O
noted	O
that	O
for	O
random	O
access	O
patterns	O
and	O
repeated	O
scans	O
over	O
large	O
datasets	O
(	O
sometimes	O
known	O
as	O
cyclic	O
access	O
patterns	O
)	O
MRU	O
cache	B-General_Concept
algorithms	O
have	O
more	O
hits	O
than	O
LRU	O
due	O
to	O
their	O
tendency	O
to	O
retain	O
older	O
data	O
.	O
</s>
<s>
Here	O
,	O
A	O
B	O
C	O
D	O
are	O
placed	O
in	O
the	O
cache	B-General_Concept
as	O
there	O
is	O
still	O
space	O
available	O
.	O
</s>
<s>
SLRU	O
cache	B-General_Concept
is	O
divided	O
into	O
two	O
segments	O
,	O
a	O
probationary	O
segment	O
and	O
a	O
protected	O
segment	O
.	O
</s>
<s>
Data	O
from	O
misses	O
is	O
added	O
to	O
the	O
cache	B-General_Concept
at	O
the	O
most	O
recently	O
accessed	O
end	O
of	O
the	O
probationary	O
segment	O
.	O
</s>
<s>
Whenever	O
data	O
must	O
be	O
discarded	O
from	O
the	O
cache	B-General_Concept
,	O
lines	O
are	O
obtained	O
from	O
the	O
LRU	O
end	O
of	O
the	O
probationary	O
segment	O
.	O
</s>
<s>
LRU	O
can	O
be	O
prohibitively	O
expensive	O
in	O
caches	B-General_Concept
with	O
higher	O
associativity	O
.	O
</s>
<s>
For	O
CPU	B-General_Concept
caches	I-General_Concept
with	O
large	O
associativity	O
(	O
generally	O
>4	O
ways	O
)	O
,	O
the	O
implementation	O
cost	O
of	O
LRU	O
becomes	O
prohibitive	O
.	O
</s>
<s>
In	O
many	O
CPU	B-General_Concept
caches	I-General_Concept
,	O
a	O
scheme	O
that	O
almost	O
always	O
discards	O
one	O
of	O
the	O
least	B-General_Concept
recently	I-General_Concept
used	I-General_Concept
items	O
is	O
sufficient	O
,	O
so	O
many	O
CPU	O
designers	O
choose	O
a	O
PLRU	O
algorithm	O
which	O
only	O
needs	O
one	O
bit	O
per	O
cache	B-General_Concept
item	O
to	O
work	O
.	O
</s>
<s>
When	O
there	O
is	O
an	O
access	O
to	O
a	O
value	O
,	O
say	O
'	O
A	O
 '	O
,	O
and	O
we	O
cannot	O
find	O
it	O
in	O
the	O
cache	B-General_Concept
,	O
then	O
we	O
load	O
it	O
from	O
memory	O
and	O
place	O
it	O
at	O
the	O
block	O
where	O
the	O
arrows	O
are	O
currently	O
pointing	O
,	O
going	O
from	O
top	O
to	O
bottom	O
.	O
</s>
<s>
Then	O
as	O
the	O
cache	B-General_Concept
became	O
full	O
'	O
E	O
 '	O
replaced	O
'	O
A	O
 '	O
because	O
that	O
was	O
where	O
the	O
arrows	O
were	O
pointing	O
at	O
that	O
time	O
,	O
and	O
the	O
arrows	O
that	O
led	O
to	O
'	O
A	O
 '	O
were	O
flipped	O
to	O
point	O
in	O
the	O
opposite	O
direction	O
.	O
</s>
<s>
The	O
arrows	O
then	O
led	O
to	O
'	O
B	O
 '	O
,	O
which	O
will	O
be	O
the	O
block	O
replaced	O
on	O
the	O
next	O
cache	B-General_Concept
miss	O
.	O
</s>
<s>
LRU	O
algorithm	O
cannot	O
be	O
directly	O
implemented	O
in	O
the	O
critical	O
path	O
of	O
computer	O
systems	O
,	O
such	O
as	O
operating	B-General_Concept
systems	I-General_Concept
,	O
due	O
to	O
its	O
high	O
overhead	O
.	O
</s>
<s>
The	O
buffer	O
cache	B-General_Concept
replacement	O
implementation	O
in	O
the	O
current	O
version	O
of	O
Linux	O
is	O
a	O
combination	O
of	O
LRU	O
and	O
CLOCK-Pro	O
.	O
</s>
<s>
So	O
of	O
course	O
while	O
running	O
an	O
access	O
sequence	O
we	O
will	O
replace	O
a	O
block	O
which	O
was	O
used	O
fewest	O
times	O
from	O
our	O
cache	B-General_Concept
.	O
</s>
<s>
The	O
Least	O
Frequent	O
Recently	O
Used	O
(	O
LFRU	O
)	O
cache	B-General_Concept
replacement	O
scheme	O
combines	O
the	O
benefits	O
of	O
LFU	O
and	O
LRU	O
schemes	O
.	O
</s>
<s>
LFRU	O
is	O
suitable	O
for	O
'	O
in	O
network	O
 '	O
cache	B-General_Concept
applications	O
,	O
such	O
as	O
Information-centric	B-Protocol
networking	I-Protocol
(	O
ICN	O
)	O
,	O
Content	B-Operating_System
Delivery	I-Operating_System
Networks	I-Operating_System
(	O
CDNs	O
)	O
and	O
distributed	O
networks	O
in	O
general	O
.	O
</s>
<s>
In	O
LFRU	O
,	O
the	O
cache	B-General_Concept
is	O
divided	O
into	O
two	O
partitions	O
called	O
privileged	O
and	O
unprivileged	O
partitions	O
.	O
</s>
<s>
It	O
adds	O
a	O
cache	B-General_Concept
age	O
factor	O
to	O
the	O
reference	O
count	O
when	O
a	O
new	O
object	O
is	O
added	O
to	O
the	O
cache	B-General_Concept
or	O
when	O
an	O
existing	O
object	O
is	O
re-referenced	O
.	O
</s>
<s>
LFUDA	O
increments	O
the	O
cache	B-General_Concept
ages	O
when	O
evicting	O
blocks	O
by	O
setting	O
it	O
to	O
the	O
evicted	O
object	O
's	O
key	O
value	O
.	O
</s>
<s>
Thus	O
,	O
the	O
cache	B-General_Concept
age	O
is	O
always	O
less	O
than	O
or	O
equal	O
to	O
the	O
minimum	O
key	O
value	O
in	O
the	O
cache	B-General_Concept
.	O
</s>
<s>
Suppose	O
when	O
an	O
object	O
was	O
frequently	O
accessed	O
in	O
the	O
past	O
and	O
now	O
it	O
becomes	O
unpopular	O
,	O
it	O
will	O
remain	O
in	O
the	O
cache	B-General_Concept
for	O
a	O
long	O
time	O
thereby	O
preventing	O
the	O
newly	O
or	O
less	O
popular	O
objects	O
from	O
replacing	O
it	O
.	O
</s>
<s>
The	O
advantage	O
of	O
LFUDA	O
is	O
it	O
reduces	O
the	O
cache	B-General_Concept
pollution	I-General_Concept
caused	O
by	O
LFU	O
when	O
cache	B-General_Concept
sizes	O
are	O
very	O
small	O
.	O
</s>
<s>
When	O
Cache	B-General_Concept
sizes	O
are	O
large	O
few	O
replacement	O
decisions	O
are	O
sufficient	O
and	O
cache	B-General_Concept
pollution	I-General_Concept
will	O
not	O
be	O
a	O
problem	O
.	O
</s>
<s>
RRIP-style	O
policies	O
form	O
the	O
basis	O
for	O
many	O
other	O
cache	B-General_Concept
replacement	O
policies	O
including	O
Hawkeye	O
which	O
won	O
the	O
CRC2	O
championship	O
and	O
was	O
considered	O
the	O
most	O
advanced	O
cache	B-General_Concept
replacement	O
policy	O
of	O
its	O
time	O
.	O
</s>
<s>
RRIP	O
is	O
a	O
very	O
flexible	O
policy	O
proposed	O
by	O
Intel	O
that	O
attempts	O
to	O
provide	O
good	O
scan	O
resistance	O
while	O
also	O
allowing	O
older	O
cache	B-General_Concept
lines	O
that	O
have	O
n't	O
been	O
reused	O
to	O
be	O
evicted	O
.	O
</s>
<s>
All	O
cache	B-General_Concept
lines	O
have	O
a	O
prediction	O
value	O
called	O
the	O
RRPV	O
(	O
Re-Reference	O
Prediction	O
Value	O
)	O
that	O
should	O
correlate	O
with	O
when	O
the	O
line	O
is	O
expected	O
to	O
be	O
reused	O
.	O
</s>
<s>
On	O
insertion	O
,	O
this	O
RRPV	O
is	O
usually	O
high	O
,	O
so	O
that	O
if	O
the	O
line	O
is	O
n't	O
reused	O
soon	O
,	O
it	O
will	O
be	O
evicted	O
,	O
this	O
is	O
done	O
to	O
prevent	O
scans	O
(	O
large	O
amounts	O
of	O
data	O
that	O
is	O
used	O
only	O
once	O
)	O
from	O
filling	O
up	O
the	O
cache	B-General_Concept
.	O
</s>
<s>
When	O
a	O
cache	B-General_Concept
line	O
is	O
reused	O
,	O
this	O
RRPV	O
is	O
set	O
to	O
zero	O
,	O
indicating	O
that	O
this	O
line	O
has	O
been	O
reused	O
once	O
,	O
and	O
is	O
likely	O
to	O
be	O
reused	O
again	O
.	O
</s>
<s>
On	O
a	O
cache	B-General_Concept
miss	O
,	O
the	O
line	O
with	O
the	O
RRPV	O
equal	O
to	O
the	O
maximum	O
possible	O
RRPV	O
is	O
evicted	O
(	O
for	O
example	O
,	O
with	O
3-bit	O
values	O
,	O
the	O
line	O
with	O
the	O
RRPV	O
of	O
23	O
=	O
7	O
is	O
evicted	O
)	O
,	O
if	O
no	O
lines	O
have	O
this	O
value	O
,	O
all	O
RRPVs	O
in	O
the	O
set	O
are	O
incremented	O
by	O
1	O
until	O
one	O
reaches	O
it	O
.	O
</s>
<s>
This	O
means	O
that	O
a	O
line	O
that	O
has	O
just	O
been	O
inserted	O
will	O
be	O
the	O
most	O
likely	O
to	O
be	O
evicted	O
on	O
a	O
cache	B-General_Concept
miss	O
.	O
</s>
<s>
SRRIP	O
performs	O
well	O
in	O
the	O
normal	O
case	O
,	O
but	O
suffers	O
when	O
the	O
working	O
set	O
is	O
much	O
larger	O
than	O
the	O
cache	B-General_Concept
size	O
and	O
causes	O
cache	B-General_Concept
thrashing	I-General_Concept
,	O
this	O
is	O
remedied	O
by	O
inserting	O
lines	O
with	O
an	O
RRPV	O
value	O
of	O
maxRRPV	O
most	O
of	O
time	O
,	O
and	O
inserting	O
lines	O
with	O
an	O
RRPV	O
value	O
of	O
maxRRPV	O
-	O
1	O
randomly	O
with	O
a	O
low	O
probability	O
.	O
</s>
<s>
This	O
causes	O
some	O
lines	O
"	O
stick	O
"	O
in	O
the	O
cache	B-General_Concept
and	O
help	O
against	O
thrashing	O
.	O
</s>
<s>
SRRIP	O
performs	O
best	O
when	O
the	O
working	O
set	O
is	O
smaller	O
than	O
the	O
cache	B-General_Concept
size	O
,	O
while	O
BRRIP	O
performs	O
best	O
when	O
the	O
working	O
set	O
is	O
larger	O
than	O
the	O
cache	B-General_Concept
size	O
.	O
</s>
<s>
It	O
dedicates	O
a	O
few	O
sets	O
(	O
typically	O
32	O
)	O
to	O
only	O
use	O
SRRIP	O
and	O
another	O
few	O
to	O
only	O
use	O
BRRIP	O
,	O
and	O
it	O
uses	O
a	O
policy	O
counter	O
that	O
monitors	O
which	O
of	O
these	O
sets	O
performs	O
better	O
to	O
determine	O
which	O
policy	O
will	O
be	O
used	O
by	O
the	O
rest	O
of	O
the	O
cache	B-General_Concept
.	O
</s>
<s>
Bélády	O
's	O
algorithm	O
is	O
the	O
optimal	O
cache	B-General_Concept
replacement	O
policy	O
,	O
but	O
it	O
requires	O
knowledge	O
of	O
the	O
future	O
to	O
evict	O
lines	O
that	O
will	O
be	O
reused	O
farthest	O
in	O
the	O
future	O
.	O
</s>
<s>
Some	O
of	O
the	O
best	O
performing	O
cache	B-General_Concept
replacement	O
policies	O
are	O
ones	O
that	O
attempt	O
to	O
imitate	O
Bélády	O
's	O
algorithm	O
.	O
</s>
<s>
Hawkeye	O
attempts	O
to	O
emulate	O
Bélády	O
's	O
algorithm	O
by	O
using	O
past	O
accesses	O
by	O
a	O
PC	O
to	O
predict	O
whether	O
the	O
accesses	O
it	O
produces	O
generate	O
cache	B-General_Concept
friendly	O
accesses	O
(	O
accesses	O
that	O
get	O
used	O
later	O
on	O
)	O
or	O
cache	B-General_Concept
averse	O
accesses	O
(	O
do	O
n't	O
get	O
used	O
later	O
on	O
)	O
.	O
</s>
<s>
It	O
does	O
this	O
by	O
sampling	O
a	O
number	O
of	O
the	O
cache	B-General_Concept
sets	O
(	O
that	O
are	O
n't	O
aligned	O
)	O
,	O
it	O
uses	O
a	O
history	O
of	O
length	O
and	O
emulates	O
Bélády	O
's	O
algorithm	O
on	O
these	O
accesses	O
.	O
</s>
<s>
This	O
data	O
allows	O
it	O
to	O
predict	O
whether	O
an	O
instruction	O
is	O
cache	B-General_Concept
friendly	O
or	O
cache	B-General_Concept
averse	O
.	O
</s>
<s>
This	O
data	O
is	O
then	O
fed	O
into	O
an	O
RRIP	O
,	O
and	O
means	O
accesses	O
from	O
instructions	O
that	O
are	O
cache	B-General_Concept
friendly	O
have	O
a	O
lower	O
RRPV	O
value	O
(	O
likely	O
to	O
be	O
evicted	O
later	O
)	O
,	O
and	O
accesses	O
from	O
instructions	O
that	O
are	O
cache	B-General_Concept
averse	O
have	O
a	O
higher	O
RRPV	O
value	O
(	O
likely	O
to	O
be	O
evicted	O
sooner	O
)	O
.	O
</s>
<s>
The	O
sampled	O
cache	B-General_Concept
and	O
OPT	O
generator	O
are	O
only	O
used	O
to	O
set	O
the	O
initial	O
RRPV	O
value	O
of	O
the	O
inserted	O
cache	B-General_Concept
lines	O
.	O
</s>
<s>
Hawkeye	O
won	O
the	O
CRC2	O
cache	B-General_Concept
championship	O
in	O
2017	O
,	O
beating	O
all	O
other	O
cache	B-General_Concept
replacement	O
policies	O
at	O
the	O
time	O
.	O
</s>
<s>
First	O
,	O
it	O
drops	O
the	O
binary	O
prediction	O
,	O
allowing	O
it	O
to	O
make	O
more	O
fine	O
grained	O
decisions	O
about	O
which	O
cache	B-General_Concept
lines	O
to	O
evict	O
.	O
</s>
<s>
Second	O
,	O
it	O
leaves	O
the	O
decision	O
about	O
which	O
cache	B-General_Concept
line	O
to	O
evict	O
later	O
on	O
,	O
after	O
more	O
information	O
is	O
available	O
.	O
</s>
<s>
It	O
achieves	O
this	O
by	O
keeping	O
a	O
sampled	O
cache	B-General_Concept
of	O
unique	O
accesses	O
,	O
the	O
PCs	O
that	O
produced	O
them	O
and	O
their	O
timestamps	O
.	O
</s>
<s>
When	O
a	O
line	O
in	O
the	O
sampled	O
cache	B-General_Concept
gets	O
accessed	O
again	O
,	O
the	O
difference	O
in	O
time	O
will	O
be	O
sent	O
to	O
the	O
Reuse	O
Distance	O
Predictor	O
,	O
which	O
uses	O
Temporal	O
Difference	O
Learning	O
,	O
where	O
the	O
new	O
RDP	O
vale	O
will	O
be	O
incremented	O
or	O
decremented	O
by	O
a	O
small	O
number	O
to	O
compensate	O
for	O
outliers	O
.	O
</s>
<s>
If	O
the	O
sampled	O
cache	B-General_Concept
is	O
full	O
,	O
and	O
we	O
need	O
to	O
throw	O
away	O
a	O
line	O
,	O
we	O
train	O
the	O
RDP	O
that	O
the	O
PC	O
that	O
last	O
accessed	O
it	O
produces	O
streaming	O
accesses	O
.	O
</s>
<s>
On	O
a	O
cache	B-General_Concept
miss	O
,	O
the	O
line	O
with	O
the	O
highest	O
absolute	O
ETR	O
value	O
is	O
evicted	O
(	O
The	O
line	O
which	O
is	O
estimated	O
to	O
be	O
reused	O
farthest	O
in	O
the	O
future	O
,	O
or	O
has	O
been	O
estimated	O
to	O
be	O
reused	O
farthest	O
in	O
the	O
past	O
and	O
has	O
n't	O
been	O
reused	O
)	O
.	O
</s>
<s>
Multiple	O
cache	B-General_Concept
replacement	O
policies	O
have	O
attempted	O
to	O
use	O
perceptrons	B-Algorithm
,	O
markov	O
chains	O
or	O
other	O
types	O
of	O
machine	O
learning	O
to	O
predict	O
while	O
line	O
to	O
evict	O
.	O
</s>
<s>
There	O
are	O
also	O
learning	B-Algorithm
augmented	I-Algorithm
algorithms	I-Algorithm
for	O
the	O
cache	B-General_Concept
replacement	O
problem	O
.	O
</s>
<s>
LIRS	O
is	O
a	O
page	B-General_Concept
replacement	I-General_Concept
algorithm	I-General_Concept
with	O
an	O
improved	O
performance	O
over	O
LRU	O
and	O
many	O
other	O
newer	O
replacement	O
algorithms	O
.	O
</s>
<s>
ARC	O
improves	O
on	O
SLRU	O
by	O
using	O
information	O
about	O
recently	O
evicted	O
cache	B-General_Concept
items	O
to	O
dynamically	O
adjust	O
the	O
size	O
of	O
the	O
protected	O
segment	O
and	O
the	O
probationary	O
segment	O
to	O
make	O
the	O
best	O
use	O
of	O
the	O
available	O
cache	B-General_Concept
space	O
.	O
</s>
<s>
Adaptive	O
replacement	B-General_Concept
algorithm	I-General_Concept
is	O
explained	O
with	O
the	O
example	O
.	O
</s>
<s>
Also	O
support	O
cache	B-General_Concept
sharing	O
among	O
cores	O
by	O
releasing	O
extras	O
when	O
the	O
references	O
are	O
to	O
the	O
top	O
part	O
of	O
the	O
cache	B-General_Concept
.	O
</s>
<s>
Combines	O
the	O
advantages	O
of	O
Adaptive	O
Replacement	O
Cache	B-General_Concept
(	O
ARC	O
)	O
and	O
CLOCK	O
.	O
</s>
<s>
T1	O
and	O
T2	O
contain	O
those	O
pages	O
that	O
are	O
in	O
the	O
cache	B-General_Concept
,	O
while	O
B1	O
and	O
B2	O
contain	O
pages	O
that	O
have	O
recently	O
been	O
evicted	O
from	O
T1	O
and	O
T2	O
respectively	O
.	O
</s>
<s>
The	O
multi	O
queue	O
algorithm	O
or	O
MQ	O
was	O
developed	O
to	O
improve	O
the	O
performance	O
of	O
second	O
level	O
buffer	O
cache	B-General_Concept
for	O
e.g.	O
</s>
<s>
a	O
server	O
buffer	O
cache	B-General_Concept
.	O
</s>
<s>
The	O
MQ	O
cache	B-General_Concept
contains	O
an	O
m	O
number	O
of	O
LRU	O
queues	O
:	O
Q0	O
,	O
Q1	O
,	O
...	O
,	O
Qm-1	O
.	O
</s>
<s>
Blocks	O
stay	O
in	O
the	O
LRU	O
queues	O
for	O
a	O
given	O
lifetime	O
,	O
which	O
is	O
defined	O
dynamically	O
by	O
the	O
MQ	O
algorithm	O
to	O
be	O
the	O
maximum	O
temporal	O
distance	O
between	O
two	O
accesses	O
to	O
the	O
same	O
file	O
or	O
the	O
number	O
of	O
cache	B-General_Concept
blocks	I-General_Concept
,	O
whichever	O
is	O
larger	O
.	O
</s>
<s>
If	O
a	O
block	O
has	O
not	O
been	O
referenced	O
within	O
its	O
lifetime	O
,	O
it	O
is	O
demoted	O
from	O
Qi	O
to	O
Qi−1	O
or	O
evicted	O
from	O
the	O
cache	B-General_Concept
if	O
it	O
is	O
in	O
Q0	O
.	O
</s>
<s>
how	O
the	O
m	O
LRU	O
queues	O
are	O
placed	O
in	O
the	O
cache	B-General_Concept
.	O
</s>
<s>
When	O
the	O
cache	B-General_Concept
is	O
full	O
,	O
the	O
first	O
block	O
to	O
be	O
evicted	O
will	O
be	O
the	O
head	O
of	O
Q0	O
in	O
this	O
case	O
a	O
.	O
</s>
<s>
Pannier	O
is	O
a	O
container-based	O
flash	O
caching	B-General_Concept
mechanism	O
that	O
identifies	O
divergent	O
(	O
heterogeneous	O
)	O
containers	O
where	O
blocks	O
held	O
therein	O
have	O
highly	O
varying	O
access	O
patterns	O
.	O
</s>
<s>
One	O
may	O
want	O
to	O
establish	O
,	O
through	O
static	O
analysis	O
,	O
which	O
accesses	O
are	O
cache	B-General_Concept
hits	O
or	O
misses	O
,	O
for	O
instance	O
to	O
rigorously	O
bound	O
the	O
worst-case	B-General_Concept
execution	I-General_Concept
time	I-General_Concept
of	O
a	O
program	O
.	O
</s>
<s>
The	O
output	O
of	O
static	O
analysis	O
is	O
thus	O
,	O
for	O
every	O
access	O
in	O
the	O
program	O
,	O
an	O
indication	O
if	O
it	O
always	O
a	O
cache	B-General_Concept
hit	O
,	O
always	O
a	O
miss	O
,	O
or	O
in	O
indeterminate	O
status	O
.	O
</s>
<s>
Many	O
refinements	O
are	O
possible	O
:	O
for	O
instance	O
one	O
may	O
establish	O
that	O
an	O
access	O
is	O
a	O
hit	O
if	O
the	O
procedure	O
where	O
it	O
is	O
located	O
is	O
used	O
in	O
certain	O
calling	O
contexts	O
,	O
that	O
an	O
access	O
in	O
a	O
loop	O
a	O
cache	B-General_Concept
miss	O
in	O
the	O
first	O
iteration	O
of	O
that	O
loop	O
but	O
a	O
hit	O
in	O
the	O
other	O
iterations	O
,	O
etc	O
.	O
</s>
<s>
A	O
classical	O
approach	O
to	O
analyzing	O
properties	O
of	O
LRU	O
caches	B-General_Concept
is	O
to	O
associate	O
to	O
each	O
block	O
in	O
the	O
cache	B-General_Concept
an	O
"	O
age	O
"	O
(	O
0	O
for	O
the	O
most	O
recently	O
used	O
,	O
and	O
so	O
on	O
up	O
to	O
cache	B-General_Concept
associativity	O
)	O
and	O
compute	O
intervals	O
for	O
possible	O
ages	O
.	O
</s>
<s>
One	O
may	O
even	O
obtain	O
an	O
exact	O
analysis	O
(	O
with	O
respect	O
to	O
an	O
execution	O
model	O
that	O
considers	O
only	O
the	O
syntactic	O
control	O
flow	O
of	O
the	O
program	O
,	O
without	O
semantics	O
for	O
conditions	O
)	O
that	O
is	O
at	O
the	O
same	O
time	O
efficient	O
by	O
abstracting	O
sets	O
of	O
cache	B-General_Concept
states	I-General_Concept
by	O
antichains	O
,	O
which	O
are	O
themselves	O
represented	O
by	O
compact	O
binary	B-Application
decision	I-Application
diagrams	I-Application
.	O
</s>
<s>
It	O
indeed	O
can	O
be	O
shown	O
that	O
,	O
from	O
the	O
point	O
of	O
view	O
of	O
computational	O
complexity	O
theory	O
,	O
static	O
analysis	O
problems	O
posed	O
by	O
pseudo-LRU	O
and	O
FIFO	B-Operating_System
belong	O
to	O
higher	O
complexity	O
classes	O
than	O
those	O
for	O
LRU	O
.	O
</s>
