The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/huge_memory: drop dead split helper variants
@ 2026-07-16 10:03 Kiryl Shutsemau
  2026-07-16 10:03 ` [PATCH 1/2] mm/huge_memory: remove unused can_split_folio() Kiryl Shutsemau
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Kiryl Shutsemau @ 2026-07-16 10:03 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes
  Cc: Zi Yan, Baolin Wang, Liam R . Howlett, Nico Pache, Ryan Roberts,
	Dev Jain, Barry Song, Lance Yang, Usama Arif, linux-mm,
	linux-kernel, Kiryl Shutsemau (Meta)

From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>

Two trivial cleanups in the folio split API, found while auditing the
split helpers for the inode UAF fix [1]:

 - can_split_folio() is dead: only the !THP stub remains, no definition
   under CONFIG_TRANSPARENT_HUGEPAGE and no callers. Leftover from an
   earlier cleanup.

 - split_folio_to_list_to_order() has no direct callers; its only user
   is split_folio_to_order(), which always passes a NULL list. Fold it.

These were 4/5 and 5/5 of the withdrawn series [2], rebased without the
memory_failure() dependency. 3/5 (removing split_huge_page_to_order())
is dropped: with the UAF fixed by [1] instead, memory_failure() keeps
using it. The syzbot ci failures against [2] were all caused by its
patch 1, which is gone.

No functional change.

[1] https://lore.kernel.org/linux-mm/aldjhtfVByHDQXe6@thinkstation
[2] https://lore.kernel.org/linux-mm/20260714122344.351895-1-kirill@shutemov.name

Kiryl Shutsemau (Meta) (2):
  mm/huge_memory: remove unused can_split_folio()
  mm/huge_memory: fold split_folio_to_list_to_order() into
    split_folio_to_order()

 include/linux/huge_mm.h | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)


base-commit: 0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53
-- 
2.54.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] mm/huge_memory: remove unused can_split_folio()
  2026-07-16 10:03 [PATCH 0/2] mm/huge_memory: drop dead split helper variants Kiryl Shutsemau
@ 2026-07-16 10:03 ` Kiryl Shutsemau
  2026-07-16 11:08   ` Usama Arif
                     ` (2 more replies)
  2026-07-16 10:03 ` [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order() Kiryl Shutsemau
  2026-07-16 11:11 ` [PATCH 0/2] mm/huge_memory: drop dead split helper variants David Hildenbrand (Arm)
  2 siblings, 3 replies; 10+ messages in thread
From: Kiryl Shutsemau @ 2026-07-16 10:03 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes
  Cc: Zi Yan, Baolin Wang, Liam R . Howlett, Nico Pache, Ryan Roberts,
	Dev Jain, Barry Song, Lance Yang, Usama Arif, linux-mm,
	linux-kernel, Kiryl Shutsemau (Meta)

From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>

can_split_folio() has no callers and no definition under
CONFIG_TRANSPARENT_HUGEPAGE; only the !THP stub remains, left behind by an
earlier cleanup.  Remove it.

No functional change.

Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
---
 include/linux/huge_mm.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index ad20f7f8c179..6961db4d1591 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -621,11 +621,6 @@ thp_get_unmapped_area_vmflags(struct file *filp, unsigned long addr,
 	return 0;
 }
 
-static inline bool
-can_split_folio(struct folio *folio, int caller_pins, int *pextra_pins)
-{
-	return false;
-}
 static inline int
 split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
 		unsigned int new_order)
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order()
  2026-07-16 10:03 [PATCH 0/2] mm/huge_memory: drop dead split helper variants Kiryl Shutsemau
  2026-07-16 10:03 ` [PATCH 1/2] mm/huge_memory: remove unused can_split_folio() Kiryl Shutsemau
@ 2026-07-16 10:03 ` Kiryl Shutsemau
  2026-07-16 11:09   ` Usama Arif
                     ` (2 more replies)
  2026-07-16 11:11 ` [PATCH 0/2] mm/huge_memory: drop dead split helper variants David Hildenbrand (Arm)
  2 siblings, 3 replies; 10+ messages in thread
From: Kiryl Shutsemau @ 2026-07-16 10:03 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes
  Cc: Zi Yan, Baolin Wang, Liam R . Howlett, Nico Pache, Ryan Roberts,
	Dev Jain, Barry Song, Lance Yang, Usama Arif, linux-mm,
	linux-kernel, Kiryl Shutsemau (Meta)

From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>

split_folio_to_list_to_order() had no direct callers; its only user was
split_folio_to_order(), which always passed a NULL list.  Fold it into
split_folio_to_order() and call split_huge_page_to_list_to_order()
directly.

No functional change.

Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
---
 include/linux/huge_mm.h | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 6961db4d1591..1842b1e6862a 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -792,15 +792,9 @@ static inline bool is_pmd_order(unsigned int order)
 	return order == HPAGE_PMD_ORDER;
 }
 
-static inline int split_folio_to_list_to_order(struct folio *folio,
-		struct list_head *list, int new_order)
-{
-	return split_huge_page_to_list_to_order(&folio->page, list, new_order);
-}
-
 static inline int split_folio_to_order(struct folio *folio, int new_order)
 {
-	return split_folio_to_list_to_order(folio, NULL, new_order);
+	return split_huge_page_to_list_to_order(&folio->page, NULL, new_order);
 }
 
 /**
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] mm/huge_memory: remove unused can_split_folio()
  2026-07-16 10:03 ` [PATCH 1/2] mm/huge_memory: remove unused can_split_folio() Kiryl Shutsemau
@ 2026-07-16 11:08   ` Usama Arif
  2026-07-16 13:51   ` Lorenzo Stoakes (ARM)
  2026-07-16 14:57   ` Zi Yan
  2 siblings, 0 replies; 10+ messages in thread
From: Usama Arif @ 2026-07-16 11:08 UTC (permalink / raw)
  To: Kiryl Shutsemau, Andrew Morton, David Hildenbrand,
	Lorenzo Stoakes
  Cc: Zi Yan, Baolin Wang, Liam R . Howlett, Nico Pache, Ryan Roberts,
	Dev Jain, Barry Song, Lance Yang, linux-mm, linux-kernel,
	Kiryl Shutsemau (Meta)



On 16/07/2026 11:03, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
> 
> can_split_folio() has no callers and no definition under
> CONFIG_TRANSPARENT_HUGEPAGE; only the !THP stub remains, left behind by an
> earlier cleanup.  Remove it.
> 
> No functional change.
> 
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
> ---
>  include/linux/huge_mm.h | 5 -----
>  1 file changed, 5 deletions(-)
> 
Acked-by: Usama Arif <usama.arif@linux.dev>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order()
  2026-07-16 10:03 ` [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order() Kiryl Shutsemau
@ 2026-07-16 11:09   ` Usama Arif
  2026-07-16 13:52   ` Lorenzo Stoakes (ARM)
  2026-07-16 14:58   ` Zi Yan
  2 siblings, 0 replies; 10+ messages in thread
From: Usama Arif @ 2026-07-16 11:09 UTC (permalink / raw)
  To: Kiryl Shutsemau, Andrew Morton, David Hildenbrand,
	Lorenzo Stoakes
  Cc: Zi Yan, Baolin Wang, Liam R . Howlett, Nico Pache, Ryan Roberts,
	Dev Jain, Barry Song, Lance Yang, linux-mm, linux-kernel,
	Kiryl Shutsemau (Meta)



On 16/07/2026 11:03, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
> 
> split_folio_to_list_to_order() had no direct callers; its only user was
> split_folio_to_order(), which always passed a NULL list.  Fold it into
> split_folio_to_order() and call split_huge_page_to_list_to_order()
> directly.
> 
> No functional change.
> 
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
> ---
>  include/linux/huge_mm.h | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
Acked-by: Usama Arif <usama.arif@linux.dev>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] mm/huge_memory: drop dead split helper variants
  2026-07-16 10:03 [PATCH 0/2] mm/huge_memory: drop dead split helper variants Kiryl Shutsemau
  2026-07-16 10:03 ` [PATCH 1/2] mm/huge_memory: remove unused can_split_folio() Kiryl Shutsemau
  2026-07-16 10:03 ` [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order() Kiryl Shutsemau
@ 2026-07-16 11:11 ` David Hildenbrand (Arm)
  2 siblings, 0 replies; 10+ messages in thread
From: David Hildenbrand (Arm) @ 2026-07-16 11:11 UTC (permalink / raw)
  To: Kiryl Shutsemau, Andrew Morton, Lorenzo Stoakes
  Cc: Zi Yan, Baolin Wang, Liam R . Howlett, Nico Pache, Ryan Roberts,
	Dev Jain, Barry Song, Lance Yang, Usama Arif, linux-mm,
	linux-kernel, Kiryl Shutsemau (Meta)

On 7/16/26 12:03, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
> 
> Two trivial cleanups in the folio split API, found while auditing the
> split helpers for the inode UAF fix [1]:
> 
>  - can_split_folio() is dead: only the !THP stub remains, no definition
>    under CONFIG_TRANSPARENT_HUGEPAGE and no callers. Leftover from an
>    earlier cleanup.
> 
>  - split_folio_to_list_to_order() has no direct callers; its only user
>    is split_folio_to_order(), which always passes a NULL list. Fold it.
> 
> These were 4/5 and 5/5 of the withdrawn series [2], rebased without the
> memory_failure() dependency. 3/5 (removing split_huge_page_to_order())
> is dropped: with the UAF fixed by [1] instead, memory_failure() keeps
> using it. The syzbot ci failures against [2] were all caused by its
> patch 1, which is gone.
> 
> No functional change.

Thanks!

Acked-by: David Hildenbrand (Arm) <david@kernel.org>

-- 
Cheers,

David

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] mm/huge_memory: remove unused can_split_folio()
  2026-07-16 10:03 ` [PATCH 1/2] mm/huge_memory: remove unused can_split_folio() Kiryl Shutsemau
  2026-07-16 11:08   ` Usama Arif
