Skip to content

Commit

Permalink
dm zoned: prefer full zones for reclaim
Browse files Browse the repository at this point in the history
Prefer full zones when selecting the next zone for reclaim.

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>
  • Loading branch information
hreinecke authored and snitm committed Jun 5, 2020
1 parent 69875d4 commit 2094045
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/md/dm-zoned-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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))
Expand Down

0 comments on commit 2094045

Please sign in to comment.