pagecachelimit: set an initial value for may_deactivate in shrink page cache

The global pagecache limit function fails due to backport the
upstream commit. In the scenario where the active file list
needs to be reclaimed, it cannot reclaim the LRU_ACTIVE_FILE
list, making the pagecache limit inaccurate.

When shrinking page cache, we set an initial value for
may_deactivate in scan_control to DEACTIVATE_FILE, allowing
the active file list to be scanned in shrink_list.

Signed-off-by: Honglin Li <honglinli@tencent.com>
Reviewed-by: Hongbo Li <herberthbli@tencent.com>
This commit is contained in:
Honglin Li 2023-07-21 15:11:30 +08:00 committed by Haisu Wang
parent 26941c0f5e
commit 04f49a445c
1 changed files with 1 additions and 0 deletions

View File

@ -7635,6 +7635,7 @@ static void __shrink_page_cache(gfp_t mask)
.priority = DEF_PRIORITY,
.may_unmap = 0,
.may_writepage = 0,
.may_deactivate = DEACTIVATE_FILE,
.target_mem_cgroup = NULL,
.reclaim_idx = MAX_NR_ZONES,
};