Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1482847pxb; Thu, 4 Mar 2021 12:30:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzZaxrBUoFMPhS5c6Q8gc8DB6IL1KmsQr8+Gv94o0fOpKwCpDh4Jc2AAOm3h0wWDoBJQmk X-Received: by 2002:a17:907:9709:: with SMTP id jg9mr6169656ejc.276.1614889808258; Thu, 04 Mar 2021 12:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614889808; cv=none; d=google.com; s=arc-20160816; b=mSFOhRNGvqaHH6bwNzDLLEC++tpOHihNzLWnVCP6J7T/ZhKM2eKq6B4nxW4qZU6H8T /xsPr7qvtkxEzL/E77u2T1J0E74Y+2REXRD/p2vLT1bjqfFs2MvmG7lM6Wt79x0B55Yg nmbuPlYPJCC8OlOBSF+iwkoBwDkvZayL14ZrbRSZ0AurnR9LDVNdIFfL2PjlP2fs0O1a MuLxIMLyypl5ChnTVlxCQFk4vawDxXzamvIVkvxWaS8Wer+8qpZ/7iR6vBJcKO484u+H LlsntrbFOsnrf2tbjX/oK4TjTdQoj9WAKrrkXX5Z/9ZwklWLhjE+YGdzuATOBwUqvPbT /h7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=duFrThFL0/xAdpZtMz38t5joplZpwBlVJfElr2prT/g=; b=ZBiiMYT7GU5Xx6fNX0rRZ7TXPoSOumxqJ3KLLcq+BfuijmiXkwDBXeNUeFGnL03MFO 9p2Unim84QZy4SLPqQSyoamc7fhYuP39g9y6Y7kQHtTshpW19ORWWVTEHBDjsRuM5q2G /Kwgaz66m59EidapKlhogyACUi2y2k925yq66EXdnPZCsYkAythttn1ZiExKiwgOREag U4Q6XSktLtFTRHc1nJykwBJLAUXiNlB50IMCSeMnoaQC6wG9qiHz8YbPkIeaZhrqOqsc d3BKiWb493ao0K2s60lFX5ODM3B3towzzqgAqM0nh8c1FliA96p8fyUHBFz2PfgvGIuu w3dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QgZZ/lRm"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si366452edx.95.2021.03.04.12.29.45; Thu, 04 Mar 2021 12:30:08 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QgZZ/lRm"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384268AbhCBVfn (ORCPT + 99 others); Tue, 2 Mar 2021 16:35:43 -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