summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2017-05-03 18:01:27 +0200
committerMike Snitzer <snitzer@redhat.com>2017-05-04 16:27:47 +0200
commitce1d64e84dbea98d41deaf5db0fe91fd729ad2cd (patch)
tree7d56b14e5ae0e3eccdbf8c6bb1d197072250ce6b
parentMerge tag 'for-4.12/dm-post-merge-changes' of git://git.kernel.org/pub/scm/li... (diff)
downloadlinux-ce1d64e84dbea98d41deaf5db0fe91fd729ad2cd.tar.xz
linux-ce1d64e84dbea98d41deaf5db0fe91fd729ad2cd.zip
dm cache policy smq: allow demotions to happen even during continuous IO
dm-cache's smq policy tries hard to do it's work during the idle periods when there is no IO. But if there are no idle periods (eg, a long fio run) we still need to allow some demotions and promotions to occur. To achieve this, pass @idle=true to queue_promotion()'s free_target_met() call so that free_target_met() doesn't short-circuit the possibility of demotion simply because it isn't an idle period. Fixes: b29d4986d0 ("dm cache: significant rework to leverage dm-bio-prison-v2") Reported-by: John Harrigan <jharriga@redhat.com> Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r--drivers/md/dm-cache-policy-smq.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/dm-cache-policy-smq.c b/drivers/md/dm-cache-policy-smq.c
index e0c40aec5e96..d13d9edf8dfe 100644
--- a/drivers/md/dm-cache-policy-smq.c
+++ b/drivers/md/dm-cache-policy-smq.c
@@ -1214,7 +1214,11 @@ static void queue_promotion(struct smq_policy *mq, dm_oblock_t oblock,
return;
if (allocator_empty(&mq->cache_alloc)) {
- if (!free_target_met(mq, false))
+ /*
+ * We always claim to be 'idle' to ensure some demotions happen
+ * with continuous loads.
+ */
+ if (!free_target_met(mq, true))
queue_demotion(mq);
return;
}