OSDN Git Service

dm cache policy smq: only demote entries in bottom half of the clean multiqueue
authorJoe Thornber <ejt@redhat.com>
Thu, 11 May 2017 09:07:34 +0000 (05:07 -0400)
committerMike Snitzer <snitzer@redhat.com>
Mon, 15 May 2017 01:54:32 +0000 (21:54 -0400)
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>
drivers/md/dm-cache-policy-smq.c

index 72479bd..a177559 100644 (file)
@@ -1190,7 +1190,7 @@ static void queue_demotion(struct smq_policy *mq)
        if (unlikely(WARN_ON_ONCE(!mq->migrations_allowed)))
                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 (!clean_target_met(mq, false))
                        queue_writeback(mq);