Skip to contentSkip to conversation

mm-hwpoison-add-in-use-hugepage-hwpoison-filter-judgement.patch removed from -mm tree

merged Andrew Morton 1 participant 1 message Mar 25, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/hwpoison: add in-use hugepage hwpoison filter judgement
has been removed from the -mm tree. Its filename was
mm-hwpoison-add-in-use-hugepage-hwpoison-filter-judgement.patch

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

------------------------------------------------------
From: luofei <[email protected]>
Subject: mm/hwpoison: add in-use hugepage hwpoison filter judgement

After successfully obtaining the reference count of the huge page, it is still necessary to call hwpoison_filter() to make a filter judgement, otherwise the filter hugepage will be unmaped and the related process may be killed.

---

 mm/memory-failure.c |    8 ++++++++
 1 file changed, 8 insertions(+)
mm/memory-failure.c renamed from mm/memory-failure.c~mm-hwpoison-add-in-use-hugepage-hwpoison-filter-judgement +8 -0
@@ -1534,6 +1534,14 @@ static int memory_failure_hugetlb(unsign
 	lock_page(head);
 	page_flags = head->flags;
 
+	if (hwpoison_filter(p)) {
+		if (TestClearPageHWPoison(head))
+			num_poisoned_pages_dec();
+		put_page(p);
+		res = -EOPNOTSUPP;
+		goto out;
+	}
+
 	/*
 	 * TODO: hwpoison for pud-sized hugetlb doesn't work right now, so
 	 * simply disable it. In order to make it work properly, we need

_

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