From patchwork Mon Dec 7 22:09:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 11956979 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.5 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 9D7B6C4167B for ; Mon, 7 Dec 2020 22:10:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 438CC2395A for ; Mon, 7 Dec 2020 22:10:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 438CC2395A 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 662F08D0008; Mon, 7 Dec 2020 17:10:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 50F088D000F; Mon, 7 Dec 2020 17:10:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FBBD8D000A; Mon, 7 Dec 2020 17:10:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id E97688D000A for ; Mon, 7 Dec 2020 17:10:14 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A4E82824999B for ; Mon, 7 Dec 2020 22:10:14 +0000 (UTC) X-FDA: 77567880348.19.drain53_010a75c273e1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 38CC91AD1B4 for ; Mon, 7 Dec 2020 22:10:14 +0000 (UTC) X-HE-Tag: drain53_010a75c273e1 X-Filterd-Recvd-Size: 4639 Received: from mail-qk1-f202.google.com (mail-qk1-f202.google.com [209.85.222.202]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 7 Dec 2020 22:10:12 +0000 (UTC) Received: by mail-qk1-f202.google.com with SMTP id a68so7112522qke.9 for ; Mon, 07 Dec 2020 14:10:12 -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=h0OiZUD2Xpj8wH+yrifT175RqRi+PBeb00G32sH3P0Y=; b=DvNTqP0Jlg37VPbc2IrU9Pi+z1DkfYcdpq+P8NKbSX5O4nR9+j1cJ/O7LgDhG6ijWS 5WJrRyQ9KRj2fcmKVTH6HUkEAC3mRxu+7jsql3dYH6K0bEbI6sQmRqfgK5T6Sn0lsNsQ FV2ifEGawMSAgN48r8Rk38P1zjpaAOaqsFPr7xuR9r6XpdYY8KWCUlLUBwWGdy2sC/b3 97xjHAFK+USl+MsFwNv1hwIoc9J3eGUDlJg+qVSMHN+ioy3g07+q1CtrpQA7AMlzd+Xi MRstm38sV1pNPo6mendy2h7S1ZhNp6ekXl1EEep86WN2Xr2a3m+olse1oMEm/wEdfDPT ipuw== 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=h0OiZUD2Xpj8wH+yrifT175RqRi+PBeb00G32sH3P0Y=; b=Qq7y0vzKNqA6PvbhuQ92FuLMhX+zv6pE4ryHgnhfNJ//bUDJNxqPdK4Vz4LQZ3ySWN UOq5jlV2NUy9nY5KK5DU991l7+z0wXW6idwz6qVj7n67ZDsCsQw8+Vw+Syxfyad4c0TO Tp+El3GtdE5j2tk44wUOQmsSd9XALM3uNROt80UaE4sDbq9J7cd9jmWg8cRvDGliX6rh ECS1FtBxR0EDfJKBu6+16kcxBhH29khGmsvdWqSn9VPj859QH5S/x5wQc750pJ40P9wm oZ61k6vDCdAn3Vu6esa1XLfSawuW/FeiODrzbzQpwdW8kwwGspT1d+uZ5AGySwBOyko9 4AOg== X-Gm-Message-State: AOAM533jFOm5mdFGPlzx5ph3xW68sQ/zxQlWQ7JR+XFmYPnVKnjjeiMc KAmA+dBYQISbCAFLGtmQorUT7PnWJ/g= X-Google-Smtp-Source: ABdhPJwqHNXxnqK14pujguHwfglOZuFBgiZx/0erN/Z0wWVSGH4yVtQs+MW8BefBjdNfc6hh2AsPchdiBe4= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:7220:84ff:fe09:2d90]) (user=yuzhao job=sendgmr) by 2002:a05:6214:1785:: with SMTP id ct5mr4855273qvb.26.1607379011448; Mon, 07 Dec 2020 14:10:11 -0800 (PST) Date: Mon, 7 Dec 2020 15:09:46 -0700 In-Reply-To: <20201207220949.830352-1-yuzhao@google.com> Message-Id: <20201207220949.830352-9-yuzhao@google.com> Mime-Version: 1.0 References: <20201207220949.830352-1-yuzhao@google.com> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog Subject: [PATCH 08/11] 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. 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; }