mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
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
Date: Thu, 4 Mar 2021 15:55:28 +0800	[thread overview]
Message-ID: <05b43d3e-d735-ae34-5a4f-3d81a4fc8a9b@huawei.com> (raw)
In-Reply-To: <YD6HjZG7QMS6Z3Tb@google.com>

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/<disk>/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/<disk>/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 "<disk>" 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 <jaegeuk@kernel.org>
>>>> ---
>>>>    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
> .
> 

  reply	other threads:[~2021-03-04  7:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02  5:42 Jaegeuk Kim
2021-03-02  6:11 ` [f2fs-dev] " Chao Yu
2021-03-02 17:05   ` Jaegeuk Kim
2021-03-02 18:44     ` Jaegeuk Kim
2021-03-04  7:55       ` Chao Yu [this message]
2021-03-04 17:50         ` Jaegeuk Kim
2021-03-05  2:19           ` Chao Yu
2021-03-09  0:07             ` Jaegeuk Kim
2021-03-09  2:50               ` Chao Yu
2021-03-03 19:28 ` [PATCH v2] " Jaegeuk Kim
2021-03-09  9:23   ` [f2fs-dev] " Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05b43d3e-d735-ae34-5a4f-3d81a4fc8a9b@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®