[lkml]   [2011]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 2/3] Fix poison failure for unmapped hugetlb page without MF_COUNT_INCREASED.
The unmapped hugetlb page could not be poisoned when the tail
page is poisoned.

The reason is because the PG_hwpoison of head page is checked
before setting PG_hwpoison on other pages of the hugetlb page.
Usually the head page here is not poisoned yet, so __memory_failure()
will return without poisoning the rest pages of hugetlb page.
If the head page is poisoned, poisoning for the hugetlb page
has been finished by other context running simultaneously.

As it is described in the comment(in __memory_failure()):
994 /*
995 * Check "just unpoisoned", "filter hit", and
996 * "race with other subpage."
997 */

I think the real checking expected here is "just unpoisoned",
whether the tail page just poisoned by this context is still
poisoned or not. It should be realized by checking against
the poisoned tail page, not against the head page.

Signed-off-by: Jin Dongming <>
Reviewed-by: Hidetoshi Seto <>
mm/memory-failure.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 8665eed..824850a 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -996,7 +996,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
* "race with other subpage."
- if (!PageHWPoison(hpage)
+ if (!PageHWPoison(p)
|| (hwpoison_filter(p) && TestClearPageHWPoison(p))
|| (p != hpage && TestSetPageHWPoison(hpage))) {
atomic_long_sub(nr_pages, &mce_bad_pages);

 \ /
  Last update: 2011-01-21 02:23    [W:0.026 / U:7.828 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site