linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Do not change split folio target order
@ 2025-10-10 17:39 Zi Yan
  2025-10-10 17:39 ` [PATCH 1/2] mm/huge_memory: do not change split_huge_page*() target order silently Zi Yan
  2025-10-10 17:39 ` [PATCH 2/2] mm/memory-failure: improve large block size folio handling Zi Yan
  0 siblings, 2 replies; 22+ messages in thread
From: Zi Yan @ 2025-10-10 17:39 UTC (permalink / raw)
  To: linmiaohe, david, jane.chu, kernel, syzbot+e6367ea2fdab6ed46056,
	syzkaller-bugs
  Cc: ziy, akpm, mcgrof, nao.horiguchi, Lorenzo Stoakes, Baolin Wang,
	Liam R. Howlett, Nico Pache, Ryan Roberts, Dev Jain, Barry Song,
	Lance Yang, Matthew Wilcox (Oracle),
	linux-fsdevel, linux-kernel, linux-mm

Hi all,

Currently, huge page and large folio split APIs would bump new order
when the target folio has min_order_for_split() > 0 and return
success if split succeeds. When callers expect after-split folios to be
order-0, the actual ones are not. The callers might not be able to
handle them, since they call huge page and large folio split APIs to get
order-0 folios. This issue appears in a recent report on
memory_failure()[1], where memory_failure() used split_huge_page() to split
a large forlio to order-0, but after a successful split got non order-0
folios. Because memory_failure() can only handle order-0 folios, this
caused a WARNING.

Fix the issue by not changing split target order and failing the
split if min_order_for_split() is greater than the target order.
In addition, to avoid wasting memory in memory failure handling, a second
patch is added to always split a large folio to min_order_for_split()
even if it is not 0, so that folios not containing the poisoned page can
be freed for reuse. For soft offline, since the folio is still accessible,
do not split if min_order_for_split() is not zero to avoid potential
performance loss.


[1] https://lore.kernel.org/all/68d2c943.a70a0220.1b52b.02b3.GAE@google.com/

Zi Yan (2):
  mm/huge_memory: do not change split_huge_page*() target order
    silently.
  mm/memory-failure: improve large block size folio handling.

 include/linux/huge_mm.h | 28 +++++-----------------------
 mm/huge_memory.c        |  9 +--------
 mm/memory-failure.c     | 25 +++++++++++++++++++++----
 mm/truncate.c           |  6 ++++--
 4 files changed, 31 insertions(+), 37 deletions(-)

-- 
2.51.0



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

end of thread, other threads:[~2025-10-16  8:34 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-10 17:39 [PATCH 0/2] Do not change split folio target order Zi Yan
2025-10-10 17:39 ` [PATCH 1/2] mm/huge_memory: do not change split_huge_page*() target order silently Zi Yan
2025-10-10 18:02   ` Luis Chamberlain
2025-10-13 17:11     ` Zi Yan
2025-10-11  2:25   ` Lance Yang
2025-10-13 17:06     ` Zi Yan
2025-10-11  9:00   ` kernel test robot
2025-10-12  0:41   ` Wei Yang
2025-10-13 17:07     ` Zi Yan
2025-10-12  8:24   ` Pankaj Raghav (Samsung)
2025-10-13 17:11     ` Zi Yan
2025-10-15 14:25   ` Lorenzo Stoakes
2025-10-15 22:57     ` Zi Yan
2025-10-16  8:34       ` Lorenzo Stoakes
2025-10-10 17:39 ` [PATCH 2/2] mm/memory-failure: improve large block size folio handling Zi Yan
2025-10-10 18:05   ` Luis Chamberlain
2025-10-11  4:12   ` Miaohe Lin
2025-10-11  5:00     ` Matthew Wilcox
2025-10-11  9:07       ` Miaohe Lin
2025-10-13 17:04       ` Zi Yan
2025-10-11 10:23   ` kernel test robot
2025-10-13 17:08     ` Zi Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox