dm cache policy mq: try not to writeback data that changed in the last second
authorJoe Thornber <ejt@redhat.com>
Fri, 20 Feb 2015 14:22:17 +0000 (14:22 +0000)
committerMike Snitzer <snitzer@redhat.com>
Tue, 31 Mar 2015 16:03:48 +0000 (12:03 -0400)
commite65ff8703f56273c6dc8b77373f4d2bef6e35107
tree64f115b6ea2912e0605be69e45839d16fcf2c924
parentfdecee3224d90e51c611198baeb0c38e568ca0e8
dm cache policy mq: try not to writeback data that changed in the last second

Writeback takes out a lock on the cache block, so will increase the
latency for any concurrent io.

This patch works by placing 2 sentinel objects on each level of the
multiqueues.  Every WRITEBACK_PERIOD the oldest sentinel gets moved to
the newest end of the queue level.

When looking for writeback work:
  if less than 25% of the cache is clean:
    we select the oldest object with the lowest hit count
  otherwise:
    we select the oldest object that is not past a writeback sentinel.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-policy-mq.c