linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH v2 2/4] btrfs: make __btrfs_dump_space_info() output better formatted
Date: Tue, 19 Jul 2022 16:56:00 -0400	[thread overview]
Message-ID: <a5321725-1667-fd6f-2bfd-8ddb7b78d038@dorminy.me> (raw)
In-Reply-To: <dc40ddc78b7173d757065dcdde910bcf593d3a5c.1658207325.git.wqu@suse.com>



On 7/19/22 01:11, Qu Wenruo wrote:
> The format change includes:
> 
> - Output each bytes_* in a separate line
> 
> - All bytes_* output starts at the same vertical position
>    Do human a favor reading the numbers
> 
> - Skip zone specific numbers if zone is not enabled
> 
> Now one example of __btrfs_dump_space_info() looks like this for its
> bytes_* members.
> 
>   BTRFS info (device dm-1: state A): space_info META has 251494400 free, is not full
>   BTRFS info (device dm-1: state A):   total:         268435456
>   BTRFS info (device dm-1: state A):   used:          376832
>   BTRFS info (device dm-1: state A):   pinned:        229376
>   BTRFS info (device dm-1: state A):   reserved:      0
>   BTRFS info (device dm-1: state A):   may_use:       16269312
>   BTRFS info (device dm-1: state A):   read_only:     65536
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>   fs/btrfs/space-info.c | 14 +++++++++-----
>   1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
> index 36b466525318..623fa0488545 100644
> --- a/fs/btrfs/space-info.c
> +++ b/fs/btrfs/space-info.c
> @@ -475,11 +475,15 @@ static void __btrfs_dump_space_info(struct btrfs_fs_info *fs_info,
>   		   flag_str,
>   		   (s64)(info->total_bytes - btrfs_space_info_used(info, true)),
>   		   info->full ? "" : "not ");
> -	btrfs_info(fs_info,
> -		"space_info total=%llu, used=%llu, pinned=%llu, reserved=%llu, may_use=%llu, readonly=%llu zone_unusable=%llu",
> -		info->total_bytes, info->bytes_used, info->bytes_pinned,
> -		info->bytes_reserved, info->bytes_may_use,
> -		info->bytes_readonly, info->bytes_zone_unusable);
> +	btrfs_info(fs_info, "  total:         %llu", info->total_bytes);
> +	btrfs_info(fs_info, "  used:          %llu", info->bytes_used);
> +	btrfs_info(fs_info, "  pinned:        %llu", info->bytes_pinned);
> +	btrfs_info(fs_info, "  reserved:      %llu", info->bytes_reserved);
> +	btrfs_info(fs_info, "  may_use:       %llu", info->bytes_may_use);
> +	btrfs_info(fs_info, "  read_only:     %llu", info->bytes_readonly);
> +	if (btrfs_is_zoned(fs_info))
> +		btrfs_info(fs_info,
> +			    "  zone_unusable: %llu", info->bytes_zone_unusable);

I'm (perhaps needlessly) worried about splitting this up into six/seven 
messages, because of the ratelimiting rolled into btrfs_printk. The 
ratelimit is 100 messages per 5 * HZ, and it seems like it would be 
unfortunate if it kicked in during the middle of this dump and prevented 
later info from being dumped.

Maybe we should add a btrfs_dump_printk() helper that doesn't have a 
ratelimit built in, for exceptional cases like this where we really, 
really don't want anything ratelimited?


>   
>   	DUMP_BLOCK_RSV(fs_info, global_block_rsv);
>   	DUMP_BLOCK_RSV(fs_info, trans_block_rsv);



  reply	other threads:[~2022-07-19 20:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19  5:11 [PATCH v2 0/4] btrfs: output more info for -ENOSPC caused transaction abort and other enhancement Qu Wenruo
2022-07-19  5:11 ` [PATCH v2 1/4] btrfs: output human readable space info flag Qu Wenruo
2022-07-19 20:38   ` Sweet Tea Dorminy
2022-07-19  5:11 ` [PATCH v2 2/4] btrfs: make __btrfs_dump_space_info() output better formatted Qu Wenruo
2022-07-19 20:56   ` Sweet Tea Dorminy [this message]
2022-07-19 21:38     ` David Sterba
2022-07-19 22:58       ` Qu Wenruo
2022-07-26 18:13         ` David Sterba
2022-07-26 20:53           ` Boris Burkov
2022-07-26 21:39             ` David Sterba
2022-07-26 23:21               ` Boris Burkov
2022-07-27  1:21                 ` Sweet Tea Dorminy
2022-07-27  1:44                   ` Qu Wenruo
2022-07-27 15:09                     ` Sweet Tea Dorminy
2022-07-19  5:11 ` [PATCH v2 3/4] btrfs: make DUMP_BLOCK_RSV() to have better output Qu Wenruo
2022-07-19  5:11 ` [PATCH v2 4/4] btrfs: dump all space infos if we abort transaction due to ENOSPC Qu Wenruo
2022-07-20  0:42   ` Sweet Tea Dorminy
2022-07-20  1:03     ` Qu Wenruo
2022-07-20  1:43       ` Sweet Tea Dorminy
2022-07-20  1:57         ` Qu Wenruo
2022-07-26 18:20       ` David Sterba
2022-07-26 18:38         ` Sweet Tea Dorminy
2022-08-24 15:53 ` [PATCH v2 0/4] btrfs: output more info for -ENOSPC caused transaction abort and other enhancement David Sterba
2022-08-25  3: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=a5321725-1667-fd6f-2bfd-8ddb7b78d038@dorminy.me \
    --to=sweettea-kernel@dorminy.me \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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;
as well as URLs for NNTP newsgroup(s).