summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-zoned-reclaim.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2020-06-02 13:09:51 +0200
committerMike Snitzer <snitzer@redhat.com>2020-06-05 20:59:50 +0200
commitbd82fdabf162fec1404c4e22988b178c4f3dd23b (patch)
tree3879a3ba59c1c4e83e4c1a5427c5c42f9d225790 /drivers/md/dm-zoned-reclaim.c
parentdm zoned: per-device reclaim (diff)
downloadlinux-bd82fdabf162fec1404c4e22988b178c4f3dd23b.tar.xz
linux-bd82fdabf162fec1404c4e22988b178c4f3dd23b.zip
dm zoned: move random and sequential zones into struct dmz_dev
Random and sequential zones should be part of the respective device structure to make arbitration between devices possible. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-zoned-reclaim.c')
-rw-r--r--drivers/md/dm-zoned-reclaim.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/md/dm-zoned-reclaim.c b/drivers/md/dm-zoned-reclaim.c
index 09843645248a..18edf1b9bf52 100644
--- a/drivers/md/dm-zoned-reclaim.c
+++ b/drivers/md/dm-zoned-reclaim.c
@@ -447,15 +447,14 @@ static unsigned int dmz_reclaim_percentage(struct dmz_reclaim *zrc)
{
struct dmz_metadata *zmd = zrc->metadata;
unsigned int nr_cache = dmz_nr_cache_zones(zmd);
- unsigned int nr_rnd = dmz_nr_rnd_zones(zmd);
unsigned int nr_unmap, nr_zones;
if (nr_cache) {
nr_zones = nr_cache;
nr_unmap = dmz_nr_unmap_cache_zones(zmd);
} else {
- nr_zones = nr_rnd;
- nr_unmap = dmz_nr_unmap_rnd_zones(zmd);
+ nr_zones = dmz_nr_rnd_zones(zmd, zrc->dev_idx);
+ nr_unmap = dmz_nr_unmap_rnd_zones(zmd, zrc->dev_idx);
}
return nr_unmap * 100 / nr_zones;
}
@@ -467,7 +466,7 @@ static bool dmz_should_reclaim(struct dmz_reclaim *zrc, unsigned int p_unmap)
{
unsigned int nr_reclaim;
- nr_reclaim = dmz_nr_rnd_zones(zrc->metadata);
+ nr_reclaim = dmz_nr_rnd_zones(zrc->metadata, zrc->dev_idx);
if (dmz_nr_cache_zones(zrc->metadata)) {
/*
@@ -528,8 +527,8 @@ static void dmz_reclaim_work(struct work_struct *work)
zrc->kc_throttle.throttle = min(75U, 100U - p_unmap / 2);
}
- nr_unmap_rnd = dmz_nr_unmap_rnd_zones(zmd);
- nr_rnd = dmz_nr_rnd_zones(zmd);
+ nr_unmap_rnd = dmz_nr_unmap_rnd_zones(zmd, zrc->dev_idx);
+ nr_rnd = dmz_nr_rnd_zones(zmd, zrc->dev_idx);
DMDEBUG("(%s/%u): Reclaim (%u): %s, %u%% free zones (%u/%u cache %u/%u random)",
dmz_metadata_label(zmd), zrc->dev_idx,
@@ -537,8 +536,8 @@ static void dmz_reclaim_work(struct work_struct *work)
(dmz_target_idle(zrc) ? "Idle" : "Busy"),
p_unmap, dmz_nr_unmap_cache_zones(zmd),
dmz_nr_cache_zones(zmd),
- dmz_nr_unmap_rnd_zones(zmd),
- dmz_nr_rnd_zones(zmd));
+ dmz_nr_unmap_rnd_zones(zmd, zrc->dev_idx),
+ dmz_nr_rnd_zones(zmd, zrc->dev_idx));
ret = dmz_do_reclaim(zrc);
if (ret && ret != -EINTR) {