diff options
author | Hannes Reinecke <hare@suse.de> | 2020-05-19 10:14:23 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2020-05-20 23:09:52 +0200 |
commit | a16b7dee302d2040d9e1fedff2161d1aceda0e8c (patch) | |
tree | 1515146f96d66caa920ab522ac15dd71daabe89f /drivers/md/dm-zoned-reclaim.c | |
parent | dm zoned: start reclaim with sequential zones (diff) | |
download | linux-a16b7dee302d2040d9e1fedff2161d1aceda0e8c.tar.xz linux-a16b7dee302d2040d9e1fedff2161d1aceda0e8c.zip |
dm zoned: terminate reclaim on congestion
When dmz_get_chunk_mapping() selects a zone which is under reclaim
we should terminate the reclaim copy process. Since we're changing
the zone itself, reclaim needs to run afterwards again anyway.
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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/dm-zoned-reclaim.c b/drivers/md/dm-zoned-reclaim.c index d62f6890b92c..571bc1d41bab 100644 --- a/drivers/md/dm-zoned-reclaim.c +++ b/drivers/md/dm-zoned-reclaim.c @@ -143,6 +143,9 @@ static int dmz_reclaim_copy(struct dmz_reclaim *zrc, if (dst_dev->flags & DMZ_BDEV_DYING) return -EIO; + if (dmz_reclaim_should_terminate(src_zone)) + return -EINTR; + /* Get a valid region from the source zone */ ret = dmz_first_valid_block(zmd, src_zone, &block); if (ret <= 0) @@ -515,7 +518,7 @@ static void dmz_reclaim_work(struct work_struct *work) dmz_nr_rnd_zones(zmd)); ret = dmz_do_reclaim(zrc); - if (ret) { + if (ret && ret != -EINTR) { DMDEBUG("(%s): Reclaim error %d", dmz_metadata_label(zmd), ret); if (!dmz_check_dev(zmd)) @@ -615,4 +618,3 @@ void dmz_schedule_reclaim(struct dmz_reclaim *zrc) if (dmz_should_reclaim(zrc, p_unmap)) mod_delayed_work(zrc->wq, &zrc->work, 0); } - |