Skip to content

Commit 9ed8469

Browse files
jthornbersnitm
authored andcommitted
dm cache: make the 'mq' policy an alias for 'smq'
smq seems to be performing better than the old mq policy in all situations, as well as using a quarter of the memory. Make 'mq' an alias for 'smq' when choosing a cache policy. The tunables that were present for the old mq are faked, and have no effect. mq should be considered deprecated now. Signed-off-by: Joe Thornber <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent e233d80 commit 9ed8469

File tree

5 files changed

+87
-1529
lines changed

5 files changed

+87
-1529
lines changed

Documentation/device-mapper/cache-policies.txt

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,51 +28,16 @@ Overview of supplied cache replacement policies
2828
multiqueue (mq)
2929
---------------
3030

31-
This policy has been deprecated in favor of the smq policy (see below).
31+
This policy is now an alias for smq (see below).
3232

33-
The multiqueue policy has three sets of 16 queues: one set for entries
34-
waiting for the cache and another two for those in the cache (a set for
35-
clean entries and a set for dirty entries).
33+
The following tunables are accepted, but have no effect:
3634

37-
Cache entries in the queues are aged based on logical time. Entry into
38-
the cache is based on variable thresholds and queue selection is based
39-
on hit count on entry. The policy aims to take different cache miss
40-
costs into account and to adjust to varying load patterns automatically.
41-
42-
Message and constructor argument pairs are:
4335
'sequential_threshold <#nr_sequential_ios>'
4436
'random_threshold <#nr_random_ios>'
4537
'read_promote_adjustment <value>'
4638
'write_promote_adjustment <value>'
4739
'discard_promote_adjustment <value>'
4840

49-
The sequential threshold indicates the number of contiguous I/Os
50-
required before a stream is treated as sequential. Once a stream is
51-
considered sequential it will bypass the cache. The random threshold
52-
is the number of intervening non-contiguous I/Os that must be seen
53-
before the stream is treated as random again.
54-
55-
The sequential and random thresholds default to 512 and 4 respectively.
56-
57-
Large, sequential I/Os are probably better left on the origin device
58-
since spindles tend to have good sequential I/O bandwidth. The
59-
io_tracker counts contiguous I/Os to try to spot when the I/O is in one
60-
of these sequential modes. But there are use-cases for wanting to
61-
promote sequential blocks to the cache (e.g. fast application startup).
62-
If sequential threshold is set to 0 the sequential I/O detection is
63-
disabled and sequential I/O will no longer implicitly bypass the cache.
64-
Setting the random threshold to 0 does _not_ disable the random I/O
65-
stream detection.
66-
67-
Internally the mq policy determines a promotion threshold. If the hit
68-
count of a block not in the cache goes above this threshold it gets
69-
promoted to the cache. The read, write and discard promote adjustment
70-
tunables allow you to tweak the promotion threshold by adding a small
71-
value based on the io type. They default to 4, 8 and 1 respectively.
72-
If you're trying to quickly warm a new cache device you may wish to
73-
reduce these to encourage promotion. Remember to switch them back to
74-
their defaults after the cache fills though.
75-
7641
Stochastic multiqueue (smq)
7742
---------------------------
7843

drivers/md/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,6 @@ config DM_CACHE
304304
algorithms used to select which blocks are promoted, demoted,
305305
cleaned etc. It supports writeback and writethrough modes.
306306

307-
config DM_CACHE_MQ
308-
tristate "MQ Cache Policy (EXPERIMENTAL)"
309-
depends on DM_CACHE
310-
default y
311-
---help---
312-
A cache policy that uses a multiqueue ordered by recent hit
313-
count to select which blocks should be promoted and demoted.
314-
This is meant to be a general purpose policy. It prioritises
315-
reads over writes.
316-
317307
config DM_CACHE_SMQ
318308
tristate "Stochastic MQ Cache Policy (EXPERIMENTAL)"
319309
depends on DM_CACHE

drivers/md/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dm-log-userspace-y \
1212
+= dm-log-userspace-base.o dm-log-userspace-transfer.o
1313
dm-thin-pool-y += dm-thin.o dm-thin-metadata.o
1414
dm-cache-y += dm-cache-target.o dm-cache-metadata.o dm-cache-policy.o
15-
dm-cache-mq-y += dm-cache-policy-mq.o
1615
dm-cache-smq-y += dm-cache-policy-smq.o
1716
dm-cache-cleaner-y += dm-cache-policy-cleaner.o
1817
dm-era-y += dm-era-target.o
@@ -55,7 +54,6 @@ obj-$(CONFIG_DM_RAID) += dm-raid.o
5554
obj-$(CONFIG_DM_THIN_PROVISIONING) += dm-thin-pool.o
5655
obj-$(CONFIG_DM_VERITY) += dm-verity.o
5756
obj-$(CONFIG_DM_CACHE) += dm-cache.o
58-
obj-$(CONFIG_DM_CACHE_MQ) += dm-cache-mq.o
5957
obj-$(CONFIG_DM_CACHE_SMQ) += dm-cache-smq.o
6058
obj-$(CONFIG_DM_CACHE_CLEANER) += dm-cache-cleaner.o
6159
obj-$(CONFIG_DM_ERA) += dm-era.o

0 commit comments

Comments
 (0)