The patch titled Subject: mm/memory-failure.c: fix wrong num_poisoned_pages in handling memory error on thp has been added to the -mm tree. Its filename is mm-memory-failurec-fix-wrong-num_poisoned_pages-in-handling-memory-error-on-thp.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> Subject: mm/memory-failure.c: fix wrong num_poisoned_pages in handling memory error on thp num_poisoned_pages counts up the number of pages isolated by memory errors. But for thp, only one subpage is isolated because memory error handler splits it, so it's wrong to add (1 << compound_trans_order). Signed-off-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> Cc: Andi Kleen <andi@xxxxxxxxxxxxxx> Cc: Tony Luck <tony.luck@xxxxxxxxx> Cc: Wu Fengguang <fengguang.wu@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory-failure.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff -puN mm/memory-failure.c~mm-memory-failurec-fix-wrong-num_poisoned_pages-in-handling-memory-error-on-thp mm/memory-failure.c --- a/mm/memory-failure.c~mm-memory-failurec-fix-wrong-num_poisoned_pages-in-handling-memory-error-on-thp +++ a/mm/memory-failure.c @@ -1039,7 +1039,14 @@ int memory_failure(unsigned long pfn, in return 0; } - nr_pages = 1 << compound_trans_order(hpage); + /* + * If a thp is hit by a memory failure, it's supposed to be split. + * So we should add only one to num_poisoned_pages for that case. + */ + if (PageHuge(p)) + nr_pages = 1 << compound_trans_order(hpage); + else /* normal page or thp */ + nr_pages = 1; atomic_long_add(nr_pages, &num_poisoned_pages); /* _ Patches currently in -mm which might be from n-horiguchi@xxxxxxxxxxxxx are memory-failure-fix-an-error-of-mce_bad_pages-statistics.patch mm-memory-failurec-fix-wrong-num_poisoned_pages-in-handling-memory-error-on-thp.patch mm-memory-failurec-clean-up-soft_offline_page.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html