@ 2026-07-16 13:51   ` Lorenzo Stoakes (ARM)
  2026-07-16 14:57   ` Zi Yan
  2 siblings, 0 replies; 10+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-07-16 13:51 UTC (permalink / raw)
  To: Kiryl Shutsemau
  Cc: Andrew Morton, David Hildenbrand, Zi Yan, Baolin Wang,
	Liam R . Howlett, Nico Pache, Ryan Roberts, Dev Jain, Barry Song,
	Lance Yang, Usama Arif, linux-mm, linux-kernel,
	Kiryl Shutsemau (Meta)

On Thu, Jul 16, 2026 at 11:03:44AM +0100, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
>
> can_split_folio() has no callers and no definition under
> CONFIG_TRANSPARENT_HUGEPAGE; only the !THP stub remains, left behind by an
> earlier cleanup.  Remove it.
>
> No functional change.
>
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>

LGTM, so:

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

> ---
>  include/linux/huge_mm.h | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
> index ad20f7f8c179..6961db4d1591 100644
> --- a/include/linux/huge_mm.h
> +++ b/include/linux/huge_mm.h
> @@ -621,11 +621,6 @@ thp_get_unmapped_area_vmflags(struct file *filp, unsigned long addr,
>  	return 0;
>  }
>
> -static inline bool
> -can_split_folio(struct folio *folio, int caller_pins, int *pextra_pins)
> -{
> -	return false;
> -}
>  static inline int
>  split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
>  		unsigned int new_order)
> --
> 2.54.0
>

Cheers, Lorenzo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order()
  2026-07-16 10:03 ` [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order() Kiryl Shutsemau
  2026-07-16 11:09   ` Usama Arif
@ 2026-07-16 13:52   ` Lorenzo Stoakes (ARM)
  2026-07-16 14:58   ` Zi Yan
  2 siblings, 0 replies; 10+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-07-16 13:52 UTC (permalink / raw)
  To: Kiryl Shutsemau
  Cc: Andrew Morton, David Hildenbrand, Zi Yan, Baolin Wang,
	Liam R . Howlett, Nico Pache, Ryan Roberts, Dev Jain, Barry Song,
	Lance Yang, Usama Arif, linux-mm, linux-kernel,
	Kiryl Shutsemau (Meta)

On Thu, Jul 16, 2026 at 11:03:45AM +0100, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
>
> split_folio_to_list_to_order() had no direct callers; its only user was
> split_folio_to_order(), which always passed a NULL list.  Fold it into
> split_folio_to_order() and call split_huge_page_to_list_to_order()
> directly.
>
> No functional change.
>
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>

LGTM, so:

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

> ---
>  include/linux/huge_mm.h | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
> index 6961db4d1591..1842b1e6862a 100644
> --- a/include/linux/huge_mm.h
> +++ b/include/linux/huge_mm.h
> @@ -792,15 +792,9 @@ static inline bool is_pmd_order(unsigned int order)
>  	return order == HPAGE_PMD_ORDER;
>  }
>
> -static inline int split_folio_to_list_to_order(struct folio *folio,
> -		struct list_head *list, int new_order)
> -{
> -	return split_huge_page_to_list_to_order(&folio->page, list, new_order);
> -}
> -
>  static inline int split_folio_to_order(struct folio *folio, int new_order)
>  {
> -	return split_folio_to_list_to_order(folio, NULL, new_order);
> +	return split_huge_page_to_list_to_order(&folio->page, NULL, new_order);
>  }
>
>  /**
> --
> 2.54.0
>

Cheers, Lorenzo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] mm/huge_memory: remove unused can_split_folio()
  2026-07-16 10:03 ` [PATCH 1/2] mm/huge_memory: remove unused can_split_folio() Kiryl Shutsemau
  2026-07-16 11:08   ` Usama Arif
  2026-07-16 13:51   ` Lorenzo Stoakes (ARM)
@ 2026-07-16 14:57   ` Zi Yan
  2 siblings, 0 replies; 10+ messages in thread
From: Zi Yan @ 2026-07-16 14:57 UTC (permalink / raw)
  To: Kiryl Shutsemau, Andrew Morton, David Hildenbrand,
	Lorenzo Stoakes
  Cc: Baolin Wang, Liam R . Howlett, Nico Pache, Ryan Roberts, Dev Jain,
	Barry Song, Lance Yang, Usama Arif, linux-mm, linux-kernel,
	Kiryl Shutsemau (Meta)

On Thu Jul 16, 2026 at 6:03 AM EDT, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
>
> can_split_folio() has no callers and no definition under
> CONFIG_TRANSPARENT_HUGEPAGE; only the !THP stub remains, left behind by an
> earlier cleanup.  Remove it.
>
> No functional change.
>
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
> ---
>  include/linux/huge_mm.h | 5 -----
>  1 file changed, 5 deletions(-)
>
Thanks.

Reviewed-by: Zi Yan <ziy@nvidia.com>


-- 
Best Regards,
Yan, Zi


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order()
  2026-07-16 10:03 ` [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order() Kiryl Shutsemau
  2026-07-16 11:09   ` Usama Arif
  2026-07-16 13:52   ` Lorenzo Stoakes (ARM)
@ 2026-07-16 14:58   ` Zi Yan
  2 siblings, 0 replies; 10+ messages in thread
From: Zi Yan @ 2026-07-16 14:58 UTC (permalink / raw)
  To: Kiryl Shutsemau, Andrew Morton, David Hildenbrand,
	Lorenzo Stoakes
  Cc: Baolin Wang, Liam R . Howlett, Nico Pache, Ryan Roberts, Dev Jain,
	Barry Song, Lance Yang, Usama Arif, linux-mm, linux-kernel,
	Kiryl Shutsemau (Meta)

On Thu Jul 16, 2026 at 6:03 AM EDT, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
>
> split_folio_to_list_to_order() had no direct callers; its only user was
> split_folio_to_order(), which always passed a NULL list.  Fold it into
> split_folio_to_order() and call split_huge_page_to_list_to_order()
> directly.
>
> No functional change.
>
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
> ---
>  include/linux/huge_mm.h | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>



-- 
Best Regards,
Yan, Zi


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-07-16 14:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 10:03 [PATCH 0/2] mm/huge_memory: drop dead split helper variants Kiryl Shutsemau
2026-07-16 10:03 ` [PATCH 1/2] mm/huge_memory: remove unused can_split_folio() Kiryl Shutsemau
2026-07-16 11:08   ` Usama Arif
2026-07-16 13:51   ` Lorenzo Stoakes (ARM)
2026-07-16 14:57   ` Zi Yan
2026-07-16 10:03 ` [PATCH 2/2] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order() Kiryl Shutsemau
2026-07-16 11:09   ` Usama Arif
2026-07-16 13:52   ` Lorenzo Stoakes (ARM)
2026-07-16 14:58   ` Zi Yan
2026-07-16 11:11 ` [PATCH 0/2] mm/huge_memory: drop dead split helper variants 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