[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75d28233-c8bd-4528-a775-8ccdc7fc3e26@huawei.com>
Date: Tue, 26 Sep 2023 17:39:23 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: David Hildenbrand <david@...hat.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 2023/9/26 15:49, David Hildenbrand wrote:
> 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.
Thanks for your point this, also the change also looks unnecessary too,
the main purpose to use a folio in this function is prepared for
converting page_cpupid_reset_last() to folio, as the higher-order pages
the next patch is not right, I will reconsider it.
>
> What am I missing?
>
Powered by blists - more mailing lists