Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp494645pxb; Wed, 27 Jan 2021 12:59:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvwbJXEIKECqhlNiNViMcEeQ0JxWfclWTiFnCUXQ9vBtru4HyAlqen32lodIm3s1Alz08A X-Received: by 2002:a17:906:6bca:: with SMTP id t10mr8033383ejs.35.1611781151113; Wed, 27 Jan 2021 12:59:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611781151; cv=none; d=google.com; s=arc-20160816; b=UmLsX7tUtEropmdnSOENKniSqxpBBPFKY+mhYA5nPcHpSXIFUswujZuBuxnKqpdI2f d5+bFcxgiPpEt7jF7yfaJdk5jpycbmr9t5UZ5OhvyA6xxieGIBdPDWFGWdU65VP1BSbl FqY5TbnMIHDk8ACzWdolaFY84urMKkVA1KzxQrJ9Ht/PPB2IQN6wVdZHmy5q1clyHS65 qPwITtIeMeXau0XsqpGREqilT6r6atv0kccsvq646tpvCNhDF/J1akAuI09AUv42qtws q88r8pm+gVqfjfRfiUbyh0XdzusDSVpixYfLyohEPkPHYm9za8iODdgYs/710LZ1X05r PSAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=UMfH6TP/8awbaZ3X1TZlA3/QyoJrxWczOtg1JYwQh7U=; b=sgSgNeqKc6l/94Wzzr9Y5sy41pKqWsoAG1DZDLALnu6DbKNPzBUQ2jmsG6qydrPGfI HAK/RHfJMFkNyUDrb1O+bdT41C+Ia4+XWgDyihWmzv4H4qluwDbG+ozKsG5rEa6dOUwO 0Yw1lqrrclTzRHawOQnqD4zTiPjhrWjx9MjtpMlB9jI5dK+RPn0+GlaVQHCieqNaT+cX +KRtB5Nc0QMm3Jz/6MWz32R35rDeO7oWD94it/bsAfKD2S8AGMyq9EZ4QVPO+eU8CP1B ErYfaXoilYWiNFCftzGg+1sLmtSt9uN4C1/M3ojGKKOLA07YzsdtrqejTLvo48+Zuuwg +t7w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si1587776edr.115.2021.01.27.12.58.45; Wed, 27 Jan 2021 12:59:11 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238155AbhA0EIO (ORCPT + 99 others); Tue, 26 Jan 2021 23:08:14 -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 >