From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 3338EC433DB for ; Wed, 27 Jan 2021 02:14:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD992206B5 for ; Wed, 27 Jan 2021 02:14:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD992206B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 384696B0005; Tue, 26 Jan 2021 21:14:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3348E6B0006; Tue, 26 Jan 2021 21:14:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24B006B0007; Tue, 26 Jan 2021 21:14:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id 101D06B0005 for ; Tue, 26 Jan 2021 21:14:23 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C036C181AEF2A for ; Wed, 27 Jan 2021 02:14:22 +0000 (UTC) X-FDA: 77749935564.11.cast56_1303cc927593 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 9EDA8180F8B80 for ; Wed, 27 Jan 2021 02:14:22 +0000 (UTC) X-HE-Tag: cast56_1303cc927593 X-Filterd-Recvd-Size: 4244 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Jan 2021 02:14:21 +0000 (UTC) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DQRvZ5rH1zlBL3; Wed, 27 Jan 2021 10:12:42 +0800 (CST) Received: from [10.174.179.117] (10.174.179.117) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Wed, 27 Jan 2021 10:14:11 +0800 Subject: Re: [PATCH v2 02/10] mm: shuffle lru list addition and deletion functions To: Yu Zhao CC: Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Vlastimil Babka , Matthew Wilcox , , , Andrew Morton , Hugh Dickins , Alex Shi References: <20210122220600.906146-1-yuzhao@google.com> <20210122220600.906146-3-yuzhao@google.com> From: Miaohe Lin Message-ID: <3057fa2e-b84b-fce9-783b-fb2b0adbe08e@huawei.com> Date: Wed, 27 Jan 2021 10:14:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210122220600.906146-3-yuzhao@google.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.117] X-CFilter-Loop: Reflected 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: On 2021/1/23 6:05, Yu Zhao wrote: > These functions will call page_lru() in the following patches. Move > them below page_lru() to avoid the forward declaration. > > Link: https://lore.kernel.org/linux-mm/20201207220949.830352-3-yuzhao@google.com/ > Signed-off-by: Yu Zhao Reviewed-by: Miaohe Lin > --- > include/linux/mm_inline.h | 42 +++++++++++++++++++-------------------- > 1 file changed, 21 insertions(+), 21 deletions(-) > > diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h > index 8fc71e9d7bb0..2889741f450a 100644 > --- a/include/linux/mm_inline.h > +++ b/include/linux/mm_inline.h > @@ -45,27 +45,6 @@ static __always_inline void update_lru_size(struct lruvec *lruvec, > #endif > } > > -static __always_inline void add_page_to_lru_list(struct page *page, > - struct lruvec *lruvec, enum lru_list lru) > -{ > - update_lru_size(lruvec, lru, page_zonenum(page), thp_nr_pages(page)); > - list_add(&page->lru, &lruvec->lists[lru]); > -} > - > -static __always_inline void add_page_to_lru_list_tail(struct page *page, > - struct lruvec *lruvec, enum lru_list lru) > -{ > - update_lru_size(lruvec, lru, page_zonenum(page), thp_nr_pages(page)); > - list_add_tail(&page->lru, &lruvec->lists[lru]); > -} > - > -static __always_inline void del_page_from_lru_list(struct page *page, > - struct lruvec *lruvec, enum lru_list lru) > -{ > - list_del(&page->lru); > - update_lru_size(lruvec, lru, page_zonenum(page), -thp_nr_pages(page)); > -} > - > /** > * page_lru_base_type - which LRU list type should a page be on? > * @page: the page to test > @@ -125,4 +104,25 @@ static __always_inline enum lru_list page_lru(struct page *page) > } > return lru; > } > + > +static __always_inline void add_page_to_lru_list(struct page *page, > + struct lruvec *lruvec, enum lru_list lru) > +{ > + update_lru_size(lruvec, lru, page_zonenum(page), thp_nr_pages(page)); > + list_add(&page->lru, &lruvec->lists[lru]); > +} > + > +static __always_inline void add_page_to_lru_list_tail(struct page *page, > + struct lruvec *lruvec, enum lru_list lru) > +{ > + update_lru_size(lruvec, lru, page_zonenum(page), thp_nr_pages(page)); > + list_add_tail(&page->lru, &lruvec->lists[lru]); > +} > + > +static __always_inline void del_page_from_lru_list(struct page *page, > + struct lruvec *lruvec, enum lru_list lru) > +{ > + list_del(&page->lru); > + update_lru_size(lruvec, lru, page_zonenum(page), -thp_nr_pages(page)); > +} > #endif >