aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Shi <[email protected]>2021-11-05 13:41:14 -0700
committerLinus Torvalds <[email protected]>2021-11-06 13:30:38 -0700
commit4966455d9100236fd6dd72b0cd00818435fdb25d (patch)
tree002bbeffa90feb523c6089f3528c056effd8c920
parentb9d02f1bdd98f38e6e5ecacc9786a8f58f3f8b2c (diff)
mm: hwpoison: handle non-anonymous THP correctly
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. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Yang Shi <[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]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/memory-failure.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 952a41d568c4..f38b7b42a508 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1444,14 +1444,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;
}