Thread (18 messages) 18 messages, 3 authors, 2021-10-20
STALE1709d REVIEWED: 1 (0M)
Revisions (2)
  1. v4 current
  2. v5 [diff vs current]

[v4 PATCH 6/6] mm: hwpoison: handle non-anonymous THP correctly

From: Yang Shi <hidden>
Date: 2021-10-14 19:16:48
Also in: linux-fsdevel, lkml
Subsystem: hwpoison memory failure handling, memory management, the rest · Maintainers: Miaohe Lin, Andrew Morton, Linus Torvalds

Currently hwpoison doesn't handle non-anonymous THP, but since v4.8 THP
support for tmpfs and read-only file cache has been added.  They could
be offlined by split THP, just like anonymous THP.

Acked-by: Naoya Horiguchi <redacted>
Signed-off-by: Yang Shi <redacted>
---
 mm/memory-failure.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index f5eab593b2a7..3db738c02ab2 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1443,14 +1443,11 @@ static int identify_page_state(unsigned long pfn, struct page *p,
 static int try_to_split_thp_page(struct page *page, const char *msg)
 {
 	lock_page(page);
-	if (!PageAnon(page) || unlikely(split_huge_page(page))) {
+	if (unlikely(split_huge_page(page))) {
 		unsigned long pfn = page_to_pfn(page);
 
 		unlock_page(page);
-		if (!PageAnon(page))
-			pr_info("%s: %#lx: non anonymous thp\n", msg, pfn);
-		else
-			pr_info("%s: %#lx: thp split failed\n", msg, pfn);
+		pr_info("%s: %#lx: thp split failed\n", msg, pfn);
 		put_page(page);
 		return -EBUSY;
 	}
-- 
2.26.2

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help