Skip to content

Commit c7cb42e

Browse files
yang-shitorvalds
authored andcommitted
mm: hwpoison: remove the unnecessary THP check
When handling THP hwpoison checked if the THP is in allocation or free stage since hwpoison may mistreat it as hugetlb page. After commit 415c64c ("mm/memory-failure: split thp earlier in memory error handling") the problem has been fixed, so this check is no longer needed. Remove it. The side effect of the removal is hwpoison may report unsplit THP instead of unknown error for shmem THP. It seems not like a big deal. The following patch "mm: filemap: check if THP has hwpoisoned subpage for PMD page fault" depends on this, which fixes shmem THP with hwpoisoned subpage(s) are mapped PMD wrongly. So this patch needs to be backported to -stable as well. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Yang Shi <[email protected]> Suggested-by: Naoya Horiguchi <[email protected]> Acked-by: Naoya Horiguchi <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Oscar Salvador <[email protected]> Cc: Peter Xu <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 8dcb306 commit c7cb42e

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

mm/memory-failure.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,20 +1147,6 @@ static int __get_hwpoison_page(struct page *page)
11471147
if (!HWPoisonHandlable(head))
11481148
return -EBUSY;
11491149

1150-
if (PageTransHuge(head)) {
1151-
/*
1152-
* Non anonymous thp exists only in allocation/free time. We
1153-
* can't handle such a case correctly, so let's give it up.
1154-
* This should be better than triggering BUG_ON when kernel
1155-
* tries to touch the "partially handled" page.
1156-
*/
1157-
if (!PageAnon(head)) {
1158-
pr_err("Memory failure: %#lx: non anonymous thp\n",
1159-
page_to_pfn(page));
1160-
return 0;
1161-
}
1162-
}
1163-
11641150
if (get_page_unless_zero(head)) {
11651151
if (head == compound_head(page))
11661152
return 1;

0 commit comments

Comments
 (0)