Skip to contentSkip to conversation

khugepaged-drain-lru-add-pagevec-after-swapin.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 4, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: khugepaged: drain LRU add pagevec after swapin
has been removed from the -mm tree. Its filename was
khugepaged-drain-lru-add-pagevec-after-swapin.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: "Kirill A. Shutemov" <[email protected]>
Subject: khugepaged: drain LRU add pagevec after swapin

collapse_huge_page() tries to swap in pages that are part of the PMD range. Just swapped in page goes though LRU add cache. The cache gets extra reference on the page.

The extra reference can lead to the collapse fail: the following __collapse_huge_page_isolate() would check refcount and abort collapse seeing unexpected refcount.

The fix is to drain local LRU add cache in __collapse_huge_page_swapin() if we successfully swapped in any pages.

---

 mm/khugepaged.c |    5 +++++
 1 file changed, 5 insertions(+)
mm/khugepaged.c renamed from mm/khugepaged.c~khugepaged-drain-lru-add-pagevec-after-swapin +5 -0
@@ -931,6 +931,11 @@ static bool __collapse_huge_page_swapin(
 	}
 	vmf.pte--;
 	pte_unmap(vmf.pte);
+
+	/* Drain LRU add pagevec to remove extra pin on the swapped in pages */
+	if (swapped_in)
+		lru_add_drain();
+
 	trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 1);
 	return true;
 }

_

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