linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hwpoison-inject: support injecting hwpoison to free page
@ 2022-02-18  9:20 Miaohe Lin
  0 siblings, 0 replies; only message in thread
From: Miaohe Lin @ 2022-02-18  9:20 UTC (permalink / raw)
  To: akpm, naoya.horiguchi; +Cc: linux-mm, linux-kernel, linmiaohe

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.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/hwpoison-inject.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
index aff4d27ec235..f74552977649 100644
--- a/mm/hwpoison-inject.c
+++ b/mm/hwpoison-inject.c
@@ -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;
 
 	/*
-- 
2.23.0



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-18  9:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18  9:20 [PATCH] mm/hwpoison-inject: support injecting hwpoison to free page Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox