Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1271089pxb; Thu, 4 Mar 2021 07:28:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzV2F/AxD/0a4HdyHbSGd7e3xJaaoB6Mbe2d8cJeKHtYmGQ662ZMaqNKbtM/+oToU2u0JSS X-Received: by 2002:a17:907:75c2:: with SMTP id jl2mr4921028ejc.334.1614871728954; Thu, 04 Mar 2021 07:28:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614871728; cv=none; d=google.com; s=arc-20160816; b=LcXGxbCfPu84zcX2TFBol3S4YXnNmf7R5Tny2SnVjjvMjF7IvkP6awcD5m5sGTlH1N gWXuoARm1P8XMI9phiAwYFfXCL+08CPGBO7mdleylyTrjEEEDFEiNBFFcGOURop7acJ+ sJ5i6KpRh64a6hTAJ2K2wuKIHIYFVFOLkXlYJHXKVMd7jv2XRwCvjMWn/tmRdHVWfJ70 oGC9g3OUAcrpblDll6KuI9CKTkpT/0A3rIFBcN0RyIVRcsh2GAwquvjxzeCBx15Pig1Z DSjs9v2LpaFBhFMW+5xzUkaaP9eB651GyJ01C/gj0aptKS6scn+Rd4xtOvsAll/MC7y0 q0iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=cFLH+Wgv+YZZCSjdluNi6VpNrkHn6VlfnRqEfMZ7cHQ=; b=fznUUjmwnXtlznPsYF50nUhdxc+B+JvK19mq3fNLGhfTAZc0ZB29jCv94nmBkKriRf eAsVW5a7nOsn4hNUQLXQR6g76RLz6nWLDDxoRx/o01tq7Yfa97KUay64yiuNu0IbCIva n57316cULRF2uAhJTdK8Hyk05SwWIuvWUwnGY9qbqcH87V36do60g42GgTw9iiDiAESh Fpvt7KIAfcgYIB4v8u4DN2JjmwMqxgF8DcdULsu8smcPbl/yqgT2DccdjdlDkYz4YT6y sKlogG7FADDVG73PlcUnfCtPtyFsSSFo5a9/8VVeJVAt9vVbajzhLAAiJqKVAaX6W0X1 WiXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x20si9154616edq.132.2021.03.04.07.28.24; Thu, 04 Mar 2021 07:28:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234820AbhCDH4p (ORCPT + 99 others); Thu, 4 Mar 2021 02:56:45 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:13123 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234551AbhCDH4P (ORCPT ); Thu, 4 Mar 2021 02:56:15 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Drjmb4h3lz16GGG; Thu, 4 Mar 2021 15:53:51 +0800 (CST) Received: from [10.136.110.154] (10.136.110.154) by smtp.huawei.com (10.3.19.210) with Microsoft SMTP Server (TLS) id 14.3.498.0; Thu, 4 Mar 2021 15:55:29 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments To: Jaegeuk Kim CC: , , References: <20210302054233.3886681-1-jaegeuk@kernel.org> <920469a9-45d3-68e3-1f8d-a436bdd60cfe@huawei.com> From: Chao Yu Message-ID: <05b43d3e-d735-ae34-5a4f-3d81a4fc8a9b@huawei.com> Date: Thu, 4 Mar 2021 15:55:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.136.110.154] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/3/3 2:44, Jaegeuk Kim wrote: > On 03/02, Jaegeuk Kim wrote: >> On 03/02, Chao Yu wrote: >>> On 2021/3/2 13:42, Jaegeuk Kim wrote: >>>> This is useful when checking conditions during checkpoint=disable in Android. >>> >>> This sysfs entry is readonly, how about putting this at >>> /sys/fs/f2fs//stat/? >> >> Urg.. "stat" is a bit confused. I'll take a look a better ones. Oh, I mean put it into "stat" directory, not "stat" entry, something like this: /sys/fs/f2fs//stat/ovp_segments > > Taking a look at other entries using in Android, I feel that this one can't be > in stat or whatever other location, since I worry about the consistency with > similar dirty/free segments. It seems it's not easy to clean up the existing > ones anymore. Well, actually, the entry number are still increasing continuously, the result is that it becomes more and more slower and harder for me to find target entry name from that directory. IMO, once new readonly entry was added to "" directory, there is no chance to reloacate it due to interface compatibility. So I think this is the only chance to put it to the appropriate place at this time. Thanks, > >> >>> >>>> >>>> Signed-off-by: Jaegeuk Kim >>>> --- >>>> fs/f2fs/sysfs.c | 8 ++++++++ >>>> 1 file changed, 8 insertions(+) >>>> >>>> diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c >>>> index e38a7f6921dd..254b6fa17406 100644 >>>> --- a/fs/f2fs/sysfs.c >>>> +++ b/fs/f2fs/sysfs.c >>>> @@ -91,6 +91,13 @@ static ssize_t free_segments_show(struct f2fs_attr *a, >>>> (unsigned long long)(free_segments(sbi))); >>>> } >>>> +static ssize_t ovp_segments_show(struct f2fs_attr *a, >>>> + struct f2fs_sb_info *sbi, char *buf) >>>> +{ >>>> + return sprintf(buf, "%llu\n", >>>> + (unsigned long long)(overprovision_segments(sbi))); >>>> +} >>>> + >>>> static ssize_t lifetime_write_kbytes_show(struct f2fs_attr *a, >>>> struct f2fs_sb_info *sbi, char *buf) >>>> { >>>> @@ -629,6 +636,7 @@ F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, node_io_flag, node_io_flag); >>>> F2FS_RW_ATTR(CPRC_INFO, ckpt_req_control, ckpt_thread_ioprio, ckpt_thread_ioprio); >>>> F2FS_GENERAL_RO_ATTR(dirty_segments); >>>> F2FS_GENERAL_RO_ATTR(free_segments); >>>> +F2FS_GENERAL_RO_ATTR(ovp_segments); >>> >>> Missed to add document entry in Documentation/ABI/testing/sysfs-fs-f2fs? >> >> Yeah, thanks. >> >>> >>> Thanks, >>> >>>> F2FS_GENERAL_RO_ATTR(lifetime_write_kbytes); >>>> F2FS_GENERAL_RO_ATTR(features); >>>> F2FS_GENERAL_RO_ATTR(current_reserved_blocks); >>>> >> >> >> _______________________________________________ >> Linux-f2fs-devel mailing list >> Linux-f2fs-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > . >