]> git.baikalelectronics.ru Git - kernel.git/commit
dm writecache: implement the "cleaner" policy
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 24 Feb 2020 09:20:32 +0000 (10:20 +0100)
committerMike Snitzer <snitzer@redhat.com>
Tue, 24 Mar 2020 15:50:30 +0000 (11:50 -0400)
commit090592e4b604229e9e6fa19832a04f6d7043e386
treeee1aa981aa2ea79675d9679125ed468ebfb39f45
parent8ee9d020f3801f79f5b30d1ef2f1b3312dc794b9
dm writecache: implement the "cleaner" policy

The "flush" or "flush_on_suspend" messages flush the whole cache. However,
these flushing methods can take some time and the process is left in
an interruptible state during the flush.

Implement a "cleaner" option that offers an alternate flushing method.
When this option is activated (either by a message or in the constructor
arguments), the cache will not promote new writes (however, writes to
already cached blocks are promoted, to avoid data corruption due to
misordered writes) and it will gradually writeback any cached data. The
userspace can then monitor the cleaning process with "dmsetup status".
When the number of cached bloks drops to zero, the userspace can unload
the dm-writecache target and replace it with dm-linear or other targets.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-writecache.c