Commit 2094045f authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Mike Snitzer

dm zoned: prefer full zones for reclaim

Prefer full zones when selecting the next zone for reclaim.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 69875d44
......@@ -1941,7 +1941,7 @@ static struct dm_zone *dmz_get_rnd_zone_for_reclaim(struct dmz_metadata *zmd,
unsigned int idx, bool idle)
{
struct dm_zone *dzone = NULL;
struct dm_zone *zone;
struct dm_zone *zone, *last = NULL;
struct list_head *zone_list;
/* If we have cache zones select from the cache zone list */
......@@ -1958,6 +1958,13 @@ static struct dm_zone *dmz_get_rnd_zone_for_reclaim(struct dmz_metadata *zmd,
dzone = zone->bzone;
if (dzone->dev->dev_idx != idx)
continue;
if (!last) {
last = dzone;
continue;
}
if (last->weight < dzone->weight)
continue;
dzone = last;
} else
dzone = zone;
if (dmz_lock_zone_reclaim(dzone))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment