From: Lorenzo Stoakes <lstoakes@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: move get_page_from_free_area() to mm/page_alloc.c
Date: Sun, 19 Mar 2023 12:07:43 +0000 [thread overview]
Message-ID: <0020b728-724d-4206-8768-ec94d5628b34@lucifer.local> (raw)
In-Reply-To: <20230319114214.2133332-1-rppt@kernel.org>
On Sun, Mar 19, 2023 at 01:42:14PM +0200, Mike Rapoport wrote:
> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
>
> The get_page_from_free_area() helper is only used in mm/page_alloc.c so
> move it there to reduce noise in include/linux/mmzone.h
>
> Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
> ---
> include/linux/mmzone.h | 7 -------
> mm/page_alloc.c | 7 +++++++
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 96599cb9eb62..8f5a9e2c722a 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -108,13 +108,6 @@ struct free_area {
> unsigned long nr_free;
> };
>
> -static inline struct page *get_page_from_free_area(struct free_area *area,
> - int migratetype)
> -{
> - return list_first_entry_or_null(&area->free_list[migratetype],
> - struct page, lru);
> -}
> -
> static inline bool free_area_empty(struct free_area *area, int migratetype)
> {
> return list_empty(&area->free_list[migratetype]);
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 87d760236dba..2e72fdbdd8db 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1048,6 +1048,13 @@ static inline void del_page_from_free_list(struct page *page, struct zone *zone,
> zone->free_area[order].nr_free--;
> }
>
> +static inline struct page *get_page_from_free_area(struct free_area *area,
> + int migratetype)
> +{
> + return list_first_entry_or_null(&area->free_list[migratetype],
> + struct page, lru);
> +}
> +
> /*
> * If this is not the largest possible page, check if the buddy
> * of the next-highest order is free. If it is, it's possible
>
> base-commit: 4018ab1f7cec061b8425737328edefebdc0ab832
> --
> 2.35.1
>
Good catch, I wonder if there are more functions like this that can be dropped
from headers?
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
next prev parent reply other threads:[~2023-03-19 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-19 11:42 Mike Rapoport
2023-03-19 12:07 ` Lorenzo Stoakes [this message]
2023-03-19 20:22 ` Matthew Wilcox
2023-03-19 20:52 ` Mike Rapoport
2023-03-19 14:16 ` Kirill A. Shutemov
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=0020b728-724d-4206-8768-ec94d5628b34@lucifer.local \
--to=lstoakes@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox