From patchwork Thu Jan 20 13:10:21 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: 12718615 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 F37B6C4332F for ; Thu, 20 Jan 2022 13:11:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26A406B009D; Thu, 20 Jan 2022 08:11:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2175A6B009E; Thu, 20 Jan 2022 08:11:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12D596B009F; Thu, 20 Jan 2022 08:11:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 05AA56B009D for ; Thu, 20 Jan 2022 08:11:02 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BD54920AB5 for ; Thu, 20 Jan 2022 13:11:01 +0000 (UTC) X-FDA: 79050700722.03.6BDFF5D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 5971312005F for ; Thu, 20 Jan 2022 13:11:00 +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 dfw.source.kernel.org (Postfix) with ESMTPS id A1EB06171C; Thu, 20 Jan 2022 13:10:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C35A2C340E2; Thu, 20 Jan 2022 13:10:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642684259; bh=b+tRqGpXikoPLthE/HgxBkFyjXAq1yPdeoFS7WY6SrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ATtlz/W5UoACydVrU+nbgN08od1PSQVib9LIkZRlbqVd8cEuKd+ciUqkbNZif5DT7 CREIzttbg4AUCHewm8oLt5aeJnfEKjHZhLhui8/jqWoOEdcV9oBJVnOMGJlsu/bEk3 vQQ4kMEQEZ/NvF9iTpizMSkJ9eUYyoPLWFF9aO0uV8Bbqi47dJhgOH7IGpSKf0tlwf 9aQIyucyaBpHkapj56vtbiRxeQepa5u7oSTMG0Z5i2PZ6KXUrZmQWyDajsUATpA34B lurdQWtzqvIwW1X/DYdv3KrCvbGP6y7bKxjwRGhF1prS+OVUaGUZ/vTdQBXeovvYV8 clxpnpDscorJA== 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 2/5] mm: remove __clear_page_lru_flags() Date: Thu, 20 Jan 2022 21:10:21 +0800 Message-Id: <20220120131024.502877-3-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 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 5971312005F X-Stat-Signature: 94cudw11a44nafbjtnefz6h1hzyhxonz Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="ATtlz/W5"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf29.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org X-HE-Tag: 1642684260-737680 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 __folio_clear_lru_flags(), 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 | 5 ----- mm/swap.c | 4 ++-- mm/vmscan.c | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index f0aa34b0f2c4..c2384da888b4 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -59,11 +59,6 @@ static __always_inline void __folio_clear_lru_flags(struct folio *folio) __folio_clear_unevictable(folio); } -static __always_inline void __clear_page_lru_flags(struct page *page) -{ - __folio_clear_lru_flags(page_folio(page)); -} - /** * folio_lru_list - Which LRU list should a folio be on? * @folio: The folio to test. diff --git a/mm/swap.c b/mm/swap.c index bcf3ac288b56..953cf8860542 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -86,7 +86,7 @@ static void __page_cache_release(struct page *page) lruvec = folio_lruvec_lock_irqsave(folio, &flags); del_page_from_lru_list(page, lruvec); - __clear_page_lru_flags(page); + __folio_clear_lru_flags(page_folio(page)); unlock_page_lruvec_irqrestore(lruvec, flags); } __ClearPageWaiters(page); @@ -966,7 +966,7 @@ void release_pages(struct page **pages, int nr) lock_batch = 0; del_page_from_lru_list(page, lruvec); - __clear_page_lru_flags(page); + __folio_clear_lru_flags(page_folio(page)); } __ClearPageWaiters(page); diff --git a/mm/vmscan.c b/mm/vmscan.c index c361973774b4..59a52ba8b52a 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2337,7 +2337,7 @@ static unsigned int move_pages_to_lru(struct lruvec *lruvec, SetPageLRU(page); if (unlikely(put_page_testzero(page))) { - __clear_page_lru_flags(page); + __folio_clear_lru_flags(page_folio(page)); if (unlikely(PageCompound(page))) { spin_unlock_irq(&lruvec->lru_lock);