All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: make gc_idle sysfs node readable
@ 2022-10-21  8:26 ` Yangtao Li via Linux-f2fs-devel
  0 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2022-10-21  8:26 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-f2fs-devel, linux-kernel, Yangtao Li

Changed a way of showing values of them to use strings.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/f2fs/sysfs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index b4476adea776..555849d4c744 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -332,6 +332,10 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
 		return sysfs_emit(buf, "%u\n", sbi->compr_new_inode);
 #endif
 
+	if (!strcmp(a->attr.name, "gc_idle"))
+		return sysfs_emit(buf, "%s\n",
+				gc_mode_names[sbi->gc_mode]);
+
 	if (!strcmp(a->attr.name, "gc_urgent"))
 		return sysfs_emit(buf, "%s\n",
 				gc_mode_names[sbi->gc_mode]);
-- 
2.25.1


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

* [f2fs-dev] [PATCH] f2fs: make gc_idle sysfs node readable
@ 2022-10-21  8:26 ` Yangtao Li via Linux-f2fs-devel
  0 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li via Linux-f2fs-devel @ 2022-10-21  8:26 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: Yangtao Li, linux-kernel, linux-f2fs-devel

Changed a way of showing values of them to use strings.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/f2fs/sysfs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index b4476adea776..555849d4c744 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -332,6 +332,10 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
 		return sysfs_emit(buf, "%u\n", sbi->compr_new_inode);
 #endif
 
+	if (!strcmp(a->attr.name, "gc_idle"))
+		return sysfs_emit(buf, "%s\n",
+				gc_mode_names[sbi->gc_mode]);
+
 	if (!strcmp(a->attr.name, "gc_urgent"))
 		return sysfs_emit(buf, "%s\n",
 				gc_mode_names[sbi->gc_mode]);
-- 
2.25.1



_______________________________________________
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] 8+ messages in thread

* Re: [PATCH] f2fs: make gc_idle sysfs node readable
  2022-10-21  8:26 ` [f2fs-dev] " Yangtao Li via Linux-f2fs-devel
@ 2022-10-25  1:53   ` Chao Yu
  -1 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-10-25  1:53 UTC (permalink / raw)
  To: Yangtao Li, jaegeuk; +Cc: linux-f2fs-devel, linux-kernel

On 2022/10/21 16:26, Yangtao Li wrote:
> Changed a way of showing values of them to use strings.

This change breaks forward compatibility of gc_idle interface.

Thanks,

> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>   fs/f2fs/sysfs.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> index b4476adea776..555849d4c744 100644
> --- a/fs/f2fs/sysfs.c
> +++ b/fs/f2fs/sysfs.c
> @@ -332,6 +332,10 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
>   		return sysfs_emit(buf, "%u\n", sbi->compr_new_inode);
>   #endif
>   
> +	if (!strcmp(a->attr.name, "gc_idle"))
> +		return sysfs_emit(buf, "%s\n",
> +				gc_mode_names[sbi->gc_mode]);
> +
>   	if (!strcmp(a->attr.name, "gc_urgent"))
>   		return sysfs_emit(buf, "%s\n",
>   				gc_mode_names[sbi->gc_mode]);

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

* Re: [f2fs-dev] [PATCH] f2fs: make gc_idle sysfs node readable
@ 2022-10-25  1:53   ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-10-25  1:53 UTC (permalink / raw)
  To: Yangtao Li, jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

On 2022/10/21 16:26, Yangtao Li wrote:
> Changed a way of showing values of them to use strings.

This change breaks forward compatibility of gc_idle interface.

Thanks,

> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>   fs/f2fs/sysfs.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> index b4476adea776..555849d4c744 100644
> --- a/fs/f2fs/sysfs.c
> +++ b/fs/f2fs/sysfs.c
> @@ -332,6 +332,10 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
>   		return sysfs_emit(buf, "%u\n", sbi->compr_new_inode);
>   #endif
>   
> +	if (!strcmp(a->attr.name, "gc_idle"))
> +		return sysfs_emit(buf, "%s\n",
> +				gc_mode_names[sbi->gc_mode]);
> +
>   	if (!strcmp(a->attr.name, "gc_urgent"))
>   		return sysfs_emit(buf, "%s\n",
>   				gc_mode_names[sbi->gc_mode]);


_______________________________________________
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] 8+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: make gc_idle sysfs node readable
  2022-10-25  1:53   ` [f2fs-dev] " Chao Yu
@ 2022-10-25  2:33     ` Yangtao Li via Linux-f2fs-devel
  -1 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2022-10-25  2:33 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-f2fs-devel, linux-kernel

Hi Chao,

What:       /sys/fs/f2fs/<disk>/gc_idle
Date:       July 2013
Contact:    "Namjae Jeon" <namjae.jeon@samsung.com>
Description:    Controls the victim selection policy for garbage collection.
        Setting gc_idle = 0(default) will disable this option. Setting:

        ===========  ===============================================
        gc_idle = 1  will select the Cost Benefit approach & setting
        gc_idle = 2  will select the greedy approach & setting
        gc_idle = 3  will select the age-threshold based approach.
        ===========  ===============================================

From the kernel documentation, this node only describes the writing of
the value, and does not describe the reading of the value.

