Commit ce1d64e8 authored by Joe Thornber's avatar Joe Thornber Committed by Mike Snitzer

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: b29d4986 ("dm cache: significant rework to leverage dm-bio-prison-v2")
Reported-by: default avatarJohn Harrigan <jharriga@redhat.com>
Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 7b66f132
...@@ -1214,7 +1214,11 @@ static void queue_promotion(struct smq_policy *mq, dm_oblock_t oblock, ...@@ -1214,7 +1214,11 @@ static void queue_promotion(struct smq_policy *mq, dm_oblock_t oblock,
return; return;
if (allocator_empty(&mq->cache_alloc)) { 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); queue_demotion(mq);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment