Re: [PATCH] mm/huge_memory: add VM_WARN_ON_ONCE_FOLIO() in min_order_for_split()

"Lorenzo Stoakes (ARM)" <[email protected]>
Newsgroups org.kvack.linux-mm
Message-ID <anQqEfCEbWmm5vX8@lucifer>
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, [email protected] wrote:
> From: Li Youhong <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Li Youhong <[email protected]>
> ---
>  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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.