1. 07 Mar, 2017 1 commit
    • Joe Thornber's avatar
      dm cache: significant rework to leverage dm-bio-prison-v2 · b29d4986
      Joe Thornber authored
      The cache policy interfaces have been updated to work well with the new
      bio-prison v2 interface's ability to queue work immediately (promotion,
      demotion, etc) -- overriding benefit being reduced latency on processing
      IO through the cache.  Previously such work would be left for the DM
      cache core to queue on various lists and then process in batches later
      -- this caused a serious delay in latency for IO driven by the cache.
      The background tracker code was factored out so that all cache policies
      can make use of it.
      Also, the "cleaner" policy has been removed and is now a variant of the
      smq policy that simply disallows migrations.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
  2. 16 Feb, 2017 1 commit
  3. 10 Mar, 2016 1 commit
  4. 11 Jun, 2015 1 commit
    • Joe Thornber's avatar
      dm cache: add fail io mode and needs_check flag · 028ae9f7
      Joe Thornber authored
      If a cache metadata operation fails (e.g. transaction commit) the
      cache's metadata device will abort the current transaction, set a new
      needs_check flag, and the cache will transition to "read-only" mode.  If
      aborting the transaction or setting the needs_check flag fails the cache
      will transition to "fail-io" mode.
      Once needs_check is set the cache device will not be allowed to
      activate.  Activation requires write access to metadata.  Future work is
      needed to add proper support for running the cache in read-only mode.
      Once in fail-io mode the cache will report a status of "Fail".
      Also, add commit() wrapper that will disallow commits if in read_only or
      fail mode.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
  5. 10 Nov, 2014 1 commit
  6. 01 Aug, 2014 1 commit
  7. 04 Apr, 2014 1 commit
    • Joe Thornber's avatar
      dm cache: fix a lock-inversion · 0596661f
      Joe Thornber authored
      When suspending a cache the policy is walked and the individual policy
      hints written to the metadata via sync_metadata().  This led to this
      lock order:
      When loading the cache target the policy is populated while the metadata
      lock is held:
      Fix this potential lock-inversion (ABBA) deadlock in sync_metadata() by
      ensuring the cache_metadata root_lock is held whilst all the hints are
      written, rather than being repeatedly locked while policy->lock is held
      (as was the case with each callout that policy_walk_mappings() made to
      the old save_hint() method).
      Found by turning on the CONFIG_PROVE_LOCKING ("Lock debugging: prove
      locking correctness") build option.  However, it is not clear how the
      LOCKDEP reported paths can lead to a deadlock since the two paths,
      suspending a target and loading a target, never occur at the same time.
      But that doesn't mean the same lock-inversion couldn't have occurred
      Reported-by: default avatarMarian Csontos <mcsontos@redhat.com>
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
  8. 27 Mar, 2014 1 commit
  9. 11 Nov, 2013 1 commit
    • Joe Thornber's avatar
      dm cache: add passthrough mode · 2ee57d58
      Joe Thornber authored
      "Passthrough" is a dm-cache operating mode (like writethrough or
      writeback) which is intended to be used when the cache contents are not
      known to be coherent with the origin device.  It behaves as follows:
      * All reads are served from the origin device (all reads miss the cache)
      * All writes are forwarded to the origin device; additionally, write
        hits cause cache block invalidates
      This mode decouples cache coherency checks from cache device creation,
      largely to avoid having to perform coherency checks while booting.  Boot
      scripts can create cache devices in passthrough mode and put them into
      service (mount cached filesystems, for example) without having to worry
      about coherency.  Coherency that exists is maintained, although the
      cache will gradually cool as writes take place.
      Later, applications can perform coherency checks, the nature of which
      will depend on the type of the underlying storage.  If coherency can be
      verified, the cache device can be transitioned to writethrough or
      writeback mode while still warm; otherwise, the cache contents can be
      discarded prior to transitioning to the desired operating mode.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
      Signed-off-by: default avatarMorgan Mears <Morgan.Mears@netapp.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
  10. 20 Mar, 2013 1 commit
    • Mike Snitzer's avatar
      dm cache: policy ignore hints if generated by different version · ea2dd8c1
      Mike Snitzer authored
      When reading the dm cache metadata from disk, ignore the policy hints
      unless they were generated by the same major version number of the same
      policy module.
      The hints are considered to be private data belonging to the specific
      module that generated them and there is no requirement for them to make
      sense to different versions of the policy that generated them.
      Policy modules are all required to work fine if no previous hints are
      supplied (or if existing hints are lost).
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
  11. 01 Mar, 2013 1 commit