<s>
Directory-based	B-Architecture
coherence	I-Architecture
is	O
a	O
mechanism	O
to	O
handle	O
Cache	B-General_Concept
coherence	I-General_Concept
problem	O
in	O
Distributed	B-Operating_System
shared	I-Operating_System
memory	I-Operating_System
(	O
DSM	O
)	O
a.k.a.	O
</s>
<s>
Non-Uniform	B-Operating_System
Memory	I-Operating_System
Access	I-Operating_System
(	O
NUMA	O
)	O
.	O
</s>
<s>
Another	O
popular	O
way	O
is	O
to	O
use	O
a	O
special	O
type	O
of	O
computer	B-General_Concept
bus	I-General_Concept
between	O
all	O
the	O
nodes	B-Protocol
as	O
a	O
"	O
shared	O
bus	B-General_Concept
"	O
(	O
a.k.a.	O
</s>
<s>
System	B-Architecture
bus	I-Architecture
)	O
.	O
</s>
<s>
Directory-based	B-Architecture
coherence	I-Architecture
uses	O
a	O
special	O
directory	B-Application
to	O
serve	O
instead	O
of	O
the	O
shared	O
bus	B-General_Concept
in	O
the	O
bus-based	O
coherence	B-General_Concept
protocols	I-General_Concept
.	O
</s>
<s>
directory	B-Application
or	O
bus	B-General_Concept
)	O
as	O
a	O
tool	O
to	O
facilitate	O
the	O
communication	O
between	O
different	O
nodes	B-Protocol
,	O
and	O
to	O
guarantee	O
that	O
the	O
coherence	B-General_Concept
protocol	I-General_Concept
is	O
working	O
properly	O
along	O
all	O
the	O
communicating	O
nodes	B-Protocol
.	O
</s>
<s>
In	O
directory	B-Application
based	O
cache	B-General_Concept
coherence	I-General_Concept
,	O
this	O
is	O
done	O
by	O
using	O
this	O
directory	B-Application
to	O
keep	O
track	O
of	O
the	O
status	O
of	O
all	O
cache	B-General_Concept
blocks	O
,	O
the	O
status	O
of	O
each	O
block	O
includes	O
in	O
which	O
cache	B-General_Concept
coherence	I-General_Concept
"	O
state	B-Application
"	O
that	O
block	O
is	O
,	O
and	O
which	O
nodes	B-Protocol
are	O
sharing	O
that	O
block	O
at	O
that	O
time	O
,	O
which	O
can	O
be	O
used	O
to	O
eliminate	O
the	O
need	O
to	O
broadcast	B-Operating_System
all	O
the	O
signals	O
to	O
all	O
nodes	B-Protocol
,	O
and	O
only	O
send	O
it	O
to	O
the	O
nodes	B-Protocol
that	O
are	O
interested	O
in	O
this	O
single	O
block	O
.	O
</s>
<s>
Following	O
are	O
a	O
few	O
advantages	O
and	O
disadvantages	O
of	O
the	O
directory	B-Application
based	O
cache	B-General_Concept
coherence	I-General_Concept
protocol	O
:	O
</s>
<s>
Scalability	B-Architecture
:	O
This	O
is	O
one	O
of	O
the	O
strongest	O
motivations	O
for	O
going	O
to	O
directory	B-Application
based	O
designs	O
.	O
</s>
<s>
What	O
we	O
mean	O
by	O
scalability	B-Architecture
,	O
in	O
short	O
,	O
is	O
how	O
good	O
a	O
specific	O
system	O
is	O
in	O
handling	O
the	O
growing	O
amount	O
of	O
work	O
that	O
it	O
is	O
responsible	O
to	O
do	O
.	O
</s>
<s>
For	O
this	O
criteria	O
,	O
Bus	B-General_Concept
based	O
systems	O
cannot	O
do	O
well	O
due	O
to	O
the	O
limitation	O
caused	O
when	O
having	O
a	O
shared	O
bus	B-General_Concept
that	O
all	O
nodes	B-Protocol
are	O
using	O
in	O
the	O
same	O
time	O
.	O
</s>
<s>
For	O
a	O
relatively	O
small	O
number	O
of	O
nodes	B-Protocol
,	O
bus	B-General_Concept
systems	O
can	O
do	O
well	O
.	O
</s>
<s>
However	O
,	O
while	O
the	O
number	O
of	O
nodes	B-Protocol
is	O
growing	O
,	O
some	O
problems	O
may	O
occur	O
in	O
this	O
regard	O
.	O
</s>
<s>
Especially	O
since	O
only	O
one	O
node	O
is	O
allowed	O
to	O
use	O
the	O
bus	B-General_Concept
at	O
a	O
time	O
,	O
which	O
will	O
significantly	O
harm	O
the	O
performance	O
of	O
the	O
overall	O
system	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
using	O
directory-based	O
systems	O
,	O
there	O
will	O
be	O
no	O
such	O
bottleneck	O
to	O
constrain	O
the	O
scalability	B-Architecture
of	O
the	O
system	O
.	O
</s>
<s>
Simplicity	O
:	O
This	O
is	O
one	O
of	O
the	O
points	O
where	O
the	O
bus-system	O
is	O
superior	O
.	O
</s>
<s>
Since	O
the	O
bus	B-General_Concept
structure	O
itself	O
can	O
serve	O
as	O
an	O
organizer	O
for	O
all	O
the	O
traffic	O
that	O
goes	O
through	O
the	O
system	O
,	O
and	O
ensure	O
the	O
atomicity	B-General_Concept
of	O
all	O
the	O
signals	O
passed	O
through	O
,	O
there	O
will	O
be	O
no	O
need	O
to	O
put	O
more	O
effort	O
in	O
ensuring	O
atomicity	B-General_Concept
and	O
ordering	O
between	O
signals	O
as	O
the	O
case	O
in	O
directory	B-Application
based	O
systems	O
,	O
which	O
leads	O
to	O
several	O
overhead	O
faced	O
in	O
the	O
later	O
system	O
design	O
when	O
dealing	O
with	O
issues	O
like	O
consistency	B-General_Concept
.	O
</s>
<s>
According	O
to	O
the	O
above	O
discussion	O
,	O
it	O
is	O
clear	O
that	O
using	O
bus	B-General_Concept
based	O
systems	O
seems	O
more	O
attractive	O
for	O
relatively	O
small	O
systems	O
.	O
</s>
<s>
However	O
,	O
directory	B-Application
based	O
systems	O
become	O
crucial	O
when	O
the	O
system	O
scale	O
up	O
and	O
the	O
number	O
of	O
nodes	B-Protocol
grows	O
.	O
</s>
<s>
So	O
there	O
is	O
a	O
kind	O
of	O
trade-off	O
between	O
the	O
simplicity	O
and	O
the	O
scalability	B-Architecture
when	O
comparing	O
between	O
Bus-based	O
and	O
Directory-based	O
cache	B-General_Concept
coherence	I-General_Concept
designs	O
.	O
</s>
<s>
The	O
idea	O
of	O
Directory-based	O
cache	B-General_Concept
coherence	I-General_Concept
systems	O
began	O
long	O
ago	O
.	O
</s>
<s>
The	O
idea	O
of	O
DASH	O
(	O
Directory	B-Application
Architecture	O
for	O
SHared-memory	O
)	O
was	O
first	O
proposed	O
by	O
C.K.	O
</s>
<s>
However	O
,	O
applying	O
it	O
to	O
cache	B-General_Concept
coherence	I-General_Concept
was	O
proposed	O
a	O
few	O
years	O
later	O
,	O
specifically	O
in	O
1978	O
,	O
when	O
researchers	O
at	O
Stanford	O
University	O
proposed	O
the	O
first	O
version	O
of	O
this	O
coherence	O
systems	O
called	O
Stanford	B-Operating_System
DASH	I-Operating_System
,	O
in	O
a	O
paper	O
that	O
described	O
the	O
system	O
with	O
the	O
difficulties	O
and	O
improvements	O
associated	O
with	O
such	O
designs	O
.	O
</s>
<s>
Beside	O
this	O
approach	O
,	O
several	O
attempts	O
were	O
done	O
to	O
provide	O
a	O
scalable	B-Architecture
systems	I-Architecture
.	O
</s>
<s>
For	O
instance	O
,	O
BBN	B-Device
Butterfly	I-Device
which	O
was	O
introduced	O
in	O
1985	O
,	O
and	O
IBM	O
PR3	O
which	O
was	O
introduced	O
in	O
1987	O
,	O
are	O
some	O
examples	O
of	O
scalable	B-Architecture
multiprocessor	B-General_Concept
systems	I-General_Concept
.	O
</s>
<s>
However	O
,	O
both	O
of	O
these	O
systems	O
have	O
a	O
drawback	O
;	O
For	O
example	O
,	O
BBN	B-Device
Butterfly	I-Device
does	O
not	O
have	O
caches	B-General_Concept
.	O
</s>
<s>
Similarly	O
,	O
IBM	O
PR3	O
does	O
not	O
provide	O
hardware	O
cache	B-General_Concept
coherence	I-General_Concept
,	O
which	O
limits	O
the	O
performance	O
of	O
both	O
of	O
these	O
designs	O
,	O
especially	O
when	O
employing	O
high	O
performance	O
processors	O
.	O
</s>
<s>
The	O
limitations	O
of	O
other	O
competitors	O
made	O
it	O
easier	O
for	O
DASH	O
based	O
systems	O
to	O
get	O
chosen	O
when	O
designing	O
cache	B-General_Concept
coherence	I-General_Concept
systems	O
and	O
other	O
systems	O
needing	O
scalability	B-Architecture
in	O
cache-based	O
nodes	B-Protocol
.	O
</s>
<s>
In	O
1985	O
,	O
James	O
Archibald	O
and	O
Jean-Loup	O
Baer	O
from	O
the	O
University	O
of	O
Washington	O
published	O
a	O
paper	O
that	O
proposes	O
a	O
more	O
economical	O
,	O
expandable	O
,	O
and	O
modular	O
variation	O
of	O
the	O
"	O
global	O
directory	B-Application
"	O
approach	O
in	O
the	O
term	O
of	O
hardware	O
use	O
in	O
the	O
design	O
.	O
</s>
<s>
In	O
1992	O
,	O
Daniel	O
Lenoski	O
from	O
Stanford	O
university	O
published	O
a	O
paper	O
proposing	O
advances	O
in	O
cache	B-General_Concept
coherence	I-General_Concept
protocols	O
for	O
directory-based	O
systems	O
.	O
</s>
<s>
In	O
a	O
1996	O
paper	O
,	O
he	O
introduced	O
the	O
design	O
of	O
the	O
SGI	B-Application
Origin	I-Application
2000	I-Application
,	O
a	O
family	O
of	O
server	O
computers	O
employing	O
directory	B-Application
based	O
cache	B-General_Concept
coherence	I-General_Concept
.	O
</s>
<s>
Unlike	O
snoopy	B-General_Concept
coherence	B-General_Concept
protocols	I-General_Concept
,	O
in	O
a	O
directory	B-Application
based	O
coherence	O
approach	O
,	O
the	O
information	O
about	O
which	O
caches	B-General_Concept
have	O
a	O
copy	O
of	O
a	O
block	O
is	O
maintained	O
in	O
a	O
structure	O
called	O
Directory	B-Application
.	O
</s>
<s>
In	O
a	O
directory	B-Application
based	O
scheme	O
,	O
participating	O
caches	B-General_Concept
do	O
not	O
broadcast	B-Operating_System
requests	O
to	O
all	O
other	O
sharing	O
caches	B-General_Concept
of	O
the	O
block	O
in	O
order	O
to	O
locate	O
cached	O
copies	O
,	O
instead	O
it	O
queries	O
the	O
directory	B-Application
to	O
retrieve	O
the	O
information	O
about	O
which	O
block	O
have	O
cached	O
copies	O
and	O
sends	O
only	O
to	O
those	O
particular	O
processors	O
and	O
hence	O
traffic	O
saving	O
compared	O
to	O
a	O
snoopy	B-General_Concept
protocol	O
is	O
large	O
.	O
</s>
<s>
A	O
directory	B-Application
approach	O
can	O
result	O
in	O
a	O
substantial	O
traffic	O
saving	O
compared	O
to	O
broadcast/snoopy	O
approach	O
in	O
such	O
applications	O
.	O
</s>
<s>
As	O
shown	O
in	O
the	O
data	O
flow	O
diagram	O
,	O
the	O
actors	O
involved	O
in	O
a	O
distributed	B-Operating_System
shared	I-Operating_System
memory	I-Operating_System
system	O
implementing	O
directory	B-Application
based	O
coherence	B-General_Concept
protocol	I-General_Concept
are	O
:	O
</s>
<s>
Directory	B-Application
Node	O
:	O
This	O
node	O
maintains	O
the	O
information	O
of	O
the	O
state	B-Application
of	O
each	O
cache	B-General_Concept
block	O
in	O
the	O
system	O
and	O
requestor	O
directs	O
its	O
requests	O
to	O
the	O
directory	B-Application
node	O
.	O
</s>
<s>
Owner	O
Node	O
:	O
An	O
owner	O
node	O
owns	O
the	O
most	O
recent	O
state	B-Application
of	O
the	O
cache	B-General_Concept
block	O
,	O
note	O
that	O
directory	B-Application
might	O
not	O
be	O
always	O
up	O
to	O
date	O
with	O
latest	O
data	O
.	O
</s>
<s>
Sharer	O
Node	O
:	O
One	O
or	O
many	O
node	O
which	O
are	O
sharing	O
a	O
copy	O
of	O
the	O
cache	B-General_Concept
block	O
.	O
</s>
<s>
Requestor	O
and	O
Owner	O
nodes	B-Protocol
maintain	O
their	O
state	B-Application
transition	O
similar	O
to	O
a	O
snoopy	B-General_Concept
coherence	B-General_Concept
protocols	I-General_Concept
like	O
MESI	B-General_Concept
protocol	I-General_Concept
.	O
</s>
<s>
However	O
,	O
unlike	O
a	O
bus	B-General_Concept
based	O
implementation	O
where	O
nodes	B-Protocol
communicate	O
using	O
a	O
common	O
bus	B-General_Concept
,	O
directory	B-Application
based	O
implementation	O
uses	O
message	B-Application
passing	I-Application
model	O
to	O
exchange	O
information	O
required	O
for	O
maintaining	O
cache	B-General_Concept
coherence	I-General_Concept
.	O
</s>
<s>
Directory	B-Application
node	O
acts	O
as	O
a	O
serializing	O
point	O
and	O
all	O
communications	O
are	O
directed	O
through	O
this	O
node	O
to	O
maintain	O
correctness	O
.	O
</s>
<s>
A	O
directory	B-Application
node	O
keeps	O
track	O
of	O
the	O
overall	O
state	B-Application
of	O
a	O
cache	B-General_Concept
block	O
in	O
the	O
entire	O
cache	B-General_Concept
system	O
for	O
all	O
processors	O
.	O
</s>
<s>
In	O
this	O
state	B-Application
directory	B-Application
and	O
sharers	O
have	O
clean	O
copy	O
of	O
the	O
cached	O
block	O
.	O
</s>
<s>
Note	O
that	O
directory	B-Application
cannot	O
distinguish	O
a	O
block	O
cached	O
in	O
an	O
exclusive	O
or	O
modified	O
state	B-Application
at	O
the	O
processor	O
as	O
processors	O
can	O
transition	O
from	O
an	O
exclusive	O
state	B-Application
to	O
modified	O
state	B-Application
without	O
any	O
bus	B-General_Concept
transaction	O
.	O
</s>
<s>
Explanation	O
of	O
the	O
Directory	B-Application
state	B-Application
transition	O
Finite	B-Architecture
State	I-Architecture
Machine	I-Architecture
(	O
refer	O
image	O
1	O
)	O
is	O
captured	O
below	O
in	O
the	O
table	O
:	O
</s>
<s>
BusRdX	O
Fetch	O
block	O
from	O
memory	O
as	O
the	O
directory	B-Application
is	O
having	O
the	O
updated	O
copy	O
of	O
the	O
block	O
.	O
</s>
<s>
if	O
there	O
are	O
no	O
sharers	O
:	O
requestor	O
=	O
first	O
sharer	O
,	O
directory	B-Application
transitions	O
into	O
EM	O
state.EMEMBusRd	O
Send	O
intervention(Int )	O
to	O
the	O
OwnerSBusRdX	O
Send	O
Invalidation(Inv )	O
to	O
the	O
current	O
owner	O
.	O
</s>
<s>
In	O
addition	O
to	O
cache	B-General_Concept
state	B-Application
,	O
a	O
directory	B-Application
must	O
track	O
which	O
processors	O
have	O
data	O
when	O
in	O
the	O
shared	O
state	B-Application
.	O
</s>
<s>
This	O
is	O
required	O
for	O
sending	O
invalidation	O
and	O
intervention	O
requests	O
to	O
the	O
individual	O
processor	O
caches	B-General_Concept
which	O
have	O
the	O
cache	B-General_Concept
block	O
in	O
shared	O
state	B-Application
.	O
</s>
<s>
Full	O
bit-vector	O
:	O
A	O
bit	O
field	O
for	O
each	O
processor	O
at	O
the	O
directory	B-Application
node	O
are	O
maintained	O
.	O
</s>
<s>
Limited	O
pointer	O
:	O
In	O
this	O
approach	O
directory	B-Application
information	O
of	O
limited	O
number	O
of	O
blocks	O
is	O
kept	O
at	O
the	O
directory	B-Application
to	O
reduce	O
storage	O
overhead	O
.	O
</s>
<s>
Please	O
note	O
that	O
the	O
protocol	O
described	O
above	O
is	O
the	O
basic	O
implementation	O
and	O
race	B-Operating_System
conditions	I-Operating_System
can	O
occur	O
due	O
to	O
the	O
fact	O
that	O
directory	B-Application
can	O
be	O
out	O
of	O
sync	O
with	O
the	O
caches	B-General_Concept
and	O
also	O
messages	O
between	O
processors	O
can	O
be	O
overlapping	O
.	O
</s>
<s>
More	O
complex	O
implementations	O
are	O
available	O
like	O
Scalable	B-General_Concept
Coherent	I-General_Concept
Interface	I-General_Concept
which	O
have	O
multiple	O
states	O
.	O
</s>
<s>
DASH	O
cache	B-General_Concept
coherence	I-General_Concept
protocol	O
is	O
another	O
protocol	O
that	O
uses	O
directory-based	B-Architecture
coherence	I-Architecture
scheme	O
.	O
</s>
<s>
DASH	O
protocol	O
uses	O
a	O
clustered	O
approach	O
,	O
where	O
processors	O
inside	O
a	O
cluster	O
are	O
kept	O
coherent	O
using	O
bus	B-General_Concept
based	O
snooping	O
scheme	O
,	O
while	O
the	O
clusters	O
are	O
connected	O
in	O
a	O
directory	B-Application
approach	O
.	O
</s>
<s>
Even	O
though	O
various	O
protocols	O
use	O
different	O
implementations	O
for	O
tracking	O
cache	B-General_Concept
blocks	O
,	O
however	O
the	O
concept	O
of	O
directory	B-Application
remains	O
same	O
.	O
</s>
