Flashcache creation and loading utilities

Flashcache uses 3 utilities for creating,loading and destroying cache.

1, flashcache_create
2. flashcache_load
3, flashcache_destroy

flashcache_create –> Create a new flashcache volume.

usage: flashcache_create -p back|around|thru [-s cache size] [-w] [-b block size] cachedevname ssd_devname disk_devname
-p : cache mode (writeback/writethrough/writearound).
-s : cache size. Optional. If this is not specified, the entire ssd device
is used as cache. The default units is sectors. But you can specify
k/m/g as units as well.
-b : block size. Optional. Defaults to 4KB. Must be a power of 2.
The default units is sectors. But you can specify k as units as well.
(A 4KB blocksize is the correct choice for the vast majority of
applications. But see the section “Cache Blocksize selection” below).
-f : force create. by pass checks (eg for ssd sectorsize).
-w : write cache mode. Only writes are cached, not reads
-d : disk associativity, within each cache set, we store several contigous
disk extents. Defaults to off.

2, flashcache_load : Load an existing writeback cache volume. This is not needed for writethrough/writearound

usage : flashcache_load ssd_devname [cachedev_name]

For writethrough and writearound caches flashcache_load is not needed; flashcache_create
should be used each time.

3, flashcache_destroy : Destroy an existing writeback flashcache. All data will be lost !!! .For writethrough and writearound caches this is not necessary.

usage : flashcache_destroy ssd_devname

Caching Modes in Flashcache

The basic difference in the caching modes in Flash-cache is listed below.

1,Writethrough – All writes are cached to ssd but also written to disk immediately. All disk reads are cached (tunable).Tjis is the safest one

2,Writearound – rites are not written to ssd but directly to
disk. Disk blocks will only be cached after they are read. All disk reads
are cached (tunable). This is also safe.

3, Writeback – fastest but less safe. Writes only go to the ssd initially, and
based on various policies are written to disk later.

Writethrough and Writearound caches are not persistent across a device removal
or a reboot. Only Writeback caches are persistent across device removals
and reboots.