dm-cache
GNU GPL | |
---|---|
Website | kernel |
dm-cache is a component (more specifically, a target) of the
The design of dm-cache requires three physical storage devices for the creation of a single hybrid volume; dm-cache uses those storage devices to separately store actual data, cache data, and required metadata. Configurable operating modes and cache policies, with the latter in the form of separate modules, determine the way data caching is actually performed.
dm-cache is licensed under the terms of GNU General Public License (GPL), with Joe Thornber, Heinz Mauelshagen and Mike Snitzer as its primary developers.
Overview
dm-cache uses solid-state drives (
dm-cache is implemented as a component of the Linux kernel's
When configured to use the multiqueue (mq) or stochastic multiqueue (smq) cache policy, with the latter being the default, dm-cache uses SSDs to store the data associated with performed
History
Another dm-cache project with similar goals was announced by Eric Van Hensbergen and Ming Zhao in 2006, as the result of an internship work at IBM.[8]
Later, Joe Thornber, Heinz Mauelshagen and Mike Snitzer provided their own implementation of the concept, which resulted in the inclusion of dm-cache into the Linux kernel. dm-cache was merged into the
Design
In dm-cache, creating a mapped virtual block device that acts as a
- Origin device – provides slow primary storage (usually an HDD)
- Cache device – provides a fast cache (usually an SSD)
- Metadata device – records the placement of blocks and their dirty flags, as well as other internal data required by a cache policy, including per-block hit counts; a metadata device cannot be shared between multiple cache devices, and it is recommended to be mirrored
Internally, dm-cache references to each of the origin devices through a number of fixed-size blocks; the size of these blocks, equaling to the size of a caching
Operating modes supported by dm-cache are
The rate of data migration that dm-cache performs in both directions (i.e., data promotions and demotions) can be
Cache policies
As of August 2015[update] and version 4.2 of the Linux kernel,[12] the following three cache policies are distributed with the Linux kernel mainline, out of which dm-cache by default uses the stochastic multiqueue policy:[6][7]
- multiqueue (mq)
- The multiqueue (mq) policy has three sets of 16 cache misscosts into account, and to make automatic adjustments to different load patterns.
- This policy internally tracks random I/Oand sequential I/O operations. As a result, large contiguous I/O operations are left to be performed by the origin device because such data access patterns are suitable for HDDs, and because they avoid undesirable cache invalidation.
- stochastic multiqueue (smq)
- The stochastic multiqueue (smq) policy performs in a similar way as the multiqueue policy, but requires fewer resources to operate; in particular, it uses substantially smaller amounts of least-recently used(LRU) basis. As a result, this policy provides better performance compared to the multiqueue policy, adjusts better automatically to different load patterns, and eliminates the configuration of various thresholds.
- cleaner
- The cleaner policy writes back to the origin device all blocks that are marked as dirty in the metadata. After the completion of this operation, a hybrid volume can be decommissioned or the size of a cache device can be reduced.
Use with LVM
lvmcache
, which provides a wrapper for dm-cache
integrated with LVM.[13]See also
- bcache – a Linux kernel's block layer cache, developed by Kent Overstreet
- Flashcache – a disk cache component for the Linux kernel, initially developed by Facebook
- Hybrid drive – a storage device that combines flash-based and spinning magnetic media storage technologies
- ReadyBoost – a disk caching software component of Windows Vista and later Microsoft operating systems
- Smart Response Technology (SRT) – a proprietary disk storage caching mechanism, developed by Intel for its chipsets
- ZFS – a cross-OS storage management system that has a similar integrated caching device support (L2ARC)
References
- ^ Petros Koutoupis (November 25, 2013). "Advanced Hard Drive Caching Techniques". Linux Journal. Retrieved December 2, 2013.
- ^ "dm-cache: Dynamic Block-level Storage Caching". visa.cs.fiu.edu. Archived from the original on July 18, 2014. Retrieved July 24, 2014.
- ^ Dulcardo Arteaga; Douglas Otstott; Ming Zhao (May 16, 2012). "Dynamic Block-level Cache Management for Cloud Computing Systems". visa.cs.fiu.edu. Archived from the original (PDF) on December 3, 2013. Retrieved December 2, 2013.
- ^ Dulcardo Arteaga; Ming Zhao (June 21, 2014). "Client-side Flash Caching for Cloud Systems". visa.cs.fiu.edu. ACM. Archived from the original (PDF) on September 6, 2015. Retrieved August 31, 2015.
- ^ "Red Hat Enterprise Linux 6 Documentation, Appendix A. The Device Mapper". Red Hat. October 8, 2014. Retrieved December 23, 2014.
- ^ a b c d e f g Joe Thornber; Heinz Mauelshagen; Mike Snitzer (July 20, 2015). "Linux kernel documentation: Documentation/device-mapper/cache.txt". kernel.org. Retrieved August 31, 2015.
- ^ a b c Joe Thornber; Heinz Mauelshagen; Mike Snitzer (June 29, 2015). "Linux kernel documentation: Documentation/device-mapper/cache-policies.txt". kernel.org. Retrieved August 31, 2015.
- ^ Eric Van Hensbergen; Ming Zhao (November 28, 2006). "Dynamic Policy Disk Caching for Storage Networking" (PDF). IBM Research Report. IBM. Retrieved December 2, 2013.
- ^ "Linux kernel 3.9, Section 1.3. SSD cache devices". kernelnewbies.org. April 28, 2013. Retrieved October 7, 2013.
- ^ Jake Edge (May 1, 2013). "LSFMM: Caching – dm-cache and bcache". LWN.net. Retrieved October 7, 2013.
- ^ Joe Thornber (November 11, 2013). "Linux kernel source tree: kernel/git/torvalds/linux.git: dm cache: add passthrough mode". kernel.org. Retrieved February 6, 2014.
- ^ Jonathan Corbet (July 1, 2015). "4.2 Merge window part 2". LWN.net. Retrieved August 31, 2015.
- ^ Red Hat, Inc. "lvmcache — LVM caching". Debian Manpages.
A read and write hot-spot cache, using the dm-cache kernel module.
External links
- Linux Block Caching Choices in Stable Upstream Kernel (PDF), Dell, December 2013
- Performance Comparison among EnhanceIO, bcache and dm-cache, LKML, June 11, 2013
- EnhanceIO, Bcache & DM-Cache Benchmarked, Phoronix, June 11, 2013, by Michael Larabel
- SSD Caching Using dm-cache Tutorial, July 2014, by Kyle Manna
- Re: [dm-devel] [PATCH 8/8] [dm-cache] cache target, December 14, 2012 (guidelines for metadata device sizing)