From patchwork Fri Jun 9 01:39:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 105209 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp651353vqr; Thu, 8 Jun 2023 18:37:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7vi5FO/oy0m9MrHzTFOZ2qe4qEb27xtpGVNcJejLWe/aIz2W6yyZsYNt6CtAeQCVotHDk/ X-Received: by 2002:a05:6808:f06:b0:398:19e6:56a9 with SMTP id m6-20020a0568080f0600b0039819e656a9mr279710oiw.2.1686274656516; Thu, 08 Jun 2023 18:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686274656; cv=none; d=google.com; s=arc-20160816; b=CjO4Tfue3+iqtdmFs6Hw+++IhLtZkDzmbkez6YqiwjAK/LTMJ9hhI3J2sfl3GF1j6l 8gOQsQvg2+RWkkJOaP9vbkJy6PNaFUvWjyKTLWL2xQKJGe5zevsOIl26//61195sP5gy +1Iqz280nB078T2BIRYwSKNRpAQ2S/XsXKvBySaL19tVV5ONOF7KwbpROenUDyRN9I4+ gyheYX3w1yVQ4kRl0bTfMIQzr4Zmv0jdkkO6XATwDh0Wf+keXEvtJTvgyf2uSzIOYxnq CkcBeyNN3LtgQvzUNFFAl89SobxdfeEl3O/1Atl8hTTmXzvoy9+pSQBXwOtKgv7gikbJ ysew== 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 :message-id:date:subject:cc:to:from; bh=mHCQ741+CTC8+KKbvikeJ1RcPZBWxfrU2grkUUmVIZE=; b=Iz2Fc+Tis40o+SkrQtU2DNqYbOnmdwiixQHUGBWGKgUfLJCwzfQIpCYspVUdvo1Zvx W9eJ5TM5HjutXVz+oOBZoaE9vGeuVxOgSsWCaRWVOdDyu4BFHMYf+bO079whZfR3hcI7 l96nm36FFV1I7IUxF0o5JYZCvz/mV6ypF4NSV2bSCxz9Fbio5dSQPo71MfoMLj0OjwOS 0Vo+ZKXPERbcy2Dja3mPI23v/36scg/r501QThXnZ/0v7TQUR0g3hzVXD21FY0oQTLI7 DC3PN7Jxv41pc1OcRAlfUQFaqbUPLeEJZYChG2ZQ+Ns2DEeEx1KUpaGOGQEP5Fx9r760 H4gw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w14-20020a17090a460e00b002402275fc56si1852769pjg.118.2023.06.08.18.37.24; Thu, 08 Jun 2023 18:37:36 -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 S237644AbjFIBXl (ORCPT + 99 others); Thu, 8 Jun 2023 21:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237618AbjFIBXj (ORCPT ); Thu, 8 Jun 2023 21:23:39 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9C8930EE for ; Thu, 8 Jun 2023 18:23:35 -0700 (PDT) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Qcjv25s1BzLq7Z; Fri, 9 Jun 2023 09:20:30 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 9 Jun 2023 09:23:33 +0800 From: Kefeng Wang To: Andrew Morton , CC: , Kefeng Wang Subject: [PATCH] mm: kill [add|del]_page_to_lru_list() Date: Fri, 9 Jun 2023 09:39:01 +0800 Message-ID: <20230609013901.79250-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768187134225287233?= X-GMAIL-MSGID: =?utf-8?q?1768187134225287233?= Directly call lruvec_del_folio(), and drop unused page interfaces. Signed-off-by: Kefeng Wang Acked-by: Yu Zhao --- include/linux/mm_inline.h | 12 ------------ mm/compaction.c | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 0e1d239a882c..e9cdeb290841 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -323,12 +323,6 @@ void lruvec_add_folio(struct lruvec *lruvec, struct folio *folio) list_add(&folio->lru, &lruvec->lists[lru]); } -static __always_inline void add_page_to_lru_list(struct page *page, - struct lruvec *lruvec) -{ - lruvec_add_folio(lruvec, page_folio(page)); -} - static __always_inline void lruvec_add_folio_tail(struct lruvec *lruvec, struct folio *folio) { @@ -357,12 +351,6 @@ void lruvec_del_folio(struct lruvec *lruvec, struct folio *folio) -folio_nr_pages(folio)); } -static __always_inline void del_page_from_lru_list(struct page *page, - struct lruvec *lruvec) -{ - lruvec_del_folio(lruvec, page_folio(page)); -} - #ifdef CONFIG_ANON_VMA_NAME /* * mmap_lock should be read-locked when calling anon_vma_name(). Caller should diff --git a/mm/compaction.c b/mm/compaction.c index 3398ef3a55fe..66b442d20d01 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1145,7 +1145,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, low_pfn += compound_nr(page) - 1; /* Successfully isolated */ - del_page_from_lru_list(page, lruvec); + lruvec_del_folio(lruvec, page_folio(page)); mod_node_page_state(page_pgdat(page), NR_ISOLATED_ANON + page_is_file_lru(page), thp_nr_pages(page));