From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1E2EC433FE for ; Mon, 25 Apr 2022 11:20:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E7C86B0074; Mon, 25 Apr 2022 07:20:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2979F6B0075; Mon, 25 Apr 2022 07:20:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 185B16B0078; Mon, 25 Apr 2022 07:20:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 088D16B0074 for ; Mon, 25 Apr 2022 07:20:58 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CF1C422F49 for ; Mon, 25 Apr 2022 11:20:57 +0000 (UTC) X-FDA: 79395159354.10.861CD25 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf15.hostedemail.com (Postfix) with ESMTP id 26683A0038 for ; Mon, 25 Apr 2022 11:20:53 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Kn2cp6cxBzhYj8; Mon, 25 Apr 2022 19:20:42 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 25 Apr 2022 19:20:54 +0800 From: Miaohe Lin To: CC: , , , , , Subject: [PATCH v3] mm/vmscan: take min_slab_pages into account when try to call shrink_node Date: Mon, 25 Apr 2022 19:21:18 +0800 Message-ID: <20220425112118.20924-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 26683A0038 X-Rspam-User: X-Stat-Signature: 6s1bfme4ba5ybwqy1m9tgapm1cygtynr X-HE-Tag: 1650885653-102255 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Since commit 6b4f7799c6a5 ("mm: vmscan: invoke slab shrinkers from shrink_zone()"), slab reclaim and lru page reclaim are done together in the shrink_node. So we should take min_slab_pages into account when try to call shrink_node. Signed-off-by: Miaohe Lin Cc: Huang Ying Cc: Christoph Hellwig Cc: Johannes Weiner --- v3: This patch is pending verifying. Split it out to make it easier to move forward. --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index a2752e8fc879..1049f5324765 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4718,7 +4718,8 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in noreclaim_flag = memalloc_noreclaim_save(); set_task_reclaim_state(p, &sc.reclaim_state); - if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages) { + if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages || + node_page_state_pages(pgdat, NR_SLAB_RECLAIMABLE_B) > pgdat->min_slab_pages) { /* * Free memory by calling shrink node with increasing * priorities until we have enough memory freed. -- 2.23.0