All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Yu Zhao <yuzhao@google.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Roman Gushchin <guro@fb.com>, Vlastimil Babka <vbabka@suse.cz>,
	Matthew Wilcox <willy@infradead.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	Alex Shi <alex.shi@linux.alibaba.com>
Subject: Re: [PATCH v2 02/10] mm: shuffle lru list addition and deletion functions
Date: Wed, 27 Jan 2021 10:14:11 +0800	[thread overview]
Message-ID: <3057fa2e-b84b-fce9-783b-fb2b0adbe08e@huawei.com> (raw)
In-Reply-To: <20210122220600.906146-3-yuzhao@google.com>

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 <yuzhao@google.com>

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

> ---
>  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
> 


  parent reply	other threads:[~2021-01-27  4:08 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 22:05 [PATCH v2 00/10] mm: lru related cleanups Yu Zhao
2021-01-22 22:05 ` Yu Zhao
2021-01-22 22:05 ` [PATCH v2 01/10] mm: use add_page_to_lru_list() Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-26 18:57   ` Vlastimil Babka
2021-01-27  2:12   ` Miaohe Lin
2021-01-22 22:05 ` [PATCH v2 02/10] mm: shuffle lru list addition and deletion functions Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-26 18:58   ` Vlastimil Babka
2021-01-27  2:14   ` Miaohe Lin [this message]
2021-01-22 22:05 ` [PATCH v2 03/10] mm: don't pass "enum lru_list" to lru list addition functions Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-26 19:13   ` Vlastimil Babka
2021-01-26 21:34     ` Yu Zhao
2021-01-27 10:51       ` Vlastimil Babka
2021-01-26 22:01   ` Matthew Wilcox
2021-01-26 22:14     ` Yu Zhao
2021-02-23 22:50       ` Andrew Morton
2021-02-24  5:29         ` Yu Zhao
2021-02-24  8:06           ` Alex Shi
2021-02-24  8:37             ` Yu Zhao
2021-02-24  9:01               ` Alex Shi
2021-01-22 22:05 ` [PATCH v2 04/10] mm: don't pass "enum lru_list" to trace_mm_lru_insertion() Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-22 22:05 ` [PATCH v2 05/10] mm: don't pass "enum lru_list" to del_page_from_lru_list() Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-22 22:05 ` [PATCH v2 06/10] mm: add __clear_page_lru_flags() to replace page_off_lru() Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-22 22:05 ` [PATCH v2 07/10] mm: VM_BUG_ON lru page flags Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-22 22:05 ` [PATCH v2 08/10] mm: fold page_lru_base_type() into its sole caller Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-22 22:05 ` [PATCH v2 09/10] mm: fold __update_lru_size() " Yu Zhao
2021-01-22 22:05   ` Yu Zhao
2021-01-22 22:06 ` [PATCH v2 10/10] mm: make lruvec_lru_size() static Yu Zhao
2021-01-22 22:06   ` Yu Zhao
2021-02-24  8:48   ` [PATCH] mm: test page->flags directly in page_lru() Yu Zhao
2021-02-24  8:48     ` Yu Zhao
2021-02-24 13:15     ` Andrew Morton
2021-02-24 19:57       ` Yu Zhao
2021-02-24 21:56       ` Matthew Wilcox
2021-02-24 22:34         ` Yu Zhao
2021-02-24 22:48           ` Matthew Wilcox
2021-02-24 23:50             ` Yu Zhao
2021-02-25  3:55               ` Matthew Wilcox
2021-02-25  5:22                 ` Yu Zhao
2021-02-25 12:12                   ` Matthew Wilcox
2021-02-26  9:17     ` [PATCH v2 0/3] trim the uses of compound_head() Yu Zhao
2021-02-26  9:17       ` Yu Zhao
2021-02-26  9:17       ` [PATCH v2 1/3] mm: bypass compound_head() for PF_NO_TAIL when enforce=1 Yu Zhao
2021-02-26  9:17         ` Yu Zhao
2021-02-26  9:17       ` [PATCH v2 2/3] mm: use PF_NO_TAIL for PG_lru Yu Zhao
2021-02-26  9:17         ` Yu Zhao
2021-02-26 20:22         ` Yu Zhao
2021-02-26  9:17       ` [PATCH v2 3/3] mm: use PF_ONLY_HEAD for PG_active and PG_unevictable Yu Zhao
2021-02-26  9:17         ` Yu Zhao
2021-02-26 12:13         ` Matthew Wilcox
2021-02-26 19:49           ` Yu Zhao
2021-02-26 20:27             ` Matthew Wilcox
2021-03-01 11:50           ` Kirill A. Shutemov
2021-03-01 19:58             ` Yu Zhao
2021-03-01 20:16               ` Hugh Dickins
2021-03-01 20:16                 ` Hugh Dickins
2021-03-01 20:26                 ` Matthew Wilcox
2021-02-26 10:52       ` [PATCH v2 0/3] trim the uses of compound_head() Vlastimil Babka
2021-02-26 19:04         ` Yu Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3057fa2e-b84b-fce9-783b-fb2b0adbe08e@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@linux.alibaba.com \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=vbabka@suse.cz \
    --cc=vdavydov.dev@gmail.com \
    --cc=willy@infradead.org \
    --cc=yuzhao@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.