Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Naohiro Aota <Naohiro.Aota@wdc.com>
Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: zoned: allow disabling of zone auto relcaim
Date: Mon, 9 Aug 2021 10:06:40 +0200	[thread overview]
Message-ID: <20210809080640.GI5047@suse.cz> (raw)
In-Reply-To: <20210809075059.odgjmdq4kyu7gyya@naota-xeon>

On Mon, Aug 09, 2021 at 07:50:59AM +0000, Naohiro Aota wrote:
> On Fri, Aug 06, 2021 at 06:27:04PM +0900, Johannes Thumshirn wrote:
> > Automatically reclaiming dirty zones might not always be desired for all
> > workloads, especially as there are currently still some rough edges with
> > the relocation code on zoned filesystems.
> > 
> > Allow disabling zone auto reclaim on a per filesystem basis.
> > 
> > Cc: Naohiro Aota <naohiro.aota@wdc.com>
> > Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> >
> > ---
> >  fs/btrfs/free-space-cache.c | 3 ++-
> >  fs/btrfs/sysfs.c            | 5 ++++-
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
> > index 8eeb65278ac0..933e9de37802 100644
> > --- a/fs/btrfs/free-space-cache.c
> > +++ b/fs/btrfs/free-space-cache.c
> > @@ -2567,7 +2567,8 @@ static int __btrfs_add_free_space_zoned(struct btrfs_block_group *block_group,
> >  	/* All the region is now unusable. Mark it as unused and reclaim */
> >  	if (block_group->zone_unusable == block_group->length) {
> >  		btrfs_mark_bg_unused(block_group);
> > -	} else if (block_group->zone_unusable >=
> > +	} else if (fs_info->bg_reclaim_threshold &&
> > +		   block_group->zone_unusable >=
> >  		   div_factor_fine(block_group->length,
> >  				   fs_info->bg_reclaim_threshold)) {
> 
> nit: can this race with btrfs_bg_reclaim_threshold_store()'s
> bg_reclaim_threshold assignment? Then, we can end up doing
> div_factor_fine(block_group->length, 0)?

Good point, this should be READ_ONCE and then check if it's 0.

  reply	other threads:[~2021-08-09  8:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06  9:27 [PATCH] btrfs: zoned: allow disabling of zone auto relcaim Johannes Thumshirn
2021-08-09  7:50 ` Naohiro Aota
2021-08-09  8:06   ` David Sterba [this message]
2021-08-09  8:10     ` 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=20210809080640.GI5047@suse.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=Naohiro.Aota@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