From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 5/5] f2fs: show more debug info for per-temperature log
Date: Wed, 24 Jun 2020 15:31:14 -0700 [thread overview]
Message-ID: <20200624223114.GA192472@google.com> (raw)
In-Reply-To: <20200618063625.110273-5-yuchao0@huawei.com>
On 06/18, Chao Yu wrote:
> - Add to account and show per-log dirty_seg, full_seg and valid_blocks
> in debugfs.
> - reformat printed info.
>
> TYPE segno secno zoneno dirty_seg full_seg valid_blk
> - COLD data: 1523 1523 1523 1 0 399
> - WARM data: 769 769 769 20 255 133098
> - HOT data: 767 767 767 9 0 167
> - Dir dnode: 22 22 22 3 0 70
> - File dnode: 722 722 722 14 10 6505
> - Indir nodes: 2 2 2 1 0 3
>
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
> fs/f2fs/debug.c | 67 ++++++++++++++++++++++++++++++++++++++++---------
> fs/f2fs/f2fs.h | 3 +++
> 2 files changed, 58 insertions(+), 12 deletions(-)
>
> diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
> index 0dbcb0f9c019..aa1fd2de11ba 100644
> --- a/fs/f2fs/debug.c
> +++ b/fs/f2fs/debug.c
> @@ -174,6 +174,29 @@ static void update_general_status(struct f2fs_sb_info *sbi)
> for (i = META_CP; i < META_MAX; i++)
> si->meta_count[i] = atomic_read(&sbi->meta_count[i]);
>
> + for (i = 0; i < NO_CHECK_TYPE; i++) {
> + si->dirty_seg[i] = 0;
> + si->full_seg[i] = 0;
> + si->valid_blks[i] = 0;
> + }
> +
> + for (i = 0; i < MAIN_SEGS(sbi); i++) {
> + int blks = get_seg_entry(sbi, i)->valid_blocks;
> + int type = get_seg_entry(sbi, i)->type;
> +
> + if (!blks)
> + continue;
> +
> + if (IS_CURSEG(sbi, i))
> + continue;
How about adding current segments as well? Especially, it's hard to see any
valid blocks for cold node with this.
> +
> + if (blks == sbi->blocks_per_seg)
> + si->full_seg[type]++;
> + else
> + si->dirty_seg[type]++;
> + si->valid_blks[type] += blks;
> + }
> +
> for (i = 0; i < 2; i++) {
> si->segment_count[i] = sbi->segment_count[i];
> si->block_count[i] = sbi->block_count[i];
> @@ -329,30 +352,50 @@ static int stat_show(struct seq_file *s, void *v)
> seq_printf(s, "\nMain area: %d segs, %d secs %d zones\n",
> si->main_area_segs, si->main_area_sections,
> si->main_area_zones);
> - seq_printf(s, " - COLD data: %d, %d, %d\n",
> + seq_printf(s, " TYPE %8s %8s %8s %10s %10s %10s\n",
> + "segno", "secno", "zoneno", "dirty_seg", "full_seg", "valid_blk");
> + seq_printf(s, " - COLD data: %8d %8d %8d %10u %10u %10u\n",
> si->curseg[CURSEG_COLD_DATA],
> si->cursec[CURSEG_COLD_DATA],
> - si->curzone[CURSEG_COLD_DATA]);
> - seq_printf(s, " - WARM data: %d, %d, %d\n",
> + si->curzone[CURSEG_COLD_DATA],
> + si->dirty_seg[CURSEG_COLD_DATA],
> + si->full_seg[CURSEG_COLD_DATA],
> + si->valid_blks[CURSEG_COLD_DATA]);
> + seq_printf(s, " - WARM data: %8d %8d %8d %10u %10u %10u\n",
> si->curseg[CURSEG_WARM_DATA],
> si->cursec[CURSEG_WARM_DATA],
> - si->curzone[CURSEG_WARM_DATA]);
> - seq_printf(s, " - HOT data: %d, %d, %d\n",
> + si->curzone[CURSEG_WARM_DATA],
> + si->dirty_seg[CURSEG_WARM_DATA],
> + si->full_seg[CURSEG_WARM_DATA],
> + si->valid_blks[CURSEG_WARM_DATA]);
> + seq_printf(s, " - HOT data: %8d %8d %8d %10u %10u %10u\n",
> si->curseg[CURSEG_HOT_DATA],
> si->cursec[CURSEG_HOT_DATA],
> - si->curzone[CURSEG_HOT_DATA]);
> - seq_printf(s, " - Dir dnode: %d, %d, %d\n",
> + si->curzone[CURSEG_HOT_DATA],
> + si->dirty_seg[CURSEG_HOT_DATA],
> + si->full_seg[CURSEG_HOT_DATA],
> + si->valid_blks[CURSEG_HOT_DATA]);
> + seq_printf(s, " - Dir dnode: %8d %8d %8d %10u %10u %10u\n",
> si->curseg[CURSEG_HOT_NODE],
> si->cursec[CURSEG_HOT_NODE],
> - si->curzone[CURSEG_HOT_NODE]);
> - seq_printf(s, " - File dnode: %d, %d, %d\n",
> + si->curzone[CURSEG_HOT_NODE],
> + si->dirty_seg[CURSEG_HOT_NODE],
> + si->full_seg[CURSEG_HOT_NODE],
> + si->valid_blks[CURSEG_HOT_NODE]);
> + seq_printf(s, " - File dnode: %8d %8d %8d %10u %10u %10u\n",
> si->curseg[CURSEG_WARM_NODE],
> si->cursec[CURSEG_WARM_NODE],
> - si->curzone[CURSEG_WARM_NODE]);
> - seq_printf(s, " - Indir nodes: %d, %d, %d\n",
> + si->curzone[CURSEG_WARM_NODE],
> + si->dirty_seg[CURSEG_WARM_NODE],
> + si->full_seg[CURSEG_WARM_NODE],
> + si->valid_blks[CURSEG_WARM_NODE]);
> + seq_printf(s, " - Indir nodes: %8d %8d %8d %10u %10u %10u\n",
> si->curseg[CURSEG_COLD_NODE],
> si->cursec[CURSEG_COLD_NODE],
> - si->curzone[CURSEG_COLD_NODE]);
> + si->curzone[CURSEG_COLD_NODE],
> + si->dirty_seg[CURSEG_COLD_NODE],
> + si->full_seg[CURSEG_COLD_NODE],
> + si->valid_blks[CURSEG_COLD_NODE]);
> seq_printf(s, "\n - Valid: %d\n - Dirty: %d\n",
> si->main_area_segs - si->dirty_count -
> si->prefree_count - si->free_segs,
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 72a667f1d678..70565d81320b 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -3536,6 +3536,9 @@ struct f2fs_stat_info {
> int curseg[NR_CURSEG_TYPE];
> int cursec[NR_CURSEG_TYPE];
> int curzone[NR_CURSEG_TYPE];
> + unsigned int dirty_seg[NR_CURSEG_TYPE];
> + unsigned int full_seg[NR_CURSEG_TYPE];
> + unsigned int valid_blks[NR_CURSEG_TYPE];
>
> unsigned int meta_count[META_MAX];
> unsigned int segment_count[2];
> --
> 2.18.0.rc1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2020-06-24 22:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 6:36 [f2fs-dev] [PATCH 1/5] f2fs: fix to wait page writeback before update Chao Yu
2020-06-18 6:36 ` [f2fs-dev] [PATCH 2/5] f2fs: add prefix for exported symbols Chao Yu
2020-06-18 6:36 ` [f2fs-dev] [PATCH 3/5] f2fs: shrink node_write lock coverage Chao Yu
2020-06-19 5:56 ` Jaegeuk Kim
2020-06-18 6:36 ` [f2fs-dev] [PATCH 4/5] f2fs: clean up parameter of f2fs_allocate_data_block() Chao Yu
2020-06-18 6:36 ` [f2fs-dev] [PATCH 5/5] f2fs: show more debug info for per-temperature log Chao Yu
2020-06-24 22:31 ` Jaegeuk Kim [this message]
2020-06-28 1:35 ` Chao Yu
2020-06-18 23:59 ` [f2fs-dev] [PATCH 1/5] f2fs: fix to wait page writeback before update Jaegeuk Kim
2020-06-19 1:44 ` Chao Yu
2020-06-19 5:49 ` Jaegeuk Kim
2020-06-19 6:44 ` Chao Yu
2020-06-19 22:47 ` Jaegeuk Kim
2020-06-20 0:52 ` Chao Yu
2020-06-21 16:38 ` Jaegeuk Kim
2020-06-22 0:51 ` Chao Yu
2020-06-24 15:55 ` Jaegeuk Kim
2020-06-28 1:26 ` Chao Yu
2024-03-08 6:20 ` Chao Yu
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=20200624223114.GA192472@google.com \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yuchao0@huawei.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).