Skip to contentSkip to conversation

mm/hwpoison-inject: support injecting hwpoison to free page

PATCH Applied Miaohe Lin 1 participant 1 message Feb 18, 2022

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author maintainer
#0 lore raw

PATCH 1/1 mm/hwpoison-inject: support injecting hwpoison to free page

memory_failure() can handle free buddy page. Support injecting hwpoison to free page by adding is_free_buddy_page check when hwpoison filter is disabled.

---
 mm/hwpoison-inject.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/hwpoison-inject.c +2 -2
index aff4d27ec235..f74552977649 100644
@@ -32,9 +32,9 @@ static int hwpoison_inject(void *data, u64 val)
 
 	shake_page(hpage);
 	/*
-	 * This implies unable to support non-LRU pages.
+	 * This implies unable to support non-LRU pages except free page.
 	 */
-	if (!PageLRU(hpage) && !PageHuge(p))
+	if (!PageLRU(hpage) && !PageHuge(p) && !is_free_buddy_page(p))
 		return 0;
 
 	/*
Signature · 1 line
2.23.0