<s>
Flashcache	B-Application
is	O
a	O
disk	B-General_Concept
cache	I-General_Concept
component	O
for	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
,	O
initially	O
developed	O
by	O
Facebook	B-Application
since	O
April	O
2010	O
,	O
and	O
released	O
as	O
open	B-License
source	I-License
in	O
2011	O
.	O
</s>
<s>
Since	O
January	O
2013	O
,	O
there	O
is	O
a	O
fork	O
of	O
Flashcache	B-Application
,	O
named	O
EnhanceIO	B-Application
and	O
developed	O
by	O
sTec	O
,	O
Inc	O
.	O
</s>
<s>
Flashcache	B-Application
works	O
by	O
using	O
flash	B-Device
memory	I-Device
,	O
a	O
USB	O
flash	O
drive	O
,	O
SD	B-Device
card	I-Device
,	O
CompactFlash	B-Device
or	O
any	O
kind	O
of	O
portable	O
flash	O
mass	O
storage	O
system	O
as	O
a	O
write-back	O
persistent	O
cache	B-General_Concept
.	O
</s>
<s>
An	O
internal	O
SSD	B-Device
can	O
also	O
be	O
used	O
for	O
increasing	O
performance	O
.	O
</s>
<s>
Using	O
flash	B-Device
memory	I-Device
(	O
NAND	B-Device
memory	I-Device
devices	O
)	O
for	O
caching	B-General_Concept
allows	O
Linux	B-Operating_System
kernel	I-Operating_System
to	O
service	O
random	O
disk	O
IO	O
with	O
better	O
performance	O
than	O
without	O
the	O
cache	B-General_Concept
.	O
</s>
<s>
This	O
caching	B-General_Concept
applies	O
to	O
all	O
disk	O
content	O
,	O
not	O
just	O
the	O
page	O
file	O
or	O
system	O
binaries	O
.	O
</s>
<s>
Flash	B-Device
memory	I-Device
based	O
devices	O
are	O
usually	O
a	O
magnitude	O
faster	O
than	O
spinning	O
HDDs	O
for	O
random	O
IO	O
,	O
but	O
with	O
less	O
advantage	O
or	O
even	O
slower	O
in	O
sequential	O
read/writes	O
.	O
</s>
<s>
By	O
default	O
,	O
flashcache	B-Application
caches	B-General_Concept
all	O
full	O
blocksize	O
IOs	O
,	O
but	O
can	O
be	O
configured	O
to	O
only	O
cache	B-General_Concept
random	O
IO	O
whilst	O
ignoring	O
sequential	O
IO	O
.	O
</s>
<s>
Similar	O
technology	O
exists	O
in	O
Microsoft	B-Application
Windows	I-Application
as	O
ReadyBoost	O
since	O
Windows	B-Application
Vista	I-Application
.	O
</s>
<s>
Flashcache	B-Application
is	O
built	O
on	O
top	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
's	O
device	B-Application
mapper	I-Application
.	O
</s>
<s>
The	O
data	O
structure	O
of	O
the	O
cache	B-General_Concept
is	O
a	O
set-associative	O
hash	B-Algorithm
table	I-Algorithm
,	O
in	O
which	O
the	O
cache	B-General_Concept
is	O
divided	O
up	O
into	O
a	O
number	O
of	O
fixed-size	O
sets	O
(	O
buckets	O
)	O
,	O
using	O
linear	B-Algorithm
probing	I-Algorithm
within	O
a	O
set	O
to	O
find	O
blocks	O
.	O
</s>
<s>
The	O
device	B-Application
mapper	I-Application
layer	O
breaks	O
up	O
all	O
I/O	O
requests	O
into	O
blocksize	O
chunks	O
before	O
passing	O
the	O
requests	O
to	O
the	O
cache	B-General_Concept
layer	O
.	O
</s>
<s>
When	O
a	O
write	O
request	O
happens	O
,	O
the	O
corresponding	O
cache	B-General_Concept
block	O
is	O
marked	O
dirty	O
;	O
dirty	O
cache	B-General_Concept
blocks	O
are	O
written	O
lazily	O
to	O
disk	O
in	O
the	O
background	O
.	O
</s>
<s>
There	O
are	O
a	O
few	O
limitations	O
,	O
imposed	O
by	O
the	O
implementation	O
of	O
flashcache	B-Application
:	O
</s>
<s>
Cache	B-General_Concept
block	O
writes	O
are	O
currently	O
non-atomic	O
.	O
</s>
<s>
ATA	O
TRIM	O
command	O
to	O
optimize	O
flash	B-Device
memory	I-Device
are	O
not	O
yet	O
supported	O
.	O
</s>
<s>
A	O
process	O
can	O
be	O
marked	O
non-cacheable	O
to	O
prevent	O
flashcache	B-Application
cache	B-General_Concept
its	O
requests	O
;	O
however	O
,	O
if	O
a	O
process	O
that	O
marked	O
itself	O
non-cacheable	O
dies	O
,	O
flashcache	B-Application
has	O
no	O
way	O
of	O
cleaning	O
up	O
.	O
</s>
<s>
Relying	O
on	O
the	O
device	B-Application
mapper	I-Application
resulted	O
in	O
caching	B-General_Concept
performance	O
issues	O
and	O
no	O
caching	B-General_Concept
of	O
writes	O
that	O
are	O
not	O
multiple	O
of	O
4KiB	O
.	O
</s>
<s>
Thus	O
,	O
EnhanceIO	B-Application
has	O
moved	O
away	O
from	O
the	O
device	B-Application
mapper	I-Application
integration	O
,	O
yielding	O
higher	O
performance	O
for	O
unoptimal	O
use	O
cases	O
.	O
</s>
<s>
in	O
write-around	O
mode	O
all	O
writes	O
bypass	O
the	O
cache	B-General_Concept
for	O
high	O
consistency	O
.	O
</s>
<s>
The	O
current	O
implementation	O
will	O
fetch	O
reads	O
through	O
the	O
SSD	B-Device
device	O
and	O
then	O
deliver	O
them	O
to	O
the	O
actual	O
reader	O
.	O
</s>
<s>
This	O
means	O
that	O
previously	O
uncached	O
blocks	O
will	O
always	O
need	O
to	O
go	O
to	O
the	O
SSD	B-Device
device	O
first	O
,	O
causing	O
a	O
constant	O
write	O
IO	O
.	O
</s>
<s>
Not	O
an	O
issue	O
on	O
enterprise	O
SSD	B-Device
or	O
highend	O
PCIe	O
devices	O
as	O
facebook	B-Application
uses	O
,	O
but	O
degrades	O
performance	O
on	O
lower	O
end	O
SSD	B-Device
.	O
</s>
<s>
in	O
write-around	O
mode	O
FlashCache	B-Application
has	O
no	O
information	O
to	O
compare	O
the	O
age	O
of	O
cached	O
pages	O
over	O
the	O
on-disk	O
ones	O
.	O
</s>
<s>
(	O
1	O
)	O
Because	O
the	O
device	O
could	O
have	O
been	O
mounted	O
outside	O
of	O
FlashCache	B-Application
(	O
2	O
)	O
Because	O
no	O
writes	O
are	O
tracked	O
in	O
this	O
mode	O
.	O
</s>
<s>
This	O
results	O
in	O
an	O
empty	O
cache	B-General_Concept
after	O
each	O
volume	O
activation	O
(	O
i.e.	O
</s>
