From: Chao Yu <chao@kernel.org>
To: Yangtao Li <frank.li@vivo.com>, jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix iostat parameter for discard
Date: Sun, 11 Dec 2022 10:23:23 +0800 [thread overview]
Message-ID: <38ab73c5-4865-188f-9554-6bcaec7cc78b@kernel.org> (raw)
In-Reply-To: <20221205145603.70779-1-frank.li@vivo.com>
On 2022/12/5 22:56, Yangtao Li wrote:
> Just like other data we count uses the number of bytes as the basic unit,
> but discard uses the number of cmds as the statistical unit. In fact the
> discard command contains the number of blocks, so let's change to the
> number of bytes as the base unit.
>
> Fixes: b0af6d491a6b ("f2fs: add app/fs io stat")
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> fs/f2fs/segment.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 9486ca49ecb1..bc262e17b279 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1181,7 +1181,7 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
>
> atomic_inc(&dcc->issued_discard);
>
> - f2fs_update_iostat(sbi, NULL, FS_DISCARD, 1);
> + f2fs_update_iostat(sbi, NULL, FS_DISCARD, len * F2FS_BLKSIZE);
In order to avoid breaking its usage of application, how about keeping
FS_DISCARD as it is, and add FS_DISCARD_IO to account discard bytes?
Thanks,
>
> lstart += len;
> start += len;
_______________________________________________
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:[~2022-12-11 2:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 14:56 [f2fs-dev] [PATCH] f2fs: fix iostat parameter for discard Yangtao Li via Linux-f2fs-devel
2022-12-11 2:23 ` Chao Yu [this message]
2022-12-12 22:59 ` Jaegeuk Kim
2022-12-13 1:46 ` Chao Yu
2022-12-13 11:54 ` Yangtao Li via Linux-f2fs-devel
2022-12-13 19:11 ` Jaegeuk Kim
2022-12-15 2:21 ` 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=38ab73c5-4865-188f-9554-6bcaec7cc78b@kernel.org \
--to=chao@kernel.org \
--cc=frank.li@vivo.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).