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: 13273077 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 60A77C7EE29 for ; Fri, 9 Jun 2023 01:23:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F38558E0003; Thu, 8 Jun 2023 21:23:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE8708E0001; Thu, 8 Jun 2023 21:23:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD7678E0003; Thu, 8 Jun 2023 21:23:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CFFED8E0001 for ; Thu, 8 Jun 2023 21:23:41 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A384D1C7838 for ; Fri, 9 Jun 2023 01:23:41 +0000 (UTC) X-FDA: 80881462242.05.35D903F Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf06.hostedemail.com (Postfix) with ESMTP id 7A65D180006 for ; Fri, 9 Jun 2023 01:23:38 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686273819; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=mHCQ741+CTC8+KKbvikeJ1RcPZBWxfrU2grkUUmVIZE=; b=IwdKoBNvC35Ok2rASpAfP6hzt+381pa9iti6UppFMu/4H3eXCjo0zAoA5XIkm3jfSwVqTv qyOs/tXolIegS1KIK8zmzmiRP22pe14gusov7hMwiclBiSL17OcI2UeLYg7JfUZqaJX43L ZpAvCD1FlOsYpkB9LfMMJW7cduf4Iig= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686273819; a=rsa-sha256; cv=none; b=cLAkDAH4RO3OtFR/b7jPxPYrZrYNEd0JIBV044svGZ8ViuIN3H3EK+HF/540tuegiRXmD/ aJG8j0Gid4jHsAcOKI2yhlUYh/V0EbmX6BlKkn47WFCirk9ezNLygN4AO98t7Cn2kM9Tqc Dd1eNP12f/EHpVLotTz8/Yax0weifko= 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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7A65D180006 X-Stat-Signature: eym1wgyhtjnzek7aro6j1y9r5tqp6dpm X-HE-Tag: 1686273818-46394 X-HE-Meta: U2FsdGVkX1/XMSowBpIqz29Fa6ZaIKHhbaRw3eVSct5pml1io7CTbI77jHENNmILR6y++HgV0E1kLcbZ4Z3kSgS9TchhzCD4b2axtMMrPBWtL4XPphGZLrcaL0GvhTUZCnVddNO3nTfLv3irk4QQT7yJ/prSUJk+ONv4tVCoCiJi18uAL2ApMbaeNtMXBH2NTDrwV7/1ltEywneJhOJ0JyuKmbdOYkssXEzZP5HgBmsJdCwCBcEp1yGWQlUgmOjSs6qUmgrPfYQzw1SPgigsK6wjrEFcB65E1hRpcyOT/JF2iXoUDMKa+2pb9nbBjuSPHzwJWRfoSJ2nIWSP0brKoNiB+deCg8IF4g/v0w/5+85r5IjAaKSfQKBgqURzGC/sCa6Pz+yN8TegPMF/r2C8OBhZjQMkblz6p1KOxDUW/k8e2JOa3ccHsuYpNDnGCPDarq5shCNOR0AC/Cnp3tt2Sb1Y5cg6BpfoFOXi/ygJBpz/BxcRf+jVbKEnwe3YIHxFOrHR09qPAZCvjTmKtQHwRiu+HOrnbjtLYjxS+cW0sIJ3AlHN76P3S5S3BN+BqxXRpA05YS0Paol+aqaqhziGuchOHAbUUM6ahCu5nA9VSqxnAMmJQQP92AHiLEtDU9wyr1cFvsTOHt4Cl1aQTMAG8ohfUIv5eBkOzzLb9l1brn5P5abc/NG3i6WbJVpCkm9zRMHRdL4zx6HcYWCG4OjItjn97rGRoM09dqjO3ZQNbwpzvXbgn75NaXBKHY9lU+mE3IFoWMpY+7VJ5IcOHcFEfZoTIUgHnjsz2zLaROfJ6ceHzS30AXVyWlE1bsHbqZ8hF8eNMWjU9m/+n7lNKOg2uI05M1Wrg3TgzriZWldzcg/VurXXum2s9Hn2AToOFnn+3TamO/Fk8mcO9xvHrZte82MPtVb/ClKlOylyoUzxP8bnqQ+MB0cxEnH28WE9CxK3RYdDvm9RJzwubnKjwoz wYH0hufq erCbqRfMUeYZcV1uKWhFJy+xf0bm9MX+MOPQV3iZchfB8Mr88bOIl9QlyjHGROS4fb78vTPDTXnJHqEUAVXjX6vxEO4K22zewk71czjQr+IwLrlM7I5ow0kA0xRT9eWCEHkeWwJ3P7pW2a4oEAF2oa4tWzIHdZsSOy9DHO30V+hRXjxJ4iKYuReTU6H/xa+3YG+qI 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: 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));