[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b7818a38-d991-6cdd-c908-fe0ebc3677c6@redhat.com>
Date: Tue, 26 Sep 2023 09:49:16 +0200
From: David Hildenbrand <david@...hat.com>
To: Kefeng Wang <wangkefeng.wang@...wei.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Mike Rapoport <rppt@...nel.org>,
Matthew Wilcox <willy@...radead.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, ying.huang@...el.com,
Zi Yan <ziy@...dia.com>
Subject: Re: [PATCH -next 8/9] mm: page_alloc: use a folio in
free_pages_prepare()
On 26.09.23 02:52, Kefeng Wang wrote:
> The page should not a tail page in free_pages_prepare(), let's use
> a folio in free_pages_prepare() to save several compound_head() calls.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> ---
> mm/page_alloc.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 06be8821d833..a888b9d57751 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1070,6 +1070,7 @@ static __always_inline bool free_pages_prepare(struct page *page,
> unsigned int order, fpi_t fpi_flags)
> {
> int bad = 0;
> + struct folio *folio = page_folio(page);
We might have higher-order pages here that are not folios (not compound
pages). It looks a bit like this function really shouldn't be working
with folios in the generic way, for that reason.
Wrong level of abstraction in that function.
What am I missing?
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists