From: Chen Wandun chenwandun@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S CVE: NA
-------------------------------- Add two proc interfaces to set page cache limit. Both vm_cache_limit_mbytes and vm_cache_limit_ratio will be update when writing either of the two interfaces.
Signed-off-by: Chen Wandun chenwandun@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- kernel/sysctl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 31c35a65fbb78..542611081c610 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1468,6 +1468,24 @@ static struct ctl_table vm_table[] = { .extra1 = &zero, .extra2 = &one, }, + { + .procname = "cache_limit_mbytes", + .data = &vm_cache_limit_mbytes, + .maxlen = sizeof(vm_cache_limit_mbytes), + .mode = 0644, + .proc_handler = cache_limit_mbytes_sysctl_handler, + .extra1 = &vm_cache_limit_mbytes_min, + .extra2 = &vm_cache_limit_mbytes_max, + }, + { + .procname = "cache_limit_ratio", + .data = &vm_cache_limit_ratio, + .maxlen = sizeof(vm_cache_limit_ratio), + .mode = 0644, + .proc_handler = cache_limit_ratio_sysctl_handler, + .extra1 = &vm_cache_limit_ratio_min, + .extra2 = &vm_cache_limit_ratio_max, + }, #endif #ifdef CONFIG_HUGETLB_PAGE {