From: Shuoran <liushuoran@huawei.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: <jaegeuk@kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [PATCH] f2fs: Introduce lifetime write IO statistics
Date: Mon, 22 Feb 2016 09:12:41 +0800 [thread overview]
Message-ID: <56CA6089.20905@huawei.com> (raw)
In-Reply-To: <20160220170802.GB4662@amd>
Hi Pavel,
On 2016/2/21 1:08, Pavel Machek wrote:
> Hi!
>
>> From: Shuoran Liu <liushuoran@huawei.com>
>>
>> Signed-off-by: Shuoran Liu <liushuoran@huawei.com>
>> Signed-off-by: Pengyang Hou <houpengyang@huawei.com>
>> --- a/fs/f2fs/checkpoint.c
>> +++ b/fs/f2fs/checkpoint.c
>> @@ -921,6 +921,10 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
>> int cp_payload_blks = __cp_payload(sbi);
>> block_t discard_blk = NEXT_FREE_BLKADDR(sbi, curseg);
>> bool invalidate = false;
>> + struct super_block *sb = sbi->sb;
>> + struct curseg_info *seg_i = CURSEG_I(sbi, CURSEG_HOT_NODE);
>> + __u64 kbytes_written;
>> +
> No need to __prefix in kernel.
There is a v2 version of the patch according to the suggestions of Kim
and Chao Yu, and is merged into the "dev" branch.
>> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
>> diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
>> index e59c3be..05ae034 100644
>> --- a/include/linux/f2fs_fs.h
>> +++ b/include/linux/f2fs_fs.h
>> @@ -387,6 +387,11 @@ struct sit_journal {
>> __u8 reserved[SIT_JOURNAL_RESERVED];
>> } __packed;
>>
>> +struct f2fs_extra_info {
>> + __le64 kbytes_written;
>> + __u8 reserved[SUM_JOURNAL_SIZE - 10];
>> +} __packed;
>> +
> Unless this is exported to userspace, no need for __ here, either.
>
> (Would it make sense to store bytes_written, as it is not going to
> overflow, anyway?)
>
> Is this going to be exported to userspace somehow?
This stat is exposed to the sysfs interface. Since Ext4 is using kbytes
named "lifetime_kbytes_written", we tend to maintain compatibility in
case some upper level applications are using it. Besides, the
information is obtained from block layer in the unit of "sectors"(512
bytes). So it is not necessary to use bytes.
> Pavel
Regards,
Shuoran
prev parent reply other threads:[~2016-02-22 1:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-26 3:16 [PATCH] f2fs: Introduce lifetime write IO statistics Liu Shuoran
2016-02-20 17:08 ` Pavel Machek
2016-02-22 1:12 ` Shuoran [this message]
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=56CA6089.20905@huawei.com \
--to=liushuoran@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
/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