Actually, this modification does the same thing as commit e60aeb2dee1a
("f2fs: make gc_urgent and gc_segment_mode sysfs node readabl").
I understand it is an addition to the omission of the patch above.

Why gc_urgent and gc_segment_mode can be modified to string, but gc_idle
breaks forward compatibility?

Thanks,

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

* Re: [f2fs-dev] [PATCH] f2fs: make gc_idle sysfs node readable
@ 2022-10-25  2:33     ` Yangtao Li via Linux-f2fs-devel
  0 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li via Linux-f2fs-devel @ 2022-10-25  2:33 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-kernel, linux-f2fs-devel

Hi Chao,

What:       /sys/fs/f2fs/<disk>/gc_idle
Date:       July 2013
Contact:    "Namjae Jeon" <namjae.jeon@samsung.com>
Description:    Controls the victim selection policy for garbage collection.
        Setting gc_idle = 0(default) will disable this option. Setting:

        ===========  ===============================================
        gc_idle = 1  will select the Cost Benefit approach & setting
        gc_idle = 2  will select the greedy approach & setting
        gc_idle = 3  will select the age-threshold based approach.
        ===========  ===============================================

From the kernel documentation, this node only describes the writing of
the value, and does not describe the reading of the value.

Actually, this modification does the same thing as commit e60aeb2dee1a
("f2fs: make gc_urgent and gc_segment_mode sysfs node readabl").
I understand it is an addition to the omission of the patch above.

Why gc_urgent and gc_segment_mode can be modified to string, but gc_idle
breaks forward compatibility?

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] 8+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: make gc_idle sysfs node readable
  2022-10-25  2:33     ` Yangtao Li via Linux-f2fs-devel
@ 2022-10-25  2:51       ` Chao Yu
  -1 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-10-25  2:51 UTC (permalink / raw)
  To: Yangtao Li, jaegeuk; +Cc: linux-f2fs-devel, linux-kernel

On 2022/10/25 10:33, Yangtao Li wrote:
> Hi Chao,
> 
> What:       /sys/fs/f2fs/<disk>/gc_idle
> Date:       July 2013
> Contact:    "Namjae Jeon" <namjae.jeon@samsung.com>
> Description:    Controls the victim selection policy for garbage collection.
>          Setting gc_idle = 0(default) will disable this option. Setting:
> 
>          ===========  ===============================================
>          gc_idle = 1  will select the Cost Benefit approach & setting
>          gc_idle = 2  will select the greedy approach & setting
>          gc_idle = 3  will select the age-threshold based approach.
>          ===========  ===============================================
> 
>  From the kernel documentation, this node only describes the writing of
> the value, and does not describe the reading of the value.

  If the value is used by userspace program, after the change, it will break
userspace.

> 
> Actually, this modification does the same thing as commit e60aeb2dee1a
> ("f2fs: make gc_urgent and gc_segment_mode sysfs node readabl").
> I understand it is an addition to the omission of the patch above.
> 
> Why gc_urgent and gc_segment_mode can be modified to string, but gc_idle
> breaks forward compatibility?

Oops, I guess that patch may have caused a regression...if there is any
user..

> 
> Thanks,

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

* Re: [f2fs-dev] [PATCH] f2fs: make gc_idle sysfs node readable
@ 2022-10-25  2:51       ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-10-25  2:51 UTC (permalink / raw)
  To: Yangtao Li, jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

On 2022/10/25 10:33, Yangtao Li wrote:
> Hi Chao,
> 
> What:       /sys/fs/f2fs/<disk>/gc_idle
> Date:       July 2013
> Contact:    "Namjae Jeon" <namjae.jeon@samsung.com>
> Description:    Controls the victim selection policy for garbage collection.
>          Setting gc_idle = 0(default) will disable this option. Setting:
> 
>          ===========  ===============================================
>          gc_idle = 1  will select the Cost Benefit approach & setting
>          gc_idle = 2  will select the greedy approach & setting
>          gc_idle = 3  will select the age-threshold based approach.
>          ===========  ===============================================
> 
>  From the kernel documentation, this node only describes the writing of
> the value, and does not describe the reading of the value.

  If the value is used by userspace program, after the change, it will break
userspace.

> 
> Actually, this modification does the same thing as commit e60aeb2dee1a
> ("f2fs: make gc_urgent and gc_segment_mode sysfs node readabl").
> I understand it is an addition to the omission of the patch above.
> 
> Why gc_urgent and gc_segment_mode can be modified to string, but gc_idle
> breaks forward compatibility?

Oops, I guess that patch may have caused a regression...if there is any
user..

> 
> 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] 8+ messages in thread

end of thread, other threads:[~2022-10-25  2:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21  8:26 [PATCH] f2fs: make gc_idle sysfs node readable Yangtao Li
2022-10-21  8:26 ` [f2fs-dev] " Yangtao Li via Linux-f2fs-devel
2022-10-25  1:53 ` Chao Yu
2022-10-25  1:53   ` [f2fs-dev] " Chao Yu
2022-10-25  2:33   ` Yangtao Li
2022-10-25  2:33     ` Yangtao Li via Linux-f2fs-devel
2022-10-25  2:51     ` Chao Yu
2022-10-25  2:51       ` 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.