Skip to contentSkip to conversation

mm-swap-make-should_try_to_free_swap-support-large-folio.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 25, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: swap: make should_try_to_free_swap() support large-folio
has been removed from the -mm tree. Its filename was
mm-swap-make-should_try_to_free_swap-support-large-folio.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Chuanhua Han <[email protected]>
Subject: mm: swap: make should_try_to_free_swap() support large-folio
Date: Wed, 29 May 2024 20:28:23 +1200

The function should_try_to_free_swap() operates under the assumption that swap-in always occurs at the normal page granularity, i.e., folio_nr_pages() = 1. However, in reality, for large folios, add_to_swap_cache() will invoke folio_ref_add(folio, nr). To accommodate large folio swap-in, this patch eliminates this assumption.

Cc Andreas Larsson <[email protected]>
Cc Baolin Wang <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Gao Xiang <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Kairui Song <[email protected]>
Cc Khalid Aziz <[email protected]>
Cc Len Brown <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Pavel Machek <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Yosry Ahmed <[email protected]>
Cc Yu Zhao <[email protected]>
Cc Zi Yan <[email protected]>

---

 mm/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c renamed from mm/memory.c~mm-swap-make-should_try_to_free_swap-support-large-folio +1 -1
@@ -3919,7 +3919,7 @@ static inline bool should_try_to_free_sw
 	 * reference only in case it's likely that we'll be the exlusive user.
 	 */
 	return (fault_flags & FAULT_FLAG_WRITE) && !folio_test_ksm(folio) &&
-		folio_ref_count(folio) == 2;
+		folio_ref_count(folio) == (1 + folio_nr_pages(folio));
 }
 
 static vm_fault_t pte_marker_clear(struct vm_fault *vmf)

_

Patches currently in -mm which might be from [email protected] are