浏览代码

dm cache policy smq: only demote entries in bottom half of the clean multiqueue

Heavy IO load may mean there are very few clean blocks in the cache, and
we risk demoting entries that get hit a lot.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Joe Thornber 8 年之前
父节点
当前提交
a8cd1eba61
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/md/dm-cache-policy-smq.c

+ 1 - 1
drivers/md/dm-cache-policy-smq.c

@@ -1190,7 +1190,7 @@ static void queue_demotion(struct smq_policy *mq)
 	if (unlikely(WARN_ON_ONCE(!mq->migrations_allowed)))
 	if (unlikely(WARN_ON_ONCE(!mq->migrations_allowed)))
 		return;
 		return;
 
 
-	e = q_peek(&mq->clean, mq->clean.nr_levels, true);
+	e = q_peek(&mq->clean, mq->clean.nr_levels / 2, true);
 	if (!e) {
 	if (!e) {
 		if (!clean_target_met(mq, false))
 		if (!clean_target_met(mq, false))
 			queue_writeback(mq);
 			queue_writeback(mq);