]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mm: filemap: move sysctl to mm/filemap.c
authorKaixiong Yu <yukaixiong@huawei.com>
Sat, 11 Jan 2025 07:07:37 +0000 (15:07 +0800)
committerJoel Granados <joel.granados@kernel.org>
Fri, 7 Feb 2025 15:53:03 +0000 (16:53 +0100)
This moves the filemap related sysctl to mm/filemap.c, and
removes the redundant external variable declaration.

Signed-off-by: Kaixiong Yu <yukaixiong@huawei.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
include/linux/mm.h
kernel/sysctl.c
mm/filemap.c

index 7b1068ddcbb70b732a4f2843e6b55fd73cc3e320..70cca450a68a2991552c893121c5971c970aad1a 100644 (file)
@@ -40,8 +40,6 @@ struct user_struct;
 struct pt_regs;
 struct folio_batch;
 
-extern int sysctl_page_lock_unfairness;
-
 void mm_core_init(void);
 void init_mm_internals(void);
 
index 5e6ea570cfea913b26209e83a452e69e5a9767f7..74a33552731d7ae3605b6fdc2ea61fd4017f804d 100644 (file)
@@ -2079,14 +2079,6 @@ static const struct ctl_table vm_table[] = {
                .extra1         = SYSCTL_ONE,
                .extra2         = SYSCTL_FOUR,
        },
-       {
-               .procname       = "page_lock_unfairness",
-               .data           = &sysctl_page_lock_unfairness,
-               .maxlen         = sizeof(sysctl_page_lock_unfairness),
-               .mode           = 0644,
-               .proc_handler   = proc_dointvec_minmax,
-               .extra1         = SYSCTL_ZERO,
-       },
 #ifdef CONFIG_MMU
        {
                .procname       = "max_map_count",
index 804d7365680c1cef198ed453f1bd17bc66a7decc..004d78767804dcf8cec9f238285a18acf22c6f51 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/splice.h>
 #include <linux/rcupdate_wait.h>
 #include <linux/sched/mm.h>
+#include <linux/sysctl.h>
 #include <linux/fsnotify.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
@@ -1078,6 +1079,19 @@ static wait_queue_head_t *folio_waitqueue(struct folio *folio)
        return &folio_wait_table[hash_ptr(folio, PAGE_WAIT_TABLE_BITS)];
 }
 
+/* How many times do we accept lock stealing from under a waiter? */
+static int sysctl_page_lock_unfairness = 5;
+static const struct ctl_table filemap_sysctl_table[] = {
+       {
+               .procname       = "page_lock_unfairness",
+               .data           = &sysctl_page_lock_unfairness,
+               .maxlen         = sizeof(sysctl_page_lock_unfairness),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec_minmax,
+               .extra1         = SYSCTL_ZERO,
+       }
+};
+
 void __init pagecache_init(void)
 {
        int i;
@@ -1086,6 +1100,7 @@ void __init pagecache_init(void)
                init_waitqueue_head(&folio_wait_table[i]);
 
        page_writeback_init();
+       register_sysctl_init("vm", filemap_sysctl_table);
 }
 
 /*
@@ -1233,9 +1248,6 @@ static inline bool folio_trylock_flag(struct folio *folio, int bit_nr,
        return true;
 }
 
-/* How many times do we accept lock stealing from under a waiter? */
-int sysctl_page_lock_unfairness = 5;
-
 static inline int folio_wait_bit_common(struct folio *folio, int bit_nr,
                int state, enum behavior behavior)
 {