[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e63a1f26-dfa2-4113-82bb-8d893b29d145@huawei.com>
Date: Wed, 27 Sep 2023 20:08:24 +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()
Hi David and all,
On 2023/9/26 17:39, Kefeng Wang wrote:
>
>
> 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.
>
As David mentioned,free_pages_prepare should not use folio, I won't to
convert page_cpupid_reset_last(), that is, only the first 7 patches are
reserved, any comments about the above patches, many thanks.
Powered by blists - more mailing lists