File tree Expand file tree Collapse file tree 4 files changed +16
-13
lines changed
Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,6 @@ static inline void totalram_pages_add(long count)
7676}
7777
7878extern void * high_memory ;
79- extern int page_cluster ;
80- extern const int page_cluster_max ;
8179
8280#ifdef CONFIG_SYSCTL
8381extern int sysctl_legacy_va_layout ;
Original file line number Diff line number Diff line change 2121
2222#include <linux/module.h>
2323#include <linux/mm.h>
24- #include <linux/swap.h>
2524#include <linux/slab.h>
2625#include <linux/sysctl.h>
2726#include <linux/bitmap.h>
@@ -2044,15 +2043,6 @@ static const struct ctl_table vm_table[] = {
20442043 .mode = 0644 ,
20452044 .proc_handler = overcommit_kbytes_handler ,
20462045 },
2047- {
2048- .procname = "page-cluster" ,
2049- .data = & page_cluster ,
2050- .maxlen = sizeof (int ),
2051- .mode = 0644 ,
2052- .proc_handler = proc_dointvec_minmax ,
2053- .extra1 = SYSCTL_ZERO ,
2054- .extra2 = (void * )& page_cluster_max ,
2055- },
20562046 {
20572047 .procname = "dirtytime_expire_seconds" ,
20582048 .data = & dirtytime_expire_interval ,
Original file line number Diff line number Diff line change 4545
4646/* How many pages do we try to swap or page in/out together? As a power of 2 */
4747int page_cluster ;
48- const int page_cluster_max = 31 ;
48+ static const int page_cluster_max = 31 ;
4949
5050struct cpu_fbatches {
5151 /*
@@ -1076,6 +1076,18 @@ void folio_batch_remove_exceptionals(struct folio_batch *fbatch)
10761076 fbatch -> nr = j ;
10771077}
10781078
1079+ static const struct ctl_table swap_sysctl_table [] = {
1080+ {
1081+ .procname = "page-cluster" ,
1082+ .data = & page_cluster ,
1083+ .maxlen = sizeof (int ),
1084+ .mode = 0644 ,
1085+ .proc_handler = proc_dointvec_minmax ,
1086+ .extra1 = SYSCTL_ZERO ,
1087+ .extra2 = (void * )& page_cluster_max ,
1088+ }
1089+ };
1090+
10791091/*
10801092 * Perform any setup for the swap system
10811093 */
@@ -1092,4 +1104,6 @@ void __init swap_setup(void)
10921104 * Right now other parts of the system means that we
10931105 * _really_ don't want to cluster much more
10941106 */
1107+
1108+ register_sysctl_init ("vm" , swap_sysctl_table );
10951109}
Original file line number Diff line number Diff line change 33#define _MM_SWAP_H
44
55struct mempolicy ;
6+ extern int page_cluster ;
67
78#ifdef CONFIG_SWAP
89#include <linux/swapops.h> /* for swp_offset */
You can’t perform that action at this time.
0 commit comments