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=unavailable 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 92A5FC433DB for ; Wed, 27 Jan 2021 04:08:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61816206B5 for ; Wed, 27 Jan 2021 04:08:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238163AbhA0EIU (ORCPT ); Tue, 26 Jan 2021 23:08:20 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11199 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236601AbhA0Dh4 (ORCPT ); Tue, 26 Jan 2021 22:37:56 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >