mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
5033091de8
commit
ea0ffd0c08
3 changed files with 4 additions and 1 deletions
|
@ -74,6 +74,7 @@ static inline void totalram_pages_add(long count)
|
|||
|
||||
extern void * high_memory;
|
||||
extern int page_cluster;
|
||||
extern const int page_cluster_max;
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
extern int sysctl_legacy_va_layout;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue