[PATCH 18/22] HWPOISON: use compound head page

From: Wu Fengguang
Date: Sun Jun 14 2009 - 23:18:18 EST


In most places we want to test/operate on the compound head page.
The raw poisoned page is recorded in hwpoison_control.p for others.

Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
mm/memory-failure.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

--- sound-2.6.orig/mm/memory-failure.c
+++ sound-2.6/mm/memory-failure.c
@@ -314,7 +314,8 @@ static const char *hwpoison_outcome_name

struct hwpoison_control {
unsigned long pfn;
- struct page *page;
+ struct page *p; /* corrupted page */
+ struct page *page; /* compound page head */
int outcome;
};

@@ -732,13 +733,17 @@ void memory_failure(unsigned long pfn, i
}

p = pfn_to_page(pfn);
- hpc.pfn = pfn;
- hpc.page = p;
if (TestSetPageHWPoison(p)) {
- action_result(&hpc, "already hardware poisoned", IGNORED);
+ printk(KERN_ERR
+ "MCE %#lx: already hardware poisoned: Ignored\n",
+ pfn);
return;
}

+ hpc.pfn = pfn;
+ hpc.p = p;
+ hpc.page = p = compound_head(p);
+
/*
* We need/can do nothing about count=0 pages.
* 1) it's a free page, and therefore in safe hand:
@@ -750,7 +755,7 @@ void memory_failure(unsigned long pfn, i
* In fact it's dangerous to directly bump up page count from 0,
* that may make page_freeze_refs()/page_unfreeze_refs() mismatch.
*/
- if (!get_page_unless_zero(compound_head(p))) {
+ if (!get_page_unless_zero(p)) {
action_result(&hpc, "free or high order kernel", IGNORED);
return;
}

--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/