* [PATCH] mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in min_order_for_split()
@ 2026-08-06 3:21 dayou5941
2026-08-06 6:32 ` Lorenzo Stoakes (ARM)
0 siblings, 1 reply; 5+ messages in thread
From: dayou5941 @ 2026-08-06 3:21 UTC (permalink / raw)
To: akpm, david, ljs; +Cc: ziy, linux-mm, Li Youhong, Lorenzo Stoakes
From: Li Youhong <liyouhong@kylinos.cn>
min_order_for_split() expects to be called with the folio locked,
but does not enforce this itself. Add a VM_WARN_ON_ONCE_FOLIO()
check to validate this assumption and document the locking requirement.
Suggested-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
---
mm/huge_memory.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 58cabe6af33d..e3f16dadc1d4 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -4300,6 +4300,8 @@ int folio_split(struct folio *folio, unsigned int new_order,
*/
unsigned int min_order_for_split(struct folio *folio)
{
+ VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio);
+
if (folio_test_anon(folio))
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in min_order_for_split()
2026-08-06 3:21 [PATCH] mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in min_order_for_split() dayou5941
@ 2026-08-06 6:32 ` Lorenzo Stoakes (ARM)
2026-08-06 7:34 ` 李佑鸿
0 siblings, 1 reply; 5+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-08-06 6:32 UTC (permalink / raw)
To: dayou5941; +Cc: akpm, david, ziy, linux-mm, Li Youhong, Lorenzo Stoakes
Sigh. NAK.
This will trigger immediately.
You're sending this separate from the fix that makes this make any sense,
and I literally told you to send it as a single patch.
Please do what maintainers tell you to do.
I'm pretty convinced you're just doing unacknowledged AI slopping here
because you don't seem to have any understanding of the basics.
Again inclined to just do the patch myself on that basis...!
On Thu, Aug 06, 2026 at 11:21:16AM +0800, dayou5941@163.com wrote:
> From: Li Youhong <liyouhong@kylinos.cn>
>
> min_order_for_split() expects to be called with the folio locked,
> but does not enforce this itself. Add a VM_WARN_ON_ONCE_FOLIO()
> check to validate this assumption and document the locking requirement.
>
> Suggested-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
> ---
> mm/huge_memory.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 58cabe6af33d..e3f16dadc1d4 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -4300,6 +4300,8 @@ int folio_split(struct folio *folio, unsigned int new_order,
> */
> unsigned int min_order_for_split(struct folio *folio)
> {
> + VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio);
> +
> if (folio_test_anon(folio))
> return 0;
>
> --
> 2.25.1
>
--
Cheers, Lorenzo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re:Re: [PATCH] mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in min_order_for_split()
2026-08-06 6:32 ` Lorenzo Stoakes (ARM)
@ 2026-08-06 7:34 ` 李佑鸿
2026-08-06 7:36 ` Lorenzo Stoakes (ARM)
0 siblings, 1 reply; 5+ messages in thread
From: 李佑鸿 @ 2026-08-06 7:34 UTC (permalink / raw)
To: Lorenzo Stoakes (ARM)
Cc: akpm, david, ziy, linux-mm, Li Youhong, Lorenzo Stoakes
At 2026-08-06 14:32:41, "Lorenzo Stoakes (ARM)" <ljs@kernel.org> wrote:
>Sigh. NAK.
>
>This will trigger immediately.
>
>You're sending this separate from the fix that makes this make any sense,
>and I literally told you to send it as a single patch.
>
>Please do what maintainers tell you to do.
>
>I'm pretty convinced you're just doing unacknowledged AI slopping here
>because you don't seem to have any understanding of the basics.
>
>Again inclined to just do the patch myself on that basis...!
>
Hi Lorenzo,
Thank you for your feedback, and I apologize for that.
You are right — I may have misunderstood what you meant by "separate patch." I thought you wanted it sent as an independent patch, but you clearly meant as part of the same series, placed after the fix patch that makes the warning meaningful.
I'll resend the full series as a single patchset (v5 1/2 + 2/2):
Patch 1: mm/memory-failure: fix folio refcount leak and locking in
soft/hard offline
Patch 2: mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in
min_order_for_split()
The second patch depends on the first, so they must go together as
you originally requested.
I'll send this out by tomorrow as you asked. My apologies for the
noise and the wasted review time.
Thanks,
Youhong
>On Thu, Aug 06, 2026 at 11:21:16AM +0800, dayou5941@163.com wrote:
>> From: Li Youhong <liyouhong@kylinos.cn>
>>
>> min_order_for_split() expects to be called with the folio locked,
>> but does not enforce this itself. Add a VM_WARN_ON_ONCE_FOLIO()
>> check to validate this assumption and document the locking requirement.
>>
>> Suggested-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
>> Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
>> ---
>> mm/huge_memory.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
>> index 58cabe6af33d..e3f16dadc1d4 100644
>> --- a/mm/huge_memory.c
>> +++ b/mm/huge_memory.c
>> @@ -4300,6 +4300,8 @@ int folio_split(struct folio *folio, unsigned int new_order,
>> */
>> unsigned int min_order_for_split(struct folio *folio)
>> {
>> + VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio);
>> +
>> if (folio_test_anon(folio))
>> return 0;
>>
>> --
>> 2.25.1
>>
>
>--
>Cheers, Lorenzo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in min_order_for_split()
2026-08-06 7:34 ` 李佑鸿
@ 2026-08-06 7:36 ` Lorenzo Stoakes (ARM)
2026-08-06 11:15 ` David Hildenbrand (Arm)
0 siblings, 1 reply; 5+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-08-06 7:36 UTC (permalink / raw)
To: 李佑鸿
Cc: akpm, david, ziy, linux-mm, Li Youhong, Lorenzo Stoakes
On Thu, Aug 06, 2026 at 03:34:43PM +0800, 李佑鸿 wrote:
> Hi Lorenzo,
> Thank you for your feedback, and I apologize for that.
> You are right — I may have misunderstood what you meant by "separate patch." I thought you wanted it sent as an independent patch, but you clearly meant as part of the same series, placed after the fix patch that makes the warning meaningful.
> I'll resend the full series as a single patchset (v5 1/2 + 2/2):
>
> Patch 1: mm/memory-failure: fix folio refcount leak and locking in
> soft/hard offline
> Patch 2: mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in
> min_order_for_split()
>
> The second patch depends on the first, so they must go together as
> you originally requested.
> I'll send this out by tomorrow as you asked. My apologies for the
> noise and the wasted review time.
No I think it's better that we handle this patch, please don't send any more
revisions.
--
Cheers, Lorenzo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in min_order_for_split()
2026-08-06 7:36 ` Lorenzo Stoakes (ARM)
@ 2026-08-06 11:15 ` David Hildenbrand (Arm)
0 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand (Arm) @ 2026-08-06 11:15 UTC (permalink / raw)
To: Lorenzo Stoakes (ARM), 李佑鸿
Cc: akpm, ziy, linux-mm, Li Youhong, Lorenzo Stoakes
On 8/6/26 09:36, Lorenzo Stoakes (ARM) wrote:
> On Thu, Aug 06, 2026 at 03:34:43PM +0800, 李佑鸿 wrote:
>> Hi Lorenzo,
>> Thank you for your feedback, and I apologize for that.
>> You are right — I may have misunderstood what you meant by "separate patch." I thought you wanted it sent as an independent patch, but you clearly meant as part of the same series, placed after the fix patch that makes the warning meaningful.
>> I'll resend the full series as a single patchset (v5 1/2 + 2/2):
>>
>> Patch 1: mm/memory-failure: fix folio refcount leak and locking in
>> soft/hard offline
>> Patch 2: mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in
>> min_order_for_split()
>>
>> The second patch depends on the first, so they must go together as
>> you originally requested.
>> I'll send this out by tomorrow as you asked. My apologies for the
>> noise and the wasted review time.
>
> No I think it's better that we handle this patch, please don't send any more
> revisions.
https://lore.kernel.org/r/20260806-try_to_split_thp_page-v1-1-a259e3387e38@kernel.org
--
Cheers,
David
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-08-06 11:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 3:21 [PATCH] mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in min_order_for_split() dayou5941
2026-08-06 6:32 ` Lorenzo Stoakes (ARM)
2026-08-06 7:34 ` 李佑鸿
2026-08-06 7:36 ` Lorenzo Stoakes (ARM)
2026-08-06 11:15 ` David Hildenbrand (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox