• Mikulas Patocka's avatar
    dm writecache: implement the "cleaner" policy · 93de44eb
    Mikulas Patocka authored
    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: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    93de44eb
dm-writecache.c 59.3 KB