mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: beomsu7.kim@samsung.com,
	"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
	"linux-f2fs-devel@lists.sourceforge.net" 
	<linux-f2fs-devel@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Yonggil Song <yonggil.song@samsung.com>,
	Seokhwan Kim <sukka.kim@samsung.com>,
	Daejun Park <daejun7.park@samsung.com>,
	Seonghun Kim <seonghun-sui.kim@samsung.com>
Subject: Re: [PATCH] f2fs: including waf data in f2fs status information
Date: Fri, 2 Jun 2023 16:52:10 +0800	[thread overview]
Message-ID: <f301845f-c358-4632-1df5-5944d7483072@kernel.org> (raw)
In-Reply-To: <20230602044830epcms2p141ec782e866c2adc5a3142516f051b87@epcms2p1>

On 2023/6/2 12:48, beomsu kim wrote:
> When evaluating in f2fs, it takes much time to obtain waf data.
> This patch helps to obtain waf data without calcluation.
> 
> Signed-off-by: Beomsu Kim <beomsu7.kim@samsung.com>
> ---
>   fs/f2fs/iostat.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c
> index 3d5bfb1ad585..6eab11b0610d 100644
> --- a/fs/f2fs/iostat.c
> +++ b/fs/f2fs/iostat.c
> @@ -34,10 +34,22 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset)
>   {
>          struct super_block *sb = seq->private;
>          struct f2fs_sb_info *sbi = F2FS_SB(sb);
> +       int j;
> +       unsigned long long waf = 0;
> +       unsigned long long data_written_to_storage = 0;
> +       unsigned long long data_written_by_user = 0;
>   
>          if (!sbi->iostat_enable)
>                  return 0;
>   
> +       for (j = FS_DATA_IO; j <= FS_CP_META_IO; j++)

FS_CDATA_IO is redundant?

> +               data_written_to_storage += sbi->iostat_bytes[j];
> +       for (j = FS_DATA_IO; j <= FS_CDATA_IO; j++)

Just needs to include APP_WRITE_IO and APP_MAPPED_IO?

Thanks,

> +               data_written_by_user += sbi->iostat_bytes[j];
> +
> +       if (data_written_by_user > 0)
> +               waf = data_written_to_storage * 100 / data_written_by_user;
> +
>          seq_printf(seq, "time:          %-16llu\n", ktime_get_real_seconds());
>          seq_printf(seq, "\t\t\t%-16s %-16s %-16s\n",
>                                  "io_bytes", "count", "avg_bytes");
> @@ -81,6 +93,10 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset)
>          IOSTAT_INFO_SHOW("fs discard", FS_DISCARD_IO);
>          IOSTAT_INFO_SHOW("fs flush", FS_FLUSH_IO);
>   
> +       /* print waf */
> +       seq_puts(seq, "[WAF]\n");
> +       seq_printf(seq, "fs waf:                %llu.%02llu\n", waf / 100, waf % 100);
> +
>          return 0;
>   }
>   

  reply	other threads:[~2023-06-02  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230602044830epcms2p141ec782e866c2adc5a3142516f051b87@epcms2p1>
2023-06-02  4:48 ` beomsu kim
2023-06-02  8:52   ` Chao Yu [this message]
     [not found]   ` <CGME20230602044830epcms2p141ec782e866c2adc5a3142516f051b87@epcms2p7>
2023-06-12  7:52     ` beomsu kim
     [not found] <CGME20230531082038epcms2p256f9db0d7ac377d404694354db1c3ebc@epcms2p2>
2023-05-31  8:20 ` beomsu kim
2023-06-01  6:29   ` kernel test robot
2023-06-01 14:18   ` kernel test robot

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=f301845f-c358-4632-1df5-5944d7483072@kernel.org \
    --to=chao@kernel.org \
    --cc=beomsu7.kim@samsung.com \
    --cc=daejun7.park@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seonghun-sui.kim@samsung.com \
    --cc=sukka.kim@samsung.com \
    --cc=yonggil.song@samsung.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

Powered by JetHome