Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3023010pxu; Tue, 8 Dec 2020 01:07:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHDa7vpAgmybHj91BPW9hJkkLdGm+nEwpn4MXJrHicY+yTxQkIZoc6rlm6W48SNcSUJqtV X-Received: by 2002:a17:906:fb0e:: with SMTP id lz14mr20496225ejb.232.1607418463145; Tue, 08 Dec 2020 01:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607418463; cv=none; d=google.com; s=arc-20160816; b=om5v6iCOHd/rD+yF3CV8fzN3OJbyQUk4NXAtZRKqBX1j8EgkZWSCWATqeEnnmFPfSS m2J8Th33HxwPwKfP4v6LnAowBp1lHktVPXEc3FLknxgBCtk39PvceqVEhNVsfYVUEkiD PDkQAsDAiY/LOD8aFt9zuyXaq7rMryEsxcNnKgXAWkpu3SZxmpGewNh6KSCvBMnEpEo8 517MfZQjg+nuu1sMuwqgIHgx4MctORRa871RrNb9X3RJeE2wrMrjR0cGulQoyp0DDzUF SHjgO5l5I9hLJTpL0uHykryxKKrWcTq+om0xd2m4meUyl9i1jOxtj//nLCYELOVxFZAY C/KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=H9r+PoimR1pZut9F4w9NPP/GXOUQUMgekr44siQpZaY=; b=eCt6G7V9F7vg1ovFD/ayL50bsQnOEPmvu7PvOm4K3WyXrt9xFLq76SZdUiWBkFsG3u WddwuO1u9zADQAh+oqf2kvqspUdzRJYq/Kxe/T1MMRHz/3JWendOc+1V1lkqT+EpIVDW Wkh8lbOdRZN8G/zSBBwcuCpw0W6cV3EJLV7zRwyMq5yGQ5A7boN8xs+saugdIqvHRhNM o7WdTdiQhBKgbXBtNjLngLOIRP1h3MyW5JyvJ+7KizOIIePSQpOmjhHmJQGDQMdpchPq F7M87UqKdWvPce29v/Tk7EumfRvVj12dZKNxb5B0pY5O+MtzHIRKR8dFYd9/Yz/4alxC 8mcg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k1si8004126ejz.139.2020.12.08.01.07.20; Tue, 08 Dec 2020 01:07:43 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbgLHJDm (ORCPT + 99 others); Tue, 8 Dec 2020 04:03:42 -0500 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:50281 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728644AbgLHJDk (ORCPT ); Tue, 8 Dec 2020 04:03:40 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0UHydr.H_1607418174; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UHydr.H_1607418174) by smtp.aliyun-inc.com(127.0.0.1); Tue, 08 Dec 2020 17:02:54 +0800 Subject: Re: [PATCH 08/11] mm: fold page_lru_base_type() into its sole caller To: Yu Zhao , Andrew Morton , Hugh Dickins Cc: Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Vlastimil Babka , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20201207220949.830352-1-yuzhao@google.com> <20201207220949.830352-9-yuzhao@google.com> From: Alex Shi Message-ID: Date: Tue, 8 Dec 2020 17:02:54 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201207220949.830352-9-yuzhao@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Alex Shi 在 2020/12/8 上午6:09, Yu Zhao 写道: > We've removed all other references to this function. > > 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 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; > } > >