Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2156550pxb; Mon, 8 Mar 2021 16:12:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpOE3CtPSVVwa2rtAAVlBJaw7jE8hP6hEETdrjXon6jK4fbJBwnoxd/WZQnNNXoJ0NPOCP X-Received: by 2002:a05:6402:17d6:: with SMTP id s22mr1084378edy.232.1615248725678; Mon, 08 Mar 2021 16:12:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615248725; cv=none; d=google.com; s=arc-20160816; b=E1gKLdk4GCkXuORfvQVLnOiy6MrdAqW81vM5KTepIP1B05nmBvxO7UUEhhUzt2V+nA XgoIOzAeNSoFhqCJvaTX43MA/kLM03fN3YhAMRHNkm/FtdeXbtGYgz27Z2PkxDNRm6KV IMNygoAeNG4Fx7uTZaV1NxH3uyWRZijTEpP1e/WVhFyYhgoPddkZuNuV4PzZcGC7xyY0 iGcnZmO8KgPyegWQEji1icXiEXucqYaiHZNC4K3vRwIEubvzPdoEk57qF5tou6RUrBLz FFTHOSWm50hyRXoXtR0/wGxWnoxeMQH9aasn5I0QgX2G4XTjBtFchDjw69nN/3eHCtOE CMxQ== 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=Yo9UdVtuDkDBl6CuR0MfMMAKwq7Q53cgtnHN/wYwXy0=; b=VE7veWDiDaEVDLBlTtco68oGhmPQPl3DrgweRn2SNjkpJXGBke/Z2l6RkMxYe8SvuC nkuZSYQxatuo+ahzxlEnOVc1e8t+fRli/nnYZWkE3B0jZjs/zO9rwf0kOC+4kIcafa+4 PJA2L/Syvvc0+vvGm1aYL/+mRYv2Jo/4iIwA4fk4UBOA1SHkKT2n46lp+JucpKMPAwvl K4QHGnoZPK89Tzijc3Czafqcqi22dpBbMvTlNGIAoMNu+5si4Lg/la9gBP1uKgxfQHWu eWlQEBcdpzQJ8Jcuf97KTDcHZdvMhJgKpEp4ZRjpeHjbrheVJ0uQRA4XeYcuDGvQk1P3 2+yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P5Qtd1ps; 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 y23si7992613eds.278.2021.03.08.16.11.42; Mon, 08 Mar 2021 16:12:05 -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=P5Qtd1ps; 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 S231423AbhCIAIQ (ORCPT + 99 others); Mon, 8 Mar 2021 19:08:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:44540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbhCIAH7 (ORCPT ); Mon, 8 Mar 2021 19:07:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 695E061554; Tue, 9 Mar 2021 00:07:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615248479; bh=hh6W4mb3ILZuAEfS/9qpYK9HmLfYcB44uqr5rewvqiY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P5Qtd1psIuOnnPSSLk66PHnUOWZ0U9zWdOh/dEFU3bbnDfny0T2AYUGq50iD47mjA mLbyLRO3bPBooxXftkfNdeN6KimUVhtoXa9WkWxSXvPaX/WnsdxRHMeOToGK1SbEYZ dzaU7HBdq64z2FWXTmiaDLrPOl5uSw3tJMm9VLQFgxgd+Y2YjlOzEPqQer+jly3oSr 7nU1eZZVqHwFQE7Cr4ay8ygLO7olkV+16tM/dAI5wOVL+NMG8KjRVFhATlWL2MT+1r NvnAPLQ/ORo6IEJAZR05uFFIwl4heCyMXWlqNvLDl69BvSsRyo28jSK8XQgXTDWsI6 tsNbJ8+lUJGTQ== Date: Mon, 8 Mar 2021 16:07:57 -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> <05b43d3e-d735-ae34-5a4f-3d81a4fc8a9b@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/05, Chao Yu wrote: > On 2021/3/5 1:50, Jaegeuk Kim wrote: > > On 03/04, Chao Yu wrote: > > > 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 > > > > I meant that too. Why is it like stat, since it's a geomerty? > > Hmm.. I feel a little bit weired to treat ovp_segments as 'stat' class, one reason > is ovp_segments is readonly and is matching the readonly attribute of a stat. It seems I don't fully understand what you suggest here. I don't want to add the # of ovp_segments in /stat, since it is not part of status, but put it in / to sync with other # of free/dirty segments. If you can't read out easily, I suggest to create symlinks to organize all the current mess. > > > > > > > > > > > > > > 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. > > > > I know, but this will diverge those info into different places. I don't have > > big concern when finding a specific entry with this tho, how about making > > symlinks to create a dir structure for your easy access? Or, using a script > > would be alternative way. > > Yes, there should be some alternative ways to help to access f2fs sysfs > interface, but from a point view of user, I'm not sure he can figure out those > ways. > > For those fs meta stat, why not adding a single entry to include all info you > need rather than adding them one by one? e.g. You can add that in /proc as well, which requires to parse back when retrieving specific values. > > /proc/fs/f2fs//super_block > /proc/fs/f2fs//checkpoint > /proc/fs/f2fs//nat_table > /proc/fs/f2fs//sit_table > ... > > Thanks, > > > > > > > > > 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 > > > > . > > > > > > . > >