[PATCH OLK-6.6 0/2] Fixes of page cache limit
Zhang Qilong (2): mm: Add page cache limit check before queueing shrink worker mm: Replace deferrable timer with delay timer for shrink worker mm/page_cache_limit.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.43.0
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
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ID96C0 -------------------------------- When system is idle, the deferrable timer maybe expire in unsure time. If the system have many clean cached pages at this time, shrink worker can not be queued in excepted time. So we replace deferrable timer with delay timer for shrink worker to avoid this issue. Fixes: 621647ce254f ("mm: support periodical memory reclaim") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> --- mm/page_cache_limit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_cache_limit.c b/mm/page_cache_limit.c index 6e532cfc915f..77c50993adb0 100644 --- a/mm/page_cache_limit.c +++ b/mm/page_cache_limit.c @@ -16,11 +16,11 @@ static int vm_cache_reclaim_weight __read_mostly = 1; static int vm_cache_reclaim_weight_max = 100; static int vm_cache_reclaim_enable = 1; static unsigned long vm_cache_limit_mbytes __read_mostly; static void shrink_shepherd(struct work_struct *w); -static DECLARE_DEFERRABLE_WORK(shepherd, shrink_shepherd); +static DECLARE_DELAYED_WORK(shepherd, shrink_shepherd); static struct work_struct vmscan_works[MAX_NUMNODES]; static bool should_periodical_reclaim(void) { return vm_cache_reclaim_s && vm_cache_reclaim_enable; -- 2.43.0
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/19348 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/ZGQ... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/19348 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/ZGQ...
participants (2)
-
patchwork bot -
Zhang Qilong