From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFAD3C4332B for ; Tue, 2 Mar 2021 21:36:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7BBC64F34 for ; Tue, 2 Mar 2021 21:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384298AbhCBVfp (ORCPT ); Tue, 2 Mar 2021 16:35:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:35970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378234AbhCBSpN (ORCPT ); Tue, 2 Mar 2021 13:45:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1208860234; Tue, 2 Mar 2021 18:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614710671; bh=Jez+zQ5zpYVsw8ZRUjYBKwlw+LBdVJxKIm2weKJgcAg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QgZZ/lRmbVso3uOmcSejiJnTRnZ9yzOkv44srGRjw/oqUQ1P0VDt2zzCALLelceGo nw1tWuK7MoM0hFugbabeY0B5prc0uOBz03Lk8MBDqNZr6MWJlRcn1Nezxv6oq22VRD jhw43n4UcLZW3U1hwlLeLafkoa2kwp+aTLfoSfboU94jjFoDR95VYZRES2VvypK+0p 9OzgwLwHWBmpsvkAwJ9lzXrabW99SsSoeKK/NoyDWWvim42iDimyshbHxW1kUWkZ+N le0+e4MqcombT7q3wAvDr6wY4HdRdDrM9LWDEdrTblZ8Ho16yUzggqoOg6Cw0zO7uG 2KMWdlHAWERug== Date: Tue, 2 Mar 2021 10:44:29 -0800 From: Jaegeuk Kim To: Chao Yu Cc: kernel-team@android.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments Message-ID: References: <20210302054233.3886681-1-jaegeuk@kernel.org> <920469a9-45d3-68e3-1f8d-a436bdd60cfe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. > > > > > > > > > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5758C433E0 for ; Tue, 2 Mar 2021 18:44:48 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E6C364F23; Tue, 2 Mar 2021 18:44:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E6C364F23 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lHA0l-0003pu-3A; Tue, 02 Mar 2021 18:44:47 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHA0f-0003pe-7g for linux-f2fs-devel@lists.sourceforge.net; Tue, 02 Mar 2021 18:44:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=duFrThFL0/xAdpZtMz38t5joplZpwBlVJfElr2prT/g=; b=HshLyT+jSX6HVVr5O2vmXiD9xs Ww5TnCkDgxOg+GzmtI2LYa5qoaIELiyZFBEmtyHBZCQ6RZUcYThHa24FAY3+wVeyrYtWPsfRzBN/b g7K80nmIsVEi4BxG75qDVnersFjGtCPbOQnioxbaMPGWVS/MusW0Vyw3OCbeSL/xpsrs=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=duFrThFL0/xAdpZtMz38t5joplZpwBlVJfElr2prT/g=; b=OOBbM2GOGVRtLNg5Su3MJbAQm4 MD47WgunTkTE/Pk4LD5Y0Vi6AvkWy4wUGmuWyQWJIHSa13eqs9z2X3GbpXDGdrbPGLe1s4ZQPCna6 JB8JyAP97MPtBb7N/Ya4PwlXrwLVjMGfrZ/u9Tqdi+eCGZWqwvMzzCAV/rJuoRHUqnfo=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lHA0a-00BZkp-Px for linux-f2fs-devel@lists.sourceforge.net; Tue, 02 Mar 2021 18:44:41 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1208860234; Tue, 2 Mar 2021 18:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614710671; bh=Jez+zQ5zpYVsw8ZRUjYBKwlw+LBdVJxKIm2weKJgcAg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QgZZ/lRmbVso3uOmcSejiJnTRnZ9yzOkv44srGRjw/oqUQ1P0VDt2zzCALLelceGo nw1tWuK7MoM0hFugbabeY0B5prc0uOBz03Lk8MBDqNZr6MWJlRcn1Nezxv6oq22VRD jhw43n4UcLZW3U1hwlLeLafkoa2kwp+aTLfoSfboU94jjFoDR95VYZRES2VvypK+0p 9OzgwLwHWBmpsvkAwJ9lzXrabW99SsSoeKK/NoyDWWvim42iDimyshbHxW1kUWkZ+N le0+e4MqcombT7q3wAvDr6wY4HdRdDrM9LWDEdrTblZ8Ho16yUzggqoOg6Cw0zO7uG 2KMWdlHAWERug== Date: Tue, 2 Mar 2021 10:44:29 -0800 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20210302054233.3886681-1-jaegeuk@kernel.org> <920469a9-45d3-68e3-1f8d-a436bdd60cfe@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1lHA0a-00BZkp-Px Subject: Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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. 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. > > > > > > > > > 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel