From: Wei Yang <richard.weiyang@gmail.com>
To: "David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
willy@infradead.org, akpm@linux-foundation.org,
lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com,
npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com,
baohua@kernel.org, lance.yang@linux.dev,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm/huge_memory: consolidate order-related checks into folio_split_supported()
Date: Thu, 4 Dec 2025 15:13:26 +0000 [thread overview]
Message-ID: <20251204151326.63twqgfwzxbco362@master> (raw)
In-Reply-To: <64b43302-e8cc-4259-9fa1-e27721c0d193@kernel.org>
On Fri, Nov 14, 2025 at 08:36:20PM +0100, David Hildenbrand (Red Hat) wrote:
>On 14.11.25 16:03, Wei Yang wrote:
>> On Fri, Nov 14, 2025 at 09:49:34AM +0100, David Hildenbrand (Red Hat) wrote:
>> > On 14.11.25 08:57, Wei Yang wrote:
>> > > The primary goal of the folio_split_supported() function is to validate
>> > > whether a folio is suitable for splitting and to bail out early if it is
>> > > not.
>> > >
>> > > Currently, some order-related checks are scattered throughout the
>> > > calling code rather than being centralized in folio_split_supported().
>> > >
>> > > This commit moves all remaining order-related validation logic into
>> > > folio_split_supported(). This consolidation ensures that the function
>> > > serves its intended purpose as a single point of failure and improves
>> > > the clarity and maintainability of the surrounding code.
>> >
>> > Combining the EINVAL handling sounds reasonable.
>> >
>>
>> You mean:
>>
>> This commit combines the EINVAL handling logic into folio_split_supported().
>> This consolidation ... ?
>
>It was not a suggestion to change, it was rather only a comment from my side
>:)
>
>[...]
>
>> >
>> > The mapping_max_folio_order() check is new now. What is the default value of that? Is it always initialized properly?
>> >
>>
>> Not sure "is new now" means what?
>>
>> Original check use mapping_large_folio_support() which calls
>> mapping_max_folio_order(). It looks not new to me.
>
>Right, but we did not actually care about the exact value.
>
>IOW, we didn't check for order <= mapping_max_folio_order() before.
>
>SO I'm just curious if that is universally fine.
>
Hi, David
I just happened to come across some code that might address your question
here.
Take a look at the function __filemap_get_folio(). It uses
mapping_max_folio_order() and mapping_min_folio_order() to determine the
appropriate folio order for page cache allocation.
Just want to share what I found.
>--
>Cheers
>
>David
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2025-12-04 15:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 7:57 Wei Yang
2025-11-14 8:49 ` David Hildenbrand (Red Hat)
2025-11-14 12:43 ` Zi Yan
2025-11-14 14:30 ` Wei Yang
2025-11-14 20:53 ` Zi Yan
2025-11-15 2:42 ` Wei Yang
2025-11-14 15:03 ` Wei Yang
2025-11-14 19:36 ` David Hildenbrand (Red Hat)
2025-11-15 2:51 ` Wei Yang
2025-11-15 5:07 ` Matthew Wilcox
2025-11-15 9:43 ` Wei Yang
2025-12-04 15:13 ` Wei Yang [this message]
2025-11-19 12:37 ` Dan Carpenter
2025-11-19 12:39 ` Wei Yang
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=20251204151326.63twqgfwzxbco362@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-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=npache@redhat.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--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