linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] __folio_split() clean up.
@ 2025-07-11 18:23 Zi Yan
  2025-07-11 18:23 ` [PATCH v2 1/2] mm/huge_memory: move unrelated code out of __split_unmapped_folio() Zi Yan
  2025-07-11 18:23 ` [PATCH v2 2/2] mm/huge_memory: use folio_expected_ref_count() to calculate ref_count Zi Yan
  0 siblings, 2 replies; 8+ messages in thread
From: Zi Yan @ 2025-07-11 18:23 UTC (permalink / raw)
  To: Balbir Singh, David Hildenbrand, linux-mm
  Cc: Andrew Morton, Hugh Dickins, Kirill Shutemov, Lorenzo Stoakes,
	Zi Yan, Baolin Wang, Liam R. Howlett, Nico Pache, Ryan Roberts,
	Dev Jain, Barry Song, linux-kernel

Based on the prior discussion[1], this patch improves
__split_unmapped_folio() by making it reusable for splitting unmapped folios.
This helps avoid the need for a new boolean unmapped parameter to guard
mapping-related code.

An additional benefit is that __split_unmapped_folio() could be
called on after-split folios by __folio_split(). It can enable new split
methods. For example, at deferred split time, unmapped subpages can
scatter arbitrarily within a large folio, neither uniform nor non-uniform
split can maximize after-split folio orders for mapped subpages.
The hope is that by calling __split_unmapped_folio() multiple times,
a better split result can be achieved.

It passed mm selftests.


Changelog
===
From V1[2]:
1. Fixed indentations.
2. Used folio_expected_ref_count() to calculate ref_count instead of
   open coding.


[1] https://lore.kernel.org/linux-mm/94D8C1A4-780C-4BEC-A336-7D3613B54845@nvidia.com/
[2] https://lore.kernel.org/linux-mm/20250711030259.3574392-1-ziy@nvidia.com/

Zi Yan (2):
  mm/huge_memory: move unrelated code out of __split_unmapped_folio()
  mm/huge_memory: use folio_expected_ref_count() to calculate ref_count.

 mm/huge_memory.c | 271 +++++++++++++++++++++++------------------------
 1 file changed, 135 insertions(+), 136 deletions(-)

-- 
2.47.2



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

end of thread, other threads:[~2025-07-14 15:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 18:23 [PATCH v2 0/2] __folio_split() clean up Zi Yan
2025-07-11 18:23 ` [PATCH v2 1/2] mm/huge_memory: move unrelated code out of __split_unmapped_folio() Zi Yan
2025-07-14  1:15   ` Balbir Singh
2025-07-14 15:30   ` David Hildenbrand
2025-07-14 15:33     ` Zi Yan
2025-07-11 18:23 ` [PATCH v2 2/2] mm/huge_memory: use folio_expected_ref_count() to calculate ref_count Zi Yan
2025-07-14  0:43   ` Balbir Singh
2025-07-14 15:11   ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).