提交 76569c77 编写于 作者: C Chen Wandun 提交者: Yang Yingliang

mm/vmscan: fix unexpected shrinking page cache with vm_cache_reclaim_enable disable

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S
CVE: NA

-------------------------------------------------------

In function cache_limit_ratio_sysctl_handler and
cache_limit_mbytes_sysctl_handler, it will shrink
page cache even if vm_cache_reclaim_enable is false,
it is unexpected.
Signed-off-by: NChen Wandun <chenwandun@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 18849ae6
......@@ -8600,7 +8600,8 @@ int cache_limit_ratio_sysctl_handler(struct ctl_table *table, int write,
vm_cache_limit_ratio);
else
pr_warn("page cache limit off\n");
while (vm_cache_limit_mbytes && page_cache_over_limit())
while (vm_cache_limit_mbytes && page_cache_over_limit() &&
vm_cache_reclaim_enable)
shrink_page_cache(GFP_KERNEL);
}
......@@ -8628,7 +8629,8 @@ int cache_limit_mbytes_sysctl_handler(struct ctl_table *table, int write,
else
pr_warn("page cache limit off\n");
while (vm_cache_limit_mbytes && page_cache_over_limit())
while (vm_cache_limit_mbytes && page_cache_over_limit() &&
vm_cache_reclaim_enable)
shrink_page_cache(GFP_KERNEL);
}
......
......@@ -3562,7 +3562,8 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
kernel_swap_check(&sc);
#ifdef CONFIG_SHRINK_PAGECACHE
if (vm_cache_limit_mbytes && page_cache_over_limit())
if (vm_cache_limit_mbytes && page_cache_over_limit() &&
vm_cache_reclaim_enable)
shrink_page_cache(GFP_KERNEL);
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册