From patchwork Fri Sep 18 03:00:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 11783933 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1DCB59D for ; Fri, 18 Sep 2020 03:01:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 835CB206B7 for ; Fri, 18 Sep 2020 03:01:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="cWN5izs+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 835CB206B7 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 F1455900004; Thu, 17 Sep 2020 23:01:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E9B608E0001; Thu, 17 Sep 2020 23:01:12 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1297900004; Thu, 17 Sep 2020 23:01:12 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id B31BC8E0001 for ; Thu, 17 Sep 2020 23:01:12 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8214A180AD811 for ; Fri, 18 Sep 2020 03:01:12 +0000 (UTC) X-FDA: 77274680784.10.mine35_1d03fbd27127 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 588AA16A07E for ; Fri, 18 Sep 2020 03:01:12 +0000 (UTC) X-Spam-Summary: 1,0,0,f1a9c18b8f2f6ee3,d41d8cd98f00b204,39yjkxwykcm4iej1u808805y.w86527eh-664fuw4.8b0@flex--yuzhao.bounces.google.com,,RULES_HIT:41:69:152:355:379:541:800:960:968:973:988:989:1260:1277:1313:1314:1345:1359:1437:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3152:3353:3865:3867:3868:3874:4250:4321:5007:6261:6653:6742:7875:8957:9010:9592:9969:10004:10400:11026:11473:11658:11914:12114:12296:12297:12438:12555:12895:12986:13069:13311:13357:14096:14097:14181:14394:14659:14721:21080:21444:21627:21990:30054:30070,0,RBL:209.85.160.202:@flex--yuzhao.bounces.google.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100;04ygrutmbspk37em4fc3qdhnf3yuqops1ghmj9jz6zbmis6w1996ofgdi4mzdde.y9tgtqtaou3q19d6okmux7oajx4gz14wo17w11erqr1i3bpqmwpkdm8m41ixiru.w-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: mine35_1d03fbd27127 X-Filterd-Recvd-Size: 4991 Received: from mail-qt1-f202.google.com (mail-qt1-f202.google.com [209.85.160.202]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 03:01:11 +0000 (UTC) Received: by mail-qt1-f202.google.com with SMTP id o13so3800199qtl.6 for ; Thu, 17 Sep 2020 20:01:11 -0700 (PDT) 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=b85d06LSJeBa6rsJlkkKw7JSUKETD4Y77r+y+YRUjRk=; b=cWN5izs+aaUKIykYldczEGDmX7RVsvXEViMXNM8ddq7IeJUErvEZ7YdO38E4AFWwxP YEGT0mKVWONgbxqp+r4pTV4D1WwdDlqTrABmb6KVFHS5OFMTLKY2UEzRGM+vL7hhdhKx IaQIzDSeHjmyce1otEEqrqDyv6uST3U5GfHz2sDAE1s8kXR5cjQj4EETNK69mu8yGn9j GvzZfTkNo0CzoDjDLYHYJ8I5KsS2eGdRS+qV0OiiRKfOB1pppqA28sk9tyOGnxQxSwcr G+u1NzRVk46Muag854KLQHKD6YgqmcxLbkzWgPIt4r7DV7v+ZaC3USwXXEuUreUOuKSI IIcw== 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=b85d06LSJeBa6rsJlkkKw7JSUKETD4Y77r+y+YRUjRk=; b=GXwjqEcRcIe0dp7IY7/It5TpM1wy1nuJtHPsY666gk5xsEV0yh6p62y94O1ILxhxca 8YdN6nB460cH7HzTlJx4HI8i6h0NjLjzwsI5J+/rRlH5BV6IU+lbwV/5Ex3Zr2VDf0Xo kD5ORaDZdfgz4XNpFMnWYCB/EJFHUxHX9jafdknhNXJH+yPQLG3KD4pNAnI3Slru1Xuk IW+XA2ArDJDY1hSfVP44bYYcuJTXZn1rcVCuAjMU66b6Mwnt+9HOsEvEYUlIZzcIonAH DT7+1ARtueTMiM5cTzfDpgdQYZJDP3/Dt9mMTbwnSS/f4ApDYZw1W4BsPIHaU3WOQDoy gHZQ== X-Gm-Message-State: AOAM533uIOUlDB9lyXb5S+z4caNA5SY9ezN6wT7erKFCHoxz9tr2+rij IP2FFFMdFr9GG4bC2hkw+Gnzoin1Hmo= X-Google-Smtp-Source: ABdhPJx+hjixMwDHpA9umqu4pgWDN6Xi+UKbNRpq8JuDRKAm+QSAwliVY3yAQF3K3VTtyDo+SOcVYv9cqh0= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:7220:84ff:fe09:2d90]) (user=yuzhao job=sendgmr) by 2002:a0c:e6ea:: with SMTP id m10mr15321673qvn.53.1600398071234; Thu, 17 Sep 2020 20:01:11 -0700 (PDT) Date: Thu, 17 Sep 2020 21:00:47 -0600 In-Reply-To: <20200918030051.650890-1-yuzhao@google.com> Message-Id: <20200918030051.650890-10-yuzhao@google.com> Mime-Version: 1.0 References: <20200918030051.650890-1-yuzhao@google.com> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [PATCH 09/13] mm: inline page_lru_base_type() From: Yu Zhao To: Andrew Morton , Michal Hocko Cc: Alex Shi , Steven Rostedt , Ingo Molnar , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Shakeel Butt , Chris Down , Yafang Shao , Vlastimil Babka , Huang Ying , Pankaj Gupta , Matthew Wilcox , Konstantin Khlebnikov , Minchan Kim , Jaewon Kim , cgroups@vger.kernel.org, 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. This change should have no side effects. Signed-off-by: Yu Zhao --- 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 ef3fd79222e5..07d9a0286635 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 @@ -88,12 +73,12 @@ static __always_inline enum lru_list page_lru(struct page *page) enum lru_list lru; 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; }