All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: "fdmanana@gmail.com" <fdmanana@gmail.com>
Cc: David Sterba <dsterba@suse.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Josef Bacik <josef@toxicpanda.com>,
	Naohiro Aota <Naohiro.Aota@wdc.com>,
	Filipe Manana <fdmanana@suse.com>,
	Anand Jain <anand.jain@oracle.com>
Subject: Re: [PATCH v3 1/3] btrfs: discard relocated block groups
Date: Wed, 14 Apr 2021 11:22:53 +0000	[thread overview]
Message-ID: <PH0PR04MB7416EE187963A0D7718D57979B4E9@PH0PR04MB7416.namprd04.prod.outlook.com> (raw)
In-Reply-To: CAL3q7H6Bgqkdf8Z+xRBH8C=XxtrGzXyNUf6BHaLw54LZb3Agsg@mail.gmail.com

On 14/04/2021 13:17, Filipe Manana wrote:
> Yep, that's what puzzled me, why the need to do it for non-zoned file
> systems when using -o discard=sync.
> I assumed you ran into a case where discard was not happening due to
> some bug bug in the extent pinning/unpinning mechanism.
> 
>> So the correct fix would
>> be to get the block group into the 'trans->transaction->deleted_bgs' list
>> after relocation, which would work if we wouldn't check for block_group->ro in
>> btrfs_delete_unused_bgs(), but I suppose this check is there for a reason.
> 
> Actually the check for ->ro does not make sense anymore since I
> introduced the delete_unused_bgs_mutex in commit
> 67c5e7d464bc466471b05e027abe8a6b29687ebd.
> 
> When the ->ro check was added
> (47ab2a6c689913db23ccae38349714edf8365e0a), it was meant to prevent
> the cleaner kthread and relocation tasks from calling
> btrfs_remove_chunk() concurrently, but checking for ->ro only was
> buggy, hence the addition of delete_unused_bgs_mutex later.
>


I'll have a look at these commits.

 
>>
>> How about changing the patch to the following:
> 
> Looks good.
> However would just removing the ->ro check by enough as well?

From how I understand the code, yes. It's a quick test, so let's just do it
and see what breaks.

I'd prefer to just drop the ->ro check, it's less special casing for zoned
btrfs that we have to keep in mind when changing things.

Thanks for helping me with this,
	Johannes

  reply	other threads:[~2021-04-14 11:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 10:53 [PATCH v3 0/3] btrfs: zoned: automatic BG reclaim Johannes Thumshirn
2021-04-09 10:53 ` [PATCH v3 1/3] btrfs: discard relocated block groups Johannes Thumshirn
2021-04-09 11:37   ` Filipe Manana
2021-04-12 13:49     ` Johannes Thumshirn
2021-04-12 14:08       ` Filipe Manana
2021-04-12 14:21         ` Johannes Thumshirn
2021-04-13 12:43           ` Johannes Thumshirn
2021-04-13 12:57             ` Filipe Manana
2021-04-13 17:48               ` Johannes Thumshirn
2021-04-14 11:16                 ` Filipe Manana
2021-04-14 11:22                   ` Johannes Thumshirn [this message]
2021-04-14 11:32                     ` Filipe Manana
2021-04-14 12:59                     ` Johannes Thumshirn
2021-04-14 13:13                       ` Filipe Manana
2021-04-09 10:53 ` [PATCH v3 2/3] btrfs: rename delete_unused_bgs_mutex Johannes Thumshirn
2021-04-09 10:53 ` [PATCH v3 3/3] btrfs: zoned: automatically reclaim zones 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=PH0PR04MB7416EE187963A0D7718D57979B4E9@PH0PR04MB7416.namprd04.prod.outlook.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=Naohiro.Aota@wdc.com \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@gmail.com \
    --cc=fdmanana@suse.com \
    --cc=josef@toxicpanda.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 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.