<s>
In	O
computer	O
engineering	O
,	O
directory-based	B-Architecture
cache	I-Architecture
coherence	I-Architecture
is	O
a	O
type	O
of	O
cache	B-General_Concept
coherence	O
mechanism	O
,	O
where	O
directories	O
are	O
used	O
to	O
manage	O
caches	B-General_Concept
in	O
place	O
of	O
bus	B-General_Concept
snooping	I-General_Concept
.	O
</s>
<s>
Bus	B-General_Concept
snooping	I-General_Concept
methods	O
scale	O
poorly	O
due	O
to	O
the	O
use	O
of	O
broadcasting	B-Operating_System
.	O
</s>
<s>
These	O
methods	O
can	O
be	O
used	O
to	O
target	O
both	O
performance	O
and	O
scalability	B-Architecture
of	O
directory	O
systems	O
.	O
</s>
<s>
In	O
the	O
full	O
bit	O
vector	O
format	O
,	O
for	O
each	O
possible	O
cache	B-General_Concept
line	I-General_Concept
in	O
memory	O
,	O
a	O
bit	O
is	O
used	O
to	O
track	O
whether	O
every	O
individual	O
processor	B-General_Concept
has	O
that	O
line	O
stored	O
in	O
its	O
cache	B-General_Concept
.	O
</s>
<s>
The	O
full	O
bit	O
vector	O
format	O
is	O
the	O
simplest	O
structure	O
to	O
implement	O
,	O
but	O
the	O
least	O
scalable	B-Architecture
.	O
</s>
<s>
The	O
SGI	B-Application
Origin	I-Application
2000	I-Application
uses	O
a	O
combination	O
of	O
full	O
bit	O
vector	O
and	O
coarse	O
bit	O
vector	O
depending	O
on	O
the	O
number	O
of	O
processors	O
.	O
</s>
<s>
Each	O
directory	O
entry	O
must	O
have	O
1	O
bit	O
stored	O
per	O
processor	B-General_Concept
per	O
cache	B-General_Concept
line	I-General_Concept
,	O
along	O
with	O
bits	O
for	O
tracking	O
the	O
state	O
of	O
the	O
directory	O
.	O
</s>
<s>
This	O
leads	O
to	O
the	O
total	O
size	O
required	O
being	O
(	O
number	O
of	O
processors	O
)	O
×number	O
of	O
cache	B-General_Concept
lines	I-General_Concept
,	O
having	O
a	O
storage	O
overhead	O
ratio	O
of	O
(	O
number	O
of	O
processors	O
)	O
/	O
( cache	O
block	O
size×8	O
)	O
.	O
</s>
<s>
The	O
coarse	O
bit	O
vector	O
format	O
has	O
a	O
similar	O
structure	O
to	O
the	O
full	O
bit	O
vector	O
format	O
,	O
though	O
rather	O
than	O
tracking	O
one	O
bit	O
per	O
processor	B-General_Concept
for	O
every	O
cache	B-General_Concept
line	I-General_Concept
,	O
the	O
directory	O
groups	O
several	O
processors	O
into	O
nodes	O
,	O
storing	O
whether	O
a	O
cache	B-General_Concept
line	I-General_Concept
is	O
stored	O
in	O
a	O
node	O
rather	O
than	O
a	O
line	O
.	O
</s>
<s>
This	O
improves	O
size	O
requirements	O
at	O
the	O
expense	O
of	O
bus	B-General_Concept
traffic	O
saving	O
(	O
processors	O
per	O
node	O
)	O
×( total	O
lines	O
)	O
bits	O
of	O
space	O
.	O
</s>
<s>
Thus	O
the	O
ratio	O
overhead	O
is	O
the	O
same	O
,	O
just	O
replacing	O
number	O
of	O
processors	O
with	O
number	O
of	O
processor	B-General_Concept
groups	O
.	O
</s>
<s>
When	O
a	O
bus	B-General_Concept
request	O
is	O
made	O
for	O
a	O
cache	B-General_Concept
line	I-General_Concept
that	O
one	O
processor	B-General_Concept
in	O
the	O
group	O
has	O
,	O
the	O
directory	O
broadcasts	B-Operating_System
the	O
signal	O
into	O
every	O
processor	B-General_Concept
in	O
the	O
node	O
rather	O
than	O
just	O
the	O
caches	B-General_Concept
that	O
contain	O
it	O
,	O
leading	O
to	O
unnecessary	O
traffic	O
to	O
nodes	O
that	O
do	O
not	O
have	O
the	O
data	O
cached	O
.	O
</s>
<s>
In	O
this	O
case	O
the	O
directory	O
entry	O
uses	O
1	O
bit	O
for	O
a	O
group	O
of	O
processors	O
for	O
each	O
cache	B-General_Concept
line	I-General_Concept
.	O
</s>
<s>
A	O
cache	B-General_Concept
only	O
stores	O
a	O
small	O
subset	O
of	O
blocks	O
in	O
main	O
memory	O
at	O
a	O
particular	O
time	O
.	O
</s>
<s>
Consider	O
a	O
processor	B-General_Concept
with	O
a	O
cache	B-General_Concept
size	O
of	O
64KB	O
with	O
a	O
block	O
size	O
of	O
32	O
bytes	O
and	O
the	O
main	O
memory	O
size	O
to	O
be	O
4MB	O
.	O
</s>
<s>
In	O
this	O
format	O
the	O
directory	O
is	O
decentralised	O
and	O
distributed	O
among	O
the	O
caches	B-General_Concept
that	O
share	O
a	O
memory	O
block	O
.	O
</s>
<s>
Different	O
caches	B-General_Concept
that	O
share	O
a	O
memory	O
block	O
are	O
arranged	O
in	O
the	O
form	O
of	O
a	O
binary	O
tree	O
.	O
</s>
<s>
The	O
cache	B-General_Concept
that	O
accesses	O
a	O
memory	O
block	O
first	O
is	O
the	O
root	B-Application
node	I-Application
.	O
</s>
<s>
Each	O
memory	O
block	O
has	O
the	O
root	B-Application
node	I-Application
information	O
(	O
HEAD	O
)	O
and	O
Sharing	O
counter	O
field	O
(	O
SC	O
)	O
.	O
</s>
<s>
The	O
SC	O
field	O
has	O
the	O
number	O
of	O
caches	B-General_Concept
that	O
share	O
the	O
block	O
.	O
</s>
<s>
Each	O
cache	B-General_Concept
entry	O
has	O
pointers	O
to	O
the	O
next	O
sharing	O
caches	B-General_Concept
known	O
as	O
L-CHD	O
and	O
R-CHD	O
.	O
</s>
<s>
A	O
condition	O
for	O
this	O
directory	O
is	O
that	O
the	O
binary	O
tree	O
should	O
be	O
number	O
balanced	O
,	O
i.e	O
the	O
number	O
of	O
nodes	O
in	O
the	O
left	O
sub	O
tree	O
must	O
be	O
equal	O
to	O
or	O
one	O
greater	O
than	O
the	O
number	O
of	O
nodes	O
in	O
the	O
right	O
subtree	B-Application
.	O
</s>
<s>
All	O
the	O
subtrees	B-Application
should	O
also	O
be	O
number	O
balanced	O
.	O
</s>
<s>
In	O
this	O
format	O
the	O
memory	O
holds	O
the	O
directory	O
pointer	O
to	O
the	O
latest	O
cache	B-General_Concept
that	O
accessed	O
the	O
block	O
and	O
each	O
cache	B-General_Concept
has	O
the	O
pointer	O
to	O
the	O
previous	O
cache	B-General_Concept
that	O
accessed	O
the	O
block	O
.	O
</s>
<s>
So	O
when	O
a	O
processor	B-General_Concept
sends	O
a	O
write	O
request	O
to	O
a	O
block	O
in	O
memory	O
,	O
the	O
processor	B-General_Concept
sends	O
invalidations	B-General_Concept
down	O
the	O
chain	O
of	O
pointers	O
.	O
</s>
<s>
In	O
this	O
directory	O
when	O
a	O
cache	B-General_Concept
block	O
is	O
replaced	O
we	O
need	O
to	O
traverse	O
the	O
list	B-Data_Structure
in	O
order	O
to	O
change	O
the	O
directory	O
which	O
increases	O
latency	O
.	O
</s>
<s>
In	O
order	O
to	O
prevent	O
this	O
doubly	B-Data_Structure
linked	I-Data_Structure
lists	I-Data_Structure
are	O
widely	O
used	O
now	O
in	O
which	O
each	O
cached	O
copy	O
has	O
pointers	O
to	O
previous	O
and	O
the	O
next	O
cache	B-General_Concept
that	O
accesses	O
the	O
block	O
.	O
</s>
<s>
The	O
limited	O
pointer	O
format	O
uses	O
a	O
set	O
number	O
of	O
pointers	O
to	O
track	O
the	O
processors	O
that	O
are	O
caching	B-General_Concept
the	O
data	O
.	O
</s>
<s>
When	O
a	O
new	O
processor	B-General_Concept
caches	B-General_Concept
a	O
block	O
,	O
a	O
free	O
pointer	O
is	O
chosen	O
from	O
a	O
pool	O
to	O
point	O
to	O
that	O
processor	B-General_Concept
.	O
</s>
