[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251021201513.kxhjiirr4nmzaw7u@master>
Date: Tue, 21 Oct 2025 20:15:13 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: Gregory Price <gourry@...rry.net>
Cc: Wei Yang <richard.weiyang@...il.com>, Zi Yan <ziy@...dia.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
kernel-team@...a.com, akpm@...ux-foundation.org, vbabka@...e.cz,
surenb@...gle.com, mhocko@...e.com, jackmanb@...gle.com,
hannes@...xchg.org, David Hildenbrand <david@...hat.com>
Subject: Re: [RFC PATCH v2] page_alloc: allow migration of smaller hugepages
during contig_alloc
On Tue, Oct 21, 2025 at 12:03:39PM -0400, Gregory Price wrote:
>On Tue, Oct 21, 2025 at 09:14:43AM +0000, Wei Yang wrote:
>>
>> The above code is expanded to:
>>
>> page = _compound_head(page);
>> order = compound_order(page);
>> folio = page;
>> test_bit(PG_head, &folio->flags.f);
>> return folio_large_order(folio);
>>
>> If we use
>>
>> order = folio_order(page_folio(page))
>>
>> It is expanded to:
>>
>> folio = _compound_head(page);
>> folio_test_large(folio)
>> folio_test_head(folio)
>> test_bit(PG_head, &folio->flags.f)
>> return folio_large_order(folio);
>>
>> These two seems expanded to the same code.
>>
>
>folio_test_large drops into const_folio_flags which does
>a VM_BUG_ON_PGFLAGS, so not the same logic here.
>
Thanks, you are right.
>> Maybe we can use folio_order() here?
>>
--
Wei Yang
Help you, Help me
Powered by blists - more mailing lists