Skip to content

Commit 8735a81

Browse files
Heinz Mauelshagenkergon
authored andcommitted
dm cache: add cleaner policy
A simple cache policy that writes back all data to the origin. This is used to decommission a dm cache by emptying it. Signed-off-by: Heinz Mauelshagen <mauelshagen@redhat.com> Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent f283635 commit 8735a81

4 files changed

Lines changed: 479 additions & 0 deletions

File tree

‎Documentation/device-mapper/cache-policies.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ since spindles tend to have good bandwidth. The io_tracker counts
5353
contiguous I/Os to try to spot when the io is in one of these sequential
5454
modes.
5555

56+
cleaner
57+
-------
58+
59+
The cleaner writes back all dirty blocks in a cache to decommission it.
60+
5661
Examples
5762
========
5863

‎drivers/md/Kconfig‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@ config DM_CACHE_MQ
291291
This is meant to be a general purpose policy. It prioritises
292292
reads over writes.
293293

294+
config DM_CACHE_CLEANER
295+
tristate "Cleaner Cache Policy (EXPERIMENTAL)"
296+
depends on DM_CACHE
297+
default y
298+
---help---
299+
A simple cache policy that writes back all data to the
300+
origin. Used when decommissioning a dm-cache.
301+
294302
config DM_MIRROR
295303
tristate "Mirror target"
296304
depends on BLK_DEV_DM

‎drivers/md/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dm-log-userspace-y \
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
1515
dm-cache-mq-y += dm-cache-policy-mq.o
16+
dm-cache-cleaner-y += dm-cache-policy-cleaner.o
1617
md-mod-y += md.o bitmap.o
1718
raid456-y += raid5.o
1819

@@ -48,6 +49,7 @@ obj-$(CONFIG_DM_THIN_PROVISIONING) += dm-thin-pool.o
4849
obj-$(CONFIG_DM_VERITY) += dm-verity.o
4950
obj-$(CONFIG_DM_CACHE) += dm-cache.o
5051
obj-$(CONFIG_DM_CACHE_MQ) += dm-cache-mq.o
52+
obj-$(CONFIG_DM_CACHE_CLEANER) += dm-cache-cleaner.o
5153

5254
ifeq ($(CONFIG_DM_UEVENT),y)
5355
dm-mod-objs += dm-uevent.o

0 commit comments

Comments
 (0)