Skip to contentSkip to conversation

mm-thp-do-not-wait-for-lock_page-in-deferred_split_scan.patch removed from -mm tree

merged [email protected] 1 participant 1 message Mar 23, 2018 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/thp: do not wait for lock_page() in deferred_split_scan()
has been removed from the -mm tree. Its filename was
mm-thp-do-not-wait-for-lock_page-in-deferred_split_scan.patch

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

------------------------------------------------------
From: "Kirill A. Shutemov" <[email protected]>
Subject: mm/thp: do not wait for lock_page() in deferred_split_scan()

deferred_split_scan() gets called from reclaim path. Waiting for page lock may lead to deadlock there.

Replace lock_page() with trylock_page() and skip the page if we failed to lock it. We will get to the page on the next scan.

---

 mm/huge_memory.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/huge_memory.c renamed from mm/huge_memory.c~mm-thp-do-not-wait-for-lock_page-in-deferred_split_scan +3 -1
diff -puN mm/huge_memory.c~mm-thp-do-not-wait-for-lock_page-in-deferred_split_scan mm/huge_memory.c
@@ -2783,11 +2783,13 @@ static unsigned long deferred_split_scan
 
 	list_for_each_safe(pos, next, &list) {
 		page = list_entry((void *)pos, struct page, mapping);
-		lock_page(page);
+		if (!trylock_page(page))
+			goto next;
 		/* split_huge_page() removes page from list on success */
 		if (!split_huge_page(page))
 			split++;
 		unlock_page(page);
+next:
 		put_page(page);
 	}
 

_

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