hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ID96C0 -------------------------------- Add page cache limit check before queueing shrink worker, queueing shrink worker can be avoid if vm_cache_limit_mbytes is zero or page_cache_over_limit() returns false. Fixes: 621647ce254f ("mm: support periodical memory reclaim") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> --- mm/page_cache_limit.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/page_cache_limit.c b/mm/page_cache_limit.c index 1ab00225f8ac..6e532cfc915f 100644 --- a/mm/page_cache_limit.c +++ b/mm/page_cache_limit.c @@ -127,13 +127,16 @@ static void shrink_shepherd(struct work_struct *w) int node; if (!should_periodical_reclaim()) return; - for_each_online_node(node) { - if (!work_pending(&vmscan_works[node])) - queue_work_node(node, system_unbound_wq, &vmscan_works[node]); + if (vm_cache_limit_mbytes && page_cache_over_limit()) { + for_each_online_node(node) { + if (!work_pending(&vmscan_works[node])) + queue_work_node(node, system_unbound_wq, + &vmscan_works[node]); + } } queue_delayed_work(system_unbound_wq, &shepherd, round_jiffies_relative((unsigned long)vm_cache_reclaim_s * HZ)); } -- 2.43.0