
From: Chen Wandun <chenwandun@huawei.com> hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S CVE: NA -------------------------------- The number of page cache should be limited in a range if enable CONFIG_MEMORY_RELIABLE, so only page cache instead of both file + anono page should be reclaimed during page cache reclaimtion. Signed-off-by: Chen Wandun <chenwandun@huawei.com> Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 39b06e6eaa0f0..a9fca07dba3ba 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -56,6 +56,7 @@ #include <linux/swapops.h> #include <linux/balloon_compaction.h> +#include <linux/mem_reliable.h> #include "internal.h" @@ -3968,7 +3969,7 @@ static unsigned long __shrink_page_cache(gfp_t mask) .nr_to_reclaim = SWAP_CLUSTER_MAX * (unsigned long)vm_cache_reclaim_weight, .may_unmap = 1, - .may_swap = 1, + .may_swap = mem_reliable_is_enabled() ? 0 : 1, .order = 0, .priority = DEF_PRIORITY, .target_mem_cgroup = NULL, -- 2.25.1