Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: "Naohiro Aota" <Naohiro.Aota@wdc.com>
To: "Johannes Thumshirn" <johannes.thumshirn@wdc.com>,
	<linux-btrfs@vger.kernel.org>
Cc: "Hans Holmberg" <Hans.Holmberg@wdc.com>,
	"Naohiro Aota" <naohiro.aota@wdc.com>,
	"Damien Le Moal" <dlemoal@kernel.org>,
	"Christoph Hellwig" <hch@lst.de>
Subject: Re: [PATCH 03/13] btrfs: zoned: don't recheck the reclaim threshold of zoned block-groups
Date: Fri, 16 Oct 2026 16:47:19 +0900	[thread overview]
Message-ID: <DM63HMFNJR0N.1HBGQV8SDMAT2@wdc.com> (raw)
In-Reply-To: <20261014120353.757931-4-johannes.thumshirn@wdc.com>

On Wed Oct 14, 2026 at 9:03 PM JST, Johannes Thumshirn wrote:
> On a zoned filesystem, block-groups on sequential zones are append only
> and their usage can only go down. So there is no need to re-check if a
> such block-group still qualifies for being reclaimed, once it is on the
> list it needs to be reclaimed.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  fs/btrfs/block-group.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
> index 34ce3bac45a3..bad55ab4cbb2 100644
> --- a/fs/btrfs/block-group.c
> +++ b/fs/btrfs/block-group.c
> @@ -2033,8 +2033,13 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
>  	 * being freed, pass in a fake giant value to skip that extra
>  	 * check, which is more meaningful when adding to the list in
>  	 * the first place.
> +	 *
> +	 * On zoned, block_groups placed on sequential zones are append only
> +	 * and their usage can only go down, so the block group still qualifies.
                                           ^ on full block group ?

>  	 */
> -	if (!should_reclaim_block_group(bg, bg->length)) {
> +	if (!(btrfs_zoned_bg_is_append_only(bg) &&
> +	      btrfs_zoned_bg_is_full(bg)) &&
> +	    !should_reclaim_block_group(bg, bg->length)) {
>  		spin_unlock(&bg->lock);
>  		spin_unlock(&space_info->lock);
>  		up_write(&space_info->groups_sem);


  reply	other threads:[~2026-10-16  7:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 12:03 [PATCH 00/13] btrfs: zoned: rework zoned garbage collection Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 01/13] btrfs: zoned: wait for a running block group reclaim in RECLAIM_ZONES Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 02/13] btrfs: zoned: don't count in-flight data as available in statfs Johannes Thumshirn
2026-10-16  7:01   ` Naohiro Aota
2026-10-16  7:24     ` Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 03/13] btrfs: zoned: don't recheck the reclaim threshold of zoned block-groups Johannes Thumshirn
2026-10-16  7:47   ` Naohiro Aota [this message]
2026-10-14 12:03 ` [PATCH 04/13] btrfs: zoned: don't account superblock zones as available data space Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 05/13] btrfs: zoned: factor out resetting a block group in place Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 06/13] btrfs: zoned: prepare reserving the data relocation block group at runtime Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 07/13] btrfs: zoned: promote reset data block groups to the relocation target Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 08/13] btrfs: zoned: return finished relocation block groups to the data space_info Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 09/13] btrfs: zoned: reuse block groups emptied by reclaim as relocation target Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 10/13] btrfs: add btrfs_bg_type_to_num_stripes Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 11/13] btrfs: zoned: keep a zone free for relocation when allocating data chunks Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 12/13] btrfs: zoned: don't count the relocation zone reserve as available in statfs Johannes Thumshirn
2026-10-14 12:03 ` [PATCH 13/13] btrfs: zoned: provide zoned specific reclaim sweep Johannes Thumshirn

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=DM63HMFNJR0N.1HBGQV8SDMAT2@wdc.com \
    --to=naohiro.aota@wdc.com \
    --cc=Hans.Holmberg@wdc.com \
    --cc=dlemoal@kernel.org \
    --cc=hch@lst.de \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox