Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp818164pxb; Tue, 12 Apr 2022 14:17:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt6Jui31ZHZoSQT9VuZRCctQOqh3PaZGpe6hpn9MvCtJ1UHYEZUOuiSwx+u1sW40mpLuoE X-Received: by 2002:a63:1723:0:b0:39c:e0b5:b678 with SMTP id x35-20020a631723000000b0039ce0b5b678mr21475530pgl.134.1649798277605; Tue, 12 Apr 2022 14:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649798277; cv=none; d=google.com; s=arc-20160816; b=yjbBSfgDCyWNVdYtvEATgn3FUqx3CNamXz+BzOlaSqYmw4ImqNY8pWlxnPREx46Pfy nHH47JkOW5vDSTlr426HKhEGvx6btl3+vorYEwMYLLdTCl8DFvWW+vBOf7pq0Bti/YTn sSa3zVlpmXzZ8NJqdN3v/6RFGUZRe9h3i86N7fu6vL+RV6vXV/ESiLaE6+SwyvzJw/5b 7DI9RMZR83oH1AyRffEYvopmrwVpWp8z6bXe0X3mhlkz4fnfp+RAdxX57e2zkjr/SOu9 Vxl4Li97qbMlgPF0xG4M0+KIH+ZX2d7VD2YlD6QOMAbI+c985551beEJrx5GPRk9OGYb Sg8w== 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=uNGBjI5QFA6c3HeU3owPE+iaLzqnu6s58WWG1dp/pnM=; b=tc7h8GyJ8GFi5zayJ+Ro1gz7uvdHiqvJKcHpeb1cjOkmae12jMBVdMTzMTr2DEyYgd 43I+g2wpulq9bnLXhUBaVq/qDMLxKRaFOnjNLatrn6BWye+0cYm8MF+dWQE2uwZ111fG nzblRNg9sFWZovRVMnQ3iBtB1f2VjOyPLYBqQ5jeSxU8WvRcNqHpyV1daYRkG+livQkD wCbhUDfL2R8usfh8TMuMqeEU4l0Agqh5WvRbWI7a/FBPzj0HoquIZlDlbNCJxLJnd7c/ WFSmqh6saeHrderAelbiEzZ1cwah4iSzjlh2Fitjy+FiY21ggbOA9BNa5t/lW0orY2Gi D0Og== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a2-20020a637042000000b003816043efecsi3664934pgn.481.2022.04.12.14.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:17:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B67E4F65F2; Tue, 12 Apr 2022 13:31:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241325AbiDIJg4 (ORCPT + 99 others); Sat, 9 Apr 2022 05:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241153AbiDIJgi (ORCPT ); Sat, 9 Apr 2022 05:36:38 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA927AFAD1 for ; Sat, 9 Apr 2022 02:34:32 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kb9145pSrz1HBTl; Sat, 9 Apr 2022 17:34:00 +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:30 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH v2 4/9] mm/vmscan: save a bit of stack space in shrink_lruvec Date: Sat, 9 Apr 2022 17:34:55 +0800 Message-ID: <20220409093500.10329-5-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=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 LRU_UNEVICTABLE is not taken into account when shrink lruvec. So we can save a bit of stack space by shrinking the array size of nr and targets to NR_LRU_LISTS - 1. No functional change intended. Signed-off-by: Miaohe Lin --- mm/vmscan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 59b96320f481..0e5818970998 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2881,8 +2881,9 @@ static bool can_age_anon_pages(struct pglist_data *pgdat, static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc) { - unsigned long nr[NR_LRU_LISTS]; - unsigned long targets[NR_LRU_LISTS]; + /* LRU_UNEVICTABLE is not taken into account. */ + unsigned long nr[NR_LRU_LISTS - 1]; + unsigned long targets[NR_LRU_LISTS - 1]; unsigned long nr_to_scan; enum lru_list lru; unsigned long nr_reclaimed = 0; -- 2.23.0