Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm cache: update cache-policies.txt now that mq is an alias for smq

Also fix some typos and make all "smq" and "mq" references consistently
lowercase.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>

+16 -18
+16 -18
Documentation/device-mapper/cache-policies.txt
··· 11 11 The policy can return a simple HIT or MISS or issue a migration. 12 12 13 13 Currently there's no way for the policy to issue background work, 14 - e.g. to start writing back dirty blocks that are going to be evicte 14 + e.g. to start writing back dirty blocks that are going to be evicted 15 15 soon. 16 16 17 17 Because we map bios, rather than requests it's easy for the policy ··· 48 48 49 49 The smq policy (vs mq) offers the promise of less memory utilization, 50 50 improved performance and increased adaptability in the face of changing 51 - workloads. SMQ also does not have any cumbersome tuning knobs. 51 + workloads. smq also does not have any cumbersome tuning knobs. 52 52 53 53 Users may switch from "mq" to "smq" simply by appropriately reloading a 54 54 DM table that is using the cache target. Doing so will cause all of the ··· 57 57 that should be cached. 58 58 59 59 Memory usage: 60 - The mq policy uses a lot of memory; 88 bytes per cache block on a 64 60 + The mq policy used a lot of memory; 88 bytes per cache block on a 64 61 61 bit machine. 62 62 63 - SMQ uses 28bit indexes to implement it's data structures rather than 63 + smq uses 28bit indexes to implement it's data structures rather than 64 64 pointers. It avoids storing an explicit hit count for each block. It 65 - has a 'hotspot' queue rather than a pre cache which uses a quarter of 65 + has a 'hotspot' queue, rather than a pre-cache, which uses a quarter of 66 66 the entries (each hotspot block covers a larger area than a single 67 67 cache block). 68 68 69 - All these mean smq uses ~25bytes per cache block. Still a lot of 69 + All this means smq uses ~25bytes per cache block. Still a lot of 70 70 memory, but a substantial improvement nontheless. 71 71 72 72 Level balancing: 73 - MQ places entries in different levels of the multiqueue structures 74 - based on their hit count (~ln(hit count)). This means the bottom 75 - levels generally have the most entries, and the top ones have very 76 - few. Having unbalanced levels like this reduces the efficacy of the 73 + mq placed entries in different levels of the multiqueue structures 74 + based on their hit count (~ln(hit count)). This meant the bottom 75 + levels generally had the most entries, and the top ones had very 76 + few. Having unbalanced levels like this reduced the efficacy of the 77 77 multiqueue. 78 78 79 - SMQ does not maintain a hit count, instead it swaps hit entries with 80 - the least recently used entry from the level above. The over all 79 + smq does not maintain a hit count, instead it swaps hit entries with 80 + the least recently used entry from the level above. The overall 81 81 ordering being a side effect of this stochastic process. With this 82 82 scheme we can decide how many entries occupy each multiqueue level, 83 83 resulting in better promotion/demotion decisions. 84 84 85 85 Adaptability: 86 - The MQ policy maintains a hit count for each cache block. For a 86 + The mq policy maintained a hit count for each cache block. For a 87 87 different block to get promoted to the cache it's hit count has to 88 - exceed the lowest currently in the cache. This means it can take a 88 + exceed the lowest currently in the cache. This meant it could take a 89 89 long time for the cache to adapt between varying IO patterns. 90 - Periodically degrading the hit counts could help with this, but I 91 - haven't found a nice general solution. 92 90 93 - SMQ doesn't maintain hit counts, so a lot of this problem just goes 91 + smq doesn't maintain hit counts, so a lot of this problem just goes 94 92 away. In addition it tracks performance of the hotspot queue, which 95 93 is used to decide which blocks to promote. If the hotspot queue is 96 94 performing badly then it starts moving entries more quickly between 97 95 levels. This lets it adapt to new IO patterns very quickly. 98 96 99 97 Performance: 100 - Testing SMQ shows substantially better performance than MQ. 98 + Testing smq shows substantially better performance than mq. 101 99 102 100 cleaner 103 101 -------