1. 28 1月, 2021 1 次提交
  2. 09 7月, 2020 1 次提交
    • D
      dm zoned: Fix zone reclaim trigger · 174364f6
      Damien Le Moal 提交于
      Only triggering reclaim based on the percentage of unmapped cache
      zones can fail to detect cases where reclaim is needed, e.g. if the
      target has only 2 or 3 cache zones and only one unmapped cache zone,
      the percentage of free cache zones is higher than
      DMZ_RECLAIM_LOW_UNMAP_ZONES (30%) and reclaim does not trigger.
      
      This problem, combined with the fact that dmz_schedule_reclaim() is
      called from dmz_handle_bio() without the map lock held, leads to a
      race between zone allocation and dmz_should_reclaim() result.
      Depending on the workload applied, this race can lead to the write
      path waiting forever for a free zone without reclaim being triggered.
      
      Fix this by moving dmz_schedule_reclaim() inside dmz_alloc_zone()
      under the map lock. This results in checking the need for zone reclaim
      whenever a new data or buffer zone needs to be allocated.
      
      Also fix dmz_reclaim_percentage() to always return 0 if the number of
      unmapped cache (or random) zones is less than or equal to 1.
      Suggested-by: NShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      174364f6
  3. 20 6月, 2020 3 次提交
    • S
      dm zoned: Fix reclaim zone selection · f2cd9a5e
      Shin'ichiro Kawasaki 提交于
      When dm zoned has multiple devices, random zones are never selected for
      reclaim if all reserved sequential write zones are in use and no
      sequential write required zones can be selected for reclaim. This can
      lead to deadlocks as selecting a cache zone allows reclaiming a
      sequential zone, ensuring forward progress.
      
      Fix this by always defaulting to selecting a random zone when no
      sequential write required zone can be selected.
      
      [Damien: fix commit message]
      Signed-off-by: NShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      f2cd9a5e
    • D
      dm zoned: Fix random zone reclaim selection · 3ee39573
      Damien Le Moal 提交于
      Commit 2094045f ("dm zoned: prefer full zones for reclaim")
      modified dmz_get_rnd_zone_for_reclaim() to add a search for the buffer
      zone with the heaviest weight as an optimal candidate for reclaim. This
      modification uses the zone pointer variabl "last" which is set only once
      and never modified as zones are scanned, resulting in the search being
      inefective. Furthermore, if the selected buffer zone at the end of the
      search loop is active or already locked for reclaim,
      dmz_get_rnd_zone_for_reclaim() returns NULL even if other random zones
      with a lesser weight can be reclaimed.
      
      To fix the search and to guarantee that reclaim can make forward
      progress, fix dmz_get_rnd_zone_for_reclaim() loop to correctly find
      the buffer zone with the heaviest weight using the variable maxw_z.
      Also make sure to fallback to finding the first random zone that can
      be reclaimed if this best candidate zone cannot be reclaimed.
      
      While at it, also fix the device index check to consider only random
      zones, ignoring cache zones belonging to the cache device if one is
      used as that device does not have a reclaim process.
      
      Fixes: 2094045f ("dm zoned: prefer full zones for reclaim")
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      3ee39573
    • S
      dm zoned: Fix metadata zone size check · b38c0ad5
      Shin'ichiro Kawasaki 提交于
      When dm zoned has multiple devices, metadata is on the cache device, not
      in random zones of the zoned devices. Then the number of metadata zones
      shall be checked with the number of cache zones, not random zones.
      
      Fixes: 34f5affd ("dm zoned: separate random and cache zones")
      Signed-off-by: NShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
      Reviewed-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      b38c0ad5
  4. 06 6月, 2020 13 次提交
  5. 23 5月, 2020 1 次提交
  6. 22 5月, 2020 1 次提交
  7. 21 5月, 2020 8 次提交
  8. 20 5月, 2020 1 次提交
  9. 15 5月, 2020 7 次提交
  10. 25 3月, 2020 1 次提交
  11. 08 1月, 2020 1 次提交
    • D
      dm zoned: support zone sizes smaller than 128MiB · b3996295
      Dmitry Fomichev 提交于
      dm-zoned is observed to log failed kernel assertions and not work
      correctly when operating against a device with a zone size smaller
      than 128MiB (e.g. 32768 bits per 4K block). The reason is that the
      bitmap size per zone is calculated as zero with such a small zone
      size. Fix this problem and also make the code related to zone bitmap
      management be able to handle per zone bitmaps smaller than a single
      block.
      
      A dm-zoned-tools patch is required to properly format dm-zoned devices
      with zone sizes smaller than 128MiB.
      
      Fixes: 3b1a94c8 ("dm zoned: drive-managed zoned block device target")
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Fomichev <dmitry.fomichev@wdc.com>
      Reviewed-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      b3996295
  12. 13 11月, 2019 1 次提交
  13. 07 11月, 2019 1 次提交
    • D
      dm zoned: reduce overhead of backing device checks · e7fad909
      Dmitry Fomichev 提交于
      Commit 75d66ffb added backing device health checks and as a part
      of these checks, check_events() block ops template call is invoked in
      dm-zoned mapping path as well as in reclaim and flush path. Calling
      check_events() with ATA or SCSI backing devices introduces a blocking
      scsi_test_unit_ready() call being made in sd_check_events(). Even though
      the overhead of calling scsi_test_unit_ready() is small for ATA zoned
      devices, it is much larger for SCSI and it affects performance in a very
      negative way.
      
      Fix this performance regression by executing check_events() only in case
      of any I/O errors. The function dmz_bdev_is_dying() is modified to call
      only blk_queue_dying(), while calls to check_events() are made in a new
      helper function, dmz_check_bdev().
      Reported-by: Nzhangxiaoxu <zhangxiaoxu5@huawei.com>
      Fixes: 75d66ffb ("dm zoned: properly handle backing device failure")
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Fomichev <dmitry.fomichev@wdc.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      e7fad909