From patchwork Fri Jan 22 22:05:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 12040735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECA6BC433E6 for ; Fri, 22 Jan 2021 22:06:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7D74323B06 for ; Fri, 22 Jan 2021 22:06:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D74323B06 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3CC908D0001; Fri, 22 Jan 2021 17:06:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 37CC46B0027; Fri, 22 Jan 2021 17:06:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CE478D0001; Fri, 22 Jan 2021 17:06:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id F0BDE6B0026 for ; Fri, 22 Jan 2021 17:06:14 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BFC8282D9A69 for ; Fri, 22 Jan 2021 22:06:14 +0000 (UTC) X-FDA: 77734795068.03.lock17_440bbe42756f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 9D85728A4E8 for ; Fri, 22 Jan 2021 22:06:14 +0000 (UTC) X-HE-Tag: lock17_440bbe42756f X-Filterd-Recvd-Size: 4771 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Jan 2021 22:06:14 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id w30so788175ybi.7 for ; Fri, 22 Jan 2021 14:06:13 -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=FIeltdhyq3Ey+TBau+pUltUBRnSqQsXsuAf+iU/R25vyMk5EFkVGUxawGHQ76CwKNF DbV/kZAcNWrwelI8tFWp5XLZd5ZSy57GylCuhcwmoPvZCh62RAXLg/gtwy11v+vw4T0d AlSE+lHfO7CD8Jr7763HsVfjzZ/Pg8OuFQajxlHbHVO4Cdrsyj70qk53puNu1gQsvNUA fwe5QMF4CII8z1ovBGh/GwIaxQduCDqLPuoMGZPHwh0voZrypCEYCVE+exolEfrt2fLA 7kreIehpfSM/6vRK7EFGUmeEB5ksUfXl52WX3An/5WHcGQpvJ3B6qTdX4eeEaaCDkw5w 5uqA== X-Gm-Message-State: AOAM533lvyjOlSiXkQloc4oUSQArXCtpjrzm49OFhf+DPWsokCc/34oU 8KO9B9v7RrI5qEo8bbKorjU+UHxKw3o= X-Google-Smtp-Source: ABdhPJzIdc5hTMSR1DaMMMCo4TFYoBE0en2JSCPQGQzA1Er5XzYdpjzSDq/j5NqC0FnAyeiIi+/Ammgzqgw= 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 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: 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; }