Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1373912pxb; Fri, 22 Jan 2021 14:11:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJydLu7X/+C3GoVMDjaxUUegYU2aJDV8Ejc6c6UPzfr5QLD6ojiXe2ABHsYt5aBXGBrp3muZ X-Received: by 2002:a50:fc97:: with SMTP id f23mr5103768edq.307.1611353484563; Fri, 22 Jan 2021 14:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611353484; cv=none; d=google.com; s=arc-20160816; b=oRPhW8XmUz6zPd7TXp2o+DH4g7L2Espc0F31Vnfv25q2369CVEMAkbB0n5lKQGb7xd QM4ywSO/ASnzzBe8n0XIfbdVCCX8T91nSI4I+uLqrn4AsSottz9f2UjYpSye0nbTzmvP 8gKLWh9guVBsQVmevX2taC+xVVDiptvd0mdjG0xBsczSMMKZga24nfiRyU+Of0Ko/5NP HLjJudA+r9KuRiEypWeCH8QnmFGZFTnbtC/62b3Gv3AHVqLCh80BgGDJRp/Je10K+wJG wPQngggscd6g58gC8A3dlzCp0Sgl3pO34pgTWZa8N1LBN14o5lAC+YC4IVUnjXWVMwnG sl2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=CLgXtoSMSf4chkEdW8yrd9bZvEDFHVek70YcRsgvLdo=; b=ib+LdKqLd8R4TqDUoTj9R1vU83tOufs+wJgOv7v0hJiH066pB+ZrAMx13hemotay+7 whzanUgVj9uD8DoqGtAzz6eq3qEaj3QgIh4QGdcSXjz0y77FiifOneze4kPR8fYcdFMW HRuyZtRVRYKUBQWvMwM1Uv3GdA0wuZHoJVT8E1XGqGkp0OivFj7JC2F1YC+nR3u8NEsC o9WWSzOwDhGYR0dLKPl6HnOwMDvb9BoZrGB6tSvxm2FIVFtcNuiZwmpPEionuJUwQrJe Nk/mZ82MrfahxnwkA6Xb4oeUAB5u3B80+b19XqZKwWLW0gQtet64Yn7wWeV2RjfAEShS h14Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=n21Qu+vh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si3467835ejc.544.2021.01.22.14.11.00; Fri, 22 Jan 2021 14:11:24 -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=@google.com header.s=20161025 header.b=n21Qu+vh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730929AbhAVWKQ (ORCPT + 99 others); Fri, 22 Jan 2021 17:10:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730676AbhAVWHa (ORCPT ); Fri, 22 Jan 2021 17:07:30 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25EAFC0617A7 for ; Fri, 22 Jan 2021 14:06:14 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id b62so6898329ybg.1 for ; Fri, 22 Jan 2021 14:06:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=CLgXtoSMSf4chkEdW8yrd9bZvEDFHVek70YcRsgvLdo=; b=n21Qu+vhD3FPQnNErkSfyB1JJsQj8dItdHyxzI4vIlKcnF69dBaAYDhS5EVTSWeTET lAFQAhNAm9xzKpF31PCWyVotC/FoEYwZEvKIfZB6X+cCVucd53PWMQ0+6RXC+2zHfl6O XM5vBvdJa/29P+ox0xdEyex8bfXnupKtZDsU5lzohHPAluJPt8nVS97YAgV4oSQXBE7a 6P0cM21iJv4Mqj8xTw1RKaQHaupNxxdnVTmIYsHhVtHj8f6Y97B2TTR4dPsyVqUVZXII y0E0ubLraQ/d/r2J/Lr5YsD2dTZKtpoBQGWVcAebiuVnFixbtqMqy91djMJEYKcJz6XU 5nMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=CLgXtoSMSf4chkEdW8yrd9bZvEDFHVek70YcRsgvLdo=; b=kQ+lD6wH62ypSWOe8NHd4jJac0HXraD3s1U5A5nguV5SlsSdF4nyCqB8q5jyVQIVyG Ib61XonmIRLaT445Sq8OMR+ueUu8mrfo4Ay9zrYxQ1sBLOT5YWEz563HMVMZM+PTB+2V CBTUJkMuUTJqSgjEomoXj/UwqwYeT7H4f1byIuyFmhWWREobWDnSZmOxwvXpuy5eRorc NIQqnzYzySndKIBGEbHRzeJ9hyag7U403UbJicZpGgkbcKWdmN6xQc4T38noXp+UbnDJ 9WW9FMhkvXKsZ531YxSRMpCTVPNQpJcbmi+RuH4daPRrlINQANg4v9VnO9g/GYMKwt8c ++3A== X-Gm-Message-State: AOAM5331B3zMdvQc3XWA/TqwiKeVjOaZQDyoyx+/bCn+kfLprN8bfxbx cY+BS5Dn8gIWkq53VZlE65N0EL47CHA= Sender: "yuzhao via sendgmr" X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:5129:9a91:ef0e:c1a9]) (user=yuzhao job=sendgmr) by 2002:a25:a86:: with SMTP id 128mr8664734ybk.370.1611353173347; Fri, 22 Jan 2021 14:06:13 -0800 (PST) Date: Fri, 22 Jan 2021 15:05:58 -0700 In-Reply-To: <20210122220600.906146-1-yuzhao@google.com> Message-Id: <20210122220600.906146-9-yuzhao@google.com> Mime-Version: 1.0 References: <20210122220600.906146-1-yuzhao@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH v2 08/10] mm: fold page_lru_base_type() into its sole caller From: Yu Zhao To: Andrew Morton , Hugh Dickins , Alex Shi Cc: Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Vlastimil Babka , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We've removed all other references to this function. Link: https://lore.kernel.org/linux-mm/20201207220949.830352-9-yuzhao@google.com/ Signed-off-by: Yu Zhao Reviewed-by: Alex Shi --- include/linux/mm_inline.h | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 6d907a4dd6ad..7183c7a03f09 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -45,21 +45,6 @@ static __always_inline void update_lru_size(struct lruvec *lruvec, #endif } -/** - * page_lru_base_type - which LRU list type should a page be on? - * @page: the page to test - * - * Used for LRU list index arithmetic. - * - * Returns the base LRU type - file or anon - @page should be on. - */ -static inline enum lru_list page_lru_base_type(struct page *page) -{ - if (page_is_file_lru(page)) - return LRU_INACTIVE_FILE; - return LRU_INACTIVE_ANON; -} - /** * __clear_page_lru_flags - clear page lru flags before releasing a page * @page: the page that was on lru and now has a zero reference @@ -92,12 +77,12 @@ static __always_inline enum lru_list page_lru(struct page *page) VM_BUG_ON_PAGE(PageActive(page) && PageUnevictable(page), page); if (PageUnevictable(page)) - lru = LRU_UNEVICTABLE; - else { - lru = page_lru_base_type(page); - if (PageActive(page)) - lru += LRU_ACTIVE; - } + return LRU_UNEVICTABLE; + + lru = page_is_file_lru(page) ? LRU_INACTIVE_FILE : LRU_INACTIVE_ANON; + if (PageActive(page)) + lru += LRU_ACTIVE; + return lru; } -- 2.30.0.280.ga3ce27912f-goog