Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1275925pxb; Fri, 21 Jan 2022 14:06:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJydSNOMlYMQTsx2tYmHouR33uOOx8+TsZB+9eoONAc225MSUq11QX+BrO5r8ZyJEdSWaa+D X-Received: by 2002:a17:90b:4f46:: with SMTP id pj6mr2657828pjb.213.1642802803739; Fri, 21 Jan 2022 14:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642802803; cv=none; d=google.com; s=arc-20160816; b=xg3IKhqpZtm6IHv9HKHXeafcumtg1OxpKIItLcFbUDsi0jlP3jVRLAsPAAmpRa9li3 igpm1cwJbTh4ge5Ho+fO1pQbhtQER8YJdXncQGgkl+UG+bFMBrf8e2Py2G7FhBzX9Q4a cR4KAPTqTT6XXHZk4eMI9+Q6yPv6l0SusYxYXDIhmPgjElwzts6Mx7uZcjwTIVI17a3P FQkeprnhT3xceBd84aK3Xt/8zUe/NejOP+sHsaZGQePHfqdntN/ICm+s0klshnO5WNAq 1UrNvtxAKeUlb0AqfNCZI1nHyRF6OZ9xwzFGNhWNHr/MyKLTIP3MCkizOiGpHU5xSF5K /X6g== 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 :dkim-signature; bh=zBfmiGT/V4VCIpMZyCWktizoAUoKEy53SyQ0p8fII2U=; b=Iw+2xvASnRoWc129tsQmeAyf2Luy9/5xQxMVd8wauwNPzwRDnNjBQnQzfrvaLnQXZm PxIgnKhSSuFNiRR3U3F0bLImXX7D0gfCLXG3uO/5KEptwsXMVfEuOiS4NrNwH/xnmhmV 5oEY576SV7feQnBS/9ZFATjOHuUTEzXYoXOiiBi8ighfkmgVabL2wAsqgyEPDM0h/LPG JOGwCbOg9VjRWDmodCZhFF4w9t2u4e3SaLKMgiItoO2OCe3OGAOK817dyakQd1QN5I/q gVaZQMwrIjsDlrgxlOtPbwnVg83zVMZumnNUYVE9xMtPaMoGnKIxkRzlZ7p6ZxDGQmjo dzRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ATtlz/W5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si691138plh.314.2022.01.21.14.06.31; Fri, 21 Jan 2022 14:06:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ATtlz/W5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359178AbiATNLC (ORCPT + 99 others); Thu, 20 Jan 2022 08:11:02 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:38322 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359533AbiATNLB (ORCPT ); Thu, 20 Jan 2022 08:11:01 -0500 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 595E4B81CE3 for ; Thu, 20 Jan 2022 13:11:00 +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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.25.1