LKML Archive on
help / color / mirror / Atom feed
From: Jin Dongming <>
To: Andi Kleen <>
Cc: Naoya Horiguchi <>,
	Huang Ying <>,
	Wu Fengguang <>,
	Hidetoshi Seto <>,
	LKLM <>
Subject: [Resend][PATCH -v2 2/3 -next] Fix poison failure for unmapped hugetlb page without MF_COUNT_INCREASED.
Date: Mon, 07 Feb 2011 13:47:53 +0900	[thread overview]
Message-ID: <> (raw)

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.
  - If the head page is not poisoned, the rest pages of
    hugetlb page will not be set with PG_hwpoison;
  - If the head page is poisoned, poisoning for the hugetlb page
    has been finished by other context running simultaneously.

Usually the head page here is not poisoned yet, so __memory_failure()
will return without poisoning the rest pages of hugetlb page.

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 agaist
the poisoned tail page, not against the head page.

Signed-off-by: Jin Dongming <>
Reviewed-by: Hidetoshi Seto <>
Reviewed-by: Naoya Horiguchi <>
 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 d2c2a7b..0317cb3 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1039,7 +1039,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);

                 reply	other threads:[~2011-02-07  4:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \
    --subject='Re: [Resend][PATCH -v2 2/3 -next] Fix poison failure for unmapped hugetlb page without MF_COUNT_INCREASED.' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).