All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-02  5:42 ` Jaegeuk Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-02  5:42 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Jaegeuk Kim

This is useful when checking conditions during checkpoint=disable in Android.

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);
 F2FS_GENERAL_RO_ATTR(lifetime_write_kbytes);
 F2FS_GENERAL_RO_ATTR(features);
 F2FS_GENERAL_RO_ATTR(current_reserved_blocks);
-- 
2.30.1.766.gb4fecdf3b7-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-02  5:42 ` Jaegeuk Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-02  5:42 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Jaegeuk Kim

This is useful when checking conditions during checkpoint=disable in Android.

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);
 F2FS_GENERAL_RO_ATTR(lifetime_write_kbytes);
 F2FS_GENERAL_RO_ATTR(features);
 F2FS_GENERAL_RO_ATTR(current_reserved_blocks);
-- 
2.30.1.766.gb4fecdf3b7-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
  2021-03-02  5:42 ` [f2fs-dev] " Jaegeuk Kim
@ 2021-03-02  6:11   ` Chao Yu
  -1 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-02  6:11 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel, kernel-team

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/?

> 
> 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?

Thanks,

>   F2FS_GENERAL_RO_ATTR(lifetime_write_kbytes);
>   F2FS_GENERAL_RO_ATTR(features);
>   F2FS_GENERAL_RO_ATTR(current_reserved_blocks);
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-02  6:11   ` Chao Yu
  0 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-02  6:11 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel, kernel-team

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/?

> 
> 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?

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
  2021-03-02  6:11   ` Chao Yu
@ 2021-03-02 17:05     ` Jaegeuk Kim
  -1 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-02 17:05 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel, kernel-team

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.

> 
> > 
> > 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);
> > 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-02 17:05     ` Jaegeuk Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-02 17:05 UTC (permalink / raw)
  To: Chao Yu; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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.

> 
> > 
> > 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
  2021-03-02 17:05     ` Jaegeuk Kim
@ 2021-03-02 18:44       ` Jaegeuk Kim
  -1 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-02 18:44 UTC (permalink / raw)
  To: Chao Yu; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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.

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 <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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-02 18:44       ` Jaegeuk Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-02 18:44 UTC (permalink / raw)
  To: Chao Yu; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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.

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 <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


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2] f2fs: expose # of overprivision segments
  2021-03-02  5:42 ` [f2fs-dev] " Jaegeuk Kim
@ 2021-03-03 19:28   ` Jaegeuk Kim
  -1 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-03 19:28 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team

This is useful when checking conditions during checkpoint=disable in Android.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 Documentation/ABI/testing/sysfs-fs-f2fs | 5 +++++
 fs/f2fs/sysfs.c                         | 9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs
index 9fa5a528cc23..4aa8f38b52d7 100644
--- a/Documentation/ABI/testing/sysfs-fs-f2fs
+++ b/Documentation/ABI/testing/sysfs-fs-f2fs
@@ -409,3 +409,8 @@ Description:	Give a way to change checkpoint merge daemon's io priority.
 		I/O priority "3". We can select the class between "rt" and "be",
 		and set the I/O priority within valid range of it. "," delimiter
 		is necessary in between I/O class and priority number.
+
+What:		/sys/fs/f2fs/<disk>/ovp_segments
+Date:		March 2021
+Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
+Description:	Shows the number of overprovision segments.
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index e38a7f6921dd..0c391ab2d8b7 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);
 F2FS_GENERAL_RO_ATTR(lifetime_write_kbytes);
 F2FS_GENERAL_RO_ATTR(features);
 F2FS_GENERAL_RO_ATTR(current_reserved_blocks);
@@ -715,6 +723,7 @@ static struct attribute *f2fs_attrs[] = {
 	ATTR_LIST(ckpt_thread_ioprio),
 	ATTR_LIST(dirty_segments),
 	ATTR_LIST(free_segments),
+	ATTR_LIST(ovp_segments),
 	ATTR_LIST(unusable),
 	ATTR_LIST(lifetime_write_kbytes),
 	ATTR_LIST(features),
-- 
2.31.0.rc0.254.gbdcc3b1a9d-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: expose # of overprivision segments
@ 2021-03-03 19:28   ` Jaegeuk Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-03 19:28 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team

