SSD cache (bcache)

Summary

Using recent kernel (3.9 and later) features for (fast) SSD caching of (slow) ordinary hard disks. Currently two kinds of SSD caching are available in the Linux kernel: bcache and dm-cache. In Fedora 20 basic bcache support is provided by the "bcache-tools" package, this page now provides suggestions on how to move forward in Fedora 21.

The main suggestion is to implement bcache support in Anaconda, which allows easy installation of Fedora on "bcached" root-FS and support for existing (root or non-root) bcache partitions during Fedora installation. The other suggestion is to add the blocks utility to Fedora 21 to "convert between raw partitions, logical volumes, and bcache devices without moving data" (https://github.com/g2p/blocks).

Owner

Current status

Detailed Description

Recent Linux kernels support the use of Solid State Drives as caches for rotational hard disks. Because the high cost per GB for SSD devices this feature may bring the best of both: fast end big yet affordable storage capacity. Linux kernel 3.9 introduced dm-cache, kernel 3.10 introduces bcache.

The introduction of bcache-tools in Fedora 20 allowed users to create SSD-cached block devices on which they could create bcache filesystems and/or LVM volumes. Creating a bcache root FS is possible using bcache-tools, but complicated because bcache requires a "fresh" block device destroying all data currently on it. Solving this involves:

Adding bcache support in Anaconda. This covers both support for "manually created" (bcache-tools) bcached filesystems, and support for creating a bcached root FS. (Implementing bcache support in Anaconda can't be done by me, and needs to be done by the Anaconda team, hence I consider this a suggestion).

Adding the blocks utility to "convert between raw partitions, logical volumes, and bcache devices without moving data" (https://github.com/g2p/blocks). The software is available, and needs packaging and testing.

Moving forward with dm-cache is not covered by this page because the LVM team already plans to integrate dm-cache support in LVM2. See http://www.redhat.com/archives/dm-devel/2014-January/msg00072.html. It should be noted that (in contrast to bcache) dm-cache support may not require Anaconda changes because it'll be an integral part of lvm2.

Benefit to Fedora

The availability of bcache-tools in Fedora 20 already brought the speed of SSD's to Fedora users, while also bringing the capacity of HDD's. This was limited however to expert Fedora users who feel comfortable using te command line.

The SSD caching support in Fedora 20 will become available to more Fedora users when Anaconda will support this in Fedora 21.

Scope

Proposal owners: build and test blocks package (or include blocks in bcache-tools), support Anaconda team when needed, test Anaconda.

Other developers: Build bcache support in Anaconda (by Anaconda team)

Release engineering:

Policies and guidelines:

Upgrade/compatibility impact

Implementing a caching root FS using bcache requires a reinstall for sure, because bcache requires its own superblock on disks/volumes!

All existing Fedora functionality remains as is.

How To Test

Testing involves doing a clean install of Fedora, while configuring in anaconda a cached root FS. After the installation the cache state should be checked (if it is operational or not.

Additional tests:

run benchmarks (see performance improvement over non cached storage)

update the kernel (see if dracut builds a functional initramfs including caching