Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1275913pxb; Fri, 21 Jan 2022 14:06:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHQRF2gqpPvmxXimnRjyxzyatmwEBuoZVZQPMfjsnVgql6Fj55FGCGccZ1dJb9Wu0s4JQW X-Received: by 2002:a17:902:8307:b0:14a:c935:4403 with SMTP id bd7-20020a170902830700b0014ac9354403mr5099376plb.15.1642802802241; Fri, 21 Jan 2022 14:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642802802; cv=none; d=google.com; s=arc-20160816; b=UinfsqXfDmDJjLXfr8CdKt90YFjSHCxTCmtXTtFaMzz4KtovZnoZ7ijx9TtSLok36R 1gWHxohPfT9xeGvTQ5Xu18Wj5X2iKrPUVufSaOegb8bug//vLo+WHxcVgv3CZ4yPCY4k 4tHab/4vyUeEBjqWWhdieBSTczVtYSaRS2OQsO3nLu3V2ciPxVGgeoXL0hjTKFptoTEL nIFEdJjJKsJwfC4X3UQr5l0fJzQ6lBpOBVBFs9HRfTydsUZzbz8JORRnJQApnlYxvpHl yjWnb7FdDaWffhA7v0BZyam7gTs5GeEfAyFx2cQWxyrHqdQPlGtiKninABsu+V5Dfu7V Vjyg== 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=5v5q5ac4bJfJn+I3CavcJ59vFutP9hjWZPNtRd4Va+Q=; b=XnYeLQ0zIlTIn+McazpMv+4wVdp3HVN6IV6fi2KnquH2ctYJ8JF/lOEBzBjRy1KQ5/ xq/VwHCBzcGRkOF59Ya6csfSVlV/2kLGppaLHHVY0tUfulKWedm34Qjd+/7WMc+YMntL 0PVX35QP/CY6PTab3gYYPIvYsnTeWslNRVM079t0Q1XpGGoxNOHZanNiDYVAZQ0S8bJx jz1XIlHYmzQcdKPOLBTm4gCyQk2zXKnoh2fk/VkHPAslAbkWF/jIh2D3tw3Dosz3QZPG gF7WoGyRxquPOajJvc2muk+aqvzlIzCjZhZYCG6DyfE/iRagJklcuimFQx0ofi2AM316 Jq6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oiD1Cl3M; 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 r11si4041613plr.178.2022.01.21.14.06.30; Fri, 21 Jan 2022 14:06:42 -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=oiD1Cl3M; 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 S1359663AbiATNLE (ORCPT + 99 others); Thu, 20 Jan 2022 08:11:04 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:44908 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359601AbiATNLC (ORCPT ); Thu, 20 Jan 2022 08:11:02 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 61E88616B7 for ; Thu, 20 Jan 2022 13:11:02 +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 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 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); -- 2.25.1