Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files
       [not found] ` <20241010152215.3025842-1-yukaixiong@huawei.com>
@ 2024-10-11 13:04   ` Liam R. Howlett
  2024-10-14  1:33     ` yukaixiong
       [not found]   ` <20241010152215.3025842-10-yukaixiong@huawei.com>
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Liam R. Howlett @ 2024-10-11 13:04 UTC (permalink / raw)
  To: Kaixiong Yu
  Cc: akpm, mcgrof, ysato, dalias, glaubitz, luto, tglx, mingo, bp,
	dave.hansen, hpa, viro, brauner, jack, kees, j.granados, willy,
	vbabka, lorenzo.stoakes, trondmy, anna, chuck.lever, jlayton,
	neilb, okorniev, Dai.Ngo, tom, davem, edumazet, kuba, pabeni,
	paul, jmorris, linux-sh, linux-kernel, linux-fsdevel, linux-mm,
	linux-nfs, netdev, linux-security-module, dhowells, haifeng.xu,
	baolin.wang, shikemeng, dchinner, bfoster, souravpanda, hannes,
	rientjes, pasha.tatashin, david, ryan.roberts, ying.huang, yang,
	zev, serge, vegard.nossum, wangkefeng.wang, sunnanyong

* Kaixiong Yu <yukaixiong@huawei.com> [241010 10:11]:
> This patch series moves sysctls of vm_table in kernel/sysctl.c to
> places where they actually belong, and do some related code clean-ups.
> After this patch series, all sysctls in vm_table have been moved into its
> own files, meanwhile, delete vm_table.
> 
> All the modifications of this patch series base on
> linux-next(tags/next-20241010). To test this patch series, the code was
> compiled with both the CONFIG_SYSCTL enabled and disabled on arm64 and
> x86_64 architectures. After this patch series is applied, all files
> under /proc/sys/vm can be read or written normally.

This change set moves nommu code out of the common code into the nommu.c
file (which is nice), but the above text implies that no testing was
performed on that code.  Could we have some basic compile/boot testing
for nommu?

> 
> Changes in v3:
>  - change patch1~10, patch14 title suggested by Joel Granados
>  - change sysctl_stat_interval to static type in patch1
>  - add acked-by from Paul Moore in patch7
>  - change dirtytime_expire_interval to static type in patch9
>  - add acked-by from Anna Schumaker in patch11
> 
> Changes in v2:
>  - fix sysctl_max_map_count undeclared issue in mm/nommu.c for patch6
>  - update changelog for patch7/12, suggested by Kees/Paul
>  - fix patch8, sorry for wrong changes and forget to built with NOMMU
>  - add reviewed-by from Kees except patch8 since patch8 is wrong in v1
>  - add reviewed-by from Jan Kara, Christian Brauner in patch12
> 
> Kaixiong Yu (15):
>   mm: vmstat: move sysctls to mm/vmstat.c
>   mm: filemap: move sysctl to mm/filemap.c
>   mm: swap: move sysctl to mm/swap.c
>   mm: vmscan: move vmscan sysctls to mm/vmscan.c
>   mm: util: move sysctls to mm/util.c
>   mm: mmap: move sysctl to mm/mmap.c
>   security: min_addr: move sysctl to security/min_addr.c
>   mm: nommu: move sysctl to mm/nommu.c
>   fs: fs-writeback: move sysctl to fs/fs-writeback.c
>   fs: drop_caches: move sysctl to fs/drop_caches.c
>   sunrpc: use vfs_pressure_ratio() helper
>   fs: dcache: move the sysctl to fs/dcache.c
>   x86: vdso: move the sysctl to arch/x86/entry/vdso/vdso32-setup.c
>   sh: vdso: move the sysctl to arch/sh/kernel/vsyscall/vsyscall.c
>   sysctl: remove unneeded include
> 
>  arch/sh/kernel/vsyscall/vsyscall.c |  14 ++
>  arch/x86/entry/vdso/vdso32-setup.c |  16 ++-
>  fs/dcache.c                        |  21 ++-
>  fs/drop_caches.c                   |  23 ++-
>  fs/fs-writeback.c                  |  30 ++--
>  include/linux/dcache.h             |   7 +-
>  include/linux/mm.h                 |  23 ---
>  include/linux/mman.h               |   2 -
>  include/linux/swap.h               |   9 --
>  include/linux/vmstat.h             |  11 --
>  include/linux/writeback.h          |   4 -
>  kernel/sysctl.c                    | 221 -----------------------------
>  mm/filemap.c                       |  18 ++-
>  mm/internal.h                      |  10 ++
>  mm/mmap.c                          |  54 +++++++
>  mm/nommu.c                         |  15 +-
>  mm/swap.c                          |  16 ++-
>  mm/swap.h                          |   1 +
>  mm/util.c                          |  67 +++++++--
>  mm/vmscan.c                        |  23 +++
>  mm/vmstat.c                        |  44 +++++-
>  net/sunrpc/auth.c                  |   2 +-
>  security/min_addr.c                |  11 ++
>  23 files changed, 330 insertions(+), 312 deletions(-)
> 
> -- 
> 2.34.1
> 

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

