[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <hw4t6fcvydkd5j7iyyt7hx3itrfy4rtigm4lw7u3fgsql4vksr@vuj7lftxpvss>
Date: Fri, 24 May 2024 08:33:19 +0000
From: Naohiro Aota <Naohiro.Aota@....com>
To: Johannes Thumshirn <jth@...nel.org>
CC: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>, David Sterba
<dsterba@...e.com>, Hans Holmberg <Hans.Holmberg@....com>,
"linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Filipe Manana
<fdmanana@...e.com>, Johannes Thumshirn <Johannes.Thumshirn@....com>
Subject: Re: [PATCH v4 2/2] btrfs: reserve new relocation block-group after
successful relocation
On Thu, May 23, 2024 at 05:21:59PM GMT, Johannes Thumshirn wrote:
> From: Johannes Thumshirn <johannes.thumshirn@....com>
>
> After we've committed a relocation transaction, we know we have just freed
> up space. Set it as hint for the next relocation.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@....com>
Reviewed-by: Naohiro Aota <naohiro.aota@....com>
Regards,
> ---
> fs/btrfs/relocation.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
> index 5f1a909a1d91..02a9ebf96a95 100644
> --- a/fs/btrfs/relocation.c
> +++ b/fs/btrfs/relocation.c
> @@ -3811,6 +3811,13 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
> ret = btrfs_commit_transaction(trans);
> if (ret && !err)
> err = ret;
> +
> + /*
> + * We know we have just freed space, set it as hint for the
> + * next relocation.
> + */
> + if (!err)
> + btrfs_reserve_relocation_bg(fs_info);
> out_free:
> ret = clean_dirty_subvols(rc);
> if (ret < 0 && !err)
>
> --
> 2.43.0
>
Powered by blists - more mailing lists