From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbcBVBN2 (ORCPT ); Sun, 21 Feb 2016 20:13:28 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:26232 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752304AbcBVBN1 (ORCPT ); Sun, 21 Feb 2016 20:13:27 -0500 Message-ID: <56CA6089.20905@huawei.com> Date: Mon, 22 Feb 2016 09:12:41 +0800 From: Shuoran User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Pavel Machek CC: , , Subject: Re: [PATCH] f2fs: Introduce lifetime write IO statistics References: <1453778182-66323-1-git-send-email-liushuoran@huawei.com> <20160220170802.GB4662@amd> In-Reply-To: <20160220170802.GB4662@amd> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.173.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.56CA6092.003F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 638c0f377c8bcdb781747efa7924cbc8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On 2016/2/21 1:08, Pavel Machek wrote: > Hi! > >> From: Shuoran Liu >> >> Signed-off-by: Shuoran Liu >> Signed-off-by: Pengyang Hou >> --- 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