Skip to contentSkip to conversation

mm-hwpoison-retry-with-shake_page-for-unhandlable-pages.patch removed from -mm tree

merged [email protected] 1 participant 1 message Aug 23, 2021 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/hwpoison: retry with shake_page() for unhandlable pages
has been removed from the -mm tree. Its filename was
mm-hwpoison-retry-with-shake_page-for-unhandlable-pages.patch

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

------------------------------------------------------
From: Naoya Horiguchi <[email protected]>
Subject: mm/hwpoison: retry with shake_page() for unhandlable pages

HWPoisonHandlable() sometimes returns false for typical user pages due to races with average memory events like transfers over LRU lists. This causes failures in hwpoison handling.

There's retry code for such a case but does not work because the retry loop reaches the retry limit too quickly before the page settles down to handlable state. Let get_any_page() call shake_page() to fix it.

[[email protected]: get_any_page(): return -EIO when retry limit reached]
Fixes 25182f05ffed ("mm,hwpoison: fix race with hugetlb page allocation")
Cc Oscar Salvador <[email protected]>
Cc Muchun Song <[email protected]>
Cc Mike Kravetz <[email protected]>
Cc Michal Hocko <[email protected]>
Cc <[email protected]> [5.13+]

---

 mm/memory-failure.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
mm/memory-failure.c renamed from mm/memory-failure.c~mm-hwpoison-retry-with-shake_page-for-unhandlable-pages +9 -3
@@ -1146,7 +1146,7 @@ static int __get_hwpoison_page(struct pa
 	 * unexpected races caused by taking a page refcount.
 	 */
 	if (!HWPoisonHandlable(head))
-		return 0;
+		return -EBUSY;
 
 	if (PageTransHuge(head)) {
 		/*
@@ -1199,9 +1199,15 @@ try_again:
 			}
 			goto out;
 		} else if (ret == -EBUSY) {
-			/* We raced with freeing huge page to buddy, retry. */
-			if (pass++ < 3)
+			/*
+			 * We raced with (possibly temporary) unhandlable
+			 * page, retry.
+			 */
+			if (pass++ < 3) {
+				shake_page(p, 1);
 				goto try_again;
+			}
+			ret = -EIO;
 			goto out;
 		}
 	}

_

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

mm-sparse-set-section_nid_shift-to-6.patch