From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
Andrew Morton <akpm@linux-foundation.org>,
Wu Fengguang <fengguang.wu@intel.com>, Mel Gorman <mel@csn.ul.ie>
Subject: [PATCH 8/8] HWPOISON, hugetlb: support hwpoison injection for hugepage
Date: Fri, 28 May 2010 09:29:22 +0900 [thread overview]
Message-ID: <1275006562-18946-9-git-send-email-n-horiguchi@ah.jp.nec.com> (raw)
In-Reply-To: <1275006562-18946-1-git-send-email-n-horiguchi@ah.jp.nec.com>
This patch enables hwpoison injection through debug/hwpoison interfaces,
with which we can test memory error handling for free or reserved
hugepages (which cannot be tested by madvise() injector).
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Wu Fengguang <fengguang.wu@intel.com>
---
mm/hwpoison-inject.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git v2.6.34/mm/hwpoison-inject.c v2.6.34/mm/hwpoison-inject.c
index 10ea719..0948f10 100644
--- v2.6.34/mm/hwpoison-inject.c
+++ v2.6.34/mm/hwpoison-inject.c
@@ -5,6 +5,7 @@
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/pagemap.h>
+#include <linux/hugetlb.h>
#include "internal.h"
static struct dentry *hwpoison_dir;
@@ -13,6 +14,7 @@ static int hwpoison_inject(void *data, u64 val)
{
unsigned long pfn = val;
struct page *p;
+ struct page *hpage;
int err;
if (!capable(CAP_SYS_ADMIN))
@@ -24,18 +26,19 @@ static int hwpoison_inject(void *data, u64 val)
return -ENXIO;
p = pfn_to_page(pfn);
+ hpage = compound_head(p);
/*
* This implies unable to support free buddy pages.
*/
- if (!get_page_unless_zero(p))
+ if (!get_page_unless_zero(hpage))
return 0;
- if (!PageLRU(p))
+ if (!PageLRU(p) && !PageHuge(p))
shake_page(p, 0);
/*
* This implies unable to support non-LRU pages.
*/
- if (!PageLRU(p))
+ if (!PageLRU(p) && !PageHuge(p))
return 0;
/*
@@ -44,9 +47,9 @@ static int hwpoison_inject(void *data, u64 val)
* We temporarily take page lock for try_get_mem_cgroup_from_page().
* __memory_failure() will redo the check reliably inside page lock.
*/
- lock_page(p);
- err = hwpoison_filter(p);
- unlock_page(p);
+ lock_page(hpage);
+ err = hwpoison_filter(hpage);
+ unlock_page(hpage);
if (err)
return 0;
--
1.7.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-05-28 0:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-28 0:29 [PATCH 0/8] HWPOISON for hugepage (v6) Naoya Horiguchi
2010-05-28 0:29 ` [PATCH 1/8] hugetlb: move definition of is_vm_hugetlb_page() to hugepage_inline.h Naoya Horiguchi
2010-05-28 10:03 ` Mel Gorman
2010-08-10 19:53 ` Wu Fengguang
2010-05-28 0:29 ` [PATCH 2/8] hugetlb, rmap: add reverse mapping for hugepage Naoya Horiguchi
2010-05-28 14:48 ` Mel Gorman
2010-08-10 23:23 ` Wu Fengguang
2010-06-02 18:16 ` Andrew Morton
2010-06-03 1:38 ` [PATCH] replace ifdef CONFIG_HUGETLBFS into ifdef CONFIG_HUGETLB_PAGE (Re: [PATCH 2/8] hugetlb, rmap: add reverse mapping for hugepage) Naoya Horiguchi
2010-05-28 0:29 ` [PATCH 3/8] HWPOISON, hugetlb: enable error handling path for hugepage Naoya Horiguchi
2010-05-28 0:29 ` [PATCH 4/8] HWPOISON, hugetlb: set/clear PG_hwpoison bits on hugepage Naoya Horiguchi
2010-05-28 0:29 ` [PATCH 5/8] HWPOISON, hugetlb: maintain mce_bad_pages in handling hugepage error Naoya Horiguchi
2010-05-28 0:29 ` [PATCH 6/8] HWPOISON, hugetlb: isolate corrupted hugepage Naoya Horiguchi
2010-05-28 0:29 ` [PATCH 7/8] HWPOISON, hugetlb: detect hwpoison in hugetlb code Naoya Horiguchi
2010-05-28 0:29 ` Naoya Horiguchi [this message]
2010-05-31 9:30 ` [PATCH 0/8] HWPOISON for hugepage (v6) Andi Kleen
2010-05-31 10:17 ` Naoya Horiguchi
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1275006562-18946-9-git-send-email-n-horiguchi@ah.jp.nec.com \
--to=n-horiguchi@ah.jp.nec.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=fengguang.wu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox