All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Hannes Reinecke <hare@suse.de>, Mike Snitzer <snitzer@redhat.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>
Subject: Re: [PATCH 4/6] dm-zoned: start reclaim with sequential zones
Date: Tue, 19 May 2020 22:27:44 +0000	[thread overview]
Message-ID: <BY5PR04MB6900C821E5D628F74F806D9CE7B90@BY5PR04MB6900.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20200519081424.103318-5-hare@suse.de

On 2020/05/19 17:14, Hannes Reinecke wrote:
> Sequential zones perform better for reclaim, so start off using
> them and only use random zones as a fallback when cache zones are
> present.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/md/dm-zoned-reclaim.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/md/dm-zoned-reclaim.c b/drivers/md/dm-zoned-reclaim.c
> index 1855c056d6a4..1283405bec29 100644
> --- a/drivers/md/dm-zoned-reclaim.c
> +++ b/drivers/md/dm-zoned-reclaim.c
> @@ -281,15 +281,16 @@ static int dmz_reclaim_rnd_data(struct dmz_reclaim *zrc, struct dm_zone *dzone)
>  	struct dm_zone *szone = NULL;
>  	struct dmz_metadata *zmd = zrc->metadata;
>  	int ret;
> -	int alloc_flags = dmz_nr_cache_zones(zmd) ?
> -		DMZ_ALLOC_RND : DMZ_ALLOC_SEQ;
> +	int alloc_flags = DMZ_ALLOC_SEQ;
>  
> -	/* Always use sequential zones to reclaim random zones */
> -	if (dmz_is_rnd(dzone))
> -		alloc_flags = DMZ_ALLOC_SEQ;
>  	/* Get a free random or sequential zone */
>  	dmz_lock_map(zmd);
> +again:
>  	szone = dmz_alloc_zone(zmd, alloc_flags | DMZ_ALLOC_RECLAIM);
> +	if (!szone && alloc_flags == DMZ_ALLOC_SEQ && dmz_nr_cache_zones(zmd)) {
> +		alloc_flags = DMZ_ALLOC_RND;
> +		goto again;
> +	}
>  	dmz_unlock_map(zmd);
>  	if (!szone)
>  		return -ENOSPC;
> 

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2020-05-19 22:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  8:14 [PATCHv2 0/6] dm-zoned: improve cache performance Hannes Reinecke
2020-05-19  8:14 ` [PATCH 1/6] dm-zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone Hannes Reinecke
2020-05-19 22:15   ` Damien Le Moal
2020-05-19  8:14 ` [PATCH 2/6] dm-zoned: separate random and cache zones Hannes Reinecke
2020-05-19 22:23   ` Damien Le Moal
2020-05-19  8:14 ` [PATCH 3/6] dm-zoned: reclaim random zones when idle Hannes Reinecke
2020-05-19 22:26   ` Damien Le Moal
2020-05-19  8:14 ` [PATCH 4/6] dm-zoned: start reclaim with sequential zones Hannes Reinecke
2020-05-19 22:27   ` Damien Le Moal [this message]
2020-05-19  8:14 ` [PATCH 5/6] dm-zoned: terminate reclaim on congestion Hannes Reinecke
2020-05-19 22:29   ` Damien Le Moal
2020-05-19  8:14 ` [PATCH 6/6] dm-zoned: remove unused variable in dmz_do_reclaim() Hannes Reinecke
2020-05-19 22:29   ` Damien Le Moal
2020-05-19 17:36 ` [PATCHv2 0/6] dm-zoned: improve cache performance Mike Snitzer
2020-05-19 22:36 ` Damien Le Moal
2020-05-20 18:53   ` Mike Snitzer
2020-05-20 23:59     ` Damien Le Moal
2020-05-21  7:56     ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY5PR04MB6900C821E5D628F74F806D9CE7B90@BY5PR04MB6900.namprd04.prod.outlook.com \
    --to=damien.lemoal@wdc.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.