* Re: [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files
  2024-10-11 13:04   ` [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files Liam R. Howlett
@ 2024-10-14  1:33     ` yukaixiong
  0 siblings, 0 replies; 9+ messages in thread
From: yukaixiong @ 2024-10-14  1:33 UTC (permalink / raw)
  To: Liam R. Howlett, akpm, mcgrof, ysato, dalias, glaubitz, luto,
	tglx, mingo, bp, dave.hansen, hpa, viro, brauner, jack, kees,
	j.granados, willy, vbabka, lorenzo.stoakes, trondmy, anna,
	chuck.lever, jlayton, neilb, okorniev, Dai.Ngo, tom, davem,
	edumazet, kuba, pabeni, paul, jmorris, linux-sh, linux-kernel,
	linux-fsdevel, linux-mm, linux-nfs, netdev, linux-security-module,
	dhowells, haifeng.xu, baolin.wang, shikemeng, dchinner, bfoster,
	souravpanda, hannes, rientjes, pasha.tatashin, david,
	ryan.roberts, ying.huang, yang, zev, serge, vegard.nossum,
	wangkefeng.wang, sunnanyong



On 2024/10/11 21:04, Liam R. Howlett wrote:
> * Kaixiong Yu <yukaixiong@huawei.com> [241010 10:11]:
>> This patch series moves sysctls of vm_table in kernel/sysctl.c to
>> places where they actually belong, and do some related code clean-ups.
>> After this patch series, all sysctls in vm_table have been moved into its
>> own files, meanwhile, delete vm_table.
>>
>> All the modifications of this patch series base on
>> linux-next(tags/next-20241010). To test this patch series, the code was
>> compiled with both the CONFIG_SYSCTL enabled and disabled on arm64 and
>> x86_64 architectures. After this patch series is applied, all files
>> under /proc/sys/vm can be read or written normally.
> This change set moves nommu code out of the common code into the nommu.c
> file (which is nice), but the above text implies that no testing was
> performed on that code.  Could we have some basic compile/boot testing
> for nommu?
this patch series has been compiled with CONFIG_MMU=n on arm,and produce
nommu.o without error and warning. But I don't have machine to do test 
for nommu.
>> Changes in v3:
>>   - change patch1~10, patch14 title suggested by Joel Granados
>>   - change sysctl_stat_interval to static type in patch1
>>   - add acked-by from Paul Moore in patch7
>>   - change dirtytime_expire_interval to static type in patch9
>>   - add acked-by from Anna Schumaker in patch11
>>
>> Changes in v2:
>>   - fix sysctl_max_map_count undeclared issue in mm/nommu.c for patch6
>>   - update changelog for patch7/12, suggested by Kees/Paul
>>   - fix patch8, sorry for wrong changes and forget to built with NOMMU
>>   - add reviewed-by from Kees except patch8 since patch8 is wrong in v1
>>   - add reviewed-by from Jan Kara, Christian Brauner in patch12
>>
>> Kaixiong Yu (15):
>>    mm: vmstat: move sysctls to mm/vmstat.c
>>    mm: filemap: move sysctl to mm/filemap.c
>>    mm: swap: move sysctl to mm/swap.c
>>    mm: vmscan: move vmscan sysctls to mm/vmscan.c
>>    mm: util: move sysctls to mm/util.c
>>    mm: mmap: move sysctl to mm/mmap.c
>>    security: min_addr: move sysctl to security/min_addr.c
>>    mm: nommu: move sysctl to mm/nommu.c
>>    fs: fs-writeback: move sysctl to fs/fs-writeback.c
>>    fs: drop_caches: move sysctl to fs/drop_caches.c
>>    sunrpc: use vfs_pressure_ratio() helper
>>    fs: dcache: move the sysctl to fs/dcache.c
>>    x86: vdso: move the sysctl to arch/x86/entry/vdso/vdso32-setup.c
>>    sh: vdso: move the sysctl to arch/sh/kernel/vsyscall/vsyscall.c
>>    sysctl: remove unneeded include
>>
>>   arch/sh/kernel/vsyscall/vsyscall.c |  14 ++
>>   arch/x86/entry/vdso/vdso32-setup.c |  16 ++-
>>   fs/dcache.c                        |  21 ++-
>>   fs/drop_caches.c                   |  23 ++-
>>   fs/fs-writeback.c                  |  30 ++--
>>   include/linux/dcache.h             |   7 +-
>>   include/linux/mm.h                 |  23 ---
>>   include/linux/mman.h               |   2 -
>>   include/linux/swap.h               |   9 --
>>   include/linux/vmstat.h             |  11 --
>>   include/linux/writeback.h          |   4 -
>>   kernel/sysctl.c                    | 221 -----------------------------
>>   mm/filemap.c                       |  18 ++-
>>   mm/internal.h                      |  10 ++
>>   mm/mmap.c                          |  54 +++++++
>>   mm/nommu.c                         |  15 +-
>>   mm/swap.c                          |  16 ++-
>>   mm/swap.h                          |   1 +
>>   mm/util.c                          |  67 +++++++--
>>   mm/vmscan.c                        |  23 +++
>>   mm/vmstat.c                        |  44 +++++-
>>   net/sunrpc/auth.c                  |   2 +-
>>   security/min_addr.c                |  11 ++
>>   23 files changed, 330 insertions(+), 312 deletions(-)
>>
>> -- 
>> 2.34.1
>>
> .
>


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

* Re: [PATCH v3 -next 09/15] fs: fs-writeback: move sysctl to fs/fs-writeback.c
       [not found]   ` <20241010152215.3025842-10-yukaixiong@huawei.com>
@ 2024-10-14 12:14     ` Jan Kara
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Kara @ 2024-10-14 12:14 UTC (permalink / raw)
  To: Kaixiong Yu
  Cc: akpm, mcgrof, ysato, dalias, glaubitz, luto, tglx, mingo, bp,
	dave.hansen, hpa, viro, brauner, jack, kees, j.granados, willy,
	Liam.Howlett, vbabka, lorenzo.stoakes, trondmy, anna, chuck.lever,
	jlayton, neilb, okorniev, Dai.Ngo, tom, davem, edumazet, kuba,
	pabeni, paul, jmorris, linux-sh, linux-kernel, linux-fsdevel,
	linux-mm, linux-nfs, netdev, linux-security-module, dhowells,
	haifeng.xu, baolin.wang, shikemeng, dchinner, bfoster,
	souravpanda, hannes, rientjes, pasha.tatashin, david,
	ryan.roberts, ying.huang, yang, zev, serge, vegard.nossum,
	wangkefeng.wang, sunnanyong

On Thu 10-10-24 23:22:09, Kaixiong Yu wrote:
> The dirtytime_expire_interval belongs to fs/fs-writeback.c, move it to
> fs/fs-writeback.c from /kernel/sysctl.c. And remove the useless extern
> variable declaration and the function declaration from
> include/linux/writeback.h
> 
> Signed-off-by: Kaixiong Yu <yukaixiong@huawei.com>
> Reviewed-by: Kees Cook <kees@kernel.org>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
> v3:
>  - change dirtytime_expire_interval to static type
>  - change the title
> ---
>  fs/fs-writeback.c         | 30 +++++++++++++++++++++---------
>  include/linux/writeback.h |  4 ----
>  kernel/sysctl.c           |  8 --------
>  3 files changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index d8bec3c1bb1f..4fedefdb8e15 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -65,7 +65,7 @@ struct wb_writeback_work {
>   * timestamps written to disk after 12 hours, but in the worst case a
>   * few inodes might not their timestamps updated for 24 hours.
>   */
> -unsigned int dirtytime_expire_interval = 12 * 60 * 60;
> +static unsigned int dirtytime_expire_interval = 12 * 60 * 60;
>  
>  static inline struct inode *wb_inode(struct list_head *head)
>  {
> @@ -2413,14 +2413,7 @@ static void wakeup_dirtytime_writeback(struct work_struct *w)
>  	schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
>  }
>  
> -static int __init start_dirtytime_writeback(void)
> -{
> -	schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
> -	return 0;
> -}
> -__initcall(start_dirtytime_writeback);
> -
> -int dirtytime_interval_handler(const struct ctl_table *table, int write,
> +static int dirtytime_interval_handler(const struct ctl_table *table, int write,
>  			       void *buffer, size_t *lenp, loff_t *ppos)
>  {
>  	int ret;
> @@ -2431,6 +2424,25 @@ int dirtytime_interval_handler(const struct ctl_table *table, int write,
>  	return ret;
>  }
>  
> +static struct ctl_table vm_fs_writeback_table[] = {
> +	{
> +		.procname	= "dirtytime_expire_seconds",
> +		.data		= &dirtytime_expire_interval,
> +		.maxlen		= sizeof(dirtytime_expire_interval),
> +		.mode		= 0644,
> +		.proc_handler	= dirtytime_interval_handler,
> +		.extra1		= SYSCTL_ZERO,
> +	},
> +};
> +
> +static int __init start_dirtytime_writeback(void)
> +{
> +	schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
> +	register_sysctl_init("vm", vm_fs_writeback_table);
> +	return 0;
> +}
> +__initcall(start_dirtytime_writeback);
> +
>  /**
>   * __mark_inode_dirty -	internal function to mark an inode dirty
>   *
> diff --git a/include/linux/writeback.h b/include/linux/writeback.h
> index d6db822e4bb3..5f35b24aff7b 100644
> --- a/include/linux/writeback.h
> +++ b/include/linux/writeback.h
> @@ -351,12 +351,8 @@ extern struct wb_domain global_wb_domain;
>  /* These are exported to sysctl. */
>  extern unsigned int dirty_writeback_interval;
>  extern unsigned int dirty_expire_interval;
> -extern unsigned int dirtytime_expire_interval;
>  extern int laptop_mode;
>  
> -int dirtytime_interval_handler(const struct ctl_table *table, int write,
> -		void *buffer, size_t *lenp, loff_t *ppos);
> -
>  void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
>  unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh);
>  unsigned long cgwb_calc_thresh(struct bdi_writeback *wb);
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index d3de31ec74bf..373e018b950c 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -2024,14 +2024,6 @@ static struct ctl_table kern_table[] = {
>  };
>  
>  static struct ctl_table vm_table[] = {
> -	{
> -		.procname	= "dirtytime_expire_seconds",
> -		.data		= &dirtytime_expire_interval,
> -		.maxlen		= sizeof(dirtytime_expire_interval),
> -		.mode		= 0644,
> -		.proc_handler	= dirtytime_interval_handler,
> -		.extra1		= SYSCTL_ZERO,
> -	},
>  	{
>  		.procname	= "drop_caches",
>  		.data		= &sysctl_drop_caches,
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH v3 -next 10/15] fs: drop_caches: move sysctl to fs/drop_caches.c
       [not found]   ` <20241010152215.3025842-11-yukaixiong@huawei.com>
@ 2024-10-14 12:15     ` Jan Kara
  2024-10-15 14:02     ` Christian Brauner
  1 sibling, 0 replies; 9+ messages in thread
From: Jan Kara @ 2024-10-14 12:15 UTC (permalink / raw)
  To: Kaixiong Yu
  Cc: akpm, mcgrof, ysato, dalias, glaubitz, luto, tglx, mingo, bp,
	dave.hansen, hpa, viro, brauner, jack, kees, j.granados, willy,
	Liam.Howlett, vbabka, lorenzo.stoakes, trondmy, anna, chuck.lever,
	jlayton, neilb, okorniev, Dai.Ngo, tom, davem, edumazet, kuba,
	pabeni, paul, jmorris, linux-sh, linux-kernel, linux-fsdevel,
	linux-mm, linux-nfs, netdev, linux-security-module, dhowells,
	haifeng.xu, baolin.wang, shikemeng, dchinner, bfoster,
	souravpanda, hannes, rientjes, pasha.tatashin, david,
	ryan.roberts, ying.huang, yang, zev, serge, vegard.nossum,
	wangkefeng.wang, sunnanyong

On Thu 10-10-24 23:22:10, Kaixiong Yu wrote:
> The sysctl_drop_caches to fs/drop_caches.c, move it to
> fs/drop_caches.c from /kernel/sysctl.c. And remove the
> useless extern variable declaration from include/linux/mm.h
> 
> Signed-off-by: Kaixiong Yu <yukaixiong@huawei.com>
> Reviewed-by: Kees Cook <kees@kernel.org>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
> v3:
>  - change the title
> ---
>  fs/drop_caches.c   | 23 +++++++++++++++++++++--
>  include/linux/mm.h |  6 ------
>  kernel/sysctl.c    |  9 ---------
>  3 files changed, 21 insertions(+), 17 deletions(-)
> 
> diff --git a/fs/drop_caches.c b/fs/drop_caches.c
> index d45ef541d848..f2551ace800f 100644
> --- a/fs/drop_caches.c
> +++ b/fs/drop_caches.c
> @@ -14,7 +14,7 @@
>  #include "internal.h"
>  
>  /* A global variable is a bit ugly, but it keeps the code simple */
> -int sysctl_drop_caches;
> +static int sysctl_drop_caches;
>  
>  static void drop_pagecache_sb(struct super_block *sb, void *unused)
>  {
> @@ -48,7 +48,7 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused)
>  	iput(toput_inode);
>  }
>  
> -int drop_caches_sysctl_handler(const struct ctl_table *table, int write,
> +static int drop_caches_sysctl_handler(const struct ctl_table *table, int write,
>  		void *buffer, size_t *length, loff_t *ppos)
>  {
>  	int ret;
> @@ -77,3 +77,22 @@ int drop_caches_sysctl_handler(const struct ctl_table *table, int write,
>  	}
>  	return 0;
>  }
> +
> +static struct ctl_table drop_caches_table[] = {
> +	{
> +		.procname	= "drop_caches",
> +		.data		= &sysctl_drop_caches,
> +		.maxlen		= sizeof(int),
> +		.mode		= 0200,
> +		.proc_handler	= drop_caches_sysctl_handler,
> +		.extra1		= SYSCTL_ONE,
> +		.extra2		= SYSCTL_FOUR,
> +	},
> +};
> +
> +static int __init init_vm_drop_caches_sysctls(void)
> +{
> +	register_sysctl_init("vm", drop_caches_table);
> +	return 0;
> +}
> +fs_initcall(init_vm_drop_caches_sysctls);
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index c7f73bf32024..ed2e7425c838 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -3791,12 +3791,6 @@ static inline int in_gate_area(struct mm_struct *mm, unsigned long addr)
>  
>  extern bool process_shares_mm(struct task_struct *p, struct mm_struct *mm);
>  
> -#ifdef CONFIG_SYSCTL
> -extern int sysctl_drop_caches;
> -int drop_caches_sysctl_handler(const struct ctl_table *, int, void *, size_t *,
> -		loff_t *);
> -#endif
> -
>  void drop_slab(void);
>  
>  #ifndef CONFIG_MMU
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 373e018b950c..d638a1bac9af 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -2024,15 +2024,6 @@ static struct ctl_table kern_table[] = {
>  };
>  
>  static struct ctl_table vm_table[] = {
> -	{
> -		.procname	= "drop_caches",
> -		.data		= &sysctl_drop_caches,
> -		.maxlen		= sizeof(int),
> -		.mode		= 0200,
> -		.proc_handler	= drop_caches_sysctl_handler,
> -		.extra1		= SYSCTL_ONE,
> -		.extra2		= SYSCTL_FOUR,
> -	},
>  	{
>  		.procname	= "vfs_cache_pressure",
>  		.data		= &sysctl_vfs_cache_pressure,
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH v3 -next 10/15] fs: drop_caches: move sysctl to fs/drop_caches.c
       [not found]   ` <20241010152215.3025842-11-yukaixiong@huawei.com>
  2024-10-14 12:15     ` [PATCH v3 -next 10/15] fs: drop_caches: move sysctl to fs/drop_caches.c Jan Kara
@ 2024-10-15 14:02     ` Christian Brauner
  1 sibling, 0 replies; 9+ messages in thread
From: Christian Brauner @ 2024-10-15 14:02 UTC (permalink / raw)
  To: Kaixiong Yu
  Cc: akpm, mcgrof, ysato, dalias, glaubitz, luto, tglx, mingo, bp,
	dave.hansen, hpa, viro, jack, kees, j.granados, willy,
	Liam.Howlett, vbabka, lorenzo.stoakes, trondmy, anna, chuck.lever,
	jlayton, neilb, okorniev, Dai.Ngo, tom, davem, edumazet, kuba,
	pabeni, paul, jmorris, linux-sh, linux-kernel, linux-fsdevel,
	linux-mm, linux-nfs, netdev, linux-security-module, dhowells,
	haifeng.xu, baolin.wang, shikemeng, dchinner, bfoster,
	souravpanda, hannes, rientjes, pasha.tatashin, david,
	ryan.roberts, ying.huang, yang, zev, serge, vegard.nossum,
	wangkefeng.wang, sunnanyong

On Thu, Oct 10, 2024 at 11:22:10PM +0800, Kaixiong Yu wrote:
> The sysctl_drop_caches to fs/drop_caches.c, move it to
> fs/drop_caches.c from /kernel/sysctl.c. And remove the
> useless extern variable declaration from include/linux/mm.h
> 
> Signed-off-by: Kaixiong Yu <yukaixiong@huawei.com>
> Reviewed-by: Kees Cook <kees@kernel.org>
> ---

Reviewed-by: Christian Brauner <brauner@kernel.org>

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

* Re: [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files
       [not found] ` <20241010152215.3025842-1-yukaixiong@huawei.com>
                     ` (2 preceding siblings ...)
       [not found]   ` <20241010152215.3025842-11-yukaixiong@huawei.com>
@ 2024-10-21  7:22   ` Joel Granados
  2024-10-24  8:07     ` yukaixiong
  3 siblings, 1 reply; 9+ messages in thread
From: Joel Granados @ 2024-10-21  7:22 UTC (permalink / raw)
  To: Kaixiong Yu
  Cc: akpm, mcgrof, ysato, dalias, glaubitz, luto, tglx, mingo, bp,
	dave.hansen, hpa, viro, brauner, jack, kees, willy, Liam.Howlett,
	vbabka, lorenzo.stoakes, trondmy, anna, chuck.lever, jlayton,
	neilb, okorniev, Dai.Ngo, tom, davem, edumazet, kuba, pabeni,
	paul, jmorris, linux-sh, linux-kernel, linux-fsdevel, linux-mm,
	linux-nfs, netdev, linux-security-module, dhowells, haifeng.xu,
	baolin.wang, shikemeng, dchinner, bfoster, souravpanda, hannes,
	rientjes, pasha.tatashin, david, ryan.roberts, ying.huang, yang,
	zev, serge, vegard.nossum, wangkefeng.wang, sunnanyong

On Thu, Oct 10, 2024 at 11:22:00PM +0800, Kaixiong Yu wrote:
> This patch series moves sysctls of vm_table in kernel/sysctl.c to
> places where they actually belong, and do some related code clean-ups.
> After this patch series, all sysctls in vm_table have been moved into its
> own files, meanwhile, delete vm_table.
> 
> All the modifications of this patch series base on
> linux-next(tags/next-20241010). To test this patch series, the code was
> compiled with both the CONFIG_SYSCTL enabled and disabled on arm64 and
> x86_64 architectures. After this patch series is applied, all files
> under /proc/sys/vm can be read or written normally.
> 
> Changes in v3:
>  - change patch1~10, patch14 title suggested by Joel Granados
>  - change sysctl_stat_interval to static type in patch1
>  - add acked-by from Paul Moore in patch7
>  - change dirtytime_expire_interval to static type in patch9
>  - add acked-by from Anna Schumaker in patch11
> 
> Changes in v2:
>  - fix sysctl_max_map_count undeclared issue in mm/nommu.c for patch6
>  - update changelog for patch7/12, suggested by Kees/Paul
>  - fix patch8, sorry for wrong changes and forget to built with NOMMU
>  - add reviewed-by from Kees except patch8 since patch8 is wrong in v1
>  - add reviewed-by from Jan Kara, Christian Brauner in patch12
> 
> Kaixiong Yu (15):
>   mm: vmstat: move sysctls to mm/vmstat.c
>   mm: filemap: move sysctl to mm/filemap.c
>   mm: swap: move sysctl to mm/swap.c
>   mm: vmscan: move vmscan sysctls to mm/vmscan.c
>   mm: util: move sysctls to mm/util.c
>   mm: mmap: move sysctl to mm/mmap.c
>   security: min_addr: move sysctl to security/min_addr.c
>   mm: nommu: move sysctl to mm/nommu.c
>   fs: fs-writeback: move sysctl to fs/fs-writeback.c
>   fs: drop_caches: move sysctl to fs/drop_caches.c
>   sunrpc: use vfs_pressure_ratio() helper
>   fs: dcache: move the sysctl to fs/dcache.c
>   x86: vdso: move the sysctl to arch/x86/entry/vdso/vdso32-setup.c
>   sh: vdso: move the sysctl to arch/sh/kernel/vsyscall/vsyscall.c
>   sysctl: remove unneeded include
> 
>  arch/sh/kernel/vsyscall/vsyscall.c |  14 ++
>  arch/x86/entry/vdso/vdso32-setup.c |  16 ++-
>  fs/dcache.c                        |  21 ++-
>  fs/drop_caches.c                   |  23 ++-
>  fs/fs-writeback.c                  |  30 ++--
>  include/linux/dcache.h             |   7 +-
>  include/linux/mm.h                 |  23 ---
>  include/linux/mman.h               |   2 -
>  include/linux/swap.h               |   9 --
>  include/linux/vmstat.h             |  11 --
>  include/linux/writeback.h          |   4 -
>  kernel/sysctl.c                    | 221 -----------------------------
>  mm/filemap.c                       |  18 ++-
>  mm/internal.h                      |  10 ++
>  mm/mmap.c                          |  54 +++++++
>  mm/nommu.c                         |  15 +-
>  mm/swap.c                          |  16 ++-
>  mm/swap.h                          |   1 +
>  mm/util.c                          |  67 +++++++--
>  mm/vmscan.c                        |  23 +++
>  mm/vmstat.c                        |  44 +++++-
>  net/sunrpc/auth.c                  |   2 +-
>  security/min_addr.c                |  11 ++
>  23 files changed, 330 insertions(+), 312 deletions(-)
> 
> -- 
> 2.34.1
> 
General comment for the patchset in general. I would consider making the
new sysctl tables const. There is an effort for doing this and it has
already lanted in linux-next. So if you base your patch from a recent
next release, then it should just work. If you *do* decide to add a
const qualifier, then note that you will create a dependency with the
sysctl patchset currently in next and that will have to go in before.

Best

-- 

Joel Granados

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

* Re: [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files
  2024-10-21  7:22   ` [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files Joel Granados
@ 2024-10-24  8:07     ` yukaixiong
  2024-10-24  8:59       ` Joel Granados
  0 siblings, 1 reply; 9+ messages in thread
From: yukaixiong @ 2024-10-24  8:07 UTC (permalink / raw)
  To: Joel Granados
  Cc: akpm, mcgrof, ysato, dalias, glaubitz, luto, tglx, mingo, bp,
	dave.hansen, hpa, viro, brauner, jack, kees, willy, Liam.Howlett,
	vbabka, lorenzo.stoakes, trondmy, anna, chuck.lever, jlayton,
	neilb, okorniev, Dai.Ngo, tom, davem, edumazet, kuba, pabeni,
	paul, jmorris, linux-sh, linux-kernel, linux-fsdevel, linux-mm,
	linux-nfs, netdev, linux-security-module, dhowells, haifeng.xu,
	baolin.wang, shikemeng, dchinner, bfoster, souravpanda, hannes,
	rientjes, pasha.tatashin, david, ryan.roberts, ying.huang, yang,
	zev, serge, vegard.nossum, wangkefeng.wang, sunnanyong



On 2024/10/21 15:22, Joel Granados wrote:
> On Thu, Oct 10, 2024 at 11:22:00PM +0800, Kaixiong Yu wrote:
>> This patch series moves sysctls of vm_table in kernel/sysctl.c to
>> places where they actually belong, and do some related code clean-ups.
>> After this patch series, all sysctls in vm_table have been moved into its
>> own files, meanwhile, delete vm_table.
>>
>> All the modifications of this patch series base on
>> linux-next(tags/next-20241010). To test this patch series, the code was
>> compiled with both the CONFIG_SYSCTL enabled and disabled on arm64 and
>> x86_64 architectures. After this patch series is applied, all files
>> under /proc/sys/vm can be read or written normally.
>>
>> Changes in v3:
>>   - change patch1~10, patch14 title suggested by Joel Granados
>>   - change sysctl_stat_interval to static type in patch1
>>   - add acked-by from Paul Moore in patch7
>>   - change dirtytime_expire_interval to static type in patch9
>>   - add acked-by from Anna Schumaker in patch11
>>
>> Changes in v2:
>>   - fix sysctl_max_map_count undeclared issue in mm/nommu.c for patch6
>>   - update changelog for patch7/12, suggested by Kees/Paul
>>   - fix patch8, sorry for wrong changes and forget to built with NOMMU
>>   - add reviewed-by from Kees except patch8 since patch8 is wrong in v1
>>   - add reviewed-by from Jan Kara, Christian Brauner in patch12
>>
>> Kaixiong Yu (15):
>>    mm: vmstat: move sysctls to mm/vmstat.c
>>    mm: filemap: move sysctl to mm/filemap.c
>>    mm: swap: move sysctl to mm/swap.c
>>    mm: vmscan: move vmscan sysctls to mm/vmscan.c
>>    mm: util: move sysctls to mm/util.c
>>    mm: mmap: move sysctl to mm/mmap.c
>>    security: min_addr: move sysctl to security/min_addr.c
>>    mm: nommu: move sysctl to mm/nommu.c
>>    fs: fs-writeback: move sysctl to fs/fs-writeback.c
>>    fs: drop_caches: move sysctl to fs/drop_caches.c
>>    sunrpc: use vfs_pressure_ratio() helper
>>    fs: dcache: move the sysctl to fs/dcache.c
>>    x86: vdso: move the sysctl to arch/x86/entry/vdso/vdso32-setup.c
>>    sh: vdso: move the sysctl to arch/sh/kernel/vsyscall/vsyscall.c
>>    sysctl: remove unneeded include
>>
>>   arch/sh/kernel/vsyscall/vsyscall.c |  14 ++
>>   arch/x86/entry/vdso/vdso32-setup.c |  16 ++-
>>   fs/dcache.c                        |  21 ++-
>>   fs/drop_caches.c                   |  23 ++-
>>   fs/fs-writeback.c                  |  30 ++--
>>   include/linux/dcache.h             |   7 +-
>>   include/linux/mm.h                 |  23 ---
>>   include/linux/mman.h               |   2 -
>>   include/linux/swap.h               |   9 --
>>   include/linux/vmstat.h             |  11 --
>>   include/linux/writeback.h          |   4 -
>>   kernel/sysctl.c                    | 221 -----------------------------
>>   mm/filemap.c                       |  18 ++-
>>   mm/internal.h                      |  10 ++
>>   mm/mmap.c                          |  54 +++++++
>>   mm/nommu.c                         |  15 +-
>>   mm/swap.c                          |  16 ++-
>>   mm/swap.h                          |   1 +
>>   mm/util.c                          |  67 +++++++--
>>   mm/vmscan.c                        |  23 +++
>>   mm/vmstat.c                        |  44 +++++-
>>   net/sunrpc/auth.c                  |   2 +-
>>   security/min_addr.c                |  11 ++
>>   23 files changed, 330 insertions(+), 312 deletions(-)
>>
>> -- 
>> 2.34.1
>>
> General comment for the patchset in general. I would consider making the
> new sysctl tables const. There is an effort for doing this and it has
> already lanted in linux-next. So if you base your patch from a recent
> next release, then it should just work. If you *do* decide to add a
> const qualifier, then note that you will create a dependency with the
> sysctl patchset currently in next and that will have to go in before.
>
> Best
>

Sorry,  I don't understand what is the meaning of "create a dependency 
with the sysctl patchset".

Do you just want me to change all "static struct ctl_table" type table 
into "static const struct ctl_table" type in my patchset?


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

* Re: [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files
  2024-10-24  8:07     ` yukaixiong
@ 2024-10-24  8:59       ` Joel Granados
  2024-12-19 11:15         ` yukaixiong
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Granados @ 2024-10-24  8:59 UTC (permalink / raw)
  To: yukaixiong
  Cc: akpm, mcgrof, ysato, dalias, glaubitz, luto, tglx, mingo, bp,
	dave.hansen, hpa, viro, brauner, jack, kees, willy, Liam.Howlett,
	vbabka, lorenzo.stoakes, trondmy, anna, chuck.lever, jlayton,
	neilb, okorniev, Dai.Ngo, tom, davem, edumazet, kuba, pabeni,
	paul, jmorris, linux-sh, linux-kernel, linux-fsdevel, linux-mm,
	linux-nfs, netdev, linux-security-module, dhowells, haifeng.xu,
	baolin.wang, shikemeng, dchinner, bfoster, souravpanda, hannes,
	rientjes, pasha.tatashin, david, ryan.roberts, ying.huang, yang,
	zev, serge, vegard.nossum, wangkefeng.wang, sunnanyong,
	joel.granados

On Thu, Oct 24, 2024 at 04:07:10PM +0800, yukaixiong wrote:
...
> 
> 
> >>   mm/swap.c                          |  16 ++-
> >>   mm/swap.h                          |   1 +
> >>   mm/util.c                          |  67 +++++++--
> >>   mm/vmscan.c                        |  23 +++
> >>   mm/vmstat.c                        |  44 +++++-
> >>   net/sunrpc/auth.c                  |   2 +-
> >>   security/min_addr.c                |  11 ++
> >>   23 files changed, 330 insertions(+), 312 deletions(-)
> >>
> >> -- 
> >> 2.34.1
> >>
> > General comment for the patchset in general. I would consider making the
> > new sysctl tables const. There is an effort for doing this and it has
> > already lanted in linux-next. So if you base your patch from a recent
> > next release, then it should just work. If you *do* decide to add a
> > const qualifier, then note that you will create a dependency with the
> > sysctl patchset currently in next and that will have to go in before.
> >
> > Best
> >
> 
> Sorry,  I don't understand what is the meaning of "create a dependency 
> with the sysctl patchset".
The patches in the sysctl subsys that allow you to qualify the ctl_table
as const are not in mainline yet. They are in linux-next. This means
that if these patches go into the next kernel release before the
sysctl-next branch, it will have compilation errors. Therefore the
sysctl-next branch needs to be pulled in to the new kernel release
before this patchest. This also means that for this to build properly it
has to be based on a linux-next release.

> 
> Do you just want me to change all "static struct ctl_table" type table 
> into "static const struct ctl_table" type in my patchset?
You should const qualify them if the maintainer that is pulling in these
patches is ok with it. You should *not* const qualify them if the
maintainer prefers otherwise.

Please get back to me if I did not address your questions.

Best

-- 

Joel Granados

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

* Re: [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files
  2024-10-24  8:59       ` Joel Granados
@ 2024-12-19 11:15         ` yukaixiong
  0 siblings, 0 replies; 9+ messages in thread
From: yukaixiong @ 2024-12-19 11:15 UTC (permalink / raw)
  To: Joel Granados
  Cc: akpm, mcgrof, ysato, dalias, glaubitz, luto, tglx, mingo, bp,
	dave.hansen, hpa, viro, brauner, jack, kees, willy, Liam.Howlett,
	vbabka, lorenzo.stoakes, trondmy, anna, chuck.lever, jlayton,
	neilb, okorniev, Dai.Ngo, tom, davem, edumazet, kuba, pabeni,
	paul, jmorris, linux-sh, linux-kernel, linux-fsdevel, linux-mm,
	linux-nfs, netdev, linux-security-module, dhowells, haifeng.xu,
	baolin.wang, shikemeng, dchinner, bfoster, souravpanda, hannes,
	rientjes, pasha.tatashin, david, ryan.roberts, ying.huang, yang,
	zev, serge, vegard.nossum, wangkefeng.wang, sunnanyong,
	joel.granados



On 2024/10/24 16:59, Joel Granados wrote:
> On Thu, Oct 24, 2024 at 04:07:10PM +0800, yukaixiong wrote:
> ...
>>
>>>>    mm/swap.c                          |  16 ++-
>>>>    mm/swap.h                          |   1 +
>>>>    mm/util.c                          |  67 +++++++--
>>>>    mm/vmscan.c                        |  23 +++
>>>>    mm/vmstat.c                        |  44 +++++-
>>>>    net/sunrpc/auth.c                  |   2 +-
>>>>    security/min_addr.c                |  11 ++
>>>>    23 files changed, 330 insertions(+), 312 deletions(-)
>>>>
>>>> -- 
>>>> 2.34.1
>>>>
>>> General comment for the patchset in general. I would consider making the
>>> new sysctl tables const. There is an effort for doing this and it has
>>> already lanted in linux-next. So if you base your patch from a recent
>>> next release, then it should just work. If you *do* decide to add a
>>> const qualifier, then note that you will create a dependency with the
>>> sysctl patchset currently in next and that will have to go in before.
>>>
>>> Best
>>>
>> Sorry,  I don't understand what is the meaning of "create a dependency
>> with the sysctl patchset".
> The patches in the sysctl subsys that allow you to qualify the ctl_table
> as const are not in mainline yet. They are in linux-next. This means
> that if these patches go into the next kernel release before the
> sysctl-next branch, it will have compilation errors. Therefore the
> sysctl-next branch needs to be pulled in to the new kernel release
> before this patchest. This also means that for this to build properly it
> has to be based on a linux-next release.
>
>> Do you just want me to change all "static struct ctl_table" type table
>> into "static const struct ctl_table" type in my patchset?
> You should const qualify them if the maintainer that is pulling in these
> patches is ok with it. You should *not* const qualify them if the
> maintainer prefers otherwise.
>
> Please get back to me if I did not address your questions.
>
> Best

Thank you! Now, I decide to const qualify them. Maybe, it will be better.


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

end of thread, other threads:[~2024-12-19 11:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20241010141133eucas1p1999f17c74198d3880cbd345276bcd3bd@eucas1p1.samsung.com>
     [not found] ` <20241010152215.3025842-1-yukaixiong@huawei.com>
2024-10-11 13:04   ` [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files Liam R. Howlett
2024-10-14  1:33     ` yukaixiong
     [not found]   ` <20241010152215.3025842-10-yukaixiong@huawei.com>
2024-10-14 12:14     ` [PATCH v3 -next 09/15] fs: fs-writeback: move sysctl to fs/fs-writeback.c Jan Kara
     [not found]   ` <20241010152215.3025842-11-yukaixiong@huawei.com>
2024-10-14 12:15     ` [PATCH v3 -next 10/15] fs: drop_caches: move sysctl to fs/drop_caches.c Jan Kara
2024-10-15 14:02     ` Christian Brauner
2024-10-21  7:22   ` [PATCH v3 -next 00/15] sysctl: move sysctls from vm_table into its own files Joel Granados
2024-10-24  8:07     ` yukaixiong
2024-10-24  8:59       ` Joel Granados
2024-12-19 11:15         ` yukaixiong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox