summaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorKairui Song <kasong@tencent.com>2022-10-23 18:25:33 +0200
committerAndrew Morton <akpm@linux-foundation.org>2022-11-09 02:37:22 +0100
commitea0ffd0c08d0fef1f6e93eb07badbeeabf6b43d6 (patch)
tree7c51a3389015d022f9a2b98a2157e2de31216605 /kernel/sysctl.c
parentmm/hwpoison: introduce per-memory_block hwpoison counter (diff)
downloadlinux-ea0ffd0c08d0fef1f6e93eb07badbeeabf6b43d6.tar.xz
linux-ea0ffd0c08d0fef1f6e93eb07badbeeabf6b43d6.zip
swap: add a limit for readahead page-cluster value
Currenty there is no upper limit for /proc/sys/vm/page-cluster, and it's a bit shift value, so it could result in overflow of the 32-bit integer. Add a reasonable upper limit for it, read-in at most 2**31 pages, which is a large enough value for readahead. Link: https://lkml.kernel.org/r/20221023162533.81561-1-ryncsn@gmail.com Signed-off-by: Kairui Song <kasong@tencent.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 188c305aeb8b..71a4350ac601 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2125,6 +2125,7 @@ static struct ctl_table vm_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
+ .extra2 = (void *)&page_cluster_max,
},
{
.procname = "dirtytime_expire_seconds",