Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp289509pxr; Sun, 10 Apr 2022 15:08:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAud7y7o59JctqHEBTyPfkolsBi5IRhuVVeEaxv0etArrIwMYSPrPk3/yc9CkivVIa/0fj X-Received: by 2002:a17:902:6b44:b0:154:4bee:c434 with SMTP id g4-20020a1709026b4400b001544beec434mr29685197plt.43.1649628489364; Sun, 10 Apr 2022 15:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649628489; cv=none; d=google.com; s=arc-20160816; b=TxHcScgbhO0VX1F5URF73JAW1KiGoG3tMQx6+Q0GOeUHJVNHUVTnt0ryxX5Cme0EVp dwpfM8s/ouDNbu+kBDLwbFmDirXlvCD2cMqBfh45wESOHBrPtPgzt6AJNViZIIsqdHSA 0j9BHQ6FqhSPdDGFODROyOSPy7lqFYoWAm68sWm6mtRjKSa4jYs4MlpsmmcnWuMLLBf2 iEw/CNrMuHVx7xeZqJt8AGDVRh/zybdqGR0Em1N7vETYD4oATBln+CmgGOqK2/UouPIS Kg5lPBQFJNxonlOY1oTa1zBsF2lW36j3Xr+w1M6wKHdkwRpJIsSB5DEuW5spQ+D30yrA NSwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/Iq8wuECNkSRCZP++oYuvL2DcgzUm2PnoHsdJRRfqU8=; b=S2zzBK73JgTODcUgvhNNTrkR7sM1IhunaNFD8sLNzHVpuFa3nxmMWz1iQPrhUaKKl9 K/m7XvDgLR6sczrCAYVIRgNzpXfhJ3YYNorDT00GMFwiEOmfx/HOQQuG9CRr40U8w3dq jxnP9x+wTNrVRwo3pBC3azyqxvsxAxpq6cFHsbCYweKMCj/2wrtQesmDFMJ5nXJ7ZGOr O3X3wkrIMxEUHTFPZlobX0haG3qVyu9TSzxOTdaPze7dMMOOzOPDvdP6hPrqv/5f2mW0 8dXb3m7I3aoXXEEd4o7RW3m6n0BQ+b+2prDTa7Dyf9NeZavmFujXU8LXcoDtoX2I3Q+a y9Fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a635f02000000b0039cf4948dabsi7462087pgb.314.2022.04.10.15.07.56; Sun, 10 Apr 2022 15:08:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241380AbiDIJhH (ORCPT + 99 others); Sat, 9 Apr 2022 05:37:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241186AbiDIJgk (ORCPT ); Sat, 9 Apr 2022 05:36:40 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80E4AEBBA6 for ; Sat, 9 Apr 2022 02:34:34 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Kb8zf40DyzgYKc; Sat, 9 Apr 2022 17:32:46 +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; Sat, 9 Apr 2022 17:34:32 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH v2 7/9] mm/vmscan: take min_slab_pages into account when try to call shrink_node Date: Sat, 9 Apr 2022 17:34:58 +0800 Message-ID: <20220409093500.10329-8-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220409093500.10329-1-linmiaohe@huawei.com> References: <20220409093500.10329-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 53f1d0755b34..ba83d8f3e53e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4714,7 +4714,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