mm: compaction: move compact_memory sysctl to its own file
Subsystems (4)
PATCH v3 1/2 mm: compaction: move compact_memory sysctl to its own file
From: Minghao Chi <[email protected]>
The compact_memory is part of compaction, move it to its own file.
--- kernel/sysctl.c | 7 ------- mm/compaction.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-)
kernel/sysctl.c +0 -7
@@ -2190,13 +2190,6 @@ static struct ctl_table vm_table[] = { .extra2 = SYSCTL_FOUR, },#ifdef CONFIG_COMPACTION - { - .procname = "compact_memory", - .data = NULL, - .maxlen = sizeof(int), - .mode = 0200, - .proc_handler = sysctl_compaction_handler, - }, { .procname = "compaction_proactiveness", .data = &sysctl_compaction_proactiveness,
mm/compaction.c +15 -0
@@ -2763,6 +2763,18 @@ int compaction_proactiveness_sysctl_handler(struct ctl_table *table, int write,return 0 ; } +#ifdef CONFIG_SYSCTL +static struct ctl_table vm_compact_memory[] = { + { + .procname ="compact_memory" , + .data =NULL , + .maxlen =sizeof (int ), + .mode =0200 , + .proc_handler = sysctl_compaction_handler, + }, + { } +}; +#endif /* * This is the entry point for compacting all nodes via * /proc/sys/vm/compact_memory
@@ -3078,6 +3090,9 @@ static int __init kcompactd_init(void)for_each_node_state (nid,N_MEMORY )kcompactd_run (nid); +#ifdef CONFIG_SYSCTL +register_sysctl_init ("vm" , vm_compact_memory); +#endif return 0 ; }subsys_initcall (kcompactd_init)
Signature · 1 line
2.25.1
Quoted 20 lines · On 3/9/23 04:44, [email protected] wrote:
From: Minghao Chi <[email protected]>
The
compact_memoryis part of compaction, move it to its own file.Signed-off-by Minghao Chi <[email protected]>Signed-off-by Ye Xingchen <[email protected]>--- kernel/sysctl.c | 7 ------- mm/compaction.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-)kernel/sysctl.c +0
-0@@ -2190,13 +2190,6 @@ static struct ctl_table vm_table[] = { .extra2 = SYSCTL_FOUR, },#ifdef CONFIG_COMPACTION
kernel/sysctl.c static struct ctl_table vm_table[] = { · line 2195
Quoted 10 lines
kernel/sysctl.c +0
-7- { - .procname = "compact_memory", - .data = NULL, - .maxlen = sizeof(int), - .mode = 0200, - .proc_handler = sysctl_compaction_handler, - }, { .procname = "compaction_proactiveness", .data = &sysctl_compaction_proactiveness,
There's also this one, and two more, please move all of them at once?
Quoted 33 lines
mm/compaction.c +15
-0@@ -2763,6 +2763,18 @@ int compaction_proactiveness_sysctl_handler(struct ctl_table *table, int write,return 0 ; } +#ifdef CONFIG_SYSCTL +static struct ctl_table vm_compact_memory[] = { + { + .procname ="compact_memory" , + .data =NULL , + .maxlen =sizeof (int ), + .mode =0200 , + .proc_handler = sysctl_compaction_handler, + }, + { } +}; +#endif /* * This is the entry point for compacting all nodes via * /proc/sys/vm/compact_memory @@ -3078,6 +3090,9 @@ static int __init kcompactd_init(void)for_each_node_state (nid,N_MEMORY )kcompactd_run (nid); +#ifdef CONFIG_SYSCTL +register_sysctl_init ("vm" , vm_compact_memory); +#endif return 0 ; }subsys_initcall (kcompactd_init)
Quoted 25 lines · Vlastimil Babka
Quoted 24 lines · On 3/9/23 04:44, [email protected] wrote:
From: Minghao Chi <[email protected]>
The
compact_memoryis part of compaction, move it to its own file.Signed-off-by Minghao Chi <[email protected]>Signed-off-by Ye Xingchen <[email protected]>--- kernel/sysctl.c | 7 ------- mm/compaction.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-)kernel/sysctl.c +0
-4@@ -2190,13 +2190,6 @@ static struct ctl_table vm_table[] = { .extra2 = SYSCTL_FOUR, },#ifdef CONFIG_COMPACTION - { - .procname = "compact_memory", - .data = NULL, - .maxlen = sizeof(int),
Quoted 8 lines
kernel/sysctl.c static struct ctl_table vm_table[] = { · line 2195
Quoted 6 lines
kernel/sysctl.c +0
-3- .mode = 0200, - .proc_handler = sysctl_compaction_handler, - }, { .procname = "compaction_proactiveness", .data = &sysctl_compaction_proactiveness,There's also this one, and two more, please move all of them at once?
I'll wait for a v4, and if you can rebase on top of this tree that would be appreciated:
https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/log/?h=sysctl-next
Luis