Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Naohiro Aota <Naohiro.Aota@wdc.com>, Christoph Hellwig <hch@lst.de>
Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: new scrub code vs zoned file systems
Date: Thu, 1 Jun 2023 15:21:22 +0800	[thread overview]
Message-ID: <37a62c6c-ca9a-a6d2-37ba-249605427d08@gmx.com> (raw)
In-Reply-To: <mmttvfirtcp32ruvodutdw2vnvxqdnad2gywwb6jxl7gtkzqta@xw75lfxofsso>



On 2023/6/1 13:21, Naohiro Aota wrote:
> On Thu, Jun 01, 2023 at 02:17:22PM +0900, Naohiro Aota wrote:
>> On Thu, Jun 01, 2023 at 01:00:40PM +0800, Qu Wenruo wrote:
>>>>> But I'm more concerned about why we have a full zone before that crash.
>>>>
>>>> I think this is happening because we can't account for the zone filling
>>>> without the proper context.
>>>
>>> I believe it's a different problem, maybe some de-sync between scrub
>>> write_pointer and the real zoned pointer inside the device.
>>>
>>> My current guess is, the target zone inside the target device is not
>>> properly reset before dev-replace.
>>
>> This must be a different issue. Are we choosing that zone for zone finish
>> to free the active zone resource?
>
> BTW, you may want to use this patch to track zone finishing.

Is there any function that I can go to grab the current writer pointer?

The new trace events only output the flags and used bytes, or the used
bytes is the write pointer already?

Thanks,
Qu

>
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index dbac203ea54a..5b4ab12368c9 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -2015,6 +2015,7 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ
>   		btrfs_dev_clear_active_zone(device, physical);
>   	}
>
> +	trace_btrfs_zone_finish_block_group(block_group);
>   	if (!fully_written)
>   		btrfs_dec_block_group_ro(block_group);
>
> diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
> index 8ea9cea9bfeb..594e4aca0a02 100644
> --- a/include/trace/events/btrfs.h
> +++ b/include/trace/events/btrfs.h
> @@ -2057,6 +2057,12 @@ DEFINE_EVENT(btrfs__block_group, btrfs_skip_unused_block_group,
>   	TP_ARGS(bg_cache)
>   );
>
> +DEFINE_EVENT(btrfs__block_group, btrfs_zone_finish_block_group,
> +	TP_PROTO(const struct btrfs_block_group *bg_cache),
> +
> +	TP_ARGS(bg_cache)
> +);
> +
>   TRACE_EVENT(btrfs_set_extent_bit,
>   	TP_PROTO(const struct extent_io_tree *tree,
>   		 u64 start, u64 len, unsigned set_bits),

  reply	other threads:[~2023-06-01  7:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 12:52 new scrub code vs zoned file systems Christoph Hellwig
2023-05-31 13:10 ` Johannes Thumshirn
2023-05-31 13:20   ` Christoph Hellwig
2023-05-31 13:25     ` Johannes Thumshirn
2023-05-31 13:30       ` Christoph Hellwig
2023-05-31 14:04         ` Johannes Thumshirn
2023-05-31 14:17           ` Christoph Hellwig
2023-06-01  2:09             ` Qu Wenruo
2023-06-01  4:40               ` Christoph Hellwig
2023-06-01  5:00                 ` Qu Wenruo
2023-06-01  5:17                   ` Naohiro Aota
2023-06-01  5:21                     ` Naohiro Aota
2023-06-01  7:21                       ` Qu Wenruo [this message]
2023-06-01  7:27                         ` Christoph Hellwig
2023-06-01  8:46                           ` Qu Wenruo
2023-06-01  5:22                     ` Christoph Hellwig
2023-06-01  5:34                       ` Christoph Hellwig
2023-06-01  5:45                     ` Qu Wenruo
2023-06-01  5:47                       ` Christoph Hellwig
2023-05-31 22:25           ` Qu Wenruo
2023-05-31 22:48             ` Qu Wenruo
2023-06-01  4:53             ` Christoph Hellwig
2023-06-01  5:04               ` Qu Wenruo

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=37a62c6c-ca9a-a6d2-37ba-249605427d08@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=Naohiro.Aota@wdc.com \
    --cc=hch@lst.de \
    --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