dm cache policy smq: make the cleaner policy write-back more aggressively
authorJoe Thornber <ejt@redhat.com>
Fri, 31 Mar 2017 14:46:54 +0000 (10:46 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 31 Mar 2017 15:41:05 +0000 (11:41 -0400)
By ignoring the sentinels the cleaner policy is able to write-back dirty
cache data much faster.  There is no reason to respect the sentinels,
which denote that a block was changed recently, when using the cleaner
policy given that the cleaner is tasked with writing back all dirty
data.

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

index 74436dc2122f2193d0d5dab32bf28c70ff3ea24b..e0c40aec5e964eb1428f53ee5e84814d7ba9b75a 100644 (file)
@@ -1166,7 +1166,7 @@ static void queue_writeback(struct smq_policy *mq)
        struct policy_work work;
        struct entry *e;
 
-       e = q_peek(&mq->dirty, mq->dirty.nr_levels, false);
+       e = q_peek(&mq->dirty, mq->dirty.nr_levels, !mq->migrations_allowed);
        if (e) {
                mark_pending(mq, e);
                q_del(&mq->dirty, e);