This is useful when checking conditions during checkpoint=disable in Android.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 Documentation/ABI/testing/sysfs-fs-f2fs | 5 +++++
 fs/f2fs/sysfs.c                         | 9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs
index 9fa5a528cc23..4aa8f38b52d7 100644
--- a/Documentation/ABI/testing/sysfs-fs-f2fs
+++ b/Documentation/ABI/testing/sysfs-fs-f2fs
@@ -409,3 +409,8 @@ Description:	Give a way to change checkpoint merge daemon's io priority.
 		I/O priority "3". We can select the class between "rt" and "be",
 		and set the I/O priority within valid range of it. "," delimiter
 		is necessary in between I/O class and priority number.
+
+What:		/sys/fs/f2fs/<disk>/ovp_segments
+Date:		March 2021
+Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
+Description:	Shows the number of overprovision segments.
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index e38a7f6921dd..0c391ab2d8b7 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);
 F2FS_GENERAL_RO_ATTR(lifetime_write_kbytes);
 F2FS_GENERAL_RO_ATTR(features);
 F2FS_GENERAL_RO_ATTR(current_reserved_blocks);
@@ -715,6 +723,7 @@ static struct attribute *f2fs_attrs[] = {
 	ATTR_LIST(ckpt_thread_ioprio),
 	ATTR_LIST(dirty_segments),
 	ATTR_LIST(free_segments),
+	ATTR_LIST(ovp_segments),
 	ATTR_LIST(unusable),
 	ATTR_LIST(lifetime_write_kbytes),
 	ATTR_LIST(features),
-- 
2.31.0.rc0.254.gbdcc3b1a9d-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
  2021-03-02 18:44       ` Jaegeuk Kim
@ 2021-03-04  7:55         ` Chao Yu
  -1 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-04  7:55 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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
> .
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-04  7:55         ` Chao Yu
  0 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-04  7:55 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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
> .
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
  2021-03-04  7:55         ` Chao Yu
@ 2021-03-04 17:50           ` Jaegeuk Kim
  -1 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-04 17:50 UTC (permalink / raw)
  To: Chao Yu; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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/<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

I meant that too. Why is it like stat, since it's a geomerty?

> 
> > 
> > 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.

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.

> 
> 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
> > .
> > 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-04 17:50           ` Jaegeuk Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-04 17:50 UTC (permalink / raw)
  To: Chao Yu; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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/<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

I meant that too. Why is it like stat, since it's a geomerty?

> 
> > 
> > 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.

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.

> 
> 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
> > .
> > 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
  2021-03-04 17:50           ` Jaegeuk Kim
@ 2021-03-05  2:19             ` Chao Yu
  -1 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-05  2:19 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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/<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
> 
> 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.

> 
>>
>>>
>>> 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.
> 
> 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.

/proc/fs/f2fs/<disk>/super_block
/proc/fs/f2fs/<disk>/checkpoint
/proc/fs/f2fs/<disk>/nat_table
/proc/fs/f2fs/<disk>/sit_table
...

Thanks,

> 
>>
>> 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
>>> .
>>>
> .
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-05  2:19             ` Chao Yu
  0 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-05  2:19 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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/<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
> 
> 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.

> 
>>
>>>
>>> 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.
> 
> 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.

/proc/fs/f2fs/<disk>/super_block
/proc/fs/f2fs/<disk>/checkpoint
/proc/fs/f2fs/<disk>/nat_table
/proc/fs/f2fs/<disk>/sit_table
...

Thanks,

> 
>>
>> 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
>>> .
>>>
> .
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
  2021-03-05  2:19             ` Chao Yu
@ 2021-03-09  0:07               ` Jaegeuk Kim
  -1 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-09  0:07 UTC (permalink / raw)
  To: Chao Yu; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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/<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
> > 
> > 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 <disk>/stat, since it is not part of status, but put it in
<disk>/ 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 "<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.
> > 
> > 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/<disk>/super_block
> /proc/fs/f2fs/<disk>/checkpoint
> /proc/fs/f2fs/<disk>/nat_table
> /proc/fs/f2fs/<disk>/sit_table
> ...
> 
> Thanks,
> 
> > 
> > > 
> > > 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
> > > > .
> > > > 
> > .
> > 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-09  0:07               ` Jaegeuk Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Jaegeuk Kim @ 2021-03-09  0:07 UTC (permalink / raw)
  To: Chao Yu; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

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/<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
> > 
> > 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 <disk>/stat, since it is not part of status, but put it in
<disk>/ 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 "<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.
> > 
> > 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/<disk>/super_block
> /proc/fs/f2fs/<disk>/checkpoint
> /proc/fs/f2fs/<disk>/nat_table
> /proc/fs/f2fs/<disk>/sit_table
> ...
> 
> Thanks,
> 
> > 
> > > 
> > > 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
> > > > .
> > > > 
> > .
> > 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
  2021-03-09  0:07               ` Jaegeuk Kim
@ 2021-03-09  2:50                 ` Chao Yu
  -1 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-09  2:50 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

On 2021/3/9 8:07, Jaegeuk Kim wrote:
> 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/<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
>>>
>>> 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 <disk>/stat, since it is not part of status, but put it in
> <disk>/ 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.

Alright.

> 
>>
>>>
>>>>
>>>>>
>>>>> 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.
>>>
>>> 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.

Copied.

Thanks,

> 
>>
>> /proc/fs/f2fs/<disk>/super_block
>> /proc/fs/f2fs/<disk>/checkpoint
>> /proc/fs/f2fs/<disk>/nat_table
>> /proc/fs/f2fs/<disk>/sit_table
>> ...
>>
>> Thanks,
>>
>>>
>>>>
>>>> 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
>>>>> .
>>>>>
>>> .
>>>
> .
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments
@ 2021-03-09  2:50                 ` Chao Yu
  0 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-09  2:50 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: kernel-team, linux-kernel, linux-f2fs-devel

On 2021/3/9 8:07, Jaegeuk Kim wrote:
> 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/<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
>>>
>>> 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 <disk>/stat, since it is not part of status, but put it in
> <disk>/ 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.

Alright.

> 
>>
>>>
>>>>
>>>>>
>>>>> 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.
>>>
>>> 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.

Copied.

Thanks,

> 
>>
>> /proc/fs/f2fs/<disk>/super_block
>> /proc/fs/f2fs/<disk>/checkpoint
>> /proc/fs/f2fs/<disk>/nat_table
>> /proc/fs/f2fs/<disk>/sit_table
>> ...
>>
>> Thanks,
>>
>>>
>>>>
>>>> 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
>>>>> .
>>>>>
>>> .
>>>
> .
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: expose # of overprivision segments
  2021-03-03 19:28   ` [f2fs-dev] " Jaegeuk Kim
@ 2021-03-09  9:23     ` Chao Yu
  -1 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-09  9:23 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel, kernel-team

On 2021/3/4 3:28, Jaegeuk Kim wrote:
> This is useful when checking conditions during checkpoint=disable in Android.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: expose # of overprivision segments
@ 2021-03-09  9:23     ` Chao Yu
  0 siblings, 0 replies; 22+ messages in thread
From: Chao Yu @ 2021-03-09  9:23 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel, kernel-team

On 2021/3/4 3:28, Jaegeuk Kim wrote:
> This is useful when checking conditions during checkpoint=disable in Android.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-03-09  9:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02  5:42 [PATCH] f2fs: expose # of overprivision segments Jaegeuk Kim
2021-03-02  5:42 ` [f2fs-dev] " Jaegeuk Kim
2021-03-02  6:11 ` Chao Yu
2021-03-02  6:11   ` Chao Yu
2021-03-02 17:05   ` Jaegeuk Kim
2021-03-02 17:05     ` Jaegeuk Kim
2021-03-02 18:44     ` Jaegeuk Kim
2021-03-02 18:44       ` Jaegeuk Kim
2021-03-04  7:55       ` Chao Yu
2021-03-04  7:55         ` Chao Yu
2021-03-04 17:50         ` Jaegeuk Kim
2021-03-04 17:50           ` Jaegeuk Kim
2021-03-05  2:19           ` Chao Yu
2021-03-05  2:19             ` Chao Yu
2021-03-09  0:07             ` Jaegeuk Kim
2021-03-09  0:07               ` Jaegeuk Kim
2021-03-09  2:50               ` Chao Yu
2021-03-09  2:50                 ` Chao Yu
2021-03-03 19:28 ` [PATCH v2] " Jaegeuk Kim
2021-03-03 19:28   ` [f2fs-dev] " Jaegeuk Kim
2021-03-09  9:23   ` Chao Yu
2021-03-09  9:23     ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.