Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1338748 > unrolled thread

Re: [PATCH] f2fs: Introduce lifetime write IO statistics

Started byPavel Machek <pavel@ucw.cz>
First post2016-02-20 18:10 +0100
Last post2016-02-22 02:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] f2fs: Introduce lifetime write IO statistics Pavel Machek <pavel@ucw.cz> - 2016-02-20 18:10 +0100
    Re: [PATCH] f2fs: Introduce lifetime write IO statistics Shuoran <liushuoran@huawei.com> - 2016-02-22 02:20 +0100

#1338748 — Re: [PATCH] f2fs: Introduce lifetime write IO statistics

FromPavel Machek <pavel@ucw.cz>
Date2016-02-20 18:10 +0100
SubjectRe: [PATCH] f2fs: Introduce lifetime write IO statistics
Message-ID<r4jcC-rI-23@gated-at.bofh.it>
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.

> 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?

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[toc] | [next] | [standalone]


#1339045

FromShuoran <liushuoran@huawei.com>
Date2016-02-22 02:20 +0100
Message-ID<r4Nkl-6qK-5@gated-at.bofh.it>
In reply to#1338748
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web