summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-cache-policy-smq.c
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2017-05-11 09:09:04 -0400
committerMike Snitzer <snitzer@redhat.com>2017-05-14 21:54:33 -0400
commit2e63309507c818e8b631a03f02c363031c007fb7 (patch)
tree3409b151cf068286da7f0bd4d2a9b15b44139737 /drivers/md/dm-cache-policy-smq.c
parent49b7f768900f4084a65c3689d955b2fceac39e53 (diff)
downloadblackbird-op-linux-2e63309507c818e8b631a03f02c363031c007fb7.tar.gz
blackbird-op-linux-2e63309507c818e8b631a03f02c363031c007fb7.zip
dm cache policy smq: don't do any writebacks unless IDLE
If there are no clean blocks to be demoted the writeback will be triggered at that point. Preemptively writing back can hurt high IO load scenarios. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-policy-smq.c')
-rw-r--r--drivers/md/dm-cache-policy-smq.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/dm-cache-policy-smq.c b/drivers/md/dm-cache-policy-smq.c
index 758480a1893d..e5eb9c9b4bc8 100644
--- a/drivers/md/dm-cache-policy-smq.c
+++ b/drivers/md/dm-cache-policy-smq.c
@@ -1120,8 +1120,6 @@ static bool clean_target_met(struct smq_policy *mq, bool idle)
* Cache entries may not be populated. So we cannot rely on the
* size of the clean queue.
*/
- unsigned nr_clean;
-
if (idle) {
/*
* We'd like to clean everything.
@@ -1129,9 +1127,10 @@ static bool clean_target_met(struct smq_policy *mq, bool idle)
return q_size(&mq->dirty) == 0u;
}
- nr_clean = from_cblock(mq->cache_size) - q_size(&mq->dirty);
- return (nr_clean + btracker_nr_writebacks_queued(mq->bg_work)) >=
- percent_to_target(mq, CLEAN_TARGET);
+ /*
+ * If we're busy we don't worry about cleaning at all.
+ */
+ return true;
}
static bool free_target_met(struct smq_policy *mq)
OpenPOWER on IntegriCloud