From: Wei Yang <richard.weiyang@gmail.com>
To: "David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
akpm@linux-foundation.org, lorenzo.stoakes@oracle.com,
ziy@nvidia.com, baolin.wang@linux.alibaba.com,
Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com,
dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev,
linux-mm@kvack.org
Subject: Re: [Patch v3 1/2] mm/huge_memory: introduce enum split_type for clarity
Date: Thu, 6 Nov 2025 14:57:03 +0000 [thread overview]
Message-ID: <20251106145703.7eotqtdxcilghju7@master> (raw)
In-Reply-To: <c2d8380b-6452-4b12-9d51-2741f86180b5@kernel.org>
On Thu, Nov 06, 2025 at 11:17:00AM +0100, David Hildenbrand (Red Hat) wrote:
>On 06.11.25 04:41, Wei Yang wrote:
>> We currently handle two distinct types of large folio splitting:
>> * uniform split
>> * non-uniform split
>>
>> Differentiating between these types using a simple boolean variable is
>> not obvious and can harm code readability.
>>
>> This commit introduces enum split_type to explicitly define these two
>> types. Replacing the existing boolean variable with this enumeration
>> significantly improves code clarity and expressiveness when dealing with
>> folio splitting logic.
>>
>> No functional change is expected.
>>
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> Cc: Zi Yan <ziy@nvidia.com>
>> Cc: "David Hildenbrand (Red Hat)" <david@kernel.org>
>> ---
>
>...
>
>> * Unfreeze after-split folios and put them back to the right
>> @@ -4149,8 +4149,8 @@ int __split_huge_page_to_list_to_order(struct page *page, struct list_head *list
>> {
>> struct folio *folio = page_folio(page);
>> - return __folio_split(folio, new_order, &folio->page, page, list, true,
>> - unmapped);
>> + return __folio_split(folio, new_order, &folio->page, page, list,
>> + SPLIT_TYPE_UNIFORM, unmapped);
>> }
>> /**
>> @@ -4181,7 +4181,7 @@ int folio_split(struct folio *folio, unsigned int new_order,
>> struct page *split_at, struct list_head *list)
>> {
>> return __folio_split(folio, new_order, split_at, &folio->page, list,
>> - false, false);
>> + SPLIT_TYPE_NON_UNIFORM, false);
>
>Looks like both these are not properly aligned.
>
>Should be
>
>return __folio_split(folio, new_order, split_at, &folio->page, list,
> SPLIT_TYPE_NON_UNIFORM, false);
>
Thanks.
@Andrew
Would you mind helping adjust this :-)
>
>Thanks!
>
>Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
>
>--
>Cheers
>
>David
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2025-11-06 14:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 3:41 [Patch v3 0/2] mm/huge_memory: Define split_type and consolidate split support checks Wei Yang
2025-11-06 3:41 ` [Patch v3 1/2] mm/huge_memory: introduce enum split_type for clarity Wei Yang
2025-11-06 10:17 ` David Hildenbrand (Red Hat)
2025-11-06 14:57 ` Wei Yang [this message]
2025-11-07 0:44 ` Zi Yan
2025-11-06 3:41 ` [Patch v3 2/2] mm/huge_memory: merge uniform_split_supported() and non_uniform_split_supported() Wei Yang
2025-11-06 10:20 ` David Hildenbrand (Red Hat)
2025-11-07 0:46 ` Zi Yan
2025-11-07 1:17 ` Wei Yang
2025-11-07 2:07 ` Zi Yan
2025-11-07 2:49 ` Wei Yang
2025-11-07 3:21 ` Zi Yan
2025-11-07 7:29 ` Wei Yang
2025-11-14 3:03 ` Wei Yang
2025-11-17 1:22 ` Wei Yang
2025-11-17 15:56 ` Zi Yan
2025-11-18 2:10 ` Wei Yang
2025-11-18 3:33 ` Wei Yang
2025-11-18 4:10 ` Zi Yan
2025-11-18 18:32 ` Andrew Morton
2025-11-18 18:55 ` Zi Yan
2025-11-18 22:06 ` Andrew Morton
2025-11-19 0:52 ` Wei Yang
2025-11-20 21:16 ` Andrew Morton
2025-11-21 0:55 ` Zi Yan
2025-11-21 9:00 ` Wei Yang
2025-11-21 14:59 ` Zi Yan
2025-11-21 16:50 ` Andrew Morton
2025-11-21 17:00 ` Zi Yan
2025-11-21 18:39 ` Andrew Morton
2025-11-21 19:09 ` Zi Yan
2025-11-21 19:15 ` Andrew Morton
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=20251106145703.7eotqtdxcilghju7@master \
--to=richard.weiyang@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=lance.yang@linux.dev \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=npache@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=ziy@nvidia.com \
/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