From patchwork Thu Jan 20 13:10:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 12718617 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 9D12EC433F5 for ; Thu, 20 Jan 2022 13:11:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF0646B009E; Thu, 20 Jan 2022 08:11:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C7DEF6B00A0; Thu, 20 Jan 2022 08:11:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B220C6B00A2; Thu, 20 Jan 2022 08:11:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay028.a.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 950EF6B009E for ; Thu, 20 Jan 2022 08:11:06 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5B66120AFC for ; Thu, 20 Jan 2022 13:11:06 +0000 (UTC) X-FDA: 79050700932.03.F2A60E0 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf24.hostedemail.com (Postfix) with ESMTP id D1CAD180043 for ; Thu, 20 Jan 2022 13:11:04 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1BAE1B81CE2; Thu, 20 Jan 2022 13:11:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8150CC340E7; Thu, 20 Jan 2022 13:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642684261; bh=trAm6qhV2AxtHG/93R7Wnd9+hGYx/SylLR/GP3OdBf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oiD1Cl3MrN4U8YuD+9BRofhf9vP1ui5TG1iJHLB3lIG67n29ypCdGsnv5aBMw/37f NJSTKlXZw5xN6AVwtK4Mz18hRdL0R7NsYvZhlwI8a5V8vXsOmzhAyjUmH5FMfzTVI2 nNWJ5jAVQrRr26jctDAkiPJFZVTxpM1lmv23kxOKg4CfdMrWoqMbv1/ocY1sjzMoM5 gIGL30/XiNjU3Mp2AslYoSOO+s5cMI/BcFoiq4UbrMssE6iObNNJa3kV47RSqDVrH/ +jENH16w6tg9pFDAmn3juqBlVkKyP09yU4BoG26llAbMgfxqgh3eazLR83AbPCYwU6 0AZsK9joQyI9g== From: alexs@kernel.org To: Andrew Morton Cc: Alex Shi , Steven Rostedt , Ingo Molnar , Naoya Horiguchi , Yu Zhao , Arnd Bergmann , Vlastimil Babka , Mel Gorman , Johannes Weiner , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/5] mm: remove add_page_to_lru_list() function Date: Thu, 20 Jan 2022 21:10:22 +0800 Message-Id: <20220120131024.502877-4-alexs@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220120131024.502877-1-alexs@kernel.org> References: <20220120131024.502877-1-alexs@kernel.org> MIME-Version: 1.0 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=oiD1Cl3M; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of alexs@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=alexs@kernel.org X-Stat-Signature: pre59xu96tkq8twm49icy9obbtirs9fy X-Rspamd-Queue-Id: D1CAD180043 X-Rspamd-Server: rspam12 X-HE-Tag: 1642684264-598181 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: From: Alex Shi The function could be fully replaced by ruvec_add_folio(), no reason to keep a duplicate one. Signed-off-by: Alex Shi Cc: Andrew Morton Cc: Yu Zhao Cc: Alex Shi Cc: Vlastimil Babka Cc: Arnd Bergmann Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org --- include/linux/mm_inline.h | 6 ------ mm/swap.c | 6 +++--- mm/vmscan.c | 4 ++-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index c2384da888b4..7d7abd5ff73f 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -92,12 +92,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) { diff --git a/mm/swap.c b/mm/swap.c index 953cf8860542..fb101a06dce4 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -543,7 +543,7 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec) * It can make readahead confusing. But race window * is _really_ small and it's non-critical problem. */ - add_page_to_lru_list(page, lruvec); + lruvec_add_folio(lruvec, page_folio(page)); SetPageReclaim(page); } else { /* @@ -569,7 +569,7 @@ static void lru_deactivate_fn(struct page *page, struct lruvec *lruvec) del_page_from_lru_list(page, lruvec); ClearPageActive(page); ClearPageReferenced(page); - add_page_to_lru_list(page, lruvec); + lruvec_add_folio(lruvec, page_folio(page)); __count_vm_events(PGDEACTIVATE, nr_pages); __count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, @@ -592,7 +592,7 @@ static void lru_lazyfree_fn(struct page *page, struct lruvec *lruvec) * anonymous pages */ ClearPageSwapBacked(page); - add_page_to_lru_list(page, lruvec); + lruvec_add_folio(lruvec, page_folio(page)); __count_vm_events(PGLAZYFREE, nr_pages); __count_memcg_events(lruvec_memcg(lruvec), PGLAZYFREE, diff --git a/mm/vmscan.c b/mm/vmscan.c index 59a52ba8b52a..f09473c9ff35 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2354,7 +2354,7 @@ static unsigned int move_pages_to_lru(struct lruvec *lruvec, * inhibits memcg migration). */ VM_BUG_ON_PAGE(!folio_matches_lruvec(page_folio(page), lruvec), page); - add_page_to_lru_list(page, lruvec); + lruvec_add_folio(lruvec, page_folio(page)); nr_pages = thp_nr_pages(page); nr_moved += nr_pages; if (PageActive(page)) @@ -4875,7 +4875,7 @@ void check_move_unevictable_pages(struct pagevec *pvec) if (page_evictable(page) && PageUnevictable(page)) { del_page_from_lru_list(page, lruvec); ClearPageUnevictable(page); - add_page_to_lru_list(page, lruvec); + lruvec_add_folio(lruvec, page_folio(page)); pgrescued += nr_pages; } SetPageLRU(page);