bcache

bcache
Developer(s) Kent Overstreet and others
Repository evilpiepirate.org/git/linux-bcache.git/log/?h=bcache-dev
Written in C
Operating system Linux
Type Linux kernel features
License GNU GPL
Website bcache.evilpiepirate.org

bcache (abbreviated from block cache) is a cache in the Linux kernel's block layer, which is used for accessing secondary storage devices. It allows one or more fast storage devices, such as flash-based solid-state drives (SSDs), to act as a cache for one or more slower storage devices, such as hard disk drives (HDDs); this effectively creates hybrid volumes and provides performance improvements.

Designed around the nature and performance characteristics of SSDs, bcache also minimizes write amplification by avoiding random writes and turning them into sequential writes instead. This merging of I/O operations is performed for both the cache and the primary storage, helping in extending the lifetime of flash-based devices used as caches, and in improving the performance of write-sensitive primary storages, such as RAID 5 sets.

bcache is licensed under the GNU General Public License (GPL), with Kent Overstreet as its primary developer.

Overview

Using bcache makes it possible to have SSDs as another level of indirection within the data storage access paths, resulting in improved overall performance by utilizing fast flash-based SSDs as caches for slower mechanical hard disk drives (HDDs) with rotational magnetic media. That way, the gap between SSDs and HDDs can be bridged  the costly speed of SSDs gets combined with the cheap storage capacity of traditional HDDs.[1]

Caching is implemented by using SSDs for storing data associated with performed random reads and random writes, utilizing near-zero seek times as the most prominent feature of SSDs. Sequential I/O is not cached, in order to avoid rapid SSD cache invalidation on such operations that are already suitable enough for HDDs; going around the cache for big sequential writes is known as the write-around policy. Not caching the sequential I/O also helps in extending the lifetime of SSDs used as caches.[2] Write amplification is avoided by not performing random writes to SSDs; instead, all random writes to SSD caches are always combined into block-level writes, ending up with rewriting only the complete erase blocks on SSDs.[3][4]

Both write-back and write-through (which is the default) policies are supported for caching write operations. In case of the write-back policy, written data is stored inside the SSD caches first, and propagated to the HDDs later in a batched way while performing seek-friendly operations  making bcache to act also as an I/O scheduler. For the write-through policy, which ensures that no write operation is marked as finished until the data requested to be written has reached both SSDs and HDDs, performance improvements are reduced by effectively performing only caching of the written data.[3][4]

Write-back policy with batched writes to HDDs provides additional benefits to write-sensitive redundant array of independent disks (RAID) layouts such as RAID 5 and RAID 6, which perform actual write operations as atomic read-modify-write sequences. That way, performance penalties[5] of small random writes are reduced or avoided for such RAID layouts, by grouping them together and performing as batched sequential writes.[3][4]

Caching performed by bcache operates at the block device level, making itself file systemagnostic as long as the file system provides an embedded universally unique identifier (UUID); this requirement is satisfied by virtually all standard Linux file systems, as well as by swap partitions. Sizes of the logical blocks used internally by bcache as caching extents can go down to the size of a single HDD sector.[6]

History

The bcache was first announced by Kent Overstreet in July 2010, as a completely working Linux kernel module, though at its early beta stage.[7] The development continued for almost two years, until May 2012, at which point bcache reached its production-ready state.[4]

It was merged into the Linux kernel mainline in kernel version 3.10, released on June 30, 2013.[8][9]

Features

As of version 3.10 of the Linux kernel, the following features are provided by bcache:[3]

Improvements

As of February 2014, the following new features are planned for the future releases of bcache:[9]

See also

References

  1. Petros Koutoupis (November 25, 2013). "Advanced Hard Drive Caching Techniques". Linux Journal. Retrieved December 2, 2013.
  2. 1 2 3 "Linux kernel documentation: Documentation/bcache.txt". kernel.org. August 12, 2013. Retrieved January 24, 2014.
  3. 1 2 3 4 Kent Overstreet. "bcache: Linux kernel block layer cache". bcache.evilpiepirate.org. Retrieved December 2, 2013.
  4. 1 2 3 4 Jonathan Corbet (May 12, 2012). "A bcache update". LWN.net. Retrieved October 4, 2013.
  5. "Basic RAID Organizations". ecs.umass.edu. Retrieved October 4, 2013.
  6. William Stearns; Kent Overstreet (July 2, 2010). "Bcache: Caching beyond just RAM". LWN.net. Retrieved October 4, 2013.
  7. Kent Overstreet (July 4, 2010). "Bcache: Version 6". LWN.net. Retrieved October 4, 2013.
  8. "Linux kernel 3.10, Section 1.2. Bcache, a block layer cache for SSD caching". kernelnewbies.org. June 30, 2013. Retrieved October 4, 2013.
  9. 1 2 Libby Clark (June 11, 2013). "All About the Linux Kernel: Bcache". linux.com. Retrieved October 9, 2013.

External links

Wikimedia Commons has media related to Linux kernel.
This article is issued from Wikipedia - version of the 9/16/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.