Re: [bug report] mm: huge_memory: enable debugfs to split huge pages to any order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 07, 2024 at 09:20:09AM -0500, Zi Yan wrote:
> 
> Can you check if the patch below fixes the issue? I checked the inputs from
> debugfs and also inside split_huge_page_to_list_to_order().
> 
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index a81a09236c16..4d21e57a7d07 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -3052,6 +3052,9 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
>         VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
>         VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
> 
> +       if (new_order >= folio_order(folio))
> +               return -EINVAL;
> +
>         /* Cannot split anonymous THP to order-1 */
>         if (new_order == 1 && folio_test_anon(folio)) {
>                 VM_WARN_ONCE(1, "Cannot split to order-1 folio");

>From a static analysis perspective I think just this is sufficient?  But
I don't really know the code and don't object to the other parts of
this path either.

regards,
dan carpenter





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux