All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Lauri Niskanen <ape@ape3000.com>
Cc: dm-devel@redhat.com
Subject: Re: dm-cache with a very slow device
Date: Fri, 7 Aug 2015 11:10:36 -0400	[thread overview]
Message-ID: <20150807151036.GA4218@redhat.com> (raw)
In-Reply-To: <55C44489.2050101@ape3000.com>

On Fri, Aug 07 2015 at  1:39am -0400,
Lauri Niskanen <ape@ape3000.com> wrote:

> Hi,
> 
> In my understanding dm-cache is usually used with fairly fast
> spinning hard drives as the "slow" device. Because of this the cache
> is not used very aggressively and sequential accesses skip the
> cache. Is it possible to configure dm-cache for a scenario where the
> fast disk is a state-of-the-art SSD, but the slow disk is very slow
> especially so that sequential reads and writes are significantly
> slower than on the fast device?
> 
> I'd like it to work as a very aggressive writeback buffer, so that
> all or at least close to all writes are done to the fast device if
> there is at least some free non-dirty space left. And sequential
> reads should also be promoted fairly easily. In addition there
> should be aggressive demotions to make room for future promotions
> always keeping a sizable buffer available.
> 
> So the goal would be to achieve the performance characteristics of
> the fast device for all kinds of use cases even when the backing
> slow device is at least a magnitude slower.

You can disable the sequential IO bypass of the MQ policy using the
following (with a recent lvm2):
  lvchange --cachesettings 'sequential_threshold=0' <vg/lv>

This will cause all sequential IO to be considered for promotion to the
cache.  But even in "writeback" mode dm-cache isn't a purist writeback
cache like you're hoping for.  dm-cache is a hotspot cache; so by
default it will wait for evidence that promoting particular blocks is
meaningful.

With the MQ policy you can alter the default for the
write_promote_adjustment (e.g. setting it to 0) to try to get writes
promoted more aggressively.

But even with these steps the fast device likely won't be able to buffer
all IO written to the device in the hope of later writeback to the
really slow device.  You'll potentially thrash the cache if new writes
demote older blocks aggressively (not to mention partial cache block
writes will require reads from the really slow device).

      reply	other threads:[~2015-08-07 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07  5:39 dm-cache with a very slow device Lauri Niskanen
2015-08-07 15:10 ` Mike Snitzer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150807151036.GA4218@redhat.com \
    --to=snitzer@redhat.com \
    --cc=ape@ape3